Changeset 9140 in orxonox.OLD for branches/terrain/src/lib/collision_detection/cd_engine.cc
- Timestamp:
- Jul 4, 2006, 3:06:00 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/terrain/src/lib/collision_detection/cd_engine.cc
r9110 r9140 24 24 #include "model.h" 25 25 #include "world_entity.h" 26 #include "terrain .h"26 #include "terrain_entity.h" 27 27 // #include "player.h" 28 28 … … 45 45 46 46 this->bAbordOnFirstCollision = false; 47 47 48 48 this->terrain = NULL; 49 49 } … … 106 106 std::list<WorldEntity*>::iterator entityIterator; 107 107 const std::list<BaseObject*>* bspList = ClassList::getList(CL_BSP_ENTITY); 108 if( bspList == NULL)109 return;108 if( bspList != NULL) 109 { 110 110 111 // for all bsp managers check all entities 112 for( bspIterator = bspList->begin(); bspIterator != bspList->end(); bspIterator++) { 111 // for all bsp managers check all entities 112 for( bspIterator = bspList->begin(); bspIterator != bspList->end(); bspIterator++) 113 { 113 114 for(entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++) 114 115 { 115 //PRINTF(0)("Checking: %s a %s\n", (*entityIterator)->getName(), (*entityIterator)->getClassName());116 // PRINTF(0)("Checking: %s a %s\n", (*entityIterator)->getName(), (*entityIterator)->getClassName()); 116 117 (dynamic_cast<BspEntity*>(*bspIterator)->getBspManager())->checkCollision(*entityIterator); 117 118 } 119 } 118 120 } 121 122 /// COLLISION OF THE Modular-TERRAIN 123 /* const std::list<BaseObject*>* tl = ClassList::getList( CL_TERRAIN ); 124 std::list<BaseObject*>::const_iterator ti; 125 if ( tl == NULL ) 126 return; 127 float offset = 8.0f; 128 for ( ti = tl->begin(); ti != tl->end(); ++ti ) 129 { 130 TerrainEntity* terrain = dynamic_cast<TerrainEntity*>( *ti ); 131 for( entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++ ) 132 { 133 Vector pos( (*entityIterator)->getAbsCoor() ); 134 Vector normal; 135 float height = pos.y; 136 terrain->getAltitude( pos, normal ); 137 if ( height-offset < pos.y ) 138 { 139 ( *entityIterator )->registerCollision( 140 *entityIterator, terrain, pos, normal ); 141 } 142 } 143 }*/ 119 144 } 120 145 … … 138 163 void CDEngine::debugSpawnTree(int depth, sVec3D* vertices, int numVertices) 139 164 { 140 // if ( this->rootTree == NULL)141 // this->rootTree = new OBBTree(depth, vertices, numVertices);165 // if ( this->rootTree == NULL) 166 // this->rootTree = new OBBTree(depth, vertices, numVertices); 142 167 } 143 168 … … 156 181 void CDEngine::debugDraw(int depth, int drawMode) 157 182 { 158 // if(this-> rootTree != NULL)159 // this->rootTree->drawBV(depth, drawMode);183 // if(this-> rootTree != NULL) 184 // this->rootTree->drawBV(depth, drawMode); 160 185 }
Note: See TracChangeset
for help on using the changeset viewer.