Commit 45d1a027 authored by Evgeny's avatar Evgeny

Update three dep. Update to E6^

parent a8c7af38
...@@ -4,21 +4,20 @@ ...@@ -4,21 +4,20 @@
* @author julianwa / https://github.com/julianwa * @author julianwa / https://github.com/julianwa
*/ */
define(['three'], function(THREE, BSPTree){ import THREE from 'three.js';
var Projector = {};
var i, l, o; // counters var i, l, o; // counters
Projector.RenderableObject = function () { export class RenderableObject{
this.id = 0; this.id = 0;
this.object = null; this.object = null;
this.z = 0; this.z = 0;
}; };
Projector.RenderableFace = function () { export function RenderableFace () {
this.id = 0; this.id = 0;
...@@ -38,9 +37,9 @@ define(['three'], function(THREE, BSPTree){ ...@@ -38,9 +37,9 @@ define(['three'], function(THREE, BSPTree){
this.z = 0; this.z = 0;
}; };
Projector.RenderableFace.prototype.copy = function ( face ){ RenderableFace.prototype.copy = function ( face ){
this.v1.copy(face.v1); this.v1.copy(face.v1);
this.v2.copy(face.v2); this.v2.copy(face.v2);
this.v3.copy(face.v3); this.v3.copy(face.v3);
...@@ -54,9 +53,9 @@ define(['three'], function(THREE, BSPTree){ ...@@ -54,9 +53,9 @@ define(['three'], function(THREE, BSPTree){
this.material = face.material; this.material = face.material;
this.uvs = face.uvs; this.uvs = face.uvs;
this.priority = face.priority; this.priority = face.priority;
}; };
Projector.RenderableVertex = function () { export function RenderableVertex () {
this.position = new THREE.Vector3(); this.position = new THREE.Vector3();
this.positionWorld = new THREE.Vector3(); this.positionWorld = new THREE.Vector3();
...@@ -64,38 +63,38 @@ define(['three'], function(THREE, BSPTree){ ...@@ -64,38 +63,38 @@ define(['three'], function(THREE, BSPTree){
this.visible = true; this.visible = true;
}; };
Projector.RenderableVertex.prototype.copy = function ( vertex ) { RenderableVertex.prototype.copy = function ( vertex ) {
this.positionWorld.copy( vertex.positionWorld ); this.positionWorld.copy( vertex.positionWorld );
this.positionScreen.copy( vertex.positionScreen ); this.positionScreen.copy( vertex.positionScreen );
}; };
Projector.RenderableLine = function () { export function RenderableLine () {
this.id = 0; this.id = 0;
this.v1 = new Projector.RenderableVertex(); this.v1 = new RenderableVertex();
this.v2 = new Projector.RenderableVertex(); this.v2 = new RenderableVertex();
this.vertexColors = [ new THREE.Color(), new THREE.Color() ]; this.vertexColors = [ new THREE.Color(), new THREE.Color() ];
this.material = null; this.material = null;
this.z = 0; this.z = 0;
}; };
Projector.RenderableLine.prototype.copy = function( line ){ RenderableLine.prototype.copy = function( line ){
this.v1.copy(line.v1); this.v1.copy(line.v1);
this.v2.copy(line.v2); this.v2.copy(line.v2);
this.vertexColors = line.vertexColors; this.vertexColors = line.vertexColors;
this.material = line.material; this.material = line.material;
}; };
Projector.RenderableSprite = function () { export function RenderableSprite () {
this.id = 0; this.id = 0;
...@@ -110,9 +109,9 @@ define(['three'], function(THREE, BSPTree){ ...@@ -110,9 +109,9 @@ define(['three'], function(THREE, BSPTree){
this.material = null; this.material = null;
}; };
Projector.Projector = function () { export function Projector () {
var _object, _objectCount, _objectPool = [], _objectPoolLength = 0, var _object, _objectCount, _objectPool = [], _objectPoolLength = 0,
_vertex, _camera, _vertexCount, _vertexPool = [], _vertexPoolLength = 0, _vertex, _camera, _vertexCount, _vertexPool = [], _vertexPoolLength = 0,
...@@ -788,7 +787,7 @@ define(['three'], function(THREE, BSPTree){ ...@@ -788,7 +787,7 @@ define(['three'], function(THREE, BSPTree){
if ( _objectCount === _objectPoolLength ) { if ( _objectCount === _objectPoolLength ) {
var object = new Projector.RenderableObject(); var object = new RenderableObject();
_objectPool.push( object ); _objectPool.push( object );
_objectPoolLength ++; _objectPoolLength ++;
_objectCount ++; _objectCount ++;
...@@ -804,7 +803,7 @@ define(['three'], function(THREE, BSPTree){ ...@@ -804,7 +803,7 @@ define(['three'], function(THREE, BSPTree){
if ( _vertexCount === _vertexPoolLength ) { if ( _vertexCount === _vertexPoolLength ) {
var vertex = new Projector.RenderableVertex(); var vertex = new RenderableVertex();
_vertexPool.push( vertex ); _vertexPool.push( vertex );
_vertexPoolLength ++; _vertexPoolLength ++;
_vertexCount ++; _vertexCount ++;
...@@ -820,7 +819,7 @@ define(['three'], function(THREE, BSPTree){ ...@@ -820,7 +819,7 @@ define(['three'], function(THREE, BSPTree){
if ( _faceCount === _facePoolLength ) { if ( _faceCount === _facePoolLength ) {
var face = new Projector.RenderableFace(); var face = new RenderableFace();
_facePool.push( face ); _facePool.push( face );
_facePoolLength ++; _facePoolLength ++;
_faceCount ++; _faceCount ++;
...@@ -837,7 +836,7 @@ define(['three'], function(THREE, BSPTree){ ...@@ -837,7 +836,7 @@ define(['three'], function(THREE, BSPTree){
if ( _lineCount === _linePoolLength ) { if ( _lineCount === _linePoolLength ) {
var line = new Projector.RenderableLine(); var line = new RenderableLine();
_linePool.push( line ); _linePool.push( line );
_linePoolLength ++; _linePoolLength ++;
_lineCount ++; _lineCount ++;
...@@ -853,7 +852,7 @@ define(['three'], function(THREE, BSPTree){ ...@@ -853,7 +852,7 @@ define(['three'], function(THREE, BSPTree){
if ( _spriteCount === _spritePoolLength ) { if ( _spriteCount === _spritePoolLength ) {
var sprite = new Projector.RenderableSprite(); var sprite = new RenderableSprite();
_spritePool.push( sprite ); _spritePool.push( sprite );
_spritePoolLength ++; _spritePoolLength ++;
_spriteCount ++; _spriteCount ++;
...@@ -1331,9 +1330,4 @@ define(['three'], function(THREE, BSPTree){ ...@@ -1331,9 +1330,4 @@ define(['three'], function(THREE, BSPTree){
} }
}; };
return Projector;
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment