]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix capsule end vertex coordinates
authorMikko Rasa <tdb@tdb.fi>
Thu, 3 Feb 2011 21:20:43 +0000 (21:20 +0000)
committerMikko Rasa <tdb@tdb.fi>
Thu, 3 Feb 2011 21:20:43 +0000 (21:20 +0000)
source/capsule.cpp

index fd4dbb0fb5e974b793492845dfa918c3349729a3..e4c93ae78bdbd43c85426b21048d264551867645 100644 (file)
@@ -43,7 +43,7 @@ void CapsuleBuilder::build(PrimitiveBuilder &builder) const
 
        builder.normal(0, 0, -1);
        builder.texcoord(0.5, 0);
-       builder.vertex(0, 0, -length/2+radius);
+       builder.vertex(0, 0, -length/2-radius);
        for(unsigned i=1; i<rings; ++i)
        {
                float cz = length*(i>rings/2 ? 0.5 : -0.5);
@@ -67,7 +67,7 @@ void CapsuleBuilder::build(PrimitiveBuilder &builder) const
        }
        builder.normal(0, 0, 1);
        builder.texcoord(0.5, (length+radius*M_PI)*v_scale);
-       builder.vertex(0, 0, length/2-radius);
+       builder.vertex(0, 0, length/2+radius);
 
        for(unsigned i=0; i<segments; ++i)
        {