Changeset 3318
- Timestamp:
- 01/26/10 14:36:33 (7 months ago)
- Location:
- plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src
- Files:
-
- 3 modified
-
PhysicsActor.cpp (modified) (1 diff)
-
PhysicsActor.hpp (modified) (7 diffs)
-
PhysicsMaterial.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsActor.cpp
r3302 r3318 457 457 } 458 458 } 459 460 #if 0461 // HACK Keep the object to a constant velocity462 Math::Vector3 velocity;463 464 btRigidBodyGetVelocity(_body, velocity.m_array);465 466 velocity.normalize();467 velocity = velocity * 50;468 469 btRigidBodySetVelocity(_body, velocity.m_array);470 #endif471 472 //std::cout << "TransformCallback()" << std::endl;473 #if 0474 RenderPrimitive* primitive;475 476 // get the graphic object form the rigid body477 primitive = (RenderPrimitive*) btRigidBodyGetUserData (body);478 479 // set the transformation matrix for this rigid body480 dMatrix& mat = *((dMatrix*)matrix);481 primitive->SetMatrix (mat);482 #endif483 459 } 484 460 -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsActor.hpp
r3294 r3318 46 46 namespace ZBullet { 47 47 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 48 48 class ZBulletMaterial; 49 49 class PhysicsZone; 50 50 class PhysicsActor … … 121 121 /// @} 122 122 public: 123 /// @ For Internal Newtonusage123 /// @ For Internal Bullet usage 124 124 /// @{ 125 125 btRigidBody* getActorPtr(); … … 142 142 /// @{ 143 143 private: 144 btRigidBody* m_pActor;144 btRigidBody* m_pActor; 145 145 wpPhysicsZone_type m_pZone; 146 146 pPhysicsMaterial_type m_material; 147 Zen::Math::Real m_scaleX, m_scaleY, m_scaleZ;147 Zen::Math::Real m_scaleX, m_scaleY, m_scaleZ; 148 148 Scripting::I_ObjectReference* m_pScriptObject; 149 149 std::string m_name; … … 296 296 public: 297 297 298 DuringCollisionEventData(const ZBulletMaterial* _pMaterial, const NewtonContact* _contact, Engine::Physics::I_PhysicsActor& _actor, Engine::Physics::I_PhysicsActor& _otherActor);299 300 private: 301 const NewtonContact* m_pContact;298 DuringCollisionEventData(const ZBulletMaterial* _pMaterial, const btManifoldPoint* _contact, Engine::Physics::I_PhysicsActor& _actor, Engine::Physics::I_PhysicsActor& _otherActor); 299 300 private: 301 const btManifoldPoint* m_pContact; 302 302 }; // class DuringCollisionEventData 303 303 … … 318 318 319 319 }; // class EndCollisionEventData 320 320 private: 321 class ZenMotionState : public btMotionState 322 { 323 public: 324 ZenMotionState(); 325 virtual ~ZenMotionState(); 326 virtual void getWorldTransform(btTransform &worldTrans) const; 327 virtual void setWorldTransform(const btTransform &worldTrans); 328 }; 329 330 /// @name Extended Member Variables 331 /// @{ 332 ZenMotionState * m_MotionState; 333 /// @} 321 334 }; // class PhysicsActor 322 335 … … 327 340 , m_transform(_transform) 328 341 { 329 } 330 342 m_MotionState->setWorldTransform(_transform); 343 } 344 345 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 346 inline 347 PhysicsActor::ZenMotionState::ZenMotionState() 348 { 349 350 } 351 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 352 inline 353 PhysicsActor::ZenMotionState::~ZenMotionState() 354 { 355 356 } 331 357 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 332 358 inline … … 348 374 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 349 375 inline 350 PhysicsActor::DuringCollisionEventData::DuringCollisionEventData(const ZBulletMaterial* _pMaterial, const NewtonContact* _pContact, Engine::Physics::I_PhysicsActor& _actor, Engine::Physics::I_PhysicsActor& _otherActor)376 PhysicsActor::DuringCollisionEventData::DuringCollisionEventData(const ZBulletMaterial* _pMaterial, const btManifoldPoint* _pContact, Engine::Physics::I_PhysicsActor& _actor, Engine::Physics::I_PhysicsActor& _otherActor) 351 377 : CollisionEventData(_pMaterial, _actor, _otherActor) 352 378 , m_pContact(_pContact) -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsMaterial.cpp
r3294 r3318 270 270 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 271 271 static int GenericContactBegin(const ZBulletMaterial* material, const btRigidBody* body0, const btRigidBody* body1); 272 static int GenericContactProcess(const ZBulletMaterial* material, const NewtonContact* contact);272 static int GenericContactProcess(const ZBulletMaterial* material, const btManifoldPoint* contact); 273 273 static void GenericContactEnd(const ZBulletMaterial* material); 274 274
