aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorPushkar Joshi2012-02-02 11:28:45 -0800
committerPushkar Joshi2012-02-02 11:28:45 -0800
commitacc500d1f1c76f4e7c93ae1cfea8d925ca95e7b9 (patch)
tree877f8ca734228c11050b037ce82fc0d1e1303193 /js/panels
parent4d4de64472603426a73b26cc98ba8206190949b8 (diff)
parent4222db97e353fb65fab787ba5927d16d9fa4e1f7 (diff)
downloadninja-acc500d1f1c76f4e7c93ae1cfea8d925ca95e7b9.tar.gz
Merge branch 'working' of c:/Code/github/emueller/ninja-internal/ into pentool
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Materials/Materials.xml10
-rw-r--r--js/panels/properties/sections/three-d-view.reel/three-d-view.html12
-rw-r--r--js/panels/properties/sections/three-d-view.reel/three-d-view.js86
3 files changed, 80 insertions, 28 deletions
diff --git a/js/panels/Materials/Materials.xml b/js/panels/Materials/Materials.xml
index de07990e..cdeee69e 100644
--- a/js/panels/Materials/Materials.xml
+++ b/js/panels/Materials/Materials.xml
@@ -2,7 +2,17 @@
2<tree id="Materials"> 2<tree id="Materials">
3 <folder id="ninjaMaterials" label="Ninja Materials"> 3 <folder id="ninjaMaterials" label="Ninja Materials">
4 <leaf id="UberMaterial" label="Uber" /> 4 <leaf id="UberMaterial" label="Uber" />
5 <leaf id="RadialBlurMaterial" label="Radial Blur" />
6 <leaf id="PulseMaterial" label="Pulse" />
7 <leaf id="TunnelMaterial" label="Tunnel" />
8 <leaf id="TwistMaterial" label="Twist" />
9 <leaf id="KeleidoscopeMaterial" label="Keleidoscope" />
10 <leaf id="JuliaMaterial" label="Julia" />
11 <leaf id="MandelMaterial" label="Mandel" />
12 <leaf id="PlasmaMaterial" label="Plasma" />
5 <leaf id="BumpMetalMaterial" label="Bump Metal" /> 13 <leaf id="BumpMetalMaterial" label="Bump Metal" />
14 <leaf id="LinearGradientMaterial" label="Linear Gradient" />
15 <leaf id="RadialGradientMaterial" label="Radial Gradient" />
6 </folder> 16 </folder>
7 <folder id="customMaterials" label="Custom Materials"> 17 <folder id="customMaterials" label="Custom Materials">
8 <leaf id="CheckerBoard" label="CheckerBoard" /> 18 <leaf id="CheckerBoard" label="CheckerBoard" />
diff --git a/js/panels/properties/sections/three-d-view.reel/three-d-view.html b/js/panels/properties/sections/three-d-view.reel/three-d-view.html
index 1e24cb55..11a5b3f2 100644
--- a/js/panels/properties/sections/three-d-view.reel/three-d-view.html
+++ b/js/panels/properties/sections/three-d-view.reel/three-d-view.html
@@ -39,7 +39,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
39 "value": { 39 "value": {
40 "boundObject": {"@": "owner"}, 40 "boundObject": {"@": "owner"},
41 "boundObjectPropertyPath": "x3D", 41 "boundObjectPropertyPath": "x3D",
42 "oneway": false 42 "oneway": true
43 } 43 }
44 }, 44 },
45 "listeners": [ 45 "listeners": [
@@ -68,7 +68,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
68 "value": { 68 "value": {
69 "boundObject": {"@": "owner"}, 69 "boundObject": {"@": "owner"},
70 "boundObjectPropertyPath": "y3D", 70 "boundObjectPropertyPath": "y3D",
71 "oneway": false 71 "oneway": true
72 } 72 }
73 }, 73 },
74 "listeners": [ 74 "listeners": [
@@ -97,7 +97,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
97 "value": { 97 "value": {
98 "boundObject": {"@": "owner"}, 98 "boundObject": {"@": "owner"},
99 "boundObjectPropertyPath": "z3D", 99 "boundObjectPropertyPath": "z3D",
100 "oneway": false 100 "oneway": true
101 } 101 }
102 }, 102 },
103 "listeners": [ 103 "listeners": [
@@ -128,7 +128,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
128 "value": { 128 "value": {
129 "boundObject": {"@": "owner"}, 129 "boundObject": {"@": "owner"},
130 "boundObjectPropertyPath": "xAngle", 130 "boundObjectPropertyPath": "xAngle",
131 "oneway": false 131 "oneway": true
132 } 132 }
133 }, 133 },
134 "listeners": [ 134 "listeners": [
@@ -159,7 +159,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
159 "value": { 159 "value": {
160 "boundObject": {"@": "owner"}, 160 "boundObject": {"@": "owner"},
161 "boundObjectPropertyPath": "yAngle", 161 "boundObjectPropertyPath": "yAngle",
162 "oneway": false 162 "oneway": true
163 } 163 }
164 }, 164 },
165 "listeners": [ 165 "listeners": [
@@ -190,7 +190,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
190 "value": { 190 "value": {
191 "boundObject": {"@": "owner"}, 191 "boundObject": {"@": "owner"},
192 "boundObjectPropertyPath": "zAngle", 192 "boundObjectPropertyPath": "zAngle",
193 "oneway": false 193 "oneway": true
194 } 194 }
195 }, 195 },
196 "listeners": [ 196 "listeners": [
diff --git a/js/panels/properties/sections/three-d-view.reel/three-d-view.js b/js/panels/properties/sections/three-d-view.reel/three-d-view.js
index 38dbb110..96053490 100644
--- a/js/panels/properties/sections/three-d-view.reel/three-d-view.js
+++ b/js/panels/properties/sections/three-d-view.reel/three-d-view.js
@@ -40,19 +40,16 @@ exports.ThreeD = Montage.create(Component, {
40 else 40 else
41 { 41 {
42 this.inGlobalMode = true; 42 this.inGlobalMode = true;
43 if(this.application.ninja.selectedElements.length) 43 var item = this.item;
44 if(item)
44 { 45 {
45 var item = this.application.ninja.selectedElements[0]._element; 46 this.x3D = item.elementModel.props3D.x3D;
46 if(item) 47 this.y3D = item.elementModel.props3D.y3D;
47 { 48 this.z3D = item.elementModel.props3D.z3D;
48 this.x3D = item.elementModel.props3D.x3D; 49
49 this.y3D = item.elementModel.props3D.y3D; 50 this.xAngle = item.elementModel.props3D.xAngle;
50 this.z3D = item.elementModel.props3D.z3D; 51 this.yAngle = item.elementModel.props3D.yAngle;
51 52 this.zAngle = item.elementModel.props3D.zAngle;
52 this.xAngle = item.elementModel.props3D.xAngle;
53 this.yAngle = item.elementModel.props3D.yAngle;
54 this.zAngle = item.elementModel.props3D.zAngle;
55 }
56 } 53 }
57 } 54 }
58 } 55 }
@@ -98,6 +95,18 @@ exports.ThreeD = Montage.create(Component, {
98 } 95 }
99 }, 96 },
100 97
98 item: {
99 value: null
100 },
101
102 _curMat: {
103 value: null
104 },
105
106 _curProp: {
107 value: null
108 },
109
101 handleChange: { 110 handleChange: {
102 value: function(event) { 111 value: function(event) {
103 if(event.wasSetByCode) { 112 if(event.wasSetByCode) {
@@ -106,9 +115,12 @@ exports.ThreeD = Montage.create(Component, {
106 115
107 this.apply3DProperties(event.currentTarget.identifier, 116 this.apply3DProperties(event.currentTarget.identifier,
108 event.currentTarget, 117 event.currentTarget,
109 this.application.ninja.selectedElements[0]._element, 118 this.item,
110 this.inGlobalMode, 119 this.inGlobalMode,
111 false); 120 false);
121
122 this._curMat = null;
123 this._curProp = null;
112 } 124 }
113 }, 125 },
114 126
@@ -120,7 +132,7 @@ exports.ThreeD = Montage.create(Component, {
120 132
121 this.apply3DProperties(event.currentTarget.identifier, 133 this.apply3DProperties(event.currentTarget.identifier,
122 event.currentTarget, 134 event.currentTarget,
123 this.application.ninja.selectedElements[0]._element, 135 this.item,
124 this.inGlobalMode, 136 this.inGlobalMode,
125 true); 137 true);
126 } 138 }
@@ -128,9 +140,20 @@ exports.ThreeD = Montage.create(Component, {
128 140
129 apply3DProperties : { 141 apply3DProperties : {
130 value : function(prop, value, item, inGlobalMode, isChanging){ 142 value : function(prop, value, item, inGlobalMode, isChanging){
131 // TODO - May want to use mediator instead 143 if(!this._curMat)
132 var curMat = item.elementModel.props3D.matrix3d; 144 {
133 var delta = value.value - item.elementModel.props3D[prop]; 145 this._curMat = this.application.ninja.elementMediator.getMatrix(item);
146 }
147 var curMat = this._curMat;
148 var delta = value.value;
149 if(inGlobalMode)
150 {
151 if(!this._curProp)
152 {
153 this._curProp = this.application.ninja.elementMediator.get3DProperty(item, prop);
154 }
155 delta -= this._curProp;
156 }
134 157
135 var xFormMat = Matrix.I(4); 158 var xFormMat = Matrix.I(4);
136 switch (prop) 159 switch (prop)