Skip to content
Snippets Groups Projects
Select Git revision
  • 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
16 results

BluetoothEvents.c

Blame
  • OctaVertexCell.js NaN GiB
    /**
     * Created by aghassaei on 5/26/15.
     */
    
    
    define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'],
        function(_, THREE, three, lattice, appState, DMACell){
    
        var unitGeo = new THREE.OctahedronGeometry(1/Math.sqrt(2));
    
        function OctaVertexCell(json, superCell){
            DMACell.call(this, json, superCell);
        }
        OctaVertexCell.prototype = Object.create(DMACell.prototype);
    
        OctaVertexCell.prototype._getGeometry = function(){
            return unitGeo;
        };
    
        OctaVertexCell.prototype.calcHighlighterParams = function(face, point){
    
    //        point.applyQuaternion(this.getAbsoluteOrientation());
            var position = this.getAbsolutePosition();
            var direction = null;
    
            var xScale = this.xScale();
            if (point.x < position.x+xScale/4 && point.x > position.x-xScale/4){
                if (point.y > position.y-xScale/4 && point.y < position.y+xScale/4){
                    if (face.normal.z > 0) {
                        direction = new THREE.Vector3(0,0,1);
                        position.z += this.zScale()/2;
                    }
                    else {
                        direction = new THREE.Vector3(0,0,-1);
                        position.z -= this.zScale()/2;
                    }
                } else {
                    if (point.y < position.y-xScale/4){
                        direction = new THREE.Vector3(0,-1,0);
                        position.y -= xScale/2;
                    } else {
                        direction = new THREE.Vector3(0,1,0);
                        position.y += xScale/2;
                    }
                }
            } else {
                if (point.x < position.x-xScale/4){
                    direction = new THREE.Vector3(-1,0,0);
                    position.x -= xScale/2;
                } else {
                    direction = new THREE.Vector3(1,0,0);
                    position.x += xScale/2;
                }
            }
    
            return {direction:direction, position:position};
        };
    
        return OctaVertexCell;
    });