Changeset 1900 in orxonox.OLD for orxonox/trunk/core/world.cc
- Timestamp:
- May 23, 2004, 11:21:38 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/core/world.cc
r1899 r1900 1 2 1 3 2 /* … … 232 231 void World::detectCollision() 233 232 { 233 //cout << "World::detectCollision" << endl; 234 234 float xOff, yOff, zOff, radius; 235 235 npcList* tmpNPC; … … 263 263 /* second: check if any player hits an enemy */ 264 264 265 /* 266 tmpPlayer = lastPlayer; 267 while( tmpPlayer != null ) 268 { 269 tmpNPC = lastNPC; 270 while( tmpNPC != null ) 271 { 272 radius = tmpNPC->npc->collisionRadius + tmpPlayer->player->collisionRadius; 273 xOff = tmpPlayer->player->xCor - tmpNPC->npc->xCor; 274 yOff = tmpPlayer->player->yCor - tmpNPC->npc->yCor; 275 zOff = tmpPlayer->player->zCor - tmpNPC->npc->zCor; 276 if ( sqrt(xOff*xOff + yOff*yOff + zOff*zOff) < radius ) 277 cout << "COLLISION " << endl; 278 279 tmpNPC = tmpNPC->next; 280 } 281 282 tmpPlayer = tmpPlayer->next; 283 } 284 285 */ 286 265 287 /* third: check if any enemy shoots a player */ 266 288
Note: See TracChangeset
for help on using the changeset viewer.