Minor Modification, switch /2 to 0.5f in ODEPrim.Velocity

connector_plugin
teravus 2012-10-02 23:14:35 -04:00
parent a5b8359b8e
commit df3d1d1301
1 changed files with 4 additions and 4 deletions

View File

@ -2395,15 +2395,15 @@ Console.WriteLine(" JointCreateFixed");
{ {
get get
{ {
// Averate previous velocity with the new one so // Average previous velocity with the new one so
// client object interpolation works a 'little' better // client object interpolation works a 'little' better
if (_zeroFlag) if (_zeroFlag)
return Vector3.Zero; return Vector3.Zero;
Vector3 returnVelocity = Vector3.Zero; Vector3 returnVelocity = Vector3.Zero;
returnVelocity.X = (m_lastVelocity.X + _velocity.X)/2; returnVelocity.X = (m_lastVelocity.X + _velocity.X) * 0.5f; // 0.5f is mathematically equiv to '/ 2'
returnVelocity.Y = (m_lastVelocity.Y + _velocity.Y)/2; returnVelocity.Y = (m_lastVelocity.Y + _velocity.Y) * 0.5f;
returnVelocity.Z = (m_lastVelocity.Z + _velocity.Z)/2; returnVelocity.Z = (m_lastVelocity.Z + _velocity.Z) * 0.5f;
return returnVelocity; return returnVelocity;
} }
set set