Changeset 3353

Show
Ignore:
Timestamp:
02/01/10 16:26:20 (7 weeks ago)
Author:
Azaezel
Message:

getting and applying additional torque

Files:
1 modified

Legend:

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

    r3352 r3353  
    373373PhysicsActor::getTorque() 
    374374{ 
    375     Math::Vector3 velocity; 
    376     btRigidBodyGetTorque(m_pActor, velocity.m_array); 
    377     m_torque = velocity; 
     375    btVector3 tquat = m_pActor->getTotalTorque(); 
     376    m_torque.m_x = tquat.x(); 
     377    m_torque.m_y = tquat.y(); 
     378    m_torque.m_z = tquat.z(); 
    378379    return m_torque; 
    379380} 
     
    510511PhysicsActor::applyTorque(const Math::Vector3& _torque) 
    511512{ 
    512     btRigidBodyAddTorque(m_pActor, _torque.m_array); 
     513    btVector3 tquat = btVector3(_torque.m_x,_torque.m_y,_torque.m_z); 
     514    m_pActor->applyTorque(tquat);//todo: crosscheck consistency, and if this one acts too far differently than newton, use applyTorqueImpulse, as that accounts for an inertial tensor 
    513515} 
    514516