Changeset 8741 in orxonox.OLD for branches/terrain/src/lib/collision_detection
- Timestamp:
- Jun 23, 2006, 11:29:40 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/terrain/src/lib/collision_detection/cd_engine.cc
r8715 r8741 119 119 if ( tl == NULL ) 120 120 return; 121 float offset = 8.0f; 121 122 for ( ti = tl->begin(); ti != tl->end(); ++ti ) { 122 123 TerrainEntity* terrain = dynamic_cast<TerrainEntity*>( *ti ); 123 124 for( entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++ ) 124 125 { 125 const Vector& pos = (*entityIterator)->getAbsCoor(); 126 127 float height = terrain->getHeight( pos.x, pos.z ); 128 printf( "pos.y-height: %f\n", pos.y-height ); 129 if ( height > pos.y ) { 130 (*entityIterator)->setAbsCoor( pos.x, height, pos.z ); 126 Vector pos( (*entityIterator)->getAbsCoor() ); 127 Vector normal; 128 float height = pos.y; 129 terrain->getAltitude( pos, normal ); 130 if ( height-offset < pos.y ) { 131 ( *entityIterator )->registerCollision( 132 *entityIterator, terrain, pos, normal ); 131 133 } 132 134 }
Note: See TracChangeset
for help on using the changeset viewer.