6
6
var hasFloat32Array = ( typeof Float32Array != 'undefined' ) ;
7
7
8
8
// ### new GL.Matrix([elements])
9
- //
9
+ //
10
10
// This constructor takes 16 arguments in row-major order, which can be passed
11
11
// individually, as a list, or even as four lists, one for each row. If the
12
12
// arguments are omitted then the identity matrix is constructed instead.
@@ -25,30 +25,30 @@ function Matrix() {
25
25
26
26
Matrix . prototype = {
27
27
// ### .inverse()
28
- //
28
+ //
29
29
// Returns the matrix that when multiplied with this matrix results in the
30
30
// identity matrix.
31
31
inverse : function ( ) {
32
32
return Matrix . inverse ( this , new Matrix ( ) ) ;
33
33
} ,
34
34
35
35
// ### .transpose()
36
- //
36
+ //
37
37
// Returns this matrix, exchanging columns for rows.
38
38
transpose : function ( ) {
39
39
return Matrix . transpose ( this , new Matrix ( ) ) ;
40
40
} ,
41
41
42
42
// ### .multiply(matrix)
43
- //
43
+ //
44
44
// Returns the concatenation of the transforms for this matrix and `matrix`.
45
45
// This emulates the OpenGL function `glMultMatrix()`.
46
46
multiply : function ( matrix ) {
47
47
return Matrix . multiply ( this , matrix , new Matrix ( ) ) ;
48
48
} ,
49
49
50
50
// ### .transformPoint(point)
51
- //
51
+ //
52
52
// Transforms the vector as a point with a w coordinate of 1. This
53
53
// means translations will have an effect, for example.
54
54
transformPoint : function ( v ) {
@@ -61,7 +61,7 @@ Matrix.prototype = {
61
61
} ,
62
62
63
63
// ### .transformPoint(vector)
64
- //
64
+ //
65
65
// Transforms the vector as a vector with a w coordinate of 0. This
66
66
// means translations will have no effect, for example.
67
67
transformVector : function ( v ) {
@@ -75,7 +75,7 @@ Matrix.prototype = {
75
75
} ;
76
76
77
77
// ### GL.Matrix.inverse(matrix[, result])
78
- //
78
+ //
79
79
// Returns the matrix that when multiplied with `matrix` results in the
80
80
// identity matrix. You can optionally pass an existing matrix in `result`
81
81
// to avoid allocating a new matrix. This implementation is from the Mesa
@@ -110,7 +110,7 @@ Matrix.inverse = function(matrix, result) {
110
110
} ;
111
111
112
112
// ### GL.Matrix.transpose(matrix[, result])
113
- //
113
+ //
114
114
// Returns `matrix`, exchanging columns for rows. You can optionally pass an
115
115
// existing matrix in `result` to avoid allocating a new matrix.
116
116
Matrix . transpose = function ( matrix , result ) {
@@ -124,7 +124,7 @@ Matrix.transpose = function(matrix, result) {
124
124
} ;
125
125
126
126
// ### GL.Matrix.multiply(left, right[, result])
127
- //
127
+ //
128
128
// Returns the concatenation of the transforms for `left` and `right`. You can
129
129
// optionally pass an existing matrix in `result` to avoid allocating a new
130
130
// matrix. This emulates the OpenGL function `glMultMatrix()`.
@@ -156,7 +156,7 @@ Matrix.multiply = function(left, right, result) {
156
156
} ;
157
157
158
158
// ### GL.Matrix.identity([result])
159
- //
159
+ //
160
160
// Returns an identity matrix. You can optionally pass an existing matrix in
161
161
// `result` to avoid allocating a new matrix. This emulates the OpenGL function
162
162
// `glLoadIdentity()`.
@@ -169,7 +169,7 @@ Matrix.identity = function(result) {
169
169
} ;
170
170
171
171
// ### GL.Matrix.perspective(fov, aspect, near, far[, result])
172
- //
172
+ //
173
173
// Returns a perspective transform matrix, which makes far away objects appear
174
174
// smaller than nearby objects. The `aspect` argument should be the width
175
175
// divided by the height of your viewport and `fov` is the top-to-bottom angle
@@ -183,7 +183,7 @@ Matrix.perspective = function(fov, aspect, near, far, result) {
183
183
} ;
184
184
185
185
// ### GL.Matrix.frustum(left, right, bottom, top, near, far[, result])
186
- //
186
+ //
187
187
// Sets up a viewing frustum, which is shaped like a truncated pyramid with the
188
188
// camera where the point of the pyramid would be. You can optionally pass an
189
189
// existing matrix in `result` to avoid allocating a new matrix. This emulates
@@ -216,7 +216,7 @@ Matrix.frustum = function(l, r, b, t, n, f, result) {
216
216
} ;
217
217
218
218
// ### GL.Matrix.ortho(left, right, bottom, top, near, far[, result])
219
- //
219
+ //
220
220
// Returns an orthographic projection, in which objects are the same size no
221
221
// matter how far away or nearby they are. You can optionally pass an existing
222
222
// matrix in `result` to avoid allocating a new matrix. This emulates the OpenGL
@@ -249,9 +249,9 @@ Matrix.ortho = function(l, r, b, t, n, f, result) {
249
249
} ;
250
250
251
251
// ### GL.Matrix.scale(x, y, z[, result])
252
- //
252
+ //
253
253
// This emulates the OpenGL function `glScale()`. You can optionally pass an
254
- // existing matrix in `result` to avoid allocating a new matrix.
254
+ // existing matrix in `result` to avoid allocating a new matrix.
255
255
Matrix . scale = function ( x , y , z , result ) {
256
256
result = result || new Matrix ( ) ;
257
257
var m = result . m ;
@@ -280,9 +280,9 @@ Matrix.scale = function(x, y, z, result) {
280
280
} ;
281
281
282
282
// ### GL.Matrix.translate(x, y, z[, result])
283
- //
283
+ //
284
284
// This emulates the OpenGL function `glTranslate()`. You can optionally pass
285
- // an existing matrix in `result` to avoid allocating a new matrix.
285
+ // an existing matrix in `result` to avoid allocating a new matrix.
286
286
Matrix . translate = function ( x , y , z , result ) {
287
287
result = result || new Matrix ( ) ;
288
288
var m = result . m ;
@@ -311,10 +311,10 @@ Matrix.translate = function(x, y, z, result) {
311
311
} ;
312
312
313
313
// ### GL.Matrix.rotate(a, x, y, z[, result])
314
- //
314
+ //
315
315
// Returns a matrix that rotates by `a` degrees around the vector `x, y, z`.
316
316
// You can optionally pass an existing matrix in `result` to avoid allocating
317
- // a new matrix. This emulates the OpenGL function `glRotate()`.
317
+ // a new matrix. This emulates the OpenGL function `glRotate()`.
318
318
Matrix . rotate = function ( a , x , y , z , result ) {
319
319
if ( ! a || ( ! x && ! y && ! z ) ) {
320
320
return Matrix . identity ( result ) ;
@@ -351,7 +351,7 @@ Matrix.rotate = function(a, x, y, z, result) {
351
351
} ;
352
352
353
353
// ### GL.Matrix.lookAt(ex, ey, ez, cx, cy, cz, ux, uy, uz[, result])
354
- //
354
+ //
355
355
// Returns a matrix that puts the camera at the eye point `ex, ey, ez` looking
356
356
// toward the center point `cx, cy, cz` with an up direction of `ux, uy, uz`.
357
357
// You can optionally pass an existing matrix in `result` to avoid allocating
0 commit comments