Return value of Matrix3D.recompose() method
The [Help] of the Matrix3D.recompose() method tells about its return value as follows:
Returns false if any of the scale elements are zero.
But this is not true. Try the code below, in the 7th statement of which the third element, the z coordinate, of the scale Vector3D instance is set to zero.
var myMatrix3D:Matrix3D = new Matrix3D(); trace(myMatrix3D.decompose()); // Output: Vector3D(0, 0, 0),Vector3D(0, 0, 0),Vector3D(1, 1, 1) var myVector:Vector.<Vector3D> = new Vector.<Vector3D>(); myVector.push(new Vector3D()); // translation myVector.push(new Vector3D()); // rotation myVector.push(new Vector3D(1, 1, 0)); // scale trace(myMatrix3D.recompose(myVector)); // Output: true trace(myMatrix3D.decompose()); // Output: Vector3D(0, -1.9986319541931152, 0),Vector3D(-1.5707963705062866, NaN, 0),Vector3D(7.667765755019554e-19, -1.998608112335205, 1.9719639421382673e-19)
The method returns true as long as the argument of Vector instance has three Vector3D elements. Therefore, the explanation in the [Help] should be rewritten as follows:
Returns false if any of the Vector3D elements of the Vector instance as the argument don’t exist or are null.
Note: The coordinates of Vector3D elements come to be invalid values if any of the scale elements are zero.