TAPs 0.7.7.3
TAPsCDFnsGlobalStuff.cpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsCDFnsGlobalStuff.cpp
00003 SUKITTI PUNAK   (04/14/2010)
00004 UPDATE          (05/01/2010)
00005 ******************************************************************************/
00006 #include "TAPsCDFnsGlobalStuff.hpp"
00007 // Using Inclusion Model (i.e. definitions are included in declarations)
00008 //                       (this name.cpp is included in name.hpp)
00009 // Each friend is defined directly inside its declaration.
00010 
00011 BEGIN_NAMESPACE_TAPs__CD__Fn
00012 //=============================================================================
00013 //-----------------------------------------------------------------------------
00014 
00015 // DEBUG
00016 void CalFinalForce ()
00017 {
00018     finalForce.SetXYZ( 0, 0, 0 );
00019     for ( int i = 0; i < static_cast<int>( ListOfForces.size() ); ++i ) {
00020         finalForce += ListOfForces[i];
00021     }
00022 }
00023 
00024 // DEBUG
00025 #ifdef  TAPs_DEBUG_CD_WITH_HETRI
00026 void DrawForces ()
00027 {
00028     glPushAttrib( GL_ALL_ATTRIB_BITS );
00029     glDisable( GL_LIGHTING );
00030     glLineWidth( 2 );
00031     glPointSize( 5 );
00032     glBegin( GL_POINTS );
00033 
00034     // Axes
00035     glColor3f( 0, 0, 0 );
00036     glVertex3fv( TAPs::CGMath<GLfloat>::ZeroVector );
00037     glColor3f( 1, 0, 0 );
00038     glVertex3fv( TAPs::CGMath<GLfloat>::VectorX );
00039     glColor3f( 0, 1, 0 );
00040     glVertex3fv( TAPs::CGMath<GLfloat>::VectorY );
00041     glColor3f( 0, 0, 1 );
00042     glVertex3fv( TAPs::CGMath<GLfloat>::VectorZ );
00043 
00044     glColor3f( 1, 0, 0 );
00045     for ( int i = 0; i < static_cast<int>( ListOfContactPts.size() ); ++i ) {
00046         glVertex3fv( ListOfContactPts[i].GetDataFloat() );
00047     }
00048     glEnd();
00049     glBegin( GL_LINES );
00050 
00051     // Axes
00052     glColor3f( 0, 0, 0 );
00053     glVertex3fv( TAPs::CGMath<GLfloat>::ZeroVector );
00054     glColor3f( 1, 0, 0 );
00055     glVertex3fv( TAPs::CGMath<GLfloat>::VectorX );
00056     glColor3f( 0, 0, 0 );
00057     glVertex3fv( TAPs::CGMath<GLfloat>::ZeroVector );
00058     glColor3f( 0, 1, 0 );
00059     glVertex3fv( TAPs::CGMath<GLfloat>::VectorY );
00060     glColor3f( 0, 0, 0 );
00061     glVertex3fv( TAPs::CGMath<GLfloat>::ZeroVector );
00062     glColor3f( 0, 0, 1 );
00063     glVertex3fv( TAPs::CGMath<GLfloat>::VectorZ );
00064 
00065     glColor3f( 1, 0.4, 0.2 );
00066     for ( int i = 0; i < static_cast<int>( ListOfContactPts.size() ); ++i ) {
00067         glVertex3fv( ListOfContactPts[i].GetDataFloat() );
00068         glVertex3fv( (ListOfContactPts[i] + 10*ListOfForces[i]).GetDataFloat() );
00069     }
00070 
00071     CalFinalForce();
00072     glColor3f( 0.2, 0.1, 1.0 );
00073     glVertex3f( 0, 0, 0 );
00074     glVertex3fv( finalForce.GetDataFloat() );
00075 
00076     glEnd();
00077     glPopAttrib();
00078 }
00079 #endif//TAPs_DEBUG_CD_WITH_HETRI
00080 //-----------------------------------------------------------------------------
00081 
00082 //=============================================================================
00083 END_NAMESPACE_TAPs__CD__Fn
00084 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00085 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines