From 10402a5af2c7407fc124e2b535a3005f2664043e Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Wed, 24 Jun 2015 16:03:24 -0700
Subject: [PATCH] gik hierarchy working

---
 js/cells/supercells/CompositeCell.js | 8 ++++++++
 js/cells/supercells/GIKSuperCell.js  | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/js/cells/supercells/CompositeCell.js b/js/cells/supercells/CompositeCell.js
index 70976006..f449d77e 100644
--- a/js/cells/supercells/CompositeCell.js
+++ b/js/cells/supercells/CompositeCell.js
@@ -18,6 +18,14 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell',
         return geo;
     };
 
+    CompositeCell.prototype._rotateCell = function(object3D){
+        if (lattice.get("connectionType") == "gik") {
+            if (this.index.z %2 != 0) return object3D.rotateZ(Math.PI/2);
+            return object3D;
+        }
+        return DMASuperCell.prototype._rotateCell.call(this, object3D);
+    };
+
     CompositeCell.prototype._buildWireframe = function(mesh){
         var wireframe = new THREE.BoxHelper(mesh);
         wireframe.material.color.set(0x000000);
diff --git a/js/cells/supercells/GIKSuperCell.js b/js/cells/supercells/GIKSuperCell.js
index 27832141..8191c3ed 100644
--- a/js/cells/supercells/GIKSuperCell.js
+++ b/js/cells/supercells/GIKSuperCell.js
@@ -35,7 +35,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell',
 
     GIKSuperCell.prototype._rotateCell = function(object3D){
         if (!this.index) return object3D;
-        if (this.getAbsoluteIndex().z%2 != 0) object3D.rotateZ(Math.PI/2);
+        if (this.index.z%2 != 0) object3D.rotateZ(Math.PI/2);
         return object3D;
     };
 
-- 
GitLab