mirror of
https://github.com/overte-org/overte.git
synced 2025-06-15 18:19:15 +02:00
Fix for angularVelocity zeroing out on duplication or undo
This commit is contained in:
parent
079b276c2b
commit
9c96a10f6c
1 changed files with 13 additions and 2 deletions
|
@ -28,6 +28,17 @@ Script.include([
|
||||||
SelectionManager = (function() {
|
SelectionManager = (function() {
|
||||||
var that = {};
|
var that = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description Removes known to be broken properties from a properties object
|
||||||
|
* @param properties
|
||||||
|
* @return properties
|
||||||
|
*/
|
||||||
|
var fixRemoveBrokenProperties = function (properties) {
|
||||||
|
// Reason: Entity property is always set to 0,0,0 which causes it to override angularVelocity (see MS17131)
|
||||||
|
delete properties.localAngularVelocity;
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
// FUNCTION: SUBSCRIBE TO UPDATE MESSAGES
|
// FUNCTION: SUBSCRIBE TO UPDATE MESSAGES
|
||||||
function subscribeToUpdateMessages() {
|
function subscribeToUpdateMessages() {
|
||||||
Messages.subscribe("entityToolUpdates");
|
Messages.subscribe("entityToolUpdates");
|
||||||
|
@ -118,7 +129,7 @@ SelectionManager = (function() {
|
||||||
that.savedProperties = {};
|
that.savedProperties = {};
|
||||||
for (var i = 0; i < that.selections.length; i++) {
|
for (var i = 0; i < that.selections.length; i++) {
|
||||||
var entityID = that.selections[i];
|
var entityID = that.selections[i];
|
||||||
that.savedProperties[entityID] = Entities.getEntityProperties(entityID);
|
that.savedProperties[entityID] = fixRemoveBrokenProperties(Entities.getEntityProperties(entityID));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -246,7 +257,7 @@ SelectionManager = (function() {
|
||||||
var originalEntityID = entitiesToDuplicate[i];
|
var originalEntityID = entitiesToDuplicate[i];
|
||||||
var properties = that.savedProperties[originalEntityID];
|
var properties = that.savedProperties[originalEntityID];
|
||||||
if (properties === undefined) {
|
if (properties === undefined) {
|
||||||
properties = Entities.getEntityProperties(originalEntityID);
|
properties = fixRemoveBrokenProperties(Entities.getEntityProperties(originalEntityID));
|
||||||
}
|
}
|
||||||
if (!properties.locked && (!properties.clientOnly || properties.owningAvatarID === MyAvatar.sessionUUID)) {
|
if (!properties.locked && (!properties.clientOnly || properties.owningAvatarID === MyAvatar.sessionUUID)) {
|
||||||
if (nonDynamicEntityIsBeingGrabbedByAvatar(properties)) {
|
if (nonDynamicEntityIsBeingGrabbedByAvatar(properties)) {
|
||||||
|
|
Loading…
Reference in a new issue