-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2011 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include "geometrybuilder.h"
-#include "meshbuilder.h"
-
-namespace Msp {
-namespace GL {
-
-GeometryBuilder::GeometryBuilder():
- tangent_attr(-1),
- binormal_attr(-1),
- tex_fit(STRETCH)
-{ }
-
-GeometryBuilder &GeometryBuilder::tangent(unsigned t)
-{
- tangent_attr = t;
- return *this;
-}
-
-GeometryBuilder &GeometryBuilder::binormal(unsigned b)
-{
- binormal_attr = b;
- return *this;
-}
-
-GeometryBuilder &GeometryBuilder::texture_fit(TextureFit tf)
-{
- tex_fit = tf;
- return *this;
-}
-
-void GeometryBuilder::adjust_texture_scale(float &u_scale, float &v_scale, float width, float height) const
-{
- if(tex_fit!=STRETCH)
- {
- if((width<height)==(tex_fit==CROP))
- u_scale *= width/height;
- else
- v_scale *= height/width;
- }
-}
-
-void GeometryBuilder::build(Mesh &mesh) const
-{
- MeshBuilder builder(mesh);
- build(builder);
-}
-
-} // namespace GL
-} // namespace Msp