Momentum "fall-off" added
Temporary till real fluid drag is implemented.
This commit is contained in:
parent
50d895d37c
commit
b8e6b83148
|
@ -49,6 +49,10 @@ void RigidBody::Update_LeapFrog( Float updateFrameLength )
|
|||
{ // by Dan Andersson: Euler leap frog update when Runga Kutta is not needed
|
||||
|
||||
// updating the linear
|
||||
//Decrease momentum with 1% as "fall-off"
|
||||
//! HACK: @todo Add real solution with fluid drag
|
||||
this->momentum_Linear = this->momentum_Linear*0.99f;
|
||||
this->momentum_Angular = this->momentum_Angular*0.99f;
|
||||
// ds = dt * Formula::LinearVelocity( m, avg_G ) = dt * avg_G / m = (dt / m) * avg_G
|
||||
Float3 deltaPos = ( updateFrameLength / this->mass ) * AverageWithDelta( this->momentum_Linear, this->impulse_Linear );
|
||||
if( deltaPos.GetLength() < 0.001f )
|
||||
|
|
Loading…
Reference in New Issue