mirror of
https://github.com/overte-org/overte.git
synced 2025-08-12 14:34:43 +02:00
Merge pull request #13396 from dback2/editHandleCollision
Temp disable MyAvatar collisions when stretching entities
This commit is contained in:
commit
17263a1ed3
1 changed files with 18 additions and 25 deletions
|
@ -313,8 +313,6 @@ SelectionDisplay = (function() {
|
||||||
|
|
||||||
var CTRL_KEY_CODE = 16777249;
|
var CTRL_KEY_CODE = 16777249;
|
||||||
|
|
||||||
var AVATAR_COLLISIONS_OPTION = "Enable Avatar Collisions";
|
|
||||||
|
|
||||||
var TRANSLATE_DIRECTION = {
|
var TRANSLATE_DIRECTION = {
|
||||||
X : 0,
|
X : 0,
|
||||||
Y : 1,
|
Y : 1,
|
||||||
|
@ -368,7 +366,7 @@ SelectionDisplay = (function() {
|
||||||
|
|
||||||
var ctrlPressed = false;
|
var ctrlPressed = false;
|
||||||
|
|
||||||
var handleStretchCollisionOverride = false;
|
var replaceCollisionsAfterStretch = false;
|
||||||
|
|
||||||
var handlePropertiesTranslateArrowCones = {
|
var handlePropertiesTranslateArrowCones = {
|
||||||
shape: "Cone",
|
shape: "Cone",
|
||||||
|
@ -644,11 +642,6 @@ SelectionDisplay = (function() {
|
||||||
var activeTool = null;
|
var activeTool = null;
|
||||||
var handleTools = {};
|
var handleTools = {};
|
||||||
|
|
||||||
that.shutdown = function() {
|
|
||||||
that.restoreAvatarCollisionsFromStretch();
|
|
||||||
}
|
|
||||||
Script.scriptEnding.connect(that.shutdown);
|
|
||||||
|
|
||||||
// We get mouseMoveEvents from the handControllers, via handControllerPointer.
|
// We get mouseMoveEvents from the handControllers, via handControllerPointer.
|
||||||
// But we dont' get mousePressEvents.
|
// But we dont' get mousePressEvents.
|
||||||
that.triggerMapping = Controller.newMapping(Script.resolvePath('') + '-click');
|
that.triggerMapping = Controller.newMapping(Script.resolvePath('') + '-click');
|
||||||
|
@ -1832,13 +1825,6 @@ SelectionDisplay = (function() {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
that.restoreAvatarCollisionsFromStretch = function() {
|
|
||||||
if (handleStretchCollisionOverride) {
|
|
||||||
Menu.setIsOptionChecked(AVATAR_COLLISIONS_OPTION, true);
|
|
||||||
handleStretchCollisionOverride = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TOOL DEFINITION: HANDLE STRETCH TOOL
|
// TOOL DEFINITION: HANDLE STRETCH TOOL
|
||||||
function makeStretchTool(stretchMode, directionEnum, directionVec, pivot, offset, stretchPanel, scaleHandle) {
|
function makeStretchTool(stretchMode, directionEnum, directionVec, pivot, offset, stretchPanel, scaleHandle) {
|
||||||
var directionFor3DStretch = directionVec;
|
var directionFor3DStretch = directionVec;
|
||||||
|
@ -2041,9 +2027,12 @@ SelectionDisplay = (function() {
|
||||||
if (scaleHandle != null) {
|
if (scaleHandle != null) {
|
||||||
Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE_SELECTED });
|
Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE_SELECTED });
|
||||||
}
|
}
|
||||||
if (Menu.isOptionChecked(AVATAR_COLLISIONS_OPTION)) {
|
|
||||||
Menu.setIsOptionChecked(AVATAR_COLLISIONS_OPTION, false);
|
var collisionToRemove = "myAvatar";
|
||||||
handleStretchCollisionOverride = true;
|
if (properties.collidesWith.indexOf(collisionToRemove) > -1) {
|
||||||
|
var newCollidesWith = properties.collidesWith.replace(collisionToRemove, "");
|
||||||
|
Entities.editEntity(SelectionManager.selections[0], {collidesWith: newCollidesWith});
|
||||||
|
that.replaceCollisionsAfterStretch = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2054,7 +2043,13 @@ SelectionDisplay = (function() {
|
||||||
if (scaleHandle != null) {
|
if (scaleHandle != null) {
|
||||||
Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE });
|
Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE });
|
||||||
}
|
}
|
||||||
that.restoreAvatarCollisionsFromStretch();
|
|
||||||
|
if (that.replaceCollisionsAfterStretch) {
|
||||||
|
var newCollidesWith = SelectionManager.savedProperties[SelectionManager.selections[0]].collidesWith;
|
||||||
|
Entities.editEntity(SelectionManager.selections[0], {collidesWith: newCollidesWith});
|
||||||
|
that.replaceCollisionsAfterStretch = false;
|
||||||
|
}
|
||||||
|
|
||||||
pushCommandForSelections();
|
pushCommandForSelections();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2140,12 +2135,10 @@ SelectionDisplay = (function() {
|
||||||
}
|
}
|
||||||
var newPosition = Vec3.sum(initialPosition, changeInPosition);
|
var newPosition = Vec3.sum(initialPosition, changeInPosition);
|
||||||
|
|
||||||
for (var i = 0; i < SelectionManager.selections.length; i++) {
|
Entities.editEntity(SelectionManager.selections[0], {
|
||||||
Entities.editEntity(SelectionManager.selections[i], {
|
position: newPosition,
|
||||||
position: newPosition,
|
dimensions: newDimensions
|
||||||
dimensions: newDimensions
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var wantDebug = false;
|
var wantDebug = false;
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
|
|
Loading…
Reference in a new issue