mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 12:20:00 +02:00
Merge pull request #6927 from AndrewMeadows/zero-velocities
entity.js will zero velocities when entities cease to be dynamic
This commit is contained in:
commit
7d8a3de711
1 changed files with 6 additions and 1 deletions
|
@ -1556,6 +1556,11 @@ PropertiesTool = function(opts) {
|
||||||
Entities.editEntity(selectionManager.selections[i], properties);
|
Entities.editEntity(selectionManager.selections[i], properties);
|
||||||
}
|
}
|
||||||
} else {
|
} 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) {
|
if (data.properties.rotation !== undefined) {
|
||||||
var rotation = data.properties.rotation;
|
var rotation = data.properties.rotation;
|
||||||
data.properties.rotation = Quat.fromPitchYawRollDegrees(rotation.x, rotation.y, rotation.z);
|
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");
|
var showMenuItem = propertyMenu.addMenuItem("Show in Marketplace");
|
||||||
|
|
||||||
propertiesTool = PropertiesTool();
|
propertiesTool = PropertiesTool();
|
||||||
|
|
Loading…
Reference in a new issue