Merge branch 'Physics' of https://github.com/dean11/Danbias into GameLogic

This commit is contained in:
lindaandersson 2014-01-31 15:18:19 +01:00
commit e82e61374a
2 changed files with 2 additions and 1 deletions

View File

@ -187,7 +187,7 @@ void API_Impl::Update()
if( gravityImpulse != Float4::null ) if( gravityImpulse != Float4::null )
{ {
state.ApplyLinearImpulse( gravityImpulse.xyz ); state.ApplyLinearImpulse( gravityImpulse.xyz );
(*proto)->SetGravityNormal( gravityImpulse.GetNormalized().xyz ); state.SetGravityNormal( gravityImpulse.GetNormalized().xyz );
(*proto)->SetState( state ); (*proto)->SetState( state );
} }

View File

@ -105,6 +105,7 @@ void SphericalRigidBody::SetState( const SphericalRigidBody::State &state )
this->rigid.frictionCoeff_Kinetic = state.GetFrictionCoeff_Kinetic(); this->rigid.frictionCoeff_Kinetic = state.GetFrictionCoeff_Kinetic();
this->rigid.SetMass_KeepMomentum( state.GetMass() ); this->rigid.SetMass_KeepMomentum( state.GetMass() );
this->rigid.SetMomentOfInertia_KeepMomentum( state.GetMomentOfInertia() ); this->rigid.SetMomentOfInertia_KeepMomentum( state.GetMomentOfInertia() );
this->rigid.gravityNormal = state.GetGravityNormal();
if( state.IsForwarded() ) if( state.IsForwarded() )
{ {