File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -181,8 +181,6 @@ package away3d.core.math {
181
181
return target ;
182
182
}
183
183
184
-
185
-
186
184
public static function decompose (sourceMatrix :Matrix3D , orientationStyle :String = "eulerAngles" ):Vector.<Vector3D> {
187
185
var raw: Vector .< Number > = RAW_DATA_CONTAINER ;
188
186
sourceMatrix. copyRawDataTo(raw);
@@ -210,6 +208,10 @@ package away3d.core.math {
210
208
var scaleY : Number = ty ;
211
209
var scaleZ: Number = tz;
212
210
211
+ if (a * (f* k - j* g) - e* (b * k - j* c ) + i* (b * g - f* c ) < 0 ) {
212
+ scaleZ = - scaleZ;
213
+ }
214
+
213
215
a = a / scaleX ;
214
216
e = e / scaleX ;
215
217
i = i / scaleX ;
@@ -224,7 +226,9 @@ package away3d.core.math {
224
226
if (orientationStyle == Orientation3D. EULER_ANGLES ) {
225
227
tx = Math . atan2 (j, k);
226
228
ty = Math . atan2 (- i, Math . sqrt (a * a + e * e));
227
- tz = Math . atan2 (e, a );
229
+ var s1: Number = Math . sin (tx );
230
+ var c1: Number = Math . cos (tx );
231
+ tz = Math . atan2 (s1* c - c1* b , c1* f - s1* g);
228
232
} else if (orientationStyle == Orientation3D. AXIS_ANGLE ) {
229
233
tw = Math . acos ((a + f + k - 1 ) / 2 );
230
234
var len: Number = Math . sqrt ((j - g) * (j - g) + (c - i) * (c - i) + (e - b ) * (e - b ));
You can’t perform that action at this time.
0 commit comments