Changeset 3347
- Timestamp:
- 02/01/10 12:08:08 (7 weeks ago)
- Location:
- plugins/branches/0185_GEN_PHYSICS_REFACTOR_2
- Files:
-
- 6 modified
-
ZBullet/src/PhysicsActor.cpp (modified) (3 diffs)
-
ZBullet/src/PhysicsActor.hpp (modified) (1 diff)
-
ZBullet/src/PhysicsService.cpp (modified) (1 diff)
-
ZBullet/src/PhysicsZone.cpp (modified) (3 diffs)
-
ZNewton/src/PhysicsActor.cpp (modified) (1 diff)
-
ZNewton/src/PhysicsActor.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsActor.cpp
r3339 r3347 141 141 PhysicsActor::setAdvancedCollisionPrediction(bool _mode) 142 142 { 143 if (_mode) 144 { 145 btRigidBodySetContinuousCollisionMode(m_pActor, 1); 146 } 147 else 148 { 149 btRigidBodySetContinuousCollisionMode(m_pActor, 0); 150 } 143 //no ccd switch available 151 144 } 152 145 … … 155 148 PhysicsActor::getAdvancedCollisionPrediction() const 156 149 { 157 return (btRigidBodyGetContinuousCollisionMode(m_pActor) != 0);150 return 1;//no ccd switch available 158 151 } 159 152 … … 512 505 PhysicsActor::applyForce(const Math::Vector3& _force) 513 506 { 514 btRigidBodyAddForce(m_pActor, _force.m_array); 507 m_pActor->applyCentralImpulse(btVector3(_force.m_x,_force.m_y,_force.m_z)); 508 } 509 510 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 511 void 512 PhysicsActor::applyImpulse(const Math::Vector3& _force, const Math::Vector3& _worldPos) 513 { 514 //todo: bullet needs it's force fed to it in local space coords 515 m_pActor->applyForce(btVector3(_force.m_x,_force.m_y,_force.m_z), btVector3(_worldPos.m_x,_worldPos.m_y,_worldPos.m_z)); 515 516 } 516 517 -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsActor.hpp
r3339 r3347 116 116 static void TransformCallback(const btRigidBody* _body, const Zen::Math::Real* _matrix); 117 117 void applyForce(const Math::Vector3& _force); 118 void applyImpulse(const Math::Vector3& _force, const Math::Vector3& _worldPos); 119 118 120 void applyTorque(const Math::Vector3& _torque); 119 121 /// @} -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsService.cpp
r3342 r3347 56 56 // TODO evaluate whether or not we should have an unregister function for removing worlds from the list. 57 57 58 PhysicsZone* pRawZone = new PhysicsZone( );58 PhysicsZone* pRawZone = new PhysicsZone(_min,_max); 59 59 pPhysicsZone_type pZone = pPhysicsZone_type(pRawZone, boost::bind(&PhysicsService::onDestroyPhysicsZone, this, _1)); 60 60 m_zoneSet.insert(pZone); -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsZone.cpp
r3342 r3347 269 269 { 270 270 PhysicsZone::RayCastResult* pCastquery = static_cast<PhysicsZone::RayCastResult*>(_pUserData); 271 PhysicsActor* pRawPhysicsActor = static_cast<PhysicsActor*>( btRigidBodyGetUserData(_pBody));271 PhysicsActor* pRawPhysicsActor = static_cast<PhysicsActor*>(_pBody->getUserPointer()); 272 272 assert(pCastquery != NULL); 273 273 assert(pRawPhysicsActor != NULL); … … 290 290 { 291 291 PhysicsZone::RayCastResult* pCastquery = static_cast<PhysicsZone::RayCastResult*>(_pUserData); 292 PhysicsActor* pRawPhysicsActor = static_cast<PhysicsActor*>( btRigidBodyGetUserData(_pBody));292 PhysicsActor* pRawPhysicsActor = static_cast<PhysicsActor*>(_pBody->getUserPointer()); 293 293 assert(pCastquery != NULL); 294 294 assert(pRawPhysicsActor != NULL); … … 594 594 PhysicsZone::stepSimulation(double _elapsedTime) 595 595 { 596 NewtonUpdate(getZonePtr(),(Zen::Math::Real)_elapsedTime);596 getZonePtr()->stepSimulation((Zen::Math::Real)_elapsedTime); 597 597 } 598 598 -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZNewton/src/PhysicsActor.cpp
r3339 r3347 618 618 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 619 619 void 620 PhysicsActor::applyImpulse(const Math::Vector3& _force, const Math::Vector3& _worldPos) 621 { 622 //todo: bullet needs it's force fed to it in local space coords 623 NewtonAddBodyImpulse(m_pActor, _force.m_array, _worldPos.m_array); 624 } 625 626 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 627 void 620 628 PhysicsActor::applyTorque(const Math::Vector3& _torque) 621 629 { -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZNewton/src/PhysicsActor.hpp
r3339 r3347 117 117 118 118 void applyForce(const Math::Vector3& _force); 119 void applyImpulse(const Math::Vector3& _force, const Math::Vector3& _worldPos); 119 120 void applyTorque(const Math::Vector3& _torque); 120 121 /// @}
