diff options
author | Ananya Sen | 2012-04-17 18:11:55 -0700 |
---|---|---|
committer | Ananya Sen | 2012-04-17 18:11:55 -0700 |
commit | 35abad196cc9feb76ef50c1b63032a38233a6d51 (patch) | |
tree | 914689c66d4ab6c6e088b571eade0a0e35082916 /js/models/properties-3d.js | |
parent | 1f891c58bad0b7746659aa4138001b5ee76d9a0e (diff) | |
parent | 616a8532099fec2a15855eac97cd85cb60c4451c (diff) | |
download | ninja-35abad196cc9feb76ef50c1b63032a38233a6d51.tar.gz |
Merge branch 'refs/heads/ninja-internal-master' into Codeview-improvements
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 |