Changeset 7946 in orxonox.OLD for branches/cr/src/lib
- Timestamp:
- May 29, 2006, 1:04:39 AM (19 years ago)
- Location:
- branches/cr/src/lib/collision_reaction
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cr/src/lib/collision_reaction/collision_handle.cc
r7945 r7946 43 43 { 44 44 // delete what has to be deleted here 45 } 46 47 /** 48 * restores the CollisionHandle to its initial state 49 */ 50 void CollisionHandle::reset() 51 { 52 this->flushCollisions(); 45 53 } 46 54 -
branches/cr/src/lib/collision_reaction/collision_handle.h
r7945 r7946 27 27 virtual ~CollisionHandle(); 28 28 29 void reset(); 29 30 30 31 void addTarget(long classID); 31 32 32 void registerCollision(Collision* collision); 33 33 -
branches/cr/src/lib/collision_reaction/cr_engine.cc
r7945 r7946 64 64 65 65 66 /** 67 * flushes the CollisionHandles and restores the CREngine to the initial state 68 */ 66 69 void CREngine::reset() 67 70 { … … 69 72 std::vector<CollisionHandle*>::iterator it; 70 73 for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++) 74 { 75 (*it)->reset(); 71 76 delete *it; 77 } 72 78 this->collisionHandles.clear(); 73 79 } … … 78 84 * @param owner: the WE to subscribe 79 85 * @param type: the type of collision reaction to perform 86 * @return the newly created CollisionHandle 80 87 */ 81 88 CollisionHandle* CREngine::subscribeReaction(WorldEntity* owner, CRType type) … … 86 93 87 94 88 bool CREngine::unsubscribeReaction(WorldEntity* worldEntity) 89 {} 90 91 95 /** 96 * unsubscribe reaction from the reaction list 97 * @param collisionHandle the CollisionHandle to remove 98 * @param returns true if worked collrectly 99 */ 92 100 bool CREngine::unsubscribeReaction(CollisionHandle* collisionHandle) 93 {} 101 { 102 std::vector<CollisionHandle*>::iterator it; 103 for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++) 104 { 105 if( *it == collisionHandle) 106 { 107 this->collisionHandles.erase(it); 108 delete collisionHandle; 109 return true; 110 } 111 } 112 return false; 113 } 94 114 95 115 -
branches/cr/src/lib/collision_reaction/cr_engine.h
r7945 r7946 46 46 CollisionHandle* subscribeReaction(WorldEntity* worldEntity, CRType type); 47 47 48 bool unsubscribeReaction(WorldEntity* worldEntity);49 48 bool unsubscribeReaction(CollisionHandle* collisionHandle); 50 49
Note: See TracChangeset
for help on using the changeset viewer.