mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 10:28:57 +02:00
fix translate arrow normals
This commit is contained in:
parent
11f5e7812b
commit
194b00d732
1 changed files with 8 additions and 9 deletions
|
@ -1653,11 +1653,11 @@ SelectionDisplay = (function() {
|
|||
mode: mode,
|
||||
onBegin: function(event, pickRay, pickResult) {
|
||||
if (direction === TRANSLATE_DIRECTION.X) {
|
||||
pickNormal = { x:0, y:0, z:1 };
|
||||
pickNormal = { x:0, y:1, z:1 };
|
||||
} else if (direction === TRANSLATE_DIRECTION.Y) {
|
||||
pickNormal = { x:1, y:0, z:0 };
|
||||
pickNormal = { x:1, y:0, z:1 };
|
||||
} else if (direction === TRANSLATE_DIRECTION.Z) {
|
||||
pickNormal = { x:0, y:1, z:0 };
|
||||
pickNormal = { x:1, y:1, z:0 };
|
||||
}
|
||||
|
||||
var rotation = spaceMode === SPACE_LOCAL ? SelectionManager.localRotation : SelectionManager.worldRotation;
|
||||
|
@ -1701,7 +1701,6 @@ SelectionDisplay = (function() {
|
|||
onMove: function(event) {
|
||||
pickRay = generalComputePickRay(event.x, event.y);
|
||||
|
||||
// translate mode left/right based on view toward entity
|
||||
var newIntersection = rayPlaneIntersection(pickRay, SelectionManager.worldPosition, pickNormal);
|
||||
var vector = Vec3.subtract(newIntersection, lastPick);
|
||||
|
||||
|
@ -1719,7 +1718,7 @@ SelectionDisplay = (function() {
|
|||
var dotVector = Vec3.dot(vector, projectionVector);
|
||||
vector = Vec3.multiply(dotVector, projectionVector);
|
||||
vector = grid.snapToGrid(vector);
|
||||
|
||||
|
||||
var wantDebug = false;
|
||||
if (wantDebug) {
|
||||
print("translateUpDown... ");
|
||||
|
@ -2017,10 +2016,10 @@ SelectionDisplay = (function() {
|
|||
vector = grid.snapToSpacing(vector);
|
||||
|
||||
var changeInDimensions = Vec3.multiply(NEGATE_VECTOR, vec3Mult(localSigns, vector));
|
||||
if (directionEnum === STRETCH_DIRECTION.ALL) {
|
||||
var toCameraDistance = getDistanceToCamera(position);
|
||||
var dimensionsMultiple = toCameraDistance * STRETCH_DIRECTION_ALL_CAMERA_DISTANCE_MULTIPLE;
|
||||
changeInDimensions = Vec3.multiply(changeInDimensions, dimensionsMultiple);
|
||||
if (directionEnum === STRETCH_DIRECTION.ALL) {
|
||||
var toCameraDistance = getDistanceToCamera(position);
|
||||
var dimensionsMultiple = toCameraDistance * STRETCH_DIRECTION_ALL_CAMERA_DISTANCE_MULTIPLE;
|
||||
changeInDimensions = Vec3.multiply(changeInDimensions, dimensionsMultiple);
|
||||
}
|
||||
|
||||
var newDimensions;
|
||||
|
|
Loading…
Reference in a new issue