Changeset 3318

Show
Ignore:
Timestamp:
01/26/10 14:36:33 (6 weeks ago)
Author:
Azaezel
Message:

a bit more stubout work + exposing more errors to address. might refactor out ZenMotionState? if possible. definably will be removing ZBulletMaterial later

Location:
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsActor.cpp

    r3302 r3318  
    457457        } 
    458458    } 
    459  
    460 #if 0 
    461     // HACK Keep the object to a constant velocity 
    462     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 #endif 
    471  
    472     //std::cout << "TransformCallback()" << std::endl; 
    473 #if 0 
    474         RenderPrimitive* primitive; 
    475  
    476         // get the graphic object form the rigid body 
    477         primitive = (RenderPrimitive*) btRigidBodyGetUserData (body); 
    478  
    479         // set the transformation matrix for this rigid body 
    480         dMatrix& mat = *((dMatrix*)matrix); 
    481         primitive->SetMatrix (mat); 
    482 #endif 
    483459} 
    484460 
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsActor.hpp

    r3294 r3318  
    4646namespace ZBullet { 
    4747//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    48  
     48class ZBulletMaterial; 
    4949class PhysicsZone; 
    5050class PhysicsActor 
     
    121121    /// @} 
    122122public: 
    123     /// @ For Internal Newton usage 
     123    /// @ For Internal Bullet usage 
    124124    /// @{ 
    125125    btRigidBody* getActorPtr(); 
     
    142142    /// @{ 
    143143private: 
    144     btRigidBody*                             m_pActor; 
     144    btRigidBody*                            m_pActor; 
    145145    wpPhysicsZone_type                      m_pZone; 
    146146    pPhysicsMaterial_type                   m_material; 
    147     Zen::Math::Real                                  m_scaleX, m_scaleY, m_scaleZ; 
     147    Zen::Math::Real                         m_scaleX, m_scaleY, m_scaleZ; 
    148148    Scripting::I_ObjectReference*           m_pScriptObject; 
    149149    std::string                             m_name; 
     
    296296    public: 
    297297 
    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; 
    302302    };  // class DuringCollisionEventData 
    303303 
     
    318318 
    319319    };  // 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    /// @} 
    321334};  // class PhysicsActor 
    322335 
     
    327340,   m_transform(_transform) 
    328341{ 
    329 } 
    330  
     342    m_MotionState->setWorldTransform(_transform); 
     343} 
     344 
     345//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
     346inline 
     347PhysicsActor::ZenMotionState::ZenMotionState() 
     348{ 
     349 
     350} 
     351//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
     352inline 
     353PhysicsActor::ZenMotionState::~ZenMotionState() 
     354{ 
     355 
     356} 
    331357//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    332358inline 
     
    348374//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    349375inline 
    350 PhysicsActor::DuringCollisionEventData::DuringCollisionEventData(const ZBulletMaterial* _pMaterial, const NewtonContact* _pContact, Engine::Physics::I_PhysicsActor& _actor, Engine::Physics::I_PhysicsActor& _otherActor) 
     376PhysicsActor::DuringCollisionEventData::DuringCollisionEventData(const ZBulletMaterial* _pMaterial, const btManifoldPoint* _pContact, Engine::Physics::I_PhysicsActor& _actor, Engine::Physics::I_PhysicsActor& _otherActor) 
    351377:   CollisionEventData(_pMaterial, _actor, _otherActor) 
    352378,   m_pContact(_pContact) 
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsMaterial.cpp

    r3294 r3318  
    270270//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    271271static int GenericContactBegin(const ZBulletMaterial* material, const btRigidBody* body0, const btRigidBody* body1); 
    272 static int  GenericContactProcess(const ZBulletMaterial* material, const NewtonContact* contact); 
     272static int  GenericContactProcess(const ZBulletMaterial* material, const btManifoldPoint* contact); 
    273273static void GenericContactEnd(const ZBulletMaterial* material); 
    274274