diff options
Diffstat (limited to 'js/helper-classes')
87 files changed, 33760 insertions, 0 deletions
diff --git a/js/helper-classes/3D/GLMatrix/gl-matrix.js b/js/helper-classes/3D/GLMatrix/gl-matrix.js new file mode 100644 index 00000000..811ed5cd --- /dev/null +++ b/js/helper-classes/3D/GLMatrix/gl-matrix.js | |||
@@ -0,0 +1,1842 @@ | |||
1 | /* | ||
2 | * gl-matrix.js - High performance matrix and vector operations for WebGL | ||
3 | * Version 1.0.0 | ||
4 | */ | ||
5 | |||
6 | /* | ||
7 | * Copyright (c) 2011 Brandon Jones | ||
8 | * | ||
9 | * This software is provided 'as-is', without any express or implied | ||
10 | * warranty. In no event will the authors be held liable for any damages | ||
11 | * arising from the use of this software. | ||
12 | * | ||
13 | * Permission is granted to anyone to use this software for any purpose, | ||
14 | * including commercial applications, and to alter it and redistribute it | ||
15 | * freely, subject to the following restrictions: | ||
16 | * | ||
17 | * 1. The origin of this software must not be misrepresented; you must not | ||
18 | * claim that you wrote the original software. If you use this software | ||
19 | * in a product, an acknowledgment in the product documentation would be | ||
20 | * appreciated but is not required. | ||
21 | * | ||
22 | * 2. Altered source versions must be plainly marked as such, and must not | ||
23 | * be misrepresented as being the original software. | ||
24 | * | ||
25 | * 3. This notice may not be removed or altered from any source | ||
26 | * distribution. | ||
27 | */ | ||
28 | |||
29 | "use strict"; | ||
30 | |||
31 | // Type declarations | ||
32 | var MatrixArray = (typeof Float32Array !== 'undefined') ? Float32Array : Array, // Fallback for systems that don't support TypedArrays | ||
33 | glMatrixArrayType = MatrixArray, // For Backwards compatibility | ||
34 | vec3 = {}, | ||
35 | mat3 = {}, | ||
36 | glmat4 = {}, | ||
37 | quat4 = {}; | ||
38 | |||
39 | |||
40 | /* | ||
41 | * vec3 - 3 Dimensional Vector | ||
42 | */ | ||
43 | |||
44 | /* | ||
45 | * vec3.create | ||
46 | * Creates a new instance of a vec3 using the default array type | ||
47 | * Any javascript array containing at least 3 numeric elements can serve as a vec3 | ||
48 | * | ||
49 | * Params: | ||
50 | * vec - Optional, vec3 containing values to initialize with | ||
51 | * | ||
52 | * Returns: | ||
53 | * New vec3 | ||
54 | */ | ||
55 | vec3.create = function (vec) { | ||
56 | var dest = new MatrixArray(3); | ||
57 | |||
58 | if (vec) { | ||
59 | dest[0] = vec[0]; | ||
60 | dest[1] = vec[1]; | ||
61 | dest[2] = vec[2]; | ||
62 | } | ||
63 | |||
64 | return dest; | ||
65 | }; | ||
66 | |||
67 | /* | ||
68 | * vec3.set | ||
69 | * Copies the values of one vec3 to another | ||
70 | * | ||
71 | * Params: | ||
72 | * vec - vec3 containing values to copy | ||
73 | * dest - vec3 receiving copied values | ||
74 | * | ||
75 | * Returns: | ||
76 | * dest | ||
77 | */ | ||
78 | vec3.set = function (vec, dest) { | ||