From 8c7a17ff8f8189a03d0282e00f82eaadc4e7800d Mon Sep 17 00:00:00 2001 From: Robin Engman Date: Tue, 14 Jan 2014 11:58:53 +0100 Subject: [PATCH] Added missing mass and inertia --- Code/GamePhysics/Implementation/SimpleRigidBody.cpp | 2 ++ Code/GamePhysics/Implementation/SphericalRigidBody.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Code/GamePhysics/Implementation/SimpleRigidBody.cpp b/Code/GamePhysics/Implementation/SimpleRigidBody.cpp index 09855984..49fa292f 100644 --- a/Code/GamePhysics/Implementation/SimpleRigidBody.cpp +++ b/Code/GamePhysics/Implementation/SimpleRigidBody.cpp @@ -113,6 +113,8 @@ void SimpleRigidBody::SetState( const SimpleRigidBody::State &state ) this->rigid.restitutionCoeff = state.GetRestitutionCoeff(); this->rigid.frictionCoeff_Static = state.GetFrictionCoeff_Static(); this->rigid.frictionCoeff_Kinetic = state.GetFrictionCoeff_Kinetic(); + this->rigid.SetMass_KeepMomentum( state.GetMass() ); + this->rigid.SetMomentOfInertia_KeepMomentum( state.GetMomentOfInertia() ); if( state.IsForwarded() ) { diff --git a/Code/GamePhysics/Implementation/SphericalRigidBody.cpp b/Code/GamePhysics/Implementation/SphericalRigidBody.cpp index 95901763..2d96412c 100644 --- a/Code/GamePhysics/Implementation/SphericalRigidBody.cpp +++ b/Code/GamePhysics/Implementation/SphericalRigidBody.cpp @@ -83,6 +83,8 @@ void SphericalRigidBody::SetState( const SphericalRigidBody::State &state ) this->rigid.restitutionCoeff = state.GetRestitutionCoeff(); this->rigid.frictionCoeff_Static = state.GetFrictionCoeff_Static(); this->rigid.frictionCoeff_Kinetic = state.GetFrictionCoeff_Kinetic(); + this->rigid.SetMass_KeepMomentum( state.GetMass() ); + this->rigid.SetMomentOfInertia_KeepMomentum( state.GetMomentOfInertia() ); if( state.IsForwarded() ) {