Commit bdc9bb4f authored by amandaghassaei's avatar amandaghassaei

save last orientation

parent aef0ae09
......@@ -218,7 +218,7 @@ define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', '
}
if (shouldAdd){
if (!this.isVisible() || !this.highlightedObject) return;
lattice.addCellAtIndex(this._getNextCellIndex());
lattice.addCellAtIndex(this._getNextCellIndex(), {quaternion: appState.get("currentDesignOrientation")});
} else {
if (!this.highlightedObject) return;
if (!(this.highlightedObject instanceof DMACell)) return;
......
......@@ -96,6 +96,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
for (var y=range.min.y;y<=range.max.y;y++){
for (var z=range.min.z;z<=range.max.z;z++){
var index = new THREE.Vector3(x, y, z);
var quaternion = null;
if (clone){
var relIndex = index.clone().sub(range.min);
var cloneSize = clone.get("size");
......@@ -105,8 +106,9 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
var cell = clone.cellAtIndex(relIndex);
if (!cell) continue;
materialID = cell.getMaterialID();
quaternion = cell.getOrientation();
}
this._addCellAtIndex(index, {materialID: materialID}, true);
this._addCellAtIndex(index, {materialID: materialID, quaternion: quaternion}, true);
}
}
}
......
......@@ -65,6 +65,7 @@ define(['jquery', 'underscore', 'backbone', 'text!menus/contextMenu/CellContextM
else if (axis == "z") this.cell.rotateZ();
else console.warn("unknown axis " + axis);
cellAxesVis.setRotation(this.cell.getRotation());
appState.set("currentDesignOrientation", this.cell.getOrientation());
three.render();
},
......
......@@ -34,6 +34,7 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'materialsPlis
deleteMode: false,
extrudeMode: false,
cellMode: "cell",//cell, hide
currentDesignOrientation: null,//current rotation set for placing parts
realisticColorScheme: false,
materialType: null,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment