mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 21:23:18 +02:00
Add snapping to vertical translation
This commit is contained in:
parent
31c128954e
commit
4d56c21442
1 changed files with 9 additions and 4 deletions
|
@ -1242,7 +1242,7 @@ SelectionDisplay = (function () {
|
|||
Quat.getFront(lastCameraOrientation));
|
||||
|
||||
var vector = Vec3.subtract(newIntersection, lastPlaneIntersection);
|
||||
lastPlaneIntersection = newIntersection;
|
||||
vector = grid.snapToGrid(vector);
|
||||
|
||||
// we only care about the Y axis
|
||||
vector.x = 0;
|
||||
|
@ -1258,10 +1258,15 @@ SelectionDisplay = (function () {
|
|||
Vec3.print(" newPosition:", newPosition);
|
||||
}
|
||||
for (var i = 0; i < SelectionManager.selections.length; i++) {
|
||||
var properties = Entities.getEntityProperties(SelectionManager.selections[i]);
|
||||
var id = SelectionManager.selections[i];
|
||||
var properties = selectionManager.savedProperties[id.id];
|
||||
|
||||
var original = properties.position;
|
||||
properties.position = Vec3.sum(properties.position, vector);
|
||||
Entities.editEntity(SelectionManager.selections[i], properties);
|
||||
var newPosition = Vec3.sum(properties.position, vector);
|
||||
|
||||
Entities.editEntity(id, {
|
||||
position: newPosition,
|
||||
});
|
||||
}
|
||||
|
||||
SelectionManager._update();
|
||||
|
|
Loading…
Reference in a new issue