Skip to content

Commit

Permalink
rename GLNode to Node
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag committed Jul 8, 2018
1 parent 9bace78 commit 232cb3f
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion examples/js/nodes/Nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// core

export { GLNode } from './core/GLNode.js';
export { Node } from './core/Node.js';
export { TempNode } from './core/TempNode.js';
export { InputNode } from './core/InputNode.js';
export { ConstNode } from './core/ConstNode.js';
Expand Down
4 changes: 2 additions & 2 deletions examples/js/nodes/THREE.Nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {

// core

GLNode,
Node,
TempNode,
InputNode,
ConstNode,
Expand Down Expand Up @@ -106,7 +106,7 @@ import {

// core

THREE.GLNode = GLNode;
THREE.Node = Node;
THREE.TempNode = TempNode;
THREE.InputNode = InputNode;
THREE.ConstNode = ConstNode;
Expand Down
8 changes: 4 additions & 4 deletions examples/js/nodes/core/AttributeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* @author sunag / http://www.sunag.com.br/
*/

import { GLNode } from './GLNode.js';
import { Node } from './Node.js';

function AttributeNode( name, type ) {

GLNode.call( this, type );
Node.call( this, type );

this.name = name;

};

AttributeNode.prototype = Object.create( GLNode.prototype );
AttributeNode.prototype = Object.create( Node.prototype );
AttributeNode.prototype.constructor = AttributeNode;
AttributeNode.prototype.nodeType = "Attribute";

Expand Down Expand Up @@ -45,7 +45,7 @@ AttributeNode.prototype.generate = function ( builder, output ) {

AttributeNode.prototype.copy = function ( source ) {

GLNode.prototype.copy.call( this, source );
Node.prototype.copy.call( this, source );

this.type = source.type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @author sunag / http://www.sunag.com.br/
*/

function GLNode( type ) {
function Node( type ) {

this.uuid = THREE.Math.generateUUID();

Expand All @@ -14,9 +14,9 @@ function GLNode( type ) {

};

GLNode.prototype = {
Node.prototype = {

constructor: GLNode,
constructor: Node,

isNode: true,

Expand Down Expand Up @@ -173,4 +173,4 @@ GLNode.prototype = {

};

export { GLNode };
export { Node };
14 changes: 7 additions & 7 deletions examples/js/nodes/core/TempNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* @author sunag / http://www.sunag.com.br/
*/

import { GLNode } from './GLNode.js';
import { Node } from './Node.js';

function TempNode( type, params ) {

GLNode.call( this, type );
Node.call( this, type );

params = params || {};

Expand All @@ -16,7 +16,7 @@ function TempNode( type, params ) {

};

TempNode.prototype = Object.create( GLNode.prototype );
TempNode.prototype = Object.create( Node.prototype );
TempNode.prototype.constructor = TempNode;

TempNode.prototype.build = function ( builder, output, uuid, ns ) {
Expand Down Expand Up @@ -47,17 +47,17 @@ TempNode.prototype.build = function ( builder, output, uuid, ns ) {

}

return GLNode.prototype.build.call( this, builder, output, uuid );
return Node.prototype.build.call( this, builder, output, uuid );

} else if ( isUnique ) {

data.name = data.name || GLNode.prototype.build.call( this, builder, output, uuid );
data.name = data.name || Node.prototype.build.call( this, builder, output, uuid );

return data.name;

} else if ( ! builder.optimize || data.deps == 1 ) {

return GLNode.prototype.build.call( this, builder, output, uuid );
return Node.prototype.build.call( this, builder, output, uuid );

}

Expand All @@ -84,7 +84,7 @@ TempNode.prototype.build = function ( builder, output, uuid, ns ) {

}

return GLNode.prototype.build.call( this, builder, output, uuid );
return Node.prototype.build.call( this, builder, output, uuid );

};

Expand Down
8 changes: 4 additions & 4 deletions examples/js/nodes/core/VarNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* @author sunag / http://www.sunag.com.br/
*/

import { GLNode } from './GLNode.js';
import { Node } from './Node.js';

function VarNode( type, value ) {

GLNode.call( this, type );
Node.call( this, type );

this.value = value;

};

VarNode.prototype = Object.create( GLNode.prototype );
VarNode.prototype = Object.create( Node.prototype );
VarNode.prototype.constructor = VarNode;
VarNode.prototype.nodeType = "Var";

Expand All @@ -38,7 +38,7 @@ VarNode.prototype.generate = function ( builder, output ) {

VarNode.prototype.copy = function ( source ) {

GLNode.prototype.copy.call( this, source );
Node.prototype.copy.call( this, source );

this.type = source.type;
this.value = source.value;
Expand Down
8 changes: 4 additions & 4 deletions examples/js/nodes/materials/nodes/PhongNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
* @author sunag / http://www.sunag.com.br/
*/

import { GLNode } from '../../core/GLNode.js';
import { Node } from '../../core/Node.js';
import { ColorNode } from '../../inputs/ColorNode.js';
import { FloatNode } from '../../inputs/FloatNode.js';

function PhongNode() {

GLNode.call( this );
Node.call( this );

this.color = new ColorNode( 0xEEEEEE );
this.specular = new ColorNode( 0x111111 );
this.shininess = new FloatNode( 30 );

};

PhongNode.prototype = Object.create( GLNode.prototype );
PhongNode.prototype = Object.create( Node.prototype );
PhongNode.prototype.constructor = PhongNode;
PhongNode.prototype.nodeType = "Phong";

Expand Down Expand Up @@ -321,7 +321,7 @@ PhongNode.prototype.build = function ( builder ) {

PhongNode.prototype.copy = function ( source ) {

GLNode.prototype.copy.call( this, source );
Node.prototype.copy.call( this, source );

// vertex

Expand Down
8 changes: 4 additions & 4 deletions examples/js/nodes/materials/nodes/RawNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* @author sunag / http://www.sunag.com.br/
*/

import { GLNode } from '../../core/GLNode.js';
import { Node } from '../../core/Node.js';

function RawNode( value ) {

GLNode.call( this, 'v4' );
Node.call( this, 'v4' );

this.value = value;

};

RawNode.prototype = Object.create( GLNode.prototype );
RawNode.prototype = Object.create( Node.prototype );
RawNode.prototype.constructor = RawNode;
RawNode.prototype.nodeType = "Raw";

Expand All @@ -37,7 +37,7 @@ RawNode.prototype.generate = function ( builder ) {

RawNode.prototype.copy = function ( source ) {

GLNode.prototype.copy.call( this, source );
Node.prototype.copy.call( this, source );

this.value = source.value;

Expand Down
8 changes: 4 additions & 4 deletions examples/js/nodes/materials/nodes/SpriteNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
* @author sunag / http://www.sunag.com.br/
*/

import { GLNode } from '../../core/GLNode.js';
import { Node } from '../../core/Node.js';
import { ColorNode } from '../../inputs/ColorNode.js';

function SpriteNode() {

GLNode.call( this );
Node.call( this );

this.color = new ColorNode( 0xEEEEEE );
this.spherical = true;

};

SpriteNode.prototype = Object.create( GLNode.prototype );
SpriteNode.prototype = Object.create( Node.prototype );
SpriteNode.prototype.constructor = SpriteNode;
SpriteNode.prototype.nodeType = "Sprite";

Expand Down Expand Up @@ -144,7 +144,7 @@ SpriteNode.prototype.build = function ( builder ) {

SpriteNode.prototype.copy = function ( source ) {

GLNode.prototype.copy.call( this, source );
Node.prototype.copy.call( this, source );

// vertex

Expand Down
8 changes: 4 additions & 4 deletions examples/js/nodes/materials/nodes/StandardNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
* @author sunag / http://www.sunag.com.br/
*/

import { GLNode } from '../../core/GLNode.js';
import { Node } from '../../core/Node.js';
import { ColorNode } from '../../inputs/ColorNode.js';
import { FloatNode } from '../../inputs/FloatNode.js';
import { RoughnessToBlinnExponentNode } from '../../bsdfs/RoughnessToBlinnExponentNode.js';

function StandardNode() {

GLNode.call( this );
Node.call( this );

this.color = new ColorNode( 0xEEEEEE );
this.roughness = new FloatNode( 0.5 );
this.metalness = new FloatNode( 0.5 );

};

StandardNode.prototype = Object.create( GLNode.prototype );
StandardNode.prototype = Object.create( Node.prototype );
StandardNode.prototype.constructor = StandardNode;
StandardNode.prototype.nodeType = "Standard";

Expand Down Expand Up @@ -392,7 +392,7 @@ StandardNode.prototype.build = function ( builder ) {

StandardNode.prototype.copy = function ( source ) {

GLNode.prototype.copy.call( this, source );
Node.prototype.copy.call( this, source );

// vertex

Expand Down
8 changes: 4 additions & 4 deletions examples/js/nodes/utils/BypassNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
* @author sunag / http://www.sunag.com.br/
*/

import { GLNode } from '../core/GLNode.js';
import { Node } from '../core/Node.js';

function BypassNode( code, value ) {

GLNode.call( this );
Node.call( this );

this.code = code;
this.value = value;

};

BypassNode.prototype = Object.create( GLNode.prototype );
BypassNode.prototype = Object.create( Node.prototype );
BypassNode.prototype.constructor = BypassNode;
BypassNode.prototype.nodeType = "Bypass";

Expand Down Expand Up @@ -57,7 +57,7 @@ BypassNode.prototype.generate = function ( builder, output ) {

BypassNode.prototype.copy = function ( source ) {

GLNode.prototype.copy.call( this, source );
Node.prototype.copy.call( this, source );

this.code = source.code;
this.value = source.value;
Expand Down
8 changes: 4 additions & 4 deletions examples/js/nodes/utils/SwitchNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
* @author sunag / http://www.sunag.com.br/
*/

import { GLNode } from '../core/GLNode.js';
import { Node } from '../core/Node.js';

function SwitchNode( node, components ) {

GLNode.call( this );
Node.call( this );

this.node = node;
this.components = components || 'x';

};

SwitchNode.prototype = Object.create( GLNode.prototype );
SwitchNode.prototype = Object.create( Node.prototype );
SwitchNode.prototype.constructor = SwitchNode;
SwitchNode.prototype.nodeType = "Switch";

Expand Down Expand Up @@ -75,7 +75,7 @@ SwitchNode.prototype.generate = function ( builder, output ) {

SwitchNode.prototype.copy = function ( source ) {

GLNode.prototype.copy.call( this, source );
Node.prototype.copy.call( this, source );

this.node = source.node;
this.components = source.components;
Expand Down

0 comments on commit 232cb3f

Please sign in to comment.