Commit 45d1a027 authored by Evgeny's avatar Evgeny

Update three dep. Update to E6^

parent a8c7af38
......@@ -4,21 +4,20 @@
* @author julianwa / https://github.com/julianwa
*/
define(['three'], function(THREE, BSPTree){
var Projector = {};
import THREE from 'three.js';
var i, l, o; // counters
var i, l, o; // counters
Projector.RenderableObject = function () {
export class RenderableObject{
this.id = 0;
this.object = null;
this.z = 0;
};
};
Projector.RenderableFace = function () {
export function RenderableFace () {
this.id = 0;
......@@ -38,9 +37,9 @@ define(['three'], function(THREE, BSPTree){
this.z = 0;
};
};
Projector.RenderableFace.prototype.copy = function ( face ){
RenderableFace.prototype.copy = function ( face ){
this.v1.copy(face.v1);
this.v2.copy(face.v2);
this.v3.copy(face.v3);
......@@ -54,9 +53,9 @@ define(['three'], function(THREE, BSPTree){
this.material = face.material;
this.uvs = face.uvs;
this.priority = face.priority;
};
};
Projector.RenderableVertex = function () {
export function RenderableVertex () {
this.position = new THREE.Vector3();
this.positionWorld = new THREE.Vector3();
......@@ -64,38 +63,38 @@ define(['three'], function(THREE, BSPTree){
this.visible = true;
};
};
Projector.RenderableVertex.prototype.copy = function ( vertex ) {
RenderableVertex.prototype.copy = function ( vertex ) {
this.positionWorld.copy( vertex.positionWorld );
this.positionScreen.copy( vertex.positionScreen );
};
};
Projector.RenderableLine = function () {
export function RenderableLine () {
this.id = 0;
this.v1 = new Projector.RenderableVertex();
this.v2 = new Projector.RenderableVertex();
this.v1 = new RenderableVertex();
this.v2 = new RenderableVertex();
this.vertexColors = [ new THREE.Color(), new THREE.Color() ];
this.material = null;
this.z = 0;
};
};
Projector.RenderableLine.prototype.copy = function( line ){
RenderableLine.prototype.copy = function( line ){
this.v1.copy(line.v1);
this.v2.copy(line.v2);
this.vertexColors = line.vertexColors;
this.material = line.material;
};
};
Projector.RenderableSprite = function () {
export function RenderableSprite () {
this.id = 0;
......@@ -110,9 +109,9 @@ define(['three'], function(THREE, BSPTree){
this.material = null;
};
};
Projector.Projector = function () {
export function Projector () {
var _object, _objectCount, _objectPool = [], _objectPoolLength = 0,
_vertex, _camera, _vertexCount, _vertexPool = [], _vertexPoolLength = 0,
......@@ -788,7 +787,7 @@ define(['three'], function(THREE, BSPTree){
if ( _objectCount === _objectPoolLength ) {
var object = new Projector.RenderableObject();
var object = new RenderableObject();
_objectPool.push( object );
_objectPoolLength ++;
_objectCount ++;
......@@ -804,7 +803,7 @@ define(['three'], function(THREE, BSPTree){
if ( _vertexCount === _vertexPoolLength ) {
var vertex = new Projector.RenderableVertex();
var vertex = new RenderableVertex();
_vertexPool.push( vertex );
_vertexPoolLength ++;
_vertexCount ++;
......@@ -820,7 +819,7 @@ define(['three'], function(THREE, BSPTree){
if ( _faceCount === _facePoolLength ) {
var face = new Projector.RenderableFace();
var face = new RenderableFace();
_facePool.push( face );
_facePoolLength ++;
_faceCount ++;
......@@ -837,7 +836,7 @@ define(['three'], function(THREE, BSPTree){
if ( _lineCount === _linePoolLength ) {
var line = new Projector.RenderableLine();
var line = new RenderableLine();
_linePool.push( line );
_linePoolLength ++;
_lineCount ++;
......@@ -853,7 +852,7 @@ define(['three'], function(THREE, BSPTree){
if ( _spriteCount === _spritePoolLength ) {
var sprite = new Projector.RenderableSprite();
var sprite = new RenderableSprite();
_spritePool.push( sprite );
_spritePoolLength ++;
_spriteCount ++;
......@@ -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