zero velocities when entities cease to be dynamic

This commit is contained in:
Andrew Meadows 2016-01-25 14:05:48 -08:00
parent ab133f37a0
commit 73805e831b

View file

@ -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();
propertiesTool = PropertiesTool();