mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Add "Set Rotation to Zero"
Add a "Set Rotation to Zero" button in properties tab (Spatial section) of the create app.
This commit is contained in:
parent
1122156d3a
commit
0d39eea2a6
1 changed files with 18 additions and 0 deletions
|
@ -2656,6 +2656,24 @@ var PropertiesTool = function (opts) {
|
|||
} else {
|
||||
audioFeedback.rejection();
|
||||
}
|
||||
} else if (data.action === "setRotationToZero") {
|
||||
if (selectionManager.selections.length === 1 && SelectionManager.hasUnlockedSelection()) {
|
||||
selectionManager.saveProperties();
|
||||
var parentState = getParentState(selectionManager.selections[0]);
|
||||
if ((parentState === "PARENT_CHILDREN" || parentState === "CHILDREN") && selectionDisplay.getSpaceMode() === "local" ) {
|
||||
Entities.editEntity(selectionManager.selections[0], {
|
||||
localRotation: Quat.IDENTITY
|
||||
});
|
||||
} else {
|
||||
Entities.editEntity(selectionManager.selections[0], {
|
||||
rotation: Quat.IDENTITY
|
||||
});
|
||||
}
|
||||
pushCommandForSelections();
|
||||
selectionManager._update(false, this);
|
||||
} else {
|
||||
audioFeedback.rejection();
|
||||
}
|
||||
}
|
||||
} else if (data.type === "propertiesPageReady") {
|
||||
updateSelections(true);
|
||||
|
|
Loading…
Reference in a new issue