diff options
author | Pierre Frisch | 2011-12-22 07:25:50 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-01-27 11:18:17 -0800 |
commit | b89a7ee8b956c96a1dcee995ea840feddc5d4b27 (patch) | |
tree | 0f3136ab0ecdbbbed6a83576581af0a53124d6f1 /js/models/properties-3d.js | |
parent | 2401f05d1f4b94d45e4568b81fc73e67b969d980 (diff) | |
download | ninja-b89a7ee8b956c96a1dcee995ea840feddc5d4b27.tar.gz |
First commit of Ninja to ninja-internal
Signed-off-by: Valerio Virgillito <rmwh84@motorola.com>
Diffstat (limited to 'js/models/properties-3d.js')
-rw-r--r-- | js/models/properties-3d.js | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/js/models/properties-3d.js b/js/models/properties-3d.js new file mode 100644 index 00000000..6d65bc91 --- /dev/null +++ b/js/models/properties-3d.js | |||
@@ -0,0 +1,100 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage/core/core").Montage, | ||
8 | Component = require("montage/ui/component").Component; | ||
9 | |||
10 | exports.Properties3D = Montage.create(Component, { | ||
11 | |||
12 | // m_upVector : {value : Vector.create( [0,1,0] ), enumerable: true}, | ||
13 | // m_targetPos : {value : Vector.create( [0,0,0] ), enumerable: true}, | ||
14 | // m_objStartPos : {value : Vector.create( [0,0,0] ), enumerable: true}, | ||
15 | |||
16 | m_azimuth : {value : 0.0, enumerable: true}, | ||
17 | m_altitude : {value : 0.0, enumerable: true}, | ||
18 | m_transformCtr : {value : null, enumerable: true}, | ||
19 | m_endAzimuth : {value : 0, enumerable: true}, | ||
20 | m_endAltitude : {value : 0, enumerable: true}, | ||
21 | |||
22 | _world : {value : null, enumerable:true}, // keep a referenceto the GLWorld (if any) | ||
23 | |||
24 | // Keep track of 3d properties | ||
25 | matrix3d : {value : [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], enumerable: true}, | ||
26 | |||
27 | xAngle : {value : 0, enumerable: true}, | ||
28 | yAngle : {value : 0, enumerable: true}, | ||
29 | zAngle : {value : 0, enumerable: true}, | ||
30 | |||
31 | x3D : {value : 0, enumerable: true}, | ||
32 | y3D : {value : 0, enumerable: true}, | ||
33 | z3D : {value : 0, enumerable: true}, | ||
34 | |||
35 | //TODO - not sure if this should be part of the tool or stage or a utility | ||
36 | perspectiveDist : { value : 1400, enumerable: true}, | ||
37 | perspectiveMode : { value : null, enumerable: true}, | ||
38 | |||
39 | init : { | ||
40 | value : function(elt) { | ||
41 | |||
42 | this.m_azimuth = 0.0; | ||
43 | this.m_altitude = 0.0; | ||
44 | |||
45 | this.m_endAzimuth = 0.0; | ||
46 | this.m_endAltitude = 0.0; | ||
47 | |||
48 | this.m_transformCtr = null; | ||
49 | this.perspectiveDist = 1400; | ||
50 | |||
51 | // this.m_upVector = Vector.create( [0,1,0] ); | ||
52 | // this.m_viewDir = Vector.create( [0,0,1] ); | ||
53 | // this.m_endUpVector = Vector.create( [0,1,0] ); | ||
54 | |||
55 | // this.m_targetPos = Vector.create( [0,0,0] ); | ||
56 | // this.m_objStartPos = Vector.create( [0,0,0] ); | ||
57 | |||
58 | // var mat = this.application.ninja.stage.stageDeps.viewUtils.getMatrixFromElement(elt).slice(0); | ||
59 | // var elt3DInfo = MathUtils.decomposeMatrix2(mat); | ||
60 | // if(elt3DInfo) | ||
61 | // { | ||
62 | // this.xAngle = ~~(elt3DInfo.rotation[0] * MathUtils.RAD_TO_DEG); | ||
63 | // this.yAngle = ~~(elt3DInfo.rotation[1] * MathUtils.RAD_TO_DEG); | ||
64 | // this.zAngle = ~~(elt3DInfo.rotation[2] * MathUtils.RAD_TO_DEG); | ||
65 | // | ||
66 | // this.x3D = ~~(elt3DInfo.translation[0]); | ||
67 | // this.y3D = ~~(elt3DInfo.translation[1]); | ||
68 | // this.z3D = ~~(elt3DInfo.translation[2]); | ||
69 | // | ||
70 | // this.matrix3d = mat; | ||
71 | // } | ||
72 | |||
73 | return this; | ||
74 | |||
75 | } | ||
76 | }, | ||
77 | |||
78 | ResetRotationValues : { | ||
79 | value : function() { | ||
80 | // this.m_upVector = Vector.create( [0,1,0] ); | ||
81 | // this.m_viewDir = Vector.create( [0,0,1] ); | ||
82 | |||
83 | this.m_azimuth = 0.0; | ||
84 | this.m_altitude = 0.0; | ||
85 | |||
86 | this.m_endAzimuth = 0.0; | ||
87 | this.m_endAltitude = 0.0; | ||
88 | |||
89 | this.m_transformCtr = null; | ||
90 | // this.m_targetPos = Vector.create( [0,0,0] ); | ||
91 | } | ||
92 | }, | ||
93 | |||
94 | ResetTranslationValues : { | ||
95 | value : function() { | ||
96 | // this.m_objStartPos = Vector.create( [0,0,0] ); | ||
97 | this.perspectiveDist = 1400; | ||
98 | } | ||
99 | } | ||
100 | }); \ No newline at end of file | ||