From 777c1183c509e9851e15773f1530658923b0e04f Mon Sep 17 00:00:00 2001 From: Robin Engman Date: Wed, 12 Feb 2014 13:55:43 +0100 Subject: [PATCH] Fixed set transformation --- .../Implementation/SimpleRigidBody.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Code/GamePhysics/Implementation/SimpleRigidBody.cpp b/Code/GamePhysics/Implementation/SimpleRigidBody.cpp index 7cd2f2b6..5670d32b 100644 --- a/Code/GamePhysics/Implementation/SimpleRigidBody.cpp +++ b/Code/GamePhysics/Implementation/SimpleRigidBody.cpp @@ -106,36 +106,36 @@ void SimpleRigidBody::SetLinearVelocity(Float3 velocity) void SimpleRigidBody::SetPosition(::Oyster::Math::Float3 position) { btTransform trans; - this->motionState->getWorldTransform(trans); + trans = this->rigidBody->getWorldTransform(); trans.setOrigin(btVector3(position.x, position.y, position.z)); - this->motionState->setWorldTransform(trans); + this->rigidBody->setWorldTransform(trans); this->state.centerPos = position; } void SimpleRigidBody::SetRotation(Float4 quaternion) { btTransform trans; - this->motionState->getWorldTransform(trans); + trans = this->rigidBody->getWorldTransform(); trans.setRotation(btQuaternion(quaternion.x, quaternion.y, quaternion.z, quaternion.w)); - this->motionState->setWorldTransform(trans); + this->rigidBody->setWorldTransform(trans); this->state.quaternion = Quaternion(quaternion.xyz, quaternion.w); } void SimpleRigidBody::SetRotation(::Oyster::Math::Quaternion quaternion) { btTransform trans; - this->motionState->getWorldTransform(trans); + trans = this->rigidBody->getWorldTransform(); trans.setRotation(btQuaternion(quaternion.imaginary.x, quaternion.imaginary.y, quaternion.imaginary.z, quaternion.real)); - this->motionState->setWorldTransform(trans); + this->rigidBody->setWorldTransform(trans); this->state.quaternion = quaternion; } void SimpleRigidBody::SetRotation(Float3 eulerAngles) { btTransform trans; - this->motionState->getWorldTransform(trans); + trans = this->rigidBody->getWorldTransform(); trans.setRotation(btQuaternion(eulerAngles.x, eulerAngles.y, eulerAngles.z)); - this->motionState->setWorldTransform(trans); + this->rigidBody->setWorldTransform(trans); this->state.quaternion = Quaternion(Float3(trans.getRotation().x(), trans.getRotation().y(), trans.getRotation().z()), trans.getRotation().w()); }