diff options
author | John Mayhew | 2012-04-02 16:28:39 -0700 |
---|---|---|
committer | John Mayhew | 2012-04-02 16:28:39 -0700 |
commit | b4155fb4c33675a8a7cd37473513718043fdf0ba (patch) | |
tree | 3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/helper-classes/RDGE/src/core/script/scenegraphNodes.js | |
parent | 5ba9aeac94c86049423fd5d4b37b277263939c13 (diff) | |
parent | c6de22bf42be90b403491b5f87b1818d9020310c (diff) | |
download | ninja-b4155fb4c33675a8a7cd37473513718043fdf0ba.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts:
js/helper-classes/RDGE/rdge-compiled.js
js/helper-classes/RDGE/runtime/GLRuntime.js
js/helper-classes/RDGE/src/core/script/MeshManager.js
js/helper-classes/RDGE/src/core/script/engine.js
js/helper-classes/RDGE/src/core/script/fx/ssao.js
js/helper-classes/RDGE/src/core/script/init_state.js
js/helper-classes/RDGE/src/core/script/run_state.js
js/helper-classes/RDGE/src/core/script/scenegraphNodes.js
js/helper-classes/RDGE/src/core/script/utilities.js
js/helper-classes/RDGE/src/tools/compile-rdge-core.bat
js/helper-classes/RDGE/src/tools/compile-rdge-core.sh
js/helper-classes/RDGE/src/tools/rdge-compiled.js
js/lib/drawing/world.js
js/lib/rdge/materials/bump-metal-material.js
js/lib/rdge/materials/deform-material.js
js/lib/rdge/materials/flat-material.js
js/lib/rdge/materials/fly-material.js
js/lib/rdge/materials/julia-material.js
js/lib/rdge/materials/keleidoscope-material.js
js/lib/rdge/materials/linear-gradient-material.js
js/lib/rdge/materials/mandel-material.js
js/lib/rdge/materials/plasma-material.js
js/lib/rdge/materials/pulse-material.js
js/lib/rdge/materials/radial-blur-material.js
js/lib/rdge/materials/radial-gradient-material.js
js/lib/rdge/materials/relief-tunnel-material.js
js/lib/rdge/materials/square-tunnel-material.js
js/lib/rdge/materials/star-material.js
js/lib/rdge/materials/taper-material.js
js/lib/rdge/materials/tunnel-material.js
js/lib/rdge/materials/twist-material.js
js/lib/rdge/materials/twist-vert-material.js
js/lib/rdge/materials/uber-material.js
js/lib/rdge/materials/water-material.js
js/lib/rdge/materials/z-invert-material.js
js/preloader/Preloader.js
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/scenegraphNodes.js')
-rwxr-xr-x | js/helper-classes/RDGE/src/core/script/scenegraphNodes.js | 543 |
1 files changed, 272 insertions, 271 deletions
diff --git a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js index 035e30d1..95ee2803 100755 --- a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js +++ b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js | |||
@@ -8,46 +8,46 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
8 | var RDGE = RDGE || {}; | 8 | var RDGE = RDGE || {}; |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Creates a unique node id | 11 | * Creates a unique node id |
12 | */ | 12 | */ |
13 | RDGE.nodeIdGen = {}; | 13 | RDGE.nodeIdGen = {}; |
14 | 14 | ||
15 | RDGE.nodeIdGen.counter = 0; | 15 | RDGE.nodeIdGen.counter = 0; |
16 | 16 | ||
17 | RDGE.nodeIdGen.getId = function () { | 17 | RDGE.nodeIdGen.getId = function () { |
18 | return "gen_" + RDGE.nodeIdGen.counter++; | 18 | return "gen_" + RDGE.nodeIdGen.counter++; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * Constructs a new transform node | 22 | * Constructs a new transform node |
23 | */ | 23 | */ |
24 | RDGE.createTransformNode = function (nodeName) { | 24 | RDGE.createTransformNode = function (nodeName) { |
25 | node = { 'name': nodeName }; | 25 | node = { 'name': nodeName }; |
26 | 26 | ||
27 | node.transformNodeTemplate = new RDGE.transformNodeTemplate(node); | 27 | node.transformNodeTemplate = new RDGE.transformNodeTemplate(node); |
28 | 28 | ||
29 | return node; | 29 | return node; |
30 | }; | 30 | }; |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * Constructs a new material node | 33 | * Constructs a new material node |
34 | */ | 34 | */ |
35 | RDGE.createMaterialNode = function (nodeName) { | 35 | RDGE.createMaterialNode = function (nodeName) { |
36 | node = { 'name': nodeName }; | 36 | node = { 'name': nodeName }; |
37 | 37 | ||
38 | node.materialNodeTemplate = new RDGE.materialNodeTemplate(node); | 38 | node.materialNodeTemplate = new RDGE.materialNodeTemplate(node); |
39 | 39 | ||
40 | return node; | 40 | return node; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * Constructs a new mesh node | 44 | * Constructs a new mesh node |
45 | */ | 45 | */ |
46 | RDGE.createMeshNode = function (nodeName, primitive) { | 46 | RDGE.createMeshNode = function (nodeName, primitive) { |
47 | meshNode = { 'mesh': {}, 'meshNodeTemplate': {} }; | 47 | meshNode = { 'mesh':{}, 'meshNodeTemplate':{} }; |
48 | 48 | ||
49 | var renderer = RDGE.globals.engine.getContext().renderer; | 49 | var renderer = RDGE.globals.engine.getContext().renderer; |
50 | 50 | ||
51 | if (!primitive.built) { | 51 | if (!primitive.built) { |
52 | renderer.createPrimitive(primitive); | 52 | renderer.createPrimitive(primitive); |
53 | } | 53 | } |
@@ -60,43 +60,43 @@ RDGE.createMeshNode = function (nodeName, primitive) { | |||
60 | return meshNode; // --early out-- | 60 | return meshNode; // --early out-- |
61 | } | 61 | } |
62 | else if (!renderer.buffers[model.primitive.buffersID]) { | 62 | else if (!renderer.buffers[model.primitive.buffersID]) { |
63 | renderer.createPrimitive(model.primitive); | 63 | renderer.createPrimitive(model.primitive); |
64 | } | 64 | } |
65 | 65 | ||
66 | meshNode.mesh.meshNodeTemplate = new RDGE.meshNodeTemplate(meshNode.mesh, model.primitive, nodeName); | 66 | meshNode.mesh.meshNodeTemplate = new RDGE.meshNodeTemplate(meshNode.mesh, model.primitive, nodeName); |
67 | 67 | ||
68 | return meshNode; | 68 | return meshNode; |
69 | }; | 69 | }; |
70 | 70 | ||
71 | /* | 71 | /* |
72 | * Construct a light node | 72 | * Construct a light node |
73 | */ | 73 | */ |
74 | RDGE.createLightNode = function (nodeName) { | 74 | RDGE.createLightNode = function (nodeName) { |
75 | node = { 'name': nodeName }; | 75 | node = { 'name': nodeName }; |
76 | node.lightNodeTemplate = new RDGE.lightNodeTemplate(node); | 76 | node.lightNodeTemplate = new RDGE.lightNodeTemplate(node); |
77 | 77 | ||
78 | return node; | 78 | return node; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | /* | 81 | /* |
82 | * creates a specialized mesh node representing a screen aligned quad with identity transform | 82 | * creates a specialized mesh node representing a screen aligned quad with identity transform |
83 | */ | 83 | */ |
84 | RDGE.createScreenQuadNode = function () { | 84 | RDGE.createScreenQuadNode = function () { |
85 | var trNode = RDGE.createTransformNode(); | 85 | var trNode = RDGE.createTransformNode(); |
86 | trNode.attachMeshNode("screenQuad", RDGE.renderUtils.createScreenAlignedQuad()); | 86 | trNode.attachMeshNode("screenQuad", RDGE.renderUtils.createScreenAlignedQuad()); |
87 | return trNode; | 87 | return trNode; |
88 | }; | 88 | }; |
89 | 89 | ||
90 | RDGE.verifyTransformNode = function (node) { | 90 | RDGE.verifyTransformNode = function (node) { |
91 | if (node.transformNodeTemplate == undefined) { | 91 | if (node.transformNodeTemplate == undefined) { |
92 | node.transformNodeTemplate = new RDGE.transformNodeTemplate(node); | 92 | node.transformNodeTemplate = new RDGE.transformNodeTemplate(node); |
93 | } | 93 | } |
94 | }; | 94 | }; |
95 | 95 | ||
96 | RDGE.verifyMaterialNode = function (node) { | 96 | RDGE.verifyMaterialNode = function (node) { |
97 | if (node.materialNodeTemplate == undefined) { | 97 | if (node.materialNodeTemplate == undefined) { |
98 | node.materialNodeTemplate = new RDGE.materialNodeTemplate(node); | 98 | node.materialNodeTemplate = new RDGE.materialNodeTemplate(node); |
99 | } | 99 | } |
100 | }; | 100 | }; |
101 | 101 | ||
102 | RDGE.verifyLightNode = function (node) { | 102 | RDGE.verifyLightNode = function (node) { |
@@ -107,299 +107,300 @@ RDGE.verifyLightNode = function (node) { | |||
107 | 107 | ||
108 | /* | 108 | /* |
109 | * Takes an object and attaches transform node | 109 | * Takes an object and attaches transform node |
110 | * functions and fields if they are not defined | 110 | * functions and fields if they are not defined |
111 | */ | 111 | */ |
112 | RDGE.transformNodeTemplate = function (trNode) { | 112 | RDGE.transformNodeTemplate = function (trNode) { |
113 | // Lots of checking for things that might exist and adding them when they don't | 113 | // Lots of checking for things that might exist and adding them when they don't |
114 | 114 | ||
115 | /* ------------------------------------------- */ | 115 | /* ------------------------------------------- */ |
116 | if (!trNode.children) { | 116 | if (!trNode.children) { |
117 | trNode.children = []; | 117 | trNode.children = []; |
118 | } | 118 | } |
119 | 119 | ||
120 | if (!trNode.local) { | 120 | if (!trNode.local) { |
121 | trNode.local = RDGE.mat4.identity(); | 121 | trNode.local = RDGE.mat4.identity(); |
122 | } | 122 | } |
123 | 123 | ||
124 | if (!trNode.world) { | 124 | if (!trNode.world) { |
125 | trNode.world = RDGE.mat4.identity(); | 125 | trNode.world = RDGE.mat4.identity(); |
126 | } | 126 | } |
127 | 127 | ||
128 | if (!trNode.id) { | 128 | if (!trNode.id) { |
129 | trNode.id = RDGE.nodeIdGen.getId(); | 129 | trNode.id = RDGE.nodeIdGen.getId(); |
130 | } | 130 | } |
131 | 131 | ||
132 | if (!trNode.name) { | 132 | if (!trNode.name) { |
133 | trNode.name = "xfrmNode" + trNode.id; | 133 | trNode.name = "xfrmNode" + trNode.id; |
134 | } | 134 | } |
135 | 135 | ||
136 | if (!trNode.parent) { | 136 | if (!trNode.parent) { |
137 | trNode.parent = null; | 137 | trNode.parent = null; |
138 | } | 138 | } |
139 | 139 | ||
140 | if (!trNode.meshes) { | 140 | if (!trNode.meshes) { |
141 | trNode.meshes = []; | 141 | trNode.meshes = []; |
142 | } | 142 | } |