diff options
author | hwc487 | 2012-04-19 13:01:43 -0700 |
---|---|---|
committer | hwc487 | 2012-04-19 13:01:43 -0700 |
commit | e6a20fe64574763483dc602bd759278ccf5e5e68 (patch) | |
tree | 69defe7200206f0257fe90697136fadef59d521e /js/models/properties-3d.js | |
parent | ae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff) | |
parent | 9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff) | |
download | ninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts:
js/lib/drawing/world.js
js/lib/geom/geom-obj.js
js/lib/rdge/materials/cloud-material.js
js/lib/rdge/materials/deform-material.js
js/lib/rdge/materials/flat-material.js
js/lib/rdge/materials/material.js
js/lib/rdge/materials/pulse-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
Diffstat (limited to 'js/models/properties-3d.js')
-rwxr-xr-x | js/models/properties-3d.js | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/js/models/properties-3d.js b/js/models/properties-3d.js index 0f82dc48..c1270c3b 100755 --- a/js/models/properties-3d.js +++ b/js/models/properties-3d.js | |||
@@ -5,7 +5,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var Montage = require("montage/core/core").Montage, | 7 | var Montage = require("montage/core/core").Montage, |
8 | Component = require("montage/ui/component").Component; | 8 | Component = require("montage/ui/component").Component, |
9 | NJUtils = require("js/lib/NJUtils").NJUtils; | ||
9 | 10 | ||
10 | exports.Properties3D = Montage.create(Component, { | 11 | exports.Properties3D = Montage.create(Component, { |
11 | 12 | ||
@@ -39,16 +40,7 @@ exports.Properties3D = Montage.create(Component, { | |||
39 | elementPlane : { value : null, enumerable: true}, | 40 | elementPlane : { value : null, enumerable: true}, |
40 | 41 | ||
41 | init : { | 42 | init : { |
42 | value : function(elt) { | 43 | value : function(elt, isStage) { |
43 | |||
44 | this.m_azimuth = 0.0; | ||
45 | this.m_altitude = 0.0; | ||
46 | |||
47 | this.m_endAzimuth = 0.0; | ||
48 | this.m_endAltitude = 0.0; | ||
49 | |||
50 | this.m_transformCtr = null; | ||
51 | this.perspectiveDist = 1400; | ||
52 | 44 | ||
53 | // this.m_upVector = [0,1,0]; | 45 | // this.m_upVector = [0,1,0]; |
54 | // this.m_viewDir = [0,0,1]; | 46 | // this.m_viewDir = [0,0,1]; |
@@ -57,23 +49,25 @@ exports.Properties3D = Montage.create(Component, { | |||
57 | // this.m_targetPos = [0,0,0]; | 49 | // this.m_targetPos = [0,0,0]; |
58 | // this.m_objStartPos = [0,0,0]; | 50 | // this.m_objStartPos = [0,0,0]; |
59 | 51 | ||
60 | // var mat = this.application.ninja.stage.stageDeps.viewUtils.getMatrixFromElement(elt).slice(0); | 52 | this.matrix3d = this.application.ninja.stylesController.getMatrixFromElement(elt, isStage); |
61 | // var elt3DInfo = MathUtils.decomposeMatrix2(mat); | 53 | this.perspectiveDist = this.application.ninja.stylesController.getPerspectiveDistFromElement(elt, isStage); |
62 | // if(elt3DInfo) | ||
63 | // { | ||
64 | // this.xAngle = ~~(elt3DInfo.rotation[0] * MathUtils.RAD_TO_DEG); | ||
65 | // this.yAngle = ~~(elt3DInfo.rotation[1] * MathUtils.RAD_TO_DEG); | ||
66 | // this.zAngle = ~~(elt3DInfo.rotation[2] * MathUtils.RAD_TO_DEG); | ||
67 | // | ||
68 | // this.x3D = ~~(elt3DInfo.translation[0]); | ||
69 | // this.y3D = ~~(elt3DInfo.translation[1]); | ||
70 | // this.z3D = ~~(elt3DInfo.translation[2]); | ||
71 | // | ||
72 | // this.matrix3d = mat; | ||
73 | // } | ||
74 | 54 | ||
75 | return this; | 55 | if(this.matrix3d) { |
56 | var elt3DInfo = MathUtils.decomposeMatrix2(this.matrix3d); | ||
57 | if(elt3DInfo) { | ||
58 | this.xAngle = ~~(elt3DInfo.rotation[0] * MathUtils.RAD_TO_DEG); | ||
59 | this.yAngle = ~~(elt3DInfo.rotation[1] * MathUtils.RAD_TO_DEG); | ||
60 | this.zAngle = ~~(elt3DInfo.rotation[2] * MathUtils.RAD_TO_DEG); | ||
76 | 61 | ||
62 | this.x3D = ~~(elt3DInfo.translation[0]); | ||
63 | this.y3D = ~~(elt3DInfo.translation[1]); | ||
64 | this.z3D = ~~(elt3DInfo.translation[2]); | ||
65 | } | ||
66 | } else { | ||
67 | this.matrix3d = Matrix.I(4); | ||
68 | } | ||
69 | |||
70 | return this; | ||
77 | } | 71 | } |
78 | }, | 72 | }, |
79 | 73 | ||
@@ -96,7 +90,7 @@ exports.Properties3D = Montage.create(Component, { | |||
96 | ResetTranslationValues : { | 90 | ResetTranslationValues : { |
97 | value : function() { | 91 | value : function() { |
98 | // this.m_objStartPos = [0,0,0]; | 92 | // this.m_objStartPos = [0,0,0]; |
99 | this.perspectiveDist = 1400; | 93 | // this.perspectiveDist = 1400; |
100 | } | 94 | } |
101 | } | 95 | } |
102 | }); \ No newline at end of file | 96 | }); \ No newline at end of file |