BulletSim: convert avatar movement from a force to an impulse. Shouldn't

change functionality but removes an oddity in computing the force.
user_profiles
Robert Adams 2013-01-04 16:45:34 -08:00
parent 2c6b269b6e
commit 613f516007
1 changed files with 2 additions and 2 deletions

View File

@ -214,7 +214,7 @@ public sealed class BSCharacter : BSPhysObject
} }
// 'stepVelocity' is now the speed we'd like the avatar to move in. Turn that into an instantanous force. // 'stepVelocity' is now the speed we'd like the avatar to move in. Turn that into an instantanous force.
OMV.Vector3 moveForce = (stepVelocity - _velocity) * Mass / PhysicsScene.LastTimeStep; OMV.Vector3 moveForce = (stepVelocity - _velocity) * Mass;
/* /*
// If moveForce is very small, zero things so we don't keep sending microscopic updates to the user // If moveForce is very small, zero things so we don't keep sending microscopic updates to the user
@ -231,7 +231,7 @@ public sealed class BSCharacter : BSPhysObject
} }
*/ */
// DetailLog("{0},BSCharacter.MoveMotor,move,stepVel={1},vel={2},mass={3},moveForce={4}", LocalID, stepVelocity, _velocity, Mass, moveForce); // DetailLog("{0},BSCharacter.MoveMotor,move,stepVel={1},vel={2},mass={3},moveForce={4}", LocalID, stepVelocity, _velocity, Mass, moveForce);
AddForce(moveForce, false, true); PhysicsScene.PE.ApplyCentralImpulse(PhysBody, moveForce);
}); });
} }