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

error from stock highlighting

parent 1ce7abbb
Branches
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' ...@@ -21,7 +21,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
if (this.superCell) this.superCell.addChildren(this.object3D);//add as child of supercell if (this.superCell) this.superCell.addChildren(this.object3D);//add as child of supercell
if (this.index){//todo gik supcells in stock have index but no highlight if (this.getAbsoluteIndex()){
if (!this.cells) lattice.getUItarget().addHighlightableCell(this.object3D.children[0]);//add mesh as highlightable object, only for lowest level of hierarchy if (!this.cells) lattice.getUItarget().addHighlightableCell(this.object3D.children[0]);//add mesh as highlightable object, only for lowest level of hierarchy
if (!superCell || superCell === undefined) three.sceneAdd(this.object3D);//add object3d as child of scene if top level of hierarchy if (!superCell || superCell === undefined) three.sceneAdd(this.object3D);//add object3d as child of scene if top level of hierarchy
} else this.hide();//stock cell } else this.hide();//stock cell
...@@ -102,7 +102,9 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' ...@@ -102,7 +102,9 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
return null; return null;
} }
if (!this.superCell) return this.getIndex(); if (!this.superCell) return this.getIndex();
return this.superCell.getAbsoluteIndex().add(this.superCell.applyRotation(this.getIndex()).round()); var superCellIndex = this.superCell.getAbsoluteIndex();
if (!superCellIndex) return null;
return superCellIndex.add(this.superCell.applyRotation(this.getIndex()).round());
}; };
DMACell.prototype.getPosition = function(){ DMACell.prototype.getPosition = function(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment