mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:58:27 +02:00
resize scale cube
This commit is contained in:
parent
8c422cb0eb
commit
8eddb36c82
1 changed files with 25 additions and 45 deletions
|
@ -441,7 +441,7 @@ SelectionDisplay = (function() {
|
|||
var STRETCH_PANEL_WIDTH = 0.01;
|
||||
|
||||
var SCALE_EDGE_OFFSET = 0.5;
|
||||
var SCALE_CUBE_CAMERA_DISTANCE_MULTIPLE = 0.0125;
|
||||
var SCALE_CUBE_CAMERA_DISTANCE_MULTIPLE = 0.02;
|
||||
|
||||
var CLONER_OFFSET = { x: 0.9, y: -0.9, z: 0.9 };
|
||||
|
||||
|
@ -2067,10 +2067,9 @@ SelectionDisplay = (function() {
|
|||
var pickRayPosition3D = null;
|
||||
var rotation = null;
|
||||
var previousPickRay = null;
|
||||
var beginMouseEvent = null;
|
||||
|
||||
var onBegin = function(event, pickRay, pickResult) {
|
||||
var proportional = directionEnum === STRETCH_DIRECTION.ALL;
|
||||
|
||||
var properties = Entities.getEntityProperties(SelectionManager.selections[0]);
|
||||
initialProperties = properties;
|
||||
rotation = (spaceMode === SPACE_LOCAL) ? properties.rotation : Quat.IDENTITY;
|
||||
|
@ -2158,17 +2157,7 @@ SelectionDisplay = (function() {
|
|||
}
|
||||
|
||||
planeNormal = Vec3.multiplyQbyV(rotation, planeNormal);
|
||||
|
||||
if (proportional) {
|
||||
lastPick = pickRay.origin;
|
||||
} else {
|
||||
lastPick = rayPlaneIntersection(pickRay,
|
||||
pickRayPosition,
|
||||
planeNormal);
|
||||
}
|
||||
|
||||
Vec3.print("DBACK TEST begin pickRayPosition ", pickRayPosition);
|
||||
Vec3.print("DBACK TEST begin lastPick ", lastPick);
|
||||
lastPick = rayPlaneIntersection(pickRay, pickRayPosition, planeNormal);
|
||||
|
||||
var planeNormal3D = {
|
||||
x: 0,
|
||||
|
@ -2208,6 +2197,7 @@ SelectionDisplay = (function() {
|
|||
}
|
||||
|
||||
previousPickRay = pickRay;
|
||||
beginMouseEvent = event;
|
||||
};
|
||||
|
||||
var onEnd = function(event, reason) {
|
||||
|
@ -2275,21 +2265,11 @@ SelectionDisplay = (function() {
|
|||
var changeInDimensions = Vec3.multiply(NEGATE_VECTOR, vec3Mult(localSigns, vector));
|
||||
|
||||
if (proportional) {
|
||||
newPick = pickRay.origin;
|
||||
var pickDifference = Vec3.subtract(newPick, lastPick);
|
||||
Vec3.print("DBACK TEST move newPick ", newPick);
|
||||
Vec3.print("DBACK TEST move pickDifference ", pickDifference);
|
||||
changeInDimensions =
|
||||
}
|
||||
|
||||
//Vec3.print("DBACK TEST move pickRay.origin ", pickRay.origin);
|
||||
//Vec3.print("DBACK TEST move pickRay.direction ", pickRay.direction);
|
||||
//Vec3.print("DBACK TEST move newPick ", newPick);
|
||||
//Vec3.print("DBACK TEST move vector ", vector);
|
||||
//Vec3.print("DBACK TEST move changeInDimensions ", changeInDimensions);
|
||||
|
||||
|
||||
if (proportional) {
|
||||
var viewportDimensions = Controller.getViewportDimensions();
|
||||
var mouseXDifference = (event.x - beginMouseEvent.x) / viewportDimensions.x;
|
||||
var mouseYDifference = (beginMouseEvent.y - event.y) / viewportDimensions.y;
|
||||
var mouseDifference = mouseXDifference + mouseYDifference;
|
||||
changeInDimensions = { x:mouseDifference, y:mouseDifference, z:mouseDifference };
|
||||
var toCameraDistance = getDistanceToCamera(position);
|
||||
var dimensionsMultiple = toCameraDistance * STRETCH_DIRECTION_ALL_CAMERA_DISTANCE_MULTIPLE;
|
||||
changeInDimensions = Vec3.multiply(changeInDimensions, dimensionsMultiple);
|
||||
|
|
Loading…
Reference in a new issue