mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-10 22:58:45 +02:00
v1 HMD duplication overlay.
This commit is contained in:
parent
03490c81da
commit
dae652d3db
1 changed files with 24 additions and 46 deletions
|
@ -416,7 +416,7 @@ SelectionDisplay = (function() {
|
||||||
y: 0,
|
y: 0,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
size: grabberSizeCorner + 0.025,
|
size: grabberSizeCorner,
|
||||||
color: grabberColorCloner,
|
color: grabberColorCloner,
|
||||||
alpha: 1,
|
alpha: 1,
|
||||||
solid: grabberSolid,
|
solid: grabberSolid,
|
||||||
|
@ -652,6 +652,8 @@ SelectionDisplay = (function() {
|
||||||
grabberPointLightR,
|
grabberPointLightR,
|
||||||
grabberPointLightF,
|
grabberPointLightF,
|
||||||
grabberPointLightN,
|
grabberPointLightN,
|
||||||
|
|
||||||
|
grabberCloner
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -994,8 +996,6 @@ SelectionDisplay = (function() {
|
||||||
grabberPointLightCircleY,
|
grabberPointLightCircleY,
|
||||||
grabberPointLightCircleZ,
|
grabberPointLightCircleZ,
|
||||||
|
|
||||||
grabberCloner
|
|
||||||
|
|
||||||
].concat(stretchHandles);
|
].concat(stretchHandles);
|
||||||
|
|
||||||
overlayNames[highlightBox] = "highlightBox";
|
overlayNames[highlightBox] = "highlightBox";
|
||||||
|
@ -1134,7 +1134,7 @@ SelectionDisplay = (function() {
|
||||||
if (event !== false) {
|
if (event !== false) {
|
||||||
pickRay = generalComputePickRay(event.x, event.y);
|
pickRay = generalComputePickRay(event.x, event.y);
|
||||||
|
|
||||||
var wantDebug = true;
|
var wantDebug = false;
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
print("select() with EVENT...... ");
|
print("select() with EVENT...... ");
|
||||||
print(" event.y:" + event.y);
|
print(" event.y:" + event.y);
|
||||||
|
@ -2355,7 +2355,7 @@ SelectionDisplay = (function() {
|
||||||
greatestDimension: 0.0,
|
greatestDimension: 0.0,
|
||||||
startingDistance: 0.0,
|
startingDistance: 0.0,
|
||||||
startingElevation: 0.0,
|
startingElevation: 0.0,
|
||||||
onBegin: function(event) {
|
onBegin: function(event,isAltFromGrab) {
|
||||||
SelectionManager.saveProperties();
|
SelectionManager.saveProperties();
|
||||||
startPosition = SelectionManager.worldPosition;
|
startPosition = SelectionManager.worldPosition;
|
||||||
var dimensions = SelectionManager.worldDimensions;
|
var dimensions = SelectionManager.worldDimensions;
|
||||||
|
@ -2370,7 +2370,7 @@ SelectionDisplay = (function() {
|
||||||
// Duplicate entities if alt is pressed. This will make a
|
// Duplicate entities if alt is pressed. This will make a
|
||||||
// copy of the selected entities and move the _original_ entities, not
|
// copy of the selected entities and move the _original_ entities, not
|
||||||
// the new ones.
|
// the new ones.
|
||||||
if (event.isAlt) {
|
if (event.isAlt || isAltFromGrab) {
|
||||||
duplicatedEntityIDs = [];
|
duplicatedEntityIDs = [];
|
||||||
for (var otherEntityID in SelectionManager.savedProperties) {
|
for (var otherEntityID in SelectionManager.savedProperties) {
|
||||||
var properties = SelectionManager.savedProperties[otherEntityID];
|
var properties = SelectionManager.savedProperties[otherEntityID];
|
||||||
|
@ -2402,7 +2402,7 @@ SelectionDisplay = (function() {
|
||||||
return (origin.y - intersection.y) / Vec3.distance(origin, intersection);
|
return (origin.y - intersection.y) / Vec3.distance(origin, intersection);
|
||||||
},
|
},
|
||||||
onMove: function(event) {
|
onMove: function(event) {
|
||||||
var wantDebug = true;
|
var wantDebug = false;
|
||||||
pickRay = generalComputePickRay(event.x, event.y);
|
pickRay = generalComputePickRay(event.x, event.y);
|
||||||
|
|
||||||
var pick = rayPlaneIntersection2(pickRay, translateXZTool.pickPlanePosition, {
|
var pick = rayPlaneIntersection2(pickRay, translateXZTool.pickPlanePosition, {
|
||||||
|
@ -2587,7 +2587,7 @@ SelectionDisplay = (function() {
|
||||||
vector.x = 0;
|
vector.x = 0;
|
||||||
vector.z = 0;
|
vector.z = 0;
|
||||||
|
|
||||||
var wantDebug = true;
|
var wantDebug = false;
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
print("translateUpDown... ");
|
print("translateUpDown... ");
|
||||||
print(" event.y:" + event.y);
|
print(" event.y:" + event.y);
|
||||||
|
@ -2613,45 +2613,27 @@ SelectionDisplay = (function() {
|
||||||
|
|
||||||
addGrabberTool(grabberCloner, {
|
addGrabberTool(grabberCloner, {
|
||||||
mode: "CLONE",
|
mode: "CLONE",
|
||||||
pickPlanePosition: { x: 0, y: 0, z: 0 },
|
|
||||||
greatestDimension: 0.0,
|
|
||||||
startingDistance: 0.0,
|
|
||||||
startingElevation: 0.0,
|
|
||||||
onBegin: function(event) {
|
onBegin: function(event) {
|
||||||
SelectionManager.saveProperties();
|
|
||||||
startPosition = SelectionManager.worldPosition;
|
|
||||||
var dimensions = SelectionManager.worldDimensions;
|
|
||||||
|
|
||||||
var pickRay = generalComputePickRay(event.x, event.y);
|
var pickRay = generalComputePickRay(event.x, event.y);
|
||||||
initialXZPick = rayPlaneIntersection(pickRay, translateXZTool.pickPlanePosition, {
|
var result = Overlays.findRayIntersection(pickRay);
|
||||||
x: 0,
|
translateXZTool.pickPlanePosition = result.intersection;
|
||||||
y: 1,
|
translateXZTool.greatestDimension = Math.max(Math.max(SelectionManager.worldDimensions.x, SelectionManager.worldDimensions.y),
|
||||||
z: 0
|
SelectionManager.worldDimensions.z);
|
||||||
});
|
|
||||||
|
|
||||||
// Duplicate entities if alt is pressed. This will make a
|
translateXZTool.onBegin(event,true);
|
||||||
// copy of the selected entities and move the _original_ entities, not
|
},
|
||||||
// the new ones.
|
elevation: function (event) {
|
||||||
|
translateXZTool.elevation(event);
|
||||||
duplicatedEntityIDs = [];
|
|
||||||
for (var otherEntityID in SelectionManager.savedProperties) {
|
|
||||||
var properties = SelectionManager.savedProperties[otherEntityID];
|
|
||||||
if (!properties.locked) {
|
|
||||||
var entityID = Entities.addEntity(properties);
|
|
||||||
duplicatedEntityIDs.push({
|
|
||||||
entityID: entityID,
|
|
||||||
properties: properties,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
isConstrained = false;
|
|
||||||
},
|
},
|
||||||
elevation: translateXZTool.elevation,
|
|
||||||
|
|
||||||
onEnd: translateXZTool.onEnd,
|
onEnd: function (event) {
|
||||||
|
translateXZTool.onEnd(event);
|
||||||
|
},
|
||||||
|
|
||||||
onMove: translateXZTool.onMove
|
onMove: function (event) {
|
||||||
|
translateXZTool.onMove(event);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -2921,7 +2903,7 @@ SelectionDisplay = (function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var wantDebug = true;
|
var wantDebug = false;
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
print(stretchMode);
|
print(stretchMode);
|
||||||
//Vec3.print(" newIntersection:", newIntersection);
|
//Vec3.print(" newIntersection:", newIntersection);
|
||||||
|
@ -3938,7 +3920,7 @@ SelectionDisplay = (function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
that.mousePressEvent = function(event) {
|
that.mousePressEvent = function(event) {
|
||||||
var wantDebug = true;
|
var wantDebug = false;
|
||||||
if (!event.isLeftButton && !that.triggered) {
|
if (!event.isLeftButton && !that.triggered) {
|
||||||
// if another mouse button than left is pressed ignore it
|
// if another mouse button than left is pressed ignore it
|
||||||
return false;
|
return false;
|
||||||
|
@ -4035,10 +4017,6 @@ SelectionDisplay = (function() {
|
||||||
mode = "STRETCH_LEFT";
|
mode = "STRETCH_LEFT";
|
||||||
somethingClicked = mode;
|
somethingClicked = mode;
|
||||||
break;
|
break;
|
||||||
// case grabberCloner:
|
|
||||||
// mode = "CLONE";
|
|
||||||
// somethingClicked = mode;
|
|
||||||
// break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
mode = "UNKNOWN";
|
mode = "UNKNOWN";
|
||||||
|
|
Loading…
Reference in a new issue