Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Public Attributes
GlDrawcallback Class Reference
Inheritance diagram for GlDrawcallback:
Inheritance graph
[legend]
Collaboration diagram for GlDrawcallback:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GlDrawcallback ()
virtual void processTriangle (btVector3 *triangle, int partId, int triangleIndex)

Public Attributes

bool m_wireframe

Detailed Description

Definition at line 205 of file GL_ShapeDrawer.cpp.


Constructor & Destructor Documentation

Definition at line 212 of file GL_ShapeDrawer.cpp.

              :m_wireframe(false)
       {
       }

Member Function Documentation

virtual void GlDrawcallback::processTriangle ( btVector3 triangle,
int  partId,
int  triangleIndex 
) [inline, virtual]

Implements btTriangleCallback.

Definition at line 217 of file GL_ShapeDrawer.cpp.

       {

              (void)triangleIndex;
              (void)partId;


              if (m_wireframe)
              {
                     glBegin(GL_LINES);
                     glColor3f(1, 0, 0);
                     glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
                     glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
                     glColor3f(0, 1, 0);
                     glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
                     glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
                     glColor3f(0, 0, 1);
                     glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
                     glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
                     glEnd();
              } else
              {
                     glBegin(GL_TRIANGLES);
                     glColor3f(1, 0, 0);
                     glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
                     glColor3f(0, 1, 0);
                     glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
                     glColor3f(0, 0, 1);
                     glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
                     glEnd();
              }
       }

Member Data Documentation

Definition at line 210 of file GL_ShapeDrawer.cpp.


The documentation for this class was generated from the following file: