Merge pull request #14008 from sethalves/fix-local-angular-velocity

fix bug that caused localAngularVelocity to get zeroed out
This commit is contained in:
John Conklin II 2018-09-24 14:32:57 -07:00 committed by GitHub
commit 55848e6959
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 17 deletions

View file

@ -132,8 +132,8 @@ EntityItemProperties convertPropertiesToScriptSemantics(const EntityItemProperti
EntityItemProperties scriptSideProperties = entitySideProperties;
scriptSideProperties.setLocalPosition(entitySideProperties.getPosition());
scriptSideProperties.setLocalRotation(entitySideProperties.getRotation());
scriptSideProperties.setLocalVelocity(entitySideProperties.getLocalVelocity());
scriptSideProperties.setLocalAngularVelocity(entitySideProperties.getLocalAngularVelocity());
scriptSideProperties.setLocalVelocity(entitySideProperties.getVelocity());
scriptSideProperties.setLocalAngularVelocity(entitySideProperties.getAngularVelocity());
scriptSideProperties.setLocalDimensions(entitySideProperties.getDimensions());
bool success;
@ -181,8 +181,6 @@ EntityItemProperties convertPropertiesFromScriptSemantics(const EntityItemProper
EntityItemProperties entitySideProperties = scriptSideProperties;
bool success;
// TODO -- handle velocity and angularVelocity
if (scriptSideProperties.localPositionChanged()) {
entitySideProperties.setPosition(scriptSideProperties.getLocalPosition());
} else if (scriptSideProperties.positionChanged()) {

View file

@ -29,17 +29,6 @@ Script.include([
SelectionManager = (function() {
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 subscribeToUpdateMessages() {
Messages.subscribe("entityToolUpdates");
@ -130,7 +119,7 @@ SelectionManager = (function() {
that.savedProperties = {};
for (var i = 0; i < that.selections.length; i++) {
var entityID = that.selections[i];
that.savedProperties[entityID] = fixRemoveBrokenProperties(Entities.getEntityProperties(entityID));
that.savedProperties[entityID] = Entities.getEntityProperties(entityID);
}
};
@ -258,7 +247,7 @@ SelectionManager = (function() {
var originalEntityID = entitiesToDuplicate[i];
var properties = that.savedProperties[originalEntityID];
if (properties === undefined) {
properties = fixRemoveBrokenProperties(Entities.getEntityProperties(originalEntityID));
properties = Entities.getEntityProperties(originalEntityID);
}
if (!properties.locked && (!properties.clientOnly || properties.owningAvatarID === MyAvatar.sessionUUID)) {
if (nonDynamicEntityIsBeingGrabbedByAvatar(properties)) {