瀏覽代碼

cleanup static and dynamic variables order

SUNAG 9 年之前
父節點
當前提交
43d2f36b64

+ 3 - 3
examples/js/nodes/ConstNode.js

@@ -10,9 +10,6 @@ THREE.ConstNode = function( name, useDefine ) {
 
 };
 
-THREE.ConstNode.prototype = Object.create( THREE.TempNode.prototype );
-THREE.ConstNode.prototype.constructor = THREE.ConstNode;
-
 THREE.ConstNode.PI = 'PI';
 THREE.ConstNode.PI2 = 'PI2';
 THREE.ConstNode.RECIPROCAL_PI = 'RECIPROCAL_PI';
@@ -20,6 +17,9 @@ THREE.ConstNode.RECIPROCAL_PI2 = 'RECIPROCAL_PI2';
 THREE.ConstNode.LOG2 = 'LOG2';
 THREE.ConstNode.EPSILON = 'EPSILON';
 
+THREE.ConstNode.prototype = Object.create( THREE.TempNode.prototype );
+THREE.ConstNode.prototype.constructor = THREE.ConstNode;
+
 THREE.ConstNode.prototype.parse = function( src, useDefine ) {
 
 	var name, type;

+ 3 - 3
examples/js/nodes/accessors/CameraNode.js

@@ -11,12 +11,12 @@ THREE.CameraNode = function( scope, camera ) {
 
 };
 
-THREE.CameraNode.prototype = Object.create( THREE.TempNode.prototype );
-THREE.CameraNode.prototype.constructor = THREE.CameraNode;
-
 THREE.CameraNode.POSITION = 'position';
 THREE.CameraNode.DEPTH = 'depth';
 
+THREE.CameraNode.prototype = Object.create( THREE.TempNode.prototype );
+THREE.CameraNode.prototype.constructor = THREE.CameraNode;
+
 THREE.CameraNode.prototype.setCamera = function( camera ) {
 
 	this.camera = camera;

+ 3 - 3
examples/js/nodes/accessors/ColorsNode.js

@@ -10,12 +10,12 @@ THREE.ColorsNode = function( index ) {
 
 };
 
-THREE.ColorsNode.prototype = Object.create( THREE.TempNode.prototype );
-THREE.ColorsNode.prototype.constructor = THREE.ColorsNode;
-
 THREE.ColorsNode.vertexDict = [ 'color', 'color2' ];
 THREE.ColorsNode.fragmentDict = [ 'vColor', 'vColor2' ];
 
+THREE.ColorsNode.prototype = Object.create( THREE.TempNode.prototype );
+THREE.ColorsNode.prototype.constructor = THREE.ColorsNode;
+
 THREE.ColorsNode.prototype.generate = function( builder, output ) {
 
 	var material = builder.material;

+ 3 - 3
examples/js/nodes/accessors/NormalNode.js

@@ -10,13 +10,13 @@ THREE.NormalNode = function( scope ) {
 
 };
 
-THREE.NormalNode.prototype = Object.create( THREE.TempNode.prototype );
-THREE.NormalNode.prototype.constructor = THREE.NormalNode;
-
 THREE.NormalNode.LOCAL = 'local';
 THREE.NormalNode.WORLD = 'world';
 THREE.NormalNode.VIEW = 'view';
 
+THREE.NormalNode.prototype = Object.create( THREE.TempNode.prototype );
+THREE.NormalNode.prototype.constructor = THREE.NormalNode;
+
 THREE.NormalNode.prototype.isShared = function( builder ) {
 
 	switch ( this.scope ) {

+ 3 - 3
examples/js/nodes/accessors/PositionNode.js

@@ -10,14 +10,14 @@ THREE.PositionNode = function( scope ) {
 
 };
 
-THREE.PositionNode.prototype = Object.create( THREE.TempNode.prototype );
-THREE.PositionNode.prototype.constructor = THREE.PositionNode;
-
 THREE.PositionNode.LOCAL = 'local';
 THREE.PositionNode.WORLD = 'world';
 THREE.PositionNode.VIEW = 'view';
 THREE.PositionNode.PROJECTION = 'projection';
 
+THREE.PositionNode.prototype = Object.create( THREE.TempNode.prototype );
+THREE.PositionNode.prototype.constructor = THREE.PositionNode;
+
 THREE.PositionNode.prototype.getType = function( builder ) {
 
 	switch ( this.scope ) {

+ 3 - 3
examples/js/nodes/accessors/UVNode.js

@@ -10,12 +10,12 @@ THREE.UVNode = function( index ) {
 
 };
 
-THREE.UVNode.prototype = Object.create( THREE.TempNode.prototype );
-THREE.UVNode.prototype.constructor = THREE.UVNode;
-
 THREE.UVNode.vertexDict = [ 'uv', 'uv2' ];
 THREE.UVNode.fragmentDict = [ 'vUv', 'vUv2' ];
 
+THREE.UVNode.prototype = Object.create( THREE.TempNode.prototype );
+THREE.UVNode.prototype.constructor = THREE.UVNode;
+
 THREE.UVNode.prototype.generate = function( builder, output ) {
 
 	var material = builder.material;

+ 3 - 3
examples/js/nodes/math/Math1Node.js

@@ -12,9 +12,6 @@ THREE.Math1Node = function( a, method ) {
 
 };
 
-THREE.Math1Node.prototype = Object.create( THREE.TempNode.prototype );
-THREE.Math1Node.prototype.constructor = THREE.Math1Node;
-
 THREE.Math1Node.RAD = 'radians';
 THREE.Math1Node.DEG = 'degrees';
 THREE.Math1Node.EXP = 'exp';
@@ -39,6 +36,9 @@ THREE.Math1Node.LENGTH = 'length';
 THREE.Math1Node.NEGATE = 'negate';
 THREE.Math1Node.INVERT = 'invert';
 
+THREE.Math1Node.prototype = Object.create( THREE.TempNode.prototype );
+THREE.Math1Node.prototype.constructor = THREE.Math1Node;
+
 THREE.Math1Node.prototype.getType = function( builder ) {
 
 	switch ( this.method ) {

+ 3 - 3
examples/js/nodes/math/Math2Node.js

@@ -13,9 +13,6 @@ THREE.Math2Node = function( a, b, method ) {
 
 };
 
-THREE.Math2Node.prototype = Object.create( THREE.TempNode.prototype );
-THREE.Math2Node.prototype.constructor = THREE.Math2Node;
-
 THREE.Math2Node.MIN = 'min';
 THREE.Math2Node.MAX = 'max';
 THREE.Math2Node.MOD = 'mod';
@@ -26,6 +23,9 @@ THREE.Math2Node.DOT = 'dot';
 THREE.Math2Node.CROSS = 'cross';
 THREE.Math2Node.POW = 'pow';
 
+THREE.Math2Node.prototype = Object.create( THREE.TempNode.prototype );
+THREE.Math2Node.prototype.constructor = THREE.Math2Node;
+
 THREE.Math2Node.prototype.getInputType = function( builder ) {
 
 	// use the greater length vector

+ 3 - 3
examples/js/nodes/math/Math3Node.js

@@ -14,14 +14,14 @@ THREE.Math3Node = function( a, b, c, method ) {
 
 };
 
-THREE.Math3Node.prototype = Object.create( THREE.TempNode.prototype );
-THREE.Math3Node.prototype.constructor = THREE.Math3Node;
-
 THREE.Math3Node.MIX = 'mix';
 THREE.Math3Node.REFRACT = 'refract';
 THREE.Math3Node.SMOOTHSTEP = 'smoothstep';
 THREE.Math3Node.FACEFORWARD = 'faceforward';
 
+THREE.Math3Node.prototype = Object.create( THREE.TempNode.prototype );
+THREE.Math3Node.prototype.constructor = THREE.Math3Node;
+
 THREE.Math3Node.prototype.getType = function( builder ) {
 
 	var a = builder.getFormatLength( this.a.getType( builder ) );

+ 4 - 5
examples/js/nodes/math/OperatorNode.js

@@ -6,21 +6,20 @@ THREE.OperatorNode = function( a, b, op ) {
 
 	THREE.TempNode.call( this );
 
-	this.op = op || THREE.OperatorNode.ADD;
-
 	this.a = a;
 	this.b = b;
+	this.op = op || THREE.OperatorNode.ADD;
 
 };
 
-THREE.OperatorNode.prototype = Object.create( THREE.TempNode.prototype );
-THREE.OperatorNode.prototype.constructor = THREE.OperatorNode;
-
 THREE.OperatorNode.ADD = '+';
 THREE.OperatorNode.SUB = '-';
 THREE.OperatorNode.MUL = '*';
 THREE.OperatorNode.DIV = '/';
 
+THREE.OperatorNode.prototype = Object.create( THREE.TempNode.prototype );
+THREE.OperatorNode.prototype.constructor = THREE.OperatorNode;
+
 THREE.OperatorNode.prototype.getType = function( builder ) {
 
 	// use the greater length vector