22 * @author Mat Groves http://matgroves.com/ @Doormat23
33 */
44
5- PIXI . determineMatrixArrayType = function ( ) {
6- return ( typeof Float32Array !== 'undefined' ) ? Float32Array : Array ;
7- } ;
8-
9- /*
10- * @class Matrix2
11- * The Matrix2 class will choose the best type of array to use between
12- * a regular javascript Array and a Float32Array if the latter is available
13- *
14- */
15- PIXI . Matrix2 = PIXI . determineMatrixArrayType ( ) ;
16-
17- /*
18- * @class Matrix
19- * The Matrix class is now an object, which makes it a lot faster,
20- * here is a representation of it :
21- * | a | b | tx|
22- * | c | c | ty|
23- * | 0 | 0 | 1 |
24- *
25- */
5+ /**
6+ * The Matrix class is now an object, which makes it a lot faster,
7+ * here is a representation of it :
8+ * | a | b | tx|
9+ * | c | c | ty|
10+ * | 0 | 0 | 1 |
11+ *
12+ * @class Matrix
13+ * @constructor
14+ */
2615PIXI . Matrix = function ( )
2716{
2817 this . a = 1 ;
@@ -54,7 +43,7 @@ PIXI.Matrix.prototype.fromArray = function(array)
5443 *
5544 * @method toArray
5645 * @param transpose {Boolean} Whether we need to transpose the matrix or not
57- * @return array {Array} the newly created array which contains the matrix
46+ * @return {Array } the newly created array which contains the matrix
5847 */
5948PIXI . Matrix . prototype . toArray = function ( transpose )
6049{
@@ -63,30 +52,43 @@ PIXI.Matrix.prototype.toArray = function(transpose)
6352
6453 if ( transpose )
6554 {
66- this . array [ 0 ] = this . a ;
67- this . array [ 1 ] = this . c ;
68- this . array [ 2 ] = 0 ;
69- this . array [ 3 ] = this . b ;
70- this . array [ 4 ] = this . d ;
71- this . array [ 5 ] = 0 ;
72- this . array [ 6 ] = this . tx ;
73- this . array [ 7 ] = this . ty ;
74- this . array [ 8 ] = 1 ;
55+ array [ 0 ] = this . a ;
56+ array [ 1 ] = this . c ;
57+ array [ 2 ] = 0 ;
58+ array [ 3 ] = this . b ;
59+ array [ 4 ] = this . d ;
60+ array [ 5 ] = 0 ;
61+ array [ 6 ] = this . tx ;
62+ array [ 7 ] = this . ty ;
63+ array [ 8 ] = 1 ;
7564 }
7665 else
7766 {
78- this . array [ 0 ] = this . a ;
79- this . array [ 1 ] = this . b ;
80- this . array [ 2 ] = this . tx ;
81- this . array [ 3 ] = this . c ;
82- this . array [ 4 ] = this . d ;
83- this . array [ 5 ] = this . ty ;
84- this . array [ 6 ] = 0 ;
85- this . array [ 7 ] = 0 ;
86- this . array [ 8 ] = 1 ;
67+ array [ 0 ] = this . a ;
68+ array [ 1 ] = this . b ;
69+ array [ 2 ] = this . tx ;
70+ array [ 3 ] = this . c ;
71+ array [ 4 ] = this . d ;
72+ array [ 5 ] = this . ty ;
73+ array [ 6 ] = 0 ;
74+ array [ 7 ] = 0 ;
75+ array [ 8 ] = 1 ;
8776 }
8877
89- return array ; //[this.a, this.b, this.tx, this.c, this.d, this.ty, 0, 0, 1];
78+ return array ;
9079} ;
9180
92- PIXI . identityMatrix = new PIXI . Matrix ( ) ;
81+ PIXI . identityMatrix = new PIXI . Matrix ( ) ;
82+
83+ PIXI . determineMatrixArrayType = function ( ) {
84+ return ( typeof Float32Array !== 'undefined' ) ? Float32Array : Array ;
85+ } ;
86+
87+ /**
88+ * The Matrix2 class will choose the best type of array to use between
89+ * a regular javascript Array and a Float32Array if the latter is available
90+ *
91+ * @class Matrix2
92+ * @constructor
93+ */
94+ PIXI . Matrix2 = PIXI . determineMatrixArrayType ( ) ;
0 commit comments