Skip to content
Snippets Groups Projects
Select Git revision
  • 42ac34b484b677ae1004c3d0215b27911a100a71
  • master default protected
  • LUFA-170418
  • LUFA-151115
  • LUFA-140928
  • LUFA-140302
  • LUFA-130901
  • LUFA-130901-BETA
  • LUFA-130303
  • LUFA-120730
  • LUFA-120730-BETA
  • LUFA-120219
  • LUFA-120219-BETA
  • LUFA-111009
  • LUFA-111009-BETA
  • LUFA-110528
  • LUFA-110528-BETA
17 results

MailNotifier.cs

Blame
  • OctaRotEdgeLattice.js 1.85 KiB
    /**
     * Created by aghassaei on 5/26/15.
     */
    
    define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'threeModel'],
        function(_, Backbone, appState, globals, plist, THREE, three){
    
        var OctaRotEdgeLattice = {
    
            _initLatticeType: function(){
                require(['rotEdgeOctaBaseplane'], function(RotEdgeOctaBasePlane){
                    globals.basePlane = new RotEdgeOctaBasePlane();
                });
                require([this.getHighlighterFile()], function(DefaultHighlighter){
                    globals.highlighter = new DefaultHighlighter();
                });
            },
    
            getHighlighterFile: function(){
                return "defaultHighlighter";
            },
    
            getIndexForPosition: function(absPosition){
                return this._indexForPosition(absPosition);
            },
    
            getPositionForIndex: function(index){
                index = index.clone();
                if (index.z %2 != 0){
                    index.x += 0.5;
                    index.y += 0.5;
                }
                return this._positionForIndex(index);
            },
    
            xScale: function(cellSeparation){
                if (cellSeparation === undefined) cellSeparation = this.get("cellSeparation").xy;
                return 1 + 2*cellSeparation;
            },
    
            yScale: function(cellSeparation){
                return this.xScale(cellSeparation);
            },
    
            zScale: function(cellSeparation){
                if (cellSeparation === undefined) cellSeparation = this.get("cellSeparation").z;
                return Math.sqrt(2)/2 + 2*cellSeparation;
            },
    
            getCellSubclassFile: function(){
                return "octaRotEdgeCell";
            },
    
            _undo: function(){//remove all the mixins
                var self = this;
                _.each(_.keys(OctaRotEdgeLattice), function(key){
                    self[key] = null;
                });
            }
        };
    
        return OctaRotEdgeLattice;
    });