Skip to content
Snippets Groups Projects
Commit 296ee53c authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

delete material

parent ab9187c1
No related branches found
No related tags found
No related merge requests found
...@@ -158,7 +158,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' ...@@ -158,7 +158,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
DMACell.prototype.setDeleteMode = function(state){ DMACell.prototype.setDeleteMode = function(state){
var material; var material;
if (!state && !this.materialName) return;//cell may be deleted by now if (!state && !this.materialName) return;//cell may be deleted by now
if (state) material = materials.list.deleteMaterial.threeMaterial; if (state) material = materials.getDeleteMaterial();
else material = this.getMaterial(true); else material = this.getMaterial(true);
if (!material) return;//no material object found if (!material) return;//no material object found
if (this.object3D.children[0].material == material) return; if (this.object3D.children[0].material == material) return;
......
...@@ -76,6 +76,10 @@ define(['underscore', 'three', 'appState', 'lattice', 'plist', 'threeModel'], fu ...@@ -76,6 +76,10 @@ define(['underscore', 'three', 'appState', 'lattice', 'plist', 'threeModel'], fu
return materialsList[id]; return materialsList[id];
} }
function getDeleteMaterial(){
return materialsList.deleteMaterial.threeMaterial;
}
...@@ -260,6 +264,7 @@ define(['underscore', 'three', 'appState', 'lattice', 'plist', 'threeModel'], fu ...@@ -260,6 +264,7 @@ define(['underscore', 'three', 'appState', 'lattice', 'plist', 'threeModel'], fu
getChildCellTypes:getChildCellTypes, getChildCellTypes:getChildCellTypes,
setToDefaultMaterial: setToDefaultMaterial, setToDefaultMaterial: setToDefaultMaterial,
setEditingMaterial: setEditingMaterial, setEditingMaterial: setEditingMaterial,
getEditingMaterial: getEditingMaterial getEditingMaterial: getEditingMaterial,
getDeleteMaterial: getDeleteMaterial
}; };
}); });
\ No newline at end of file
...@@ -3,13 +3,12 @@ ...@@ -3,13 +3,12 @@
*/ */
define(['underscore', 'stlLoader', 'gikPart'], function(_, THREE, GIKPart){ define(['underscore', 'stlLoader', 'gikPart', 'materials'], function(_, THREE, GIKPart, materials){
var zScale = 1.08/8; var zScale = 1.08/8;
var unitGeo = new THREE.BoxGeometry(0.2, 0.2, zScale); var unitGeo = new THREE.BoxGeometry(0.2, 0.2, zScale);
var bridgeGeo = new THREE.BoxGeometry(0.3, 0.4, zScale); var bridgeGeo = new THREE.BoxGeometry(0.3, 0.4, zScale);
console.log(bridgeGeo);
bridgeGeo.vertices[4].y = 0; bridgeGeo.vertices[4].y = 0;
bridgeGeo.vertices[5].y = 0; bridgeGeo.vertices[5].y = 0;
bridgeGeo.vertices[2].y = -0.1; bridgeGeo.vertices[2].y = -0.1;
...@@ -65,6 +64,11 @@ define(['underscore', 'stlLoader', 'gikPart'], function(_, THREE, GIKPart){ ...@@ -65,6 +64,11 @@ define(['underscore', 'stlLoader', 'gikPart'], function(_, THREE, GIKPart){
return GIKPart.prototype.getMaterial.call(this, returnTHREEObject); return GIKPart.prototype.getMaterial.call(this, returnTHREEObject);
}; };
DNAStraightPart.prototype.setMaterial = function(material){
if (material != materials.getDeleteMaterial()) material = this.getMaterial(true);
this.mesh.material = material;
};
DNAStraightPart.prototype._translatePart = function(mesh){ DNAStraightPart.prototype._translatePart = function(mesh){
if (this._isBridge){ if (this._isBridge){
mesh.translateX(0.15+0.2); mesh.translateX(0.15+0.2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment