diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-04-08 15:34:50 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-04-08 15:34:50 +0400 |
commit | 5398f1ba77d25ff27a4e8275a1453e7ddb2f2f0d (patch) | |
tree | 7407e63eceef245cc430c344a1f1a7e543a68667 /source/gameengine/Ketsji/KX_GameObject.cpp | |
parent | fc080d30d6134becd0792e2236e33ff98e5b7e9b (diff) |
Added resolveCombinedVelocities()
Fixed drot actuator. The rotation matrix was being mutilated by passing a float[9] instead of float[12].
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 2f30ac645a0..f49090acc0d 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -237,12 +237,10 @@ void KX_GameObject::ApplyRotation(const MT_Vector3& drot,bool local) MT_Matrix3x3 rotmat(drot); rotmat.transpose(); - //if (m_pPhysicsController1) // (IsDynamic()) - // m_pPhysicsController1->RelativeRotate(rotmat_,local); + if (m_pPhysicsController1) // (IsDynamic()) + m_pPhysicsController1->RelativeRotate(rotmat,local); // in worldspace GetSGNode()->RelativeRotate(rotmat,local); - if (m_pPhysicsController1) - m_pPhysicsController1->setOrientation(NodeGetWorldOrientation().getRotation()); } @@ -459,6 +457,20 @@ void KX_GameObject::setAngularVelocity(const MT_Vector3& ang_vel,bool local) m_pPhysicsController1->SetAngularVelocity(ang_vel,local); } +void KX_GameObject::ResolveCombinedVelocities( + const MT_Vector3 & lin_vel, + const MT_Vector3 & ang_vel, + bool lin_vel_local, + bool ang_vel_local +){ + if (m_pPhysicsController1) + { + m_pPhysicsController1->resolveCombinedVelocities( + lin_vel_local ? NodeGetWorldOrientation() * lin_vel : lin_vel, + ang_vel_local ? NodeGetWorldOrientation() * ang_vel : ang_vel + ); + } +} void KX_GameObject::SetObjectColor(const MT_Vector4& rgbavec) |