From 73805e831b752ed6d79857fd60d1443822199d22 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 25 Jan 2016 14:05:48 -0800 Subject: [PATCH] zero velocities when entities cease to be dynamic --- examples/edit.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/edit.js b/examples/edit.js index 6c24d00449..900eaf8e82 100644 --- a/examples/edit.js +++ b/examples/edit.js @@ -1556,6 +1556,11 @@ PropertiesTool = function(opts) { Entities.editEntity(selectionManager.selections[i], properties); } } else { + if (data.properties.dynamic === false) { + // this object is leaving dynamic, so we zero its velocities + data.properties["velocity"] = {x: 0, y: 0, z: 0}; + data.properties["angularVelocity"] = {x: 0, y: 0, z: 0}; + } if (data.properties.rotation !== undefined) { var rotation = data.properties.rotation; data.properties.rotation = Quat.fromPitchYawRollDegrees(rotation.x, rotation.y, rotation.z); @@ -1836,4 +1841,4 @@ propertyMenu.onSelectMenuItem = function(name) { var showMenuItem = propertyMenu.addMenuItem("Show in Marketplace"); -propertiesTool = PropertiesTool(); \ No newline at end of file +propertiesTool = PropertiesTool();