Merge pull request #4809 from PhilipRosedale/master

don't apply changes to velocity unless needed
This commit is contained in:
Philip Rosedale 2015-05-08 14:06:51 -07:00
commit 6008713a2a

View file

@ -193,12 +193,15 @@ function update(deltaTime) {
// Add Damping
newVelocity = Vec3.subtract(newVelocity, Vec3.multiply(newVelocity, DAMPING_RATE));
// Update entity
//add damping to angular velocity:
} else {
newVelocity = entityProps.velocity;
}
if (shouldRotate) {
angularVelocity = Vec3.subtract(angularVelocity, Vec3.multiply(angularVelocity, ANGULAR_DAMPING_RATE));
} else {
angularVelocity = entityProps.angularVelocity;
}
Entities.editEntity(grabbedEntity, {
velocity: newVelocity,
angularVelocity: angularVelocity