From d40e4b721876c3c6f691e655e87234d5d6138cf4 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Fri, 8 May 2015 14:05:32 -0700 Subject: [PATCH] don't apply changes to velocity unless needed --- examples/grab.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/grab.js b/examples/grab.js index 312d21dd43..df2042350e 100644 --- a/examples/grab.js +++ b/examples/grab.js @@ -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