#include <TAPsMultiMeshModel.hpp>


Public Member Functions | |
| virtual void | ApplyAndResetTransform () |
| virtual void | BuildBVHTree (TAPs::Enum::CD treeType) |
| virtual void | CalAndSetPhysicsCenterOfMass () |
| virtual void | DisplayGL (OpenGL::Enum::DrawMode=OpenGL::Enum::POLYGON) |
| virtual void | DisplayGLUsingColorMaterial (OpenGL::Enum::DrawMode=OpenGL::Enum::POLYGON, OpenGL::Enum::Face=OpenGL::Enum::FRONT) |
| virtual void | DrawBVHOfEachMesh (int startLevel, int endLevel) const |
| virtual void | DrawBVHOfEachMesh () const |
| virtual void | DrawBVHOfEachMeshOnlyEndLevel () const |
| int | GetID () const |
| std::vector< MeshModel< T > * > & | GetModelList () |
| std::vector< MeshModel< T > * > const & | GetModelList () const |
| char const *const | GetName () const |
| TransformationSupport< T > & | GetTransform () |
| TransformationSupport< T > const & | GetTransform () const |
| virtual void | Initialize () |
| MultiMeshModel (char *name) | |
| MultiMeshModel () | |
| virtual void | Reset () |
| void | SetID (int id) |
| void | SetName (char *name) |
| virtual | ~MultiMeshModel () |
Protected Member Functions | |
| virtual void | CalBoundingAABB () |
| virtual void | CalBoundingEllipsoid () |
| virtual void | CalBoundingSphere () |
Protected Attributes | |
| int | m_iId |
| char * | m_pcName |
| TransformationSupport< T > | m_Transform |
| std::vector< MeshModel< T > * > | m_vModelPtrList |
Static Protected Attributes | |
| static int | m_iTotal = 0 |
Definition at line 26 of file TAPsMultiMeshModel.hpp.
| MultiMeshModel< T >::MultiMeshModel | ( | ) | [inline] |
Definition at line 24 of file TAPsMultiMeshModel.cpp.
00025 : ColDetSupport<T>(), 00026 PhysicsSupport<T>(), 00027 m_iId( m_iTotal++ ), m_pcName( NULL ) 00028 { 00029 #ifdef TAPs_DEBUG_MODE 00030 std::cout << "MultiMeshModel<" << typeid(T).name() << "> #" << m_iId << " constructor\n"; 00031 #endif//TAPs_DEBUG_MODE 00032 }
| MultiMeshModel< T >::MultiMeshModel | ( | char * | name | ) | [inline] |
Definition at line 36 of file TAPsMultiMeshModel.cpp.
00037 : //TransformationSupport<T>(), 00038 m_iId( m_iTotal++ ), m_pcName( NULL ) 00039 { 00040 SetName( name ); 00041 00042 #ifdef TAPs_DEBUG_MODE 00043 std::cout << "MultiMeshModel<" << typeid(T).name() << "> #" << m_iId << " constructor\n"; 00044 #endif//TAPs_DEBUG_MODE 00045 }
| MultiMeshModel< T >::~MultiMeshModel | ( | ) | [inline, virtual] |
Definition at line 49 of file TAPsMultiMeshModel.cpp.
00050 { 00051 if ( m_pcName ) { 00052 delete [] m_pcName; 00053 m_pcName = NULL; 00054 } 00055 --m_iTotal; 00056 00057 #ifdef TAPs_DEBUG_MODE 00058 std::cout << "MultiMeshModel<" << typeid(T).name() << "> #" << m_iId << " destructor\n"; 00059 #endif//TAPs_DEBUG_MODE 00060 }
| void MultiMeshModel< T >::ApplyAndResetTransform | ( | ) | [inline, virtual] |
Definition at line 108 of file TAPsMultiMeshModel.cpp.
00109 { 00110 std::vector< MeshModel<T> * >::iterator pos = m_vModelPtrList.begin(); 00111 while ( pos != m_vModelPtrList.end() ) { 00112 assert( *pos != NULL ); 00113 (*pos)->GetTransform().SetTranslation( GetTransform().GetTranslation() ); 00114 // (*pos)->GetTransform().SetRotationAngles( GetTransform().GetRotationAngles() ); 00115 // (*pos)->GetTransform().SetScale( GetTransform().GetScale() ); 00116 (*pos)->GetTransform().SetMatrixTransform( GetTransform().GetMatrixTransform() ); 00117 (*pos)->ApplyAndResetTransform(); 00118 ++pos; 00119 } 00120 GetTransform().MakeIdentity(); 00121 }
| void MultiMeshModel< T >::BuildBVHTree | ( | TAPs::Enum::CD | treeType | ) | [inline, virtual] |
Definition at line 147 of file TAPsMultiMeshModel.cpp.
00148 { 00149 //----------------------------------------------------- 00150 // Check Model Type 00151 for ( int i = 0; i < static_cast<int>( m_vModelPtrList.size() ); ++i ) { 00152 m_vModelPtrList[i]->BuildBVHTree( treeType ); 00153 } 00154 //----------------------------------------------------- 00155 }
| virtual void MultiMeshModel< T >::CalAndSetPhysicsCenterOfMass | ( | ) | [inline, virtual] |
Calculate and set the center of mass. Inherited from class TransformationSupport.
Implements PhysicsSupport< T >.
Definition at line 41 of file TAPsMultiMeshModel.hpp.
00042 { 00043 std::cout << "MultiMeshModel::CalAndSetPhysicsCenterOfMass() need to be coded!!!\n"; 00044 SetPhysicsCenterOfMass( Vector3<T>( 0, 0, 0 ) ); 00045 }
| virtual void MultiMeshModel< T >::CalBoundingAABB | ( | ) | [inline, protected, virtual] |
| virtual void MultiMeshModel< T >::CalBoundingEllipsoid | ( | ) | [inline, protected, virtual] |
| virtual void MultiMeshModel< T >::CalBoundingSphere | ( | ) | [inline, protected, virtual] |
| void MultiMeshModel< T >::DisplayGL | ( | OpenGL::Enum::DrawMode | DM = OpenGL::Enum::POLYGON |
) | [inline, virtual] |
Definition at line 162 of file TAPsMultiMeshModel.cpp.
00163 { 00164 glPushMatrix(); 00165 GetTransform().TransformByOpenGLForDrawing(); 00166 00167 std::vector< MeshModel<T> * >::iterator pos = m_vModelPtrList.begin(); 00168 while ( pos != m_vModelPtrList.end() ) { 00169 assert( *pos != NULL ); 00170 (*pos)->DisplayGL( DM ); 00171 ++pos; 00172 } 00173 glPopMatrix(); 00174 }
| void MultiMeshModel< T >::DisplayGLUsingColorMaterial | ( | OpenGL::Enum::DrawMode | DM = OpenGL::Enum::POLYGON, |
|
| OpenGL::Enum::Face | F = OpenGL::Enum::FRONT | |||
| ) | [inline, virtual] |
Definition at line 178 of file TAPsMultiMeshModel.cpp.
00181 { 00182 glPushMatrix(); 00183 GetTransform().TransformByOpenGLForDrawing(); 00184 00185 glPushAttrib( GL_CURRENT_BIT | GL_LIGHTING_BIT ); 00186 //--------------------------------------------------------------- 00187 glEnable( GL_COLOR_MATERIAL ); 00188 00189 //glColorMaterial( F, GL_AMBIENT_AND_DIFFUSE ); 00190 //glColorMaterial( F, GL_AMBIENT ); 00191 glColorMaterial( F, GL_DIFFUSE ); 00192 //glColorMaterial( F, GL_SPECULAR ); 00193 //glColorMaterial( F, GL_EMISSION ); 00194 00195 static GLfloat specular[4] = { 1, 1, 1, 1 }; //<--------- Hack for Specular Highlight 00196 glMaterialfv( GL_FRONT, GL_SPECULAR, specular ); //<--------- Hack for Specular Highlight 00197 00198 std::vector< MeshModel<T> * >::iterator pos = m_vModelPtrList.begin(); 00199 while ( pos != m_vModelPtrList.end() ) { 00200 assert( *pos != NULL ); 00201 (*pos)->GetMaterial()->ApplyRGBAColor(); 00202 (*pos)->DisplayGL( DM ); 00203 //(*pos)->DrawBVH(); 00204 ++pos; 00205 } 00206 //--------------------------------------------------------------- 00207 glPopAttrib(); 00208 glPopMatrix(); 00209 }
| void MultiMeshModel< T >::DrawBVHOfEachMesh | ( | int | startLevel, | |
| int | endLevel | |||
| ) | const [inline, virtual] |
Definition at line 230 of file TAPsMultiMeshModel.cpp.
00231 { 00232 glPushMatrix(); 00233 GetTransform().TransformByOpenGLForDrawing(); 00234 00235 std::vector< MeshModel<T> * >::const_iterator pos = m_vModelPtrList.begin(); 00236 while ( pos != m_vModelPtrList.end() ) { 00237 assert( *pos != NULL ); 00238 (*pos)->DrawBVH( startLevel, endLevel ); 00239 ++pos; 00240 } 00241 00242 glPopMatrix(); 00243 }
| void MultiMeshModel< T >::DrawBVHOfEachMesh | ( | ) | const [inline, virtual] |
Draw BVH of each mash
Where 0 level is root level.
Definition at line 213 of file TAPsMultiMeshModel.cpp.
00214 { 00215 glPushMatrix(); 00216 GetTransform().TransformByOpenGLForDrawing(); 00217 00218 std::vector< MeshModel<T> * >::const_iterator pos = m_vModelPtrList.begin(); 00219 while ( pos != m_vModelPtrList.end() ) { 00220 assert( *pos != NULL ); 00221 (*pos)->DrawBVH(); 00222 ++pos; 00223 } 00224 00225 glPopMatrix(); 00226 }
| void MultiMeshModel< T >::DrawBVHOfEachMeshOnlyEndLevel | ( | ) | const [inline, virtual] |
Definition at line 247 of file TAPsMultiMeshModel.cpp.
00248 { 00249 glPushMatrix(); 00250 GetTransform().TransformByOpenGLForDrawing(); 00251 00252 std::vector< MeshModel<T> * >::const_iterator pos = m_vModelPtrList.begin(); 00253 while ( pos != m_vModelPtrList.end() ) { 00254 assert( *pos != NULL ); 00255 (*pos)->DrawBVHOnlyEndLevel(); 00256 ++pos; 00257 } 00258 00259 glPopMatrix(); 00260 }
| int MultiMeshModel< T >::GetID | ( | ) | const [inline] |
| std::vector< MeshModel<T> * >& MultiMeshModel< T >::GetModelList | ( | ) | [inline] |
| std::vector< MeshModel<T> * > const& MultiMeshModel< T >::GetModelList | ( | ) | const [inline] |
| char const *const MultiMeshModel< T >::GetName | ( | ) | const [inline] |
| TransformationSupport<T>& MultiMeshModel< T >::GetTransform | ( | ) | [inline] |
| TransformationSupport<T> const& MultiMeshModel< T >::GetTransform | ( | ) | const [inline] |
| void MultiMeshModel< T >::Initialize | ( | ) | [inline, virtual] |
Definition at line 94 of file TAPsMultiMeshModel.cpp.
00095 { 00096 std::vector< MeshModel<T> * >::iterator pos = m_vModelPtrList.begin(); 00097 while ( pos != m_vModelPtrList.end() ) { 00098 assert( *pos != NULL ); 00099 (*pos)->Initialize(); 00100 ++pos; 00101 } 00102 }
| virtual void MultiMeshModel< T >::Reset | ( | ) | [inline, virtual] |
| void MultiMeshModel< T >::SetID | ( | int | id | ) | [inline] |
| void MultiMeshModel< T >::SetName | ( | char * | name | ) | [inline] |
int MultiMeshModel< T >::m_iId [protected] |
Definition at line 104 of file TAPsMultiMeshModel.hpp.
BEGIN_NAMESPACE_TAPs__OpenGL int MultiMeshModel< T >::m_iTotal = 0 [inline, static, protected] |
Definition at line 103 of file TAPsMultiMeshModel.hpp.
char* MultiMeshModel< T >::m_pcName [protected] |
Definition at line 105 of file TAPsMultiMeshModel.hpp.
TransformationSupport<T> MultiMeshModel< T >::m_Transform [protected] |
Definition at line 111 of file TAPsMultiMeshModel.hpp.
std::vector< MeshModel<T> * > MultiMeshModel< T >::m_vModelPtrList [protected] |
Definition at line 108 of file TAPsMultiMeshModel.hpp.
1.5.6