diff --git a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp index 99f40d56..e68c860f 100644 --- a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp +++ b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp @@ -184,7 +184,7 @@ void API_Impl::UpdateWorld() simpleBody->GetMotionState()->getWorldTransform(trans); this->customBodies[i]->SetPosition(Float3(trans.getOrigin().x(), trans.getOrigin().y(), trans.getOrigin().z())); this->customBodies[i]->SetRotation(Quaternion(Float3(trans.getRotation().x(), trans.getRotation().y(), trans.getRotation().z()), trans.getRotation().w())); - //simpleBody->SetUpAndRight(Float3(0,1,0), Float3(-1,0,0)); + if(simpleBody->GetRigidBody()->getActivationState() == ACTIVE_TAG) { simpleBody->CallSubscription_Move(); diff --git a/Code/GamePhysics/Implementation/SimpleRigidBody.cpp b/Code/GamePhysics/Implementation/SimpleRigidBody.cpp index cb136aa9..784bd0cc 100644 --- a/Code/GamePhysics/Implementation/SimpleRigidBody.cpp +++ b/Code/GamePhysics/Implementation/SimpleRigidBody.cpp @@ -149,9 +149,9 @@ void SimpleRigidBody::SetUpAndRight(::Oyster::Math::Float3 up, ::Oyster::Math::F rotation[0] = rightVector.normalized(); rotation[2] = rightVector.cross(upVector).normalized(); - this->motionState->getWorldTransform(trans); + trans = this->rigidBody->getWorldTransform(); trans.setBasis(rotation); - this->motionState->setWorldTransform(trans); + this->rigidBody->setWorldTransform(trans); btQuaternion quaternion; quaternion = trans.getRotation(); @@ -168,9 +168,9 @@ void SimpleRigidBody::SetUpAndForward(::Oyster::Math::Float3 up, ::Oyster::Math: rotation[2] = forwardVector.normalized(); rotation[0] = forwardVector.cross(upVector).normalized(); - this->motionState->getWorldTransform(trans); + trans = this->rigidBody->getWorldTransform(); trans.setBasis(rotation); - this->motionState->setWorldTransform(trans); + this->rigidBody->setWorldTransform(trans); btQuaternion quaternion; quaternion = trans.getRotation();