Changeset 8106 in orxonox.OLD for branches/cr
- Timestamp:
- Jun 1, 2006, 10:27:53 PM (19 years ago)
- Location:
- branches/cr/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cr/src/lib/collision_reaction/collision.h
r8029 r8106 30 30 /** @return Collision WorldEntity B */ 31 31 inline WorldEntity* getEntityB() const { return this->entityB; } 32 /** @return true if Entity A collides */ 33 inline bool isEntityACollide() { return this->entityACollide; } 34 /** @return true if Entity B collides */ 35 inline bool isEntityBCollide() { return this->entityBCollide; } 32 36 33 37 /** @returns true if this Collision has already been dispatched */ … … 38 42 /** @returns a vector of collision events */ 39 43 inline const std::vector<CollisionEvent*>& getCollisionEvents() const { return this->collisionEvents; } 44 45 40 46 41 47 void handleCollisionEvents(); … … 49 55 WorldEntity* entityA; //!< the collision body A 50 56 WorldEntity* entityB; //!< the collision body B 57 bool entityACollide; //!< true if entity A is subscribed for collision reaction 58 bool entityBCollide; //!< true if entity B is subscribed for collision reaction 51 59 52 60 bool bDispatched; //!< true if this collision has already been dispatched -
branches/cr/src/lib/collision_reaction/collision_handle.cc
r8099 r8106 17 17 #include "collision_handle.h" 18 18 19 #include "world_entity.h" 19 20 20 21 #include "collision.h" … … 95 96 this->collisionList.push_back(c); 96 97 98 // now register it as a shared collision with the other collision entity 99 CollisionHandle* ch = entityB->getCollisionHandle(this->type); 100 ch->registerSharedCollision(c); 101 97 102 return c; 98 103 } … … 105 110 * Therefore dispatching it only once 106 111 */ 107 void CollisionHandle::register Collision(Collision* collision)112 void CollisionHandle::registerSharedCollision(Collision* collision) 108 113 { 114 // set the state to not dispatched 115 this->bDispatched = false; 109 116 117 this->collisionList.push_back(collision); 110 118 } 111 119 -
branches/cr/src/lib/collision_reaction/collision_handle.h
r8099 r8106 31 31 void addTarget(long target); 32 32 Collision* registerCollision(WorldEntity* entityA, WorldEntity* entityB); 33 void register Collision(Collision* collision);33 void registerSharedCollision(Collision* collision); 34 34 void registerCollisionEvent(CollisionEvent* collisionEvent); 35 35 -
branches/cr/src/lib/collision_reaction/cr_object_damage.cc
r8049 r8106 56 56 float velocity; 57 57 58 PhysicsInterface* pi;59 58 60 const std::vector<CollisionEvent*>* collisionEvents = &(collision->getCollisionEvents()); 61 std::vector<CollisionEvent*>::const_iterator it = collisionEvents->begin();62 for(; it != collisionEvents->end(); it++) 63 { 64 pi = &(*it)->getEntityA()->getPhysicsInterface(); 65 // go through the collisions and try to estimate the damage66 mass = pi->getMass();67 }59 60 // const std::vector<CollisionEvent*>* collisionEvents = &(collision->getCollisionEvents()); 61 // std::vector<CollisionEvent*>::const_iterator it = collisionEvents->begin(); 62 // for(; it != collisionEvents->end(); it++) 63 // { 64 // // go through the collisions and try to estimate the damage 65 // mass = (*it)->getEntityA()->getMass(); 66 // } 68 67 69 68 } -
branches/cr/src/lib/physics/physics_interface.h
r6616 r8106 39 39 inline float getTotalMass( void ) const { return mass + massChildren; }; 40 40 41 /** @returns the velocity */ 42 inline const Vector getVelocity() { return this->velocity; } 43 /** @returns the acceleration */ 44 inline const Vector getAcceleration() { return this->acceleration; } 45 41 46 virtual void applyForce(const Vector& force); 42 47 virtual void applyField(Field* field); … … 51 56 float massChildren; //!< Sum of the masses of the children nodes 52 57 58 Vector velocity; //!< the velocity of the masspoint 59 Vector acceleration; //!< acceleration of the masspoint 60 53 61 Vector forceSum; //!< Total central force for this tick 54 62 Quaternion momentumSum; //!< Total momentum in this tick -
branches/cr/src/world_entities/world_entity.h
r8099 r8106 84 84 inline bool isReactive() const { return this->bReactive; } 85 85 86 constCollisionHandle* getCollisionHandle(CREngine::CRType type) const { return this->collisionHandles[type]; }86 CollisionHandle* getCollisionHandle(CREngine::CRType type) const { return this->collisionHandles[type]; } 87 87 88 88
Note: See TracChangeset
for help on using the changeset viewer.