Changeset 8323 in orxonox.OLD for branches/bsp_model/src/lib
- Timestamp:
- Jun 12, 2006, 12:10:51 AM (18 years ago)
- Location:
- branches/bsp_model/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/collision_reaction/collision_event.h
r8219 r8323 41 41 inline Vector getGroundNormal() { return this->groundNormal; } 42 42 43 /** @return position of the position, only accurate if this is a collision with the ground!!! */ 44 inline Vector getCollisionPosition() { return this->position; } 43 45 44 46 private: -
branches/bsp_model/src/lib/collision_reaction/collision_handle.cc
r8288 r8323 192 192 void CollisionHandle::handleCollisions() 193 193 { 194 // if( this->type == CREngine::CR_) 194 // if continuous poll poll the reaction 195 if( this->bContinuousPoll && !this->bCollided) 196 { 197 this->collisionReaction->update(this->owner); 198 return; 199 } 195 200 196 201 // collision reaction calculations (for every collision there will be a reaction) … … 204 209 } 205 210 206 // if continuous poll poll the reaction207 if( this->bContinuousPoll && this->bCollided)208 this->collisionReaction->update(this->owner);209 210 211 // now set state to dispatched 211 212 this->bDispatched = true; -
branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.cc
r8288 r8323 53 53 void CRPhysicsGroundWalk::reactToCollision(Collision* collision) 54 54 { 55 CollisionEvent* ce = collision->getCollisionEvents().front(); 56 Vector normal = ce->getGroundNormal(); 57 normal.normalize(); 58 59 // put it back 60 PRINTF(0)("putting it back\n"); 61 collision->getEntityB()->setVelocity(Vector()); 62 // collision->getEntityB()->setAbsCoorSoft(this->lastPosition, 0.1); 63 // collision->getEntityB()->setAbsCoor(this->lastPosition/* + normal * (-5.0f)*/); 55 // CollisionEvent* ce = collision->getCollisionEvents().front(); 56 // Vector normal = ce->getGroundNormal(); 57 // normal.normalize(); 58 // 59 // Vector position = ce->getCollisionPosition(); 64 60 65 61 62 if( this->lastPosition != collision->getEntityB()->getAbsCoor()) 63 { 64 // put it back 65 PRINTF(0)("putting it back to: \n"); 66 this->lastPosition.debug(); 66 67 68 collision->getEntityB()->setVelocity(Vector()); 69 // collision->getEntityB()->setAbsCoorSoft(this->lastPosition, 0.1); 70 collision->getEntityB()->setAbsCoor(this->lastPosition); 71 } 67 72 } 68 73 … … 76 81 this->lastPosition = owner->getAbsCoor(); 77 82 this->lastDirection = owner->getAbsDir(); 83 PRINTF(0)("no collision: saving location: \n"); 84 this->lastPosition.debug(); 78 85 } 79 86 -
branches/bsp_model/src/lib/math/vector.h
r8145 r8323 46 46 /** @param v: the Vecor to compare with this one @returns true, if the Vecors are the same, false otherwise */ 47 47 inline bool operator== (const Vector& v) const { return (this->x==v.x&&this->y==v.y&&this->z==v.z)?true:false; }; 48 /** @param v: the Vecor to compare with this one @returns true, if the Vecors are different, false otherwise */ 49 inline bool operator!= (const Vector& v) const { return (this->x!=v.x&&this->y!=v.y&&this->z!=v.z)?true:false; }; 48 50 /** @param index The index of the "array" @returns the x/y/z coordinate */ 49 51 inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; }
Note: See TracChangeset
for help on using the changeset viewer.