ice-entity-designer 0.0.39 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/README.md +69 -14
  2. package/dist/index.cjs +1 -6
  3. package/dist/index.mjs +1 -6
  4. package/dist/index.umd.js +1 -6
  5. package/dist/react.cjs +1 -6
  6. package/dist/react.mjs +1 -6
  7. package/dist/types/bpmn/BpmnSimulator.d.mts +3 -3
  8. package/dist/types/bpmn/BpmnSimulator.d.ts +3 -3
  9. package/dist/types/bpmn/bpmn_shapes.d.mts +1 -1
  10. package/dist/types/bpmn/bpmn_shapes.d.ts +1 -1
  11. package/dist/types/bpmn/bpmn_validate.d.mts +1 -1
  12. package/dist/types/bpmn/bpmn_validate.d.ts +1 -1
  13. package/dist/types/bpmn/bpmn_xml.d.mts +1 -1
  14. package/dist/types/bpmn/bpmn_xml.d.ts +1 -1
  15. package/dist/types/designer/EntityDesigner.d.mts +3 -3
  16. package/dist/types/designer/EntityDesigner.d.ts +3 -3
  17. package/dist/types/er-component/Entity.d.mts +2 -2
  18. package/dist/types/er-component/Entity.d.ts +2 -2
  19. package/dist/types/er-component/Relation.d.mts +1 -1
  20. package/dist/types/er-component/Relation.d.ts +1 -1
  21. package/dist/types/flow/FlowDesigner.d.mts +4 -4
  22. package/dist/types/flow/FlowDesigner.d.ts +4 -4
  23. package/dist/types/flow/FlowEdge.d.mts +2 -2
  24. package/dist/types/flow/FlowEdge.d.ts +2 -2
  25. package/dist/types/flow/FlowNode.d.mts +3 -3
  26. package/dist/types/flow/FlowNode.d.ts +3 -3
  27. package/dist/types/flow/flow_shapes.d.mts +1 -1
  28. package/dist/types/flow/flow_shapes.d.ts +1 -1
  29. package/dist/types/gantt/GanttDependency.d.mts +1 -1
  30. package/dist/types/gantt/GanttDependency.d.ts +1 -1
  31. package/dist/types/gantt/GanttDesigner.d.mts +2 -2
  32. package/dist/types/gantt/GanttDesigner.d.ts +2 -2
  33. package/dist/types/gantt/GanttRuler.d.mts +2 -2
  34. package/dist/types/gantt/GanttRuler.d.ts +2 -2
  35. package/dist/types/gantt/GanttTask.d.mts +1 -1
  36. package/dist/types/gantt/GanttTask.d.ts +1 -1
  37. package/dist/types/gantt/gantt_text.d.mts +1 -1
  38. package/dist/types/gantt/gantt_text.d.ts +1 -1
  39. package/dist/types/index.d.mts +4 -13
  40. package/dist/types/index.d.ts +4 -13
  41. package/dist/types/power/PowerDesigner.d.mts +2 -2
  42. package/dist/types/power/PowerDesigner.d.ts +2 -2
  43. package/dist/types/power/power_shapes.d.mts +4 -4
  44. package/dist/types/power/power_shapes.d.ts +4 -4
  45. package/dist/types/power/power_voltage.d.mts +1 -1
  46. package/dist/types/power/power_voltage.d.ts +1 -1
  47. package/dist/types/react/context.d.mts +2 -2
  48. package/dist/types/react/context.d.ts +2 -2
  49. package/dist/types/react/index.d.mts +0 -1
  50. package/dist/types/react/index.d.ts +0 -1
  51. package/dist/types/react/session.d.mts +4 -4
  52. package/dist/types/react/session.d.ts +4 -4
  53. package/dist/types/react/types.d.mts +7 -7
  54. package/dist/types/react/types.d.ts +7 -7
  55. package/dist/types/secondary/SecondaryDesigner.d.mts +1 -1
  56. package/dist/types/secondary/SecondaryDesigner.d.ts +1 -1
  57. package/dist/types/secondary/secondary_shapes.d.mts +2 -2
  58. package/dist/types/secondary/secondary_shapes.d.ts +2 -2
  59. package/dist/types/statechart/StateNode.d.mts +2 -2
  60. package/dist/types/statechart/StateNode.d.ts +2 -2
  61. package/dist/types/statechart/StateTransition.d.mts +1 -1
  62. package/dist/types/statechart/StateTransition.d.ts +1 -1
  63. package/dist/types/statechart/StatechartDesigner.d.mts +1 -1
  64. package/dist/types/statechart/StatechartDesigner.d.ts +1 -1
  65. package/dist/types/statechart/statechart_text.d.mts +1 -1
  66. package/dist/types/statechart/statechart_text.d.ts +1 -1
  67. package/dist/types/uml/UmlClass.d.mts +2 -2
  68. package/dist/types/uml/UmlClass.d.ts +2 -2
  69. package/dist/types/uml/UmlDesigner.d.mts +1 -1
  70. package/dist/types/uml/UmlDesigner.d.ts +1 -1
  71. package/dist/types/uml/UmlRelation.d.mts +4 -4
  72. package/dist/types/uml/UmlRelation.d.ts +4 -4
  73. package/dist/types/uml/uml_text.d.mts +1 -1
  74. package/dist/types/uml/uml_text.d.ts +1 -1
  75. package/dist/types/utils/project_codec.d.mts +2 -2
  76. package/dist/types/utils/project_codec.d.ts +2 -2
  77. package/dist/types/utils/project_schema.d.mts +1 -1
  78. package/dist/types/utils/project_schema.d.ts +1 -1
  79. package/dist/types/utils/schema_validator.d.mts +1 -1
  80. package/dist/types/utils/schema_validator.d.ts +1 -1
  81. package/package.json +24 -20
  82. package/dist/types/gl-matrix.d.mts +0 -3273
  83. package/dist/types/gl-matrix.d.ts +0 -3273
  84. package/dist/types/ice-render/FrameManager.d.mts +0 -26
  85. package/dist/types/ice-render/FrameManager.d.ts +0 -26
  86. package/dist/types/ice-render/ICE.d.mts +0 -424
  87. package/dist/types/ice-render/ICE.d.ts +0 -424
  88. package/dist/types/ice-render/a11y/accessibility.d.mts +0 -46
  89. package/dist/types/ice-render/a11y/accessibility.d.ts +0 -46
  90. package/dist/types/ice-render/animation/AnimationManager.d.mts +0 -96
  91. package/dist/types/ice-render/animation/AnimationManager.d.ts +0 -96
  92. package/dist/types/ice-render/animation/Easing.d.mts +0 -33
  93. package/dist/types/ice-render/animation/Easing.d.ts +0 -33
  94. package/dist/types/ice-render/consts/BIG_ZINDEX_NUMBER.d.mts +0 -14
  95. package/dist/types/ice-render/consts/BIG_ZINDEX_NUMBER.d.ts +0 -14
  96. package/dist/types/ice-render/consts/COMPONENT_TYPE_MAPPING.d.mts +0 -45
  97. package/dist/types/ice-render/consts/COMPONENT_TYPE_MAPPING.d.ts +0 -45
  98. package/dist/types/ice-render/consts/DOM_EVENT_MAPPING_CONSTS.d.mts +0 -37
  99. package/dist/types/ice-render/consts/DOM_EVENT_MAPPING_CONSTS.d.ts +0 -37
  100. package/dist/types/ice-render/consts/ICE_EVENT_NAME_CONSTS.d.mts +0 -27
  101. package/dist/types/ice-render/consts/ICE_EVENT_NAME_CONSTS.d.ts +0 -27
  102. package/dist/types/ice-render/control-panel/AlignmentGuideManager.d.mts +0 -92
  103. package/dist/types/ice-render/control-panel/AlignmentGuideManager.d.ts +0 -92
  104. package/dist/types/ice-render/control-panel/ICEControlPanel.d.mts +0 -37
  105. package/dist/types/ice-render/control-panel/ICEControlPanel.d.ts +0 -37
  106. package/dist/types/ice-render/control-panel/ICEControlPanelManager.d.mts +0 -25
  107. package/dist/types/ice-render/control-panel/ICEControlPanelManager.d.ts +0 -25
  108. package/dist/types/ice-render/control-panel/link-controls/LineControlPanel.d.mts +0 -39
  109. package/dist/types/ice-render/control-panel/link-controls/LineControlPanel.d.ts +0 -39
  110. package/dist/types/ice-render/control-panel/transform-controls/ResizeControl.d.mts +0 -38
  111. package/dist/types/ice-render/control-panel/transform-controls/ResizeControl.d.ts +0 -38
  112. package/dist/types/ice-render/control-panel/transform-controls/RotateControl.d.mts +0 -12
  113. package/dist/types/ice-render/control-panel/transform-controls/RotateControl.d.ts +0 -12
  114. package/dist/types/ice-render/control-panel/transform-controls/TransformControlPanel.d.mts +0 -83
  115. package/dist/types/ice-render/control-panel/transform-controls/TransformControlPanel.d.ts +0 -83
  116. package/dist/types/ice-render/control-panel/transform-controls/constraints.d.mts +0 -24
  117. package/dist/types/ice-render/control-panel/transform-controls/constraints.d.ts +0 -24
  118. package/dist/types/ice-render/cross-platform/Path2DRecorder.d.mts +0 -76
  119. package/dist/types/ice-render/cross-platform/Path2DRecorder.d.ts +0 -76
  120. package/dist/types/ice-render/cross-platform/PolyfillPath2D.d.mts +0 -21
  121. package/dist/types/ice-render/cross-platform/PolyfillPath2D.d.ts +0 -21
  122. package/dist/types/ice-render/cross-platform/root.d.mts +0 -7
  123. package/dist/types/ice-render/cross-platform/root.d.ts +0 -7
  124. package/dist/types/ice-render/event/DOMEventDispatcher.d.mts +0 -75
  125. package/dist/types/ice-render/event/DOMEventDispatcher.d.ts +0 -75
  126. package/dist/types/ice-render/event/DOMEventInterceptor.d.mts +0 -36
  127. package/dist/types/ice-render/event/DOMEventInterceptor.d.ts +0 -36
  128. package/dist/types/ice-render/event/EventBus.d.mts +0 -27
  129. package/dist/types/ice-render/event/EventBus.d.ts +0 -27
  130. package/dist/types/ice-render/event/ICEEvent.d.mts +0 -46
  131. package/dist/types/ice-render/event/ICEEvent.d.ts +0 -46
  132. package/dist/types/ice-render/event/ICEEventTarget.d.mts +0 -106
  133. package/dist/types/ice-render/event/ICEEventTarget.d.ts +0 -106
  134. package/dist/types/ice-render/event/input-normalize.d.mts +0 -75
  135. package/dist/types/ice-render/event/input-normalize.d.ts +0 -75
  136. package/dist/types/ice-render/export/SvgExporter.d.mts +0 -54
  137. package/dist/types/ice-render/export/SvgExporter.d.ts +0 -54
  138. package/dist/types/ice-render/geometry/GeoLine.d.mts +0 -24
  139. package/dist/types/ice-render/geometry/GeoLine.d.ts +0 -24
  140. package/dist/types/ice-render/geometry/GeoPoint.d.mts +0 -53
  141. package/dist/types/ice-render/geometry/GeoPoint.d.ts +0 -53
  142. package/dist/types/ice-render/geometry/GeoUtil.d.mts +0 -73
  143. package/dist/types/ice-render/geometry/GeoUtil.d.ts +0 -73
  144. package/dist/types/ice-render/geometry/ICEBoundingBox.d.mts +0 -81
  145. package/dist/types/ice-render/geometry/ICEBoundingBox.d.ts +0 -81
  146. package/dist/types/ice-render/graphic/ICEComponent.d.mts +0 -535
  147. package/dist/types/ice-render/graphic/ICEComponent.d.ts +0 -535
  148. package/dist/types/ice-render/graphic/ICEDotPath.d.mts +0 -99
  149. package/dist/types/ice-render/graphic/ICEDotPath.d.ts +0 -99
  150. package/dist/types/ice-render/graphic/ICEImage.d.mts +0 -17
  151. package/dist/types/ice-render/graphic/ICEImage.d.ts +0 -17
  152. package/dist/types/ice-render/graphic/ICEPath.d.mts +0 -46
  153. package/dist/types/ice-render/graphic/ICEPath.d.ts +0 -46
  154. package/dist/types/ice-render/graphic/container/ICEGroup.d.mts +0 -111
  155. package/dist/types/ice-render/graphic/container/ICEGroup.d.ts +0 -111
  156. package/dist/types/ice-render/graphic/link/ICEBezier.d.mts +0 -23
  157. package/dist/types/ice-render/graphic/link/ICEBezier.d.ts +0 -23
  158. package/dist/types/ice-render/graphic/link/ICELinkHook.d.mts +0 -52
  159. package/dist/types/ice-render/graphic/link/ICELinkHook.d.ts +0 -52
  160. package/dist/types/ice-render/graphic/link/ICELinkSlot.d.mts +0 -54
  161. package/dist/types/ice-render/graphic/link/ICELinkSlot.d.ts +0 -54
  162. package/dist/types/ice-render/graphic/link/ICELinkSlotManager.d.mts +0 -28
  163. package/dist/types/ice-render/graphic/link/ICELinkSlotManager.d.ts +0 -28
  164. package/dist/types/ice-render/graphic/link/ICEPolyLine.d.mts +0 -316
  165. package/dist/types/ice-render/graphic/link/ICEPolyLine.d.ts +0 -316
  166. package/dist/types/ice-render/graphic/link/ICEVisioLink.d.mts +0 -163
  167. package/dist/types/ice-render/graphic/link/ICEVisioLink.d.ts +0 -163
  168. package/dist/types/ice-render/graphic/shape/ICECircle.d.mts +0 -19
  169. package/dist/types/ice-render/graphic/shape/ICECircle.d.ts +0 -19
  170. package/dist/types/ice-render/graphic/shape/ICEEllipse.d.mts +0 -29
  171. package/dist/types/ice-render/graphic/shape/ICEEllipse.d.ts +0 -29
  172. package/dist/types/ice-render/graphic/shape/ICEIsogon.d.mts +0 -52
  173. package/dist/types/ice-render/graphic/shape/ICEIsogon.d.ts +0 -52
  174. package/dist/types/ice-render/graphic/shape/ICERect.d.mts +0 -10
  175. package/dist/types/ice-render/graphic/shape/ICERect.d.ts +0 -10
  176. package/dist/types/ice-render/graphic/shape/ICERose.d.mts +0 -41
  177. package/dist/types/ice-render/graphic/shape/ICERose.d.ts +0 -41
  178. package/dist/types/ice-render/graphic/shape/ICEStar.d.mts +0 -45
  179. package/dist/types/ice-render/graphic/shape/ICEStar.d.ts +0 -45
  180. package/dist/types/ice-render/graphic/text/ICEText.d.mts +0 -158
  181. package/dist/types/ice-render/graphic/text/ICEText.d.ts +0 -158
  182. package/dist/types/ice-render/index.d.mts +0 -59
  183. package/dist/types/ice-render/index.d.ts +0 -59
  184. package/dist/types/ice-render/layout/ICEBorderLayout.d.mts +0 -34
  185. package/dist/types/ice-render/layout/ICEBorderLayout.d.ts +0 -34
  186. package/dist/types/ice-render/layout/ICEBoxLayout.d.mts +0 -30
  187. package/dist/types/ice-render/layout/ICEBoxLayout.d.ts +0 -30
  188. package/dist/types/ice-render/layout/ICECardLayout.d.mts +0 -36
  189. package/dist/types/ice-render/layout/ICECardLayout.d.ts +0 -36
  190. package/dist/types/ice-render/layout/ICEFlowLayout.d.mts +0 -31
  191. package/dist/types/ice-render/layout/ICEFlowLayout.d.ts +0 -31
  192. package/dist/types/ice-render/layout/ICEGridLayout.d.mts +0 -33
  193. package/dist/types/ice-render/layout/ICEGridLayout.d.ts +0 -33
  194. package/dist/types/ice-render/layout/ICELayeredLayout.d.mts +0 -49
  195. package/dist/types/ice-render/layout/ICELayeredLayout.d.ts +0 -49
  196. package/dist/types/ice-render/layout/ICELayoutManager.d.mts +0 -33
  197. package/dist/types/ice-render/layout/ICELayoutManager.d.ts +0 -33
  198. package/dist/types/ice-render/layout/ICEOverlayLayout.d.mts +0 -25
  199. package/dist/types/ice-render/layout/ICEOverlayLayout.d.ts +0 -25
  200. package/dist/types/ice-render/persistence/Deserializer.d.mts +0 -43
  201. package/dist/types/ice-render/persistence/Deserializer.d.ts +0 -43
  202. package/dist/types/ice-render/persistence/Serializer.d.mts +0 -35
  203. package/dist/types/ice-render/persistence/Serializer.d.ts +0 -35
  204. package/dist/types/ice-render/plugin/PluginHost.d.mts +0 -86
  205. package/dist/types/ice-render/plugin/PluginHost.d.ts +0 -86
  206. package/dist/types/ice-render/renderer/CanvasRenderer.d.mts +0 -150
  207. package/dist/types/ice-render/renderer/CanvasRenderer.d.ts +0 -150
  208. package/dist/types/ice-render/renderer/ObjectCache.d.mts +0 -79
  209. package/dist/types/ice-render/renderer/ObjectCache.d.ts +0 -79
  210. package/dist/types/ice-render/renderer/dirty-rect-util.d.mts +0 -86
  211. package/dist/types/ice-render/renderer/dirty-rect-util.d.ts +0 -86
  212. package/dist/types/ice-render/theme/ICETheme.d.mts +0 -382
  213. package/dist/types/ice-render/theme/ICETheme.d.ts +0 -382
  214. package/dist/types/ice-render/util/ImageCache.d.mts +0 -19
  215. package/dist/types/ice-render/util/ImageCache.d.ts +0 -19
  216. package/dist/types/ice-render/util/data-util.d.mts +0 -43
  217. package/dist/types/ice-render/util/data-util.d.ts +0 -43
  218. package/dist/types/ice-render/util/gl-matrix-skew.d.mts +0 -14
  219. package/dist/types/ice-render/util/gl-matrix-skew.d.ts +0 -14
  220. package/dist/types/ice-render/util/lang.d.mts +0 -28
  221. package/dist/types/ice-render/util/lang.d.ts +0 -28
  222. package/dist/types/ice-render/util/uuid.d.mts +0 -1
  223. package/dist/types/ice-render/util/uuid.d.ts +0 -1
@@ -1,3273 +0,0 @@
1
- declare module "gl-matrix" {
2
-
3
- // prettier-ignore
4
- export type mat2 =
5
- | [number, number,
6
- number, number]
7
- | Float32Array;
8
-
9
- // prettier-ignore
10
- export type mat2d =
11
- | [number, number,
12
- number, number,
13
- number, number]
14
- | Float32Array;
15
-
16
- // prettier-ignore
17
- export type mat3 =
18
- | [number, number, number,
19
- number, number, number,
20
- number, number, number]
21
- | Float32Array;
22
-
23
- // prettier-ignore
24
- export type mat4 =
25
- | [number, number, number, number,
26
- number, number, number, number,
27
- number, number, number, number,
28
- number, number, number, number]
29
- | Float32Array;
30
-
31
- export type quat = [number, number, number, number] | Float32Array;
32
-
33
- // prettier-ignore
34
- export type quat2 =
35
- | [number, number, number, number,
36
- number, number, number, number]
37
- | Float32Array;
38
-
39
- export type vec2 = [number, number] | Float32Array;
40
- export type vec3 = [number, number, number] | Float32Array;
41
- export type vec4 = [number, number, number, number] | Float32Array;
42
-
43
- // prettier-ignore
44
- export type ReadonlyMat2 =
45
- | readonly [
46
- number, number,
47
- number, number
48
- ]
49
- | Float32Array;
50
-
51
- // prettier-ignore
52
- export type ReadonlyMat2d =
53
- | readonly [
54
- number, number,
55
- number, number,
56
- number, number
57
- ]
58
- | Float32Array;
59
-
60
- // prettier-ignore
61
- export type ReadonlyMat3 =
62
- | readonly [
63
- number, number, number,
64
- number, number, number,
65
- number, number, number
66
- ]
67
- | Float32Array;
68
-
69
- // prettier-ignore
70
- export type ReadonlyMat4 =
71
- | readonly [
72
- number, number, number, number,
73
- number, number, number, number,
74
- number, number, number, number,
75
- number, number, number, number
76
- ]
77
- | Float32Array;
78
-
79
- export type ReadonlyQuat =
80
- | readonly [number, number, number, number]
81
- | Float32Array;
82
-
83
- export type ReadonlyQuat2 =
84
- | readonly [number, number, number, number, number, number, number, number]
85
- | Float32Array;
86
-
87
- export type ReadonlyVec2 = readonly [number, number] | Float32Array;
88
- export type ReadonlyVec3 = readonly [number, number, number] | Float32Array;
89
- export type ReadonlyVec4 =
90
- | readonly [number, number, number, number]
91
- | Float32Array;
92
-
93
- export module glMatrix {
94
- /**
95
- * Sets the type of array used when creating new vectors and matrices
96
- *
97
- * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array
98
- */
99
- export function setMatrixArrayType(type: ArrayConstructor | Float32ArrayConstructor): void;
100
- /**
101
- * Convert Degree To Radian
102
- *
103
- * @param {Number} a Angle in Degrees
104
- */
105
- export function toRadian(a: number): number;
106
- /**
107
- * Tests whether or not the arguments have approximately the same value, within an absolute
108
- * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less
109
- * than or equal to 1.0, and a relative tolerance is used for larger values)
110
- *
111
- * @param {Number} a The first number to test.
112
- * @param {Number} b The second number to test.
113
- * @returns {Boolean} True if the numbers are approximately equal, false otherwise.
114
- */
115
- export function equals(a: number, b: number): boolean;
116
- /**
117
- * Common utilities
118
- * @module glMatrix
119
- */
120
- export const EPSILON: 0.000001;
121
- export let ARRAY_TYPE: ArrayConstructor | Float32ArrayConstructor;
122
- export const RANDOM: () => number;
123
- }
124
- export module mat2 {
125
- /**
126
- * 2x2 Matrix
127
- * @module mat2
128
- */
129
- /**
130
- * Creates a new identity mat2
131
- *
132
- * @returns {mat2} a new 2x2 matrix
133
- */
134
- export function create(): mat2;
135
- /**
136
- * Creates a new mat2 initialized with values from an existing matrix
137
- *
138
- * @param {ReadonlyMat2} a matrix to clone
139
- * @returns {mat2} a new 2x2 matrix
140
- */
141
- export function clone(a: ReadonlyMat2): mat2;
142
- /**
143
- * Copy the values from one mat2 to another
144
- *
145
- * @param {mat2} out the receiving matrix
146
- * @param {ReadonlyMat2} a the source matrix
147
- * @returns {mat2} out
148
- */
149
- export function copy(out: mat2, a: ReadonlyMat2): mat2;
150
- /**
151
- * Set a mat2 to the identity matrix
152
- *
153
- * @param {mat2} out the receiving matrix
154
- * @returns {mat2} out
155
- */
156
- export function identity(out: mat2): mat2;
157
- /**
158
- * Create a new mat2 with the given values
159
- *
160
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
161
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
162
- * @param {Number} m10 Component in column 1, row 0 position (index 2)
163
- * @param {Number} m11 Component in column 1, row 1 position (index 3)
164
- * @returns {mat2} out A new 2x2 matrix
165
- */
166
- export function fromValues(m00: number, m01: number, m10: number, m11: number): mat2;
167
- /**
168
- * Set the components of a mat2 to the given values
169
- *
170
- * @param {mat2} out the receiving matrix
171
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
172
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
173
- * @param {Number} m10 Component in column 1, row 0 position (index 2)
174
- * @param {Number} m11 Component in column 1, row 1 position (index 3)
175
- * @returns {mat2} out
176
- */
177
- export function set(out: mat2, m00: number, m01: number, m10: number, m11: number): mat2;
178
- /**
179
- * Transpose the values of a mat2
180
- *
181
- * @param {mat2} out the receiving matrix
182
- * @param {ReadonlyMat2} a the source matrix
183
- * @returns {mat2} out
184
- */
185
- export function transpose(out: mat2, a: ReadonlyMat2): mat2;
186
- /**
187
- * Inverts a mat2
188
- *
189
- * @param {mat2} out the receiving matrix
190
- * @param {ReadonlyMat2} a the source matrix
191
- * @returns {mat2} out
192
- */
193
- export function invert(out: mat2, a: ReadonlyMat2): mat2;
194
- /**
195
- * Calculates the adjugate of a mat2
196
- *
197
- * @param {mat2} out the receiving matrix
198
- * @param {ReadonlyMat2} a the source matrix
199
- * @returns {mat2} out
200
- */
201
- export function adjoint(out: mat2, a: ReadonlyMat2): mat2;
202
- /**
203
- * Calculates the determinant of a mat2
204
- *
205
- * @param {ReadonlyMat2} a the source matrix
206
- * @returns {Number} determinant of a
207
- */
208
- export function determinant(a: ReadonlyMat2): number;
209
- /**
210
- * Multiplies two mat2's
211
- *
212
- * @param {mat2} out the receiving matrix
213
- * @param {ReadonlyMat2} a the first operand
214
- * @param {ReadonlyMat2} b the second operand
215
- * @returns {mat2} out
216
- */
217
- export function multiply(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2;
218
- /**
219
- * Rotates a mat2 by the given angle
220
- *
221
- * @param {mat2} out the receiving matrix
222
- * @param {ReadonlyMat2} a the matrix to rotate
223
- * @param {Number} rad the angle to rotate the matrix by
224
- * @returns {mat2} out
225
- */
226
- export function rotate(out: mat2, a: ReadonlyMat2, rad: number): mat2;
227
- /**
228
- * Scales the mat2 by the dimensions in the given vec2
229
- *
230
- * @param {mat2} out the receiving matrix
231
- * @param {ReadonlyMat2} a the matrix to rotate
232
- * @param {ReadonlyVec2} v the vec2 to scale the matrix by
233
- * @returns {mat2} out
234
- **/
235
- export function scale(out: mat2, a: ReadonlyMat2, v: ReadonlyVec2): mat2;
236
- /**
237
- * Creates a matrix from a given angle
238
- * This is equivalent to (but much faster than):
239
- *
240
- * mat2.identity(dest);
241
- * mat2.rotate(dest, dest, rad);
242
- *
243
- * @param {mat2} out mat2 receiving operation result
244
- * @param {Number} rad the angle to rotate the matrix by
245
- * @returns {mat2} out
246
- */
247
- export function fromRotation(out: mat2, rad: number): mat2;
248
- /**
249
- * Creates a matrix from a vector scaling
250
- * This is equivalent to (but much faster than):
251
- *
252
- * mat2.identity(dest);
253
- * mat2.scale(dest, dest, vec);
254
- *
255
- * @param {mat2} out mat2 receiving operation result
256
- * @param {ReadonlyVec2} v Scaling vector
257
- * @returns {mat2} out
258
- */
259
- export function fromScaling(out: mat2, v: ReadonlyVec2): mat2;
260
- /**
261
- * Returns a string representation of a mat2
262
- *
263
- * @param {ReadonlyMat2} a matrix to represent as a string
264
- * @returns {String} string representation of the matrix
265
- */
266
- export function str(a: ReadonlyMat2): string;
267
- /**
268
- * Returns Frobenius norm of a mat2
269
- *
270
- * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of
271
- * @returns {Number} Frobenius norm
272
- */
273
- export function frob(a: ReadonlyMat2): number;
274
- /**
275
- * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix
276
- * @param {ReadonlyMat2} L the lower triangular matrix
277
- * @param {ReadonlyMat2} D the diagonal matrix
278
- * @param {ReadonlyMat2} U the upper triangular matrix
279
- * @param {ReadonlyMat2} a the input matrix to factorize
280
- */
281
- export function LDU(L: ReadonlyMat2, D: ReadonlyMat2, U: ReadonlyMat2, a: ReadonlyMat2): ReadonlyMat2[];
282
- /**
283
- * Adds two mat2's
284
- *
285
- * @param {mat2} out the receiving matrix
286
- * @param {ReadonlyMat2} a the first operand
287
- * @param {ReadonlyMat2} b the second operand
288
- * @returns {mat2} out
289
- */
290
- export function add(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2;
291
- /**
292
- * Subtracts matrix b from matrix a
293
- *
294
- * @param {mat2} out the receiving matrix
295
- * @param {ReadonlyMat2} a the first operand
296
- * @param {ReadonlyMat2} b the second operand
297
- * @returns {mat2} out
298
- */
299
- export function subtract(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2;
300
- /**
301
- * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
302
- *
303
- * @param {ReadonlyMat2} a The first matrix.
304
- * @param {ReadonlyMat2} b The second matrix.
305
- * @returns {Boolean} True if the matrices are equal, false otherwise.
306
- */
307
- export function exactEquals(a: ReadonlyMat2, b: ReadonlyMat2): boolean;
308
- /**
309
- * Returns whether or not the matrices have approximately the same elements in the same position.
310
- *
311
- * @param {ReadonlyMat2} a The first matrix.
312
- * @param {ReadonlyMat2} b The second matrix.
313
- * @returns {Boolean} True if the matrices are equal, false otherwise.
314
- */
315
- export function equals(a: ReadonlyMat2, b: ReadonlyMat2): boolean;
316
- /**
317
- * Multiply each element of the matrix by a scalar.
318
- *
319
- * @param {mat2} out the receiving matrix
320
- * @param {ReadonlyMat2} a the matrix to scale
321
- * @param {Number} b amount to scale the matrix's elements by
322
- * @returns {mat2} out
323
- */
324
- export function multiplyScalar(out: mat2, a: ReadonlyMat2, b: number): mat2;
325
- /**
326
- * Adds two mat2's after multiplying each element of the second operand by a scalar value.
327
- *
328
- * @param {mat2} out the receiving vector
329
- * @param {ReadonlyMat2} a the first operand
330
- * @param {ReadonlyMat2} b the second operand
331
- * @param {Number} scale the amount to scale b's elements by before adding
332
- * @returns {mat2} out
333
- */
334
- export function multiplyScalarAndAdd(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2, scale: number): mat2;
335
- /**
336
- * Multiplies two mat2's
337
- *
338
- * @param {mat2} out the receiving matrix
339
- * @param {ReadonlyMat2} a the first operand
340
- * @param {ReadonlyMat2} b the second operand
341
- * @returns {mat2} out
342
- */
343
- export function mul(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2;
344
- /**
345
- * Subtracts matrix b from matrix a
346
- *
347
- * @param {mat2} out the receiving matrix
348
- * @param {ReadonlyMat2} a the first operand
349
- * @param {ReadonlyMat2} b the second operand
350
- * @returns {mat2} out
351
- */
352
- export function sub(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2;
353
- }
354
- export module mat2d {
355
- /**
356
- * 2x3 Matrix
357
- * @module mat2d
358
- * @description
359
- * A mat2d contains six elements defined as:
360
- * <pre>
361
- * [a, b,
362
- * c, d,
363
- * tx, ty]
364
- * </pre>
365
- * This is a short form for the 3x3 matrix:
366
- * <pre>
367
- * [a, b, 0,
368
- * c, d, 0,
369
- * tx, ty, 1]
370
- * </pre>
371
- * The last column is ignored so the array is shorter and operations are faster.
372
- */
373
- /**
374
- * Creates a new identity mat2d
375
- *
376
- * @returns {mat2d} a new 2x3 matrix
377
- */
378
- export function create(): mat2d;
379
- /**
380
- * Creates a new mat2d initialized with values from an existing matrix
381
- *
382
- * @param {ReadonlyMat2d} a matrix to clone
383
- * @returns {mat2d} a new 2x3 matrix
384
- */
385
- export function clone(a: ReadonlyMat2d): mat2d;
386
- /**
387
- * Copy the values from one mat2d to another
388
- *
389
- * @param {mat2d} out the receiving matrix
390
- * @param {ReadonlyMat2d} a the source matrix
391
- * @returns {mat2d} out
392
- */
393
- export function copy(out: mat2d, a: ReadonlyMat2d): mat2d;
394
- /**
395
- * Set a mat2d to the identity matrix
396
- *
397
- * @param {mat2d} out the receiving matrix
398
- * @returns {mat2d} out
399
- */
400
- export function identity(out: mat2d): mat2d;
401
- /**
402
- * Create a new mat2d with the given values
403
- *
404
- * @param {Number} a Component A (index 0)
405
- * @param {Number} b Component B (index 1)
406
- * @param {Number} c Component C (index 2)
407
- * @param {Number} d Component D (index 3)
408
- * @param {Number} tx Component TX (index 4)
409
- * @param {Number} ty Component TY (index 5)
410
- * @returns {mat2d} A new mat2d
411
- */
412
- export function fromValues(a: number, b: number, c: number, d: number, tx: number, ty: number): mat2d;
413
- /**
414
- * Set the components of a mat2d to the given values
415
- *
416
- * @param {mat2d} out the receiving matrix
417
- * @param {Number} a Component A (index 0)
418
- * @param {Number} b Component B (index 1)
419
- * @param {Number} c Component C (index 2)
420
- * @param {Number} d Component D (index 3)
421
- * @param {Number} tx Component TX (index 4)
422
- * @param {Number} ty Component TY (index 5)
423
- * @returns {mat2d} out
424
- */
425
- export function set(out: mat2d, a: number, b: number, c: number, d: number, tx: number, ty: number): mat2d;
426
- /**
427
- * Inverts a mat2d
428
- *
429
- * @param {mat2d} out the receiving matrix
430
- * @param {ReadonlyMat2d} a the source matrix
431
- * @returns {mat2d} out
432
- */
433
- export function invert(out: mat2d, a: ReadonlyMat2d): mat2d;
434
- /**
435
- * Calculates the determinant of a mat2d
436
- *
437
- * @param {ReadonlyMat2d} a the source matrix
438
- * @returns {Number} determinant of a
439
- */
440
- export function determinant(a: ReadonlyMat2d): number;
441
- /**
442
- * Multiplies two mat2d's
443
- *
444
- * @param {mat2d} out the receiving matrix
445
- * @param {ReadonlyMat2d} a the first operand
446
- * @param {ReadonlyMat2d} b the second operand
447
- * @returns {mat2d} out
448
- */
449
- export function multiply(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d;
450
- /**
451
- * Rotates a mat2d by the given angle
452
- *
453
- * @param {mat2d} out the receiving matrix
454
- * @param {ReadonlyMat2d} a the matrix to rotate
455
- * @param {Number} rad the angle to rotate the matrix by
456
- * @returns {mat2d} out
457
- */
458
- export function rotate(out: mat2d, a: ReadonlyMat2d, rad: number): mat2d;
459
- /**
460
- * Scales the mat2d by the dimensions in the given vec2
461
- *
462
- * @param {mat2d} out the receiving matrix
463
- * @param {ReadonlyMat2d} a the matrix to translate
464
- * @param {ReadonlyVec2} v the vec2 to scale the matrix by
465
- * @returns {mat2d} out
466
- **/
467
- export function scale(out: mat2d, a: ReadonlyMat2d, v: ReadonlyVec2): mat2d;
468
- /**
469
- * Translates the mat2d by the dimensions in the given vec2
470
- *
471
- * @param {mat2d} out the receiving matrix
472
- * @param {ReadonlyMat2d} a the matrix to translate
473
- * @param {ReadonlyVec2} v the vec2 to translate the matrix by
474
- * @returns {mat2d} out
475
- **/
476
- export function translate(out: mat2d, a: ReadonlyMat2d, v: ReadonlyVec2): mat2d;
477
- /**
478
- * Creates a matrix from a given angle
479
- * This is equivalent to (but much faster than):
480
- *
481
- * mat2d.identity(dest);
482
- * mat2d.rotate(dest, dest, rad);
483
- *
484
- * @param {mat2d} out mat2d receiving operation result
485
- * @param {Number} rad the angle to rotate the matrix by
486
- * @returns {mat2d} out
487
- */
488
- export function fromRotation(out: mat2d, rad: number): mat2d;
489
- /**
490
- * Creates a matrix from a vector scaling
491
- * This is equivalent to (but much faster than):
492
- *
493
- * mat2d.identity(dest);
494
- * mat2d.scale(dest, dest, vec);
495
- *
496
- * @param {mat2d} out mat2d receiving operation result
497
- * @param {ReadonlyVec2} v Scaling vector
498
- * @returns {mat2d} out
499
- */
500
- export function fromScaling(out: mat2d, v: ReadonlyVec2): mat2d;
501
- /**
502
- * Creates a matrix from a vector translation
503
- * This is equivalent to (but much faster than):
504
- *
505
- * mat2d.identity(dest);
506
- * mat2d.translate(dest, dest, vec);
507
- *
508
- * @param {mat2d} out mat2d receiving operation result
509
- * @param {ReadonlyVec2} v Translation vector
510
- * @returns {mat2d} out
511
- */
512
- export function fromTranslation(out: mat2d, v: ReadonlyVec2): mat2d;
513
- /**
514
- * Returns a string representation of a mat2d
515
- *
516
- * @param {ReadonlyMat2d} a matrix to represent as a string
517
- * @returns {String} string representation of the matrix
518
- */
519
- export function str(a: ReadonlyMat2d): string;
520
- /**
521
- * Returns Frobenius norm of a mat2d
522
- *
523
- * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of
524
- * @returns {Number} Frobenius norm
525
- */
526
- export function frob(a: ReadonlyMat2d): number;
527
- /**
528
- * Adds two mat2d's
529
- *
530
- * @param {mat2d} out the receiving matrix
531
- * @param {ReadonlyMat2d} a the first operand
532
- * @param {ReadonlyMat2d} b the second operand
533
- * @returns {mat2d} out
534
- */
535
- export function add(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d;
536
- /**
537
- * Subtracts matrix b from matrix a
538
- *
539
- * @param {mat2d} out the receiving matrix
540
- * @param {ReadonlyMat2d} a the first operand
541
- * @param {ReadonlyMat2d} b the second operand
542
- * @returns {mat2d} out
543
- */
544
- export function subtract(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d;
545
- /**
546
- * Multiply each element of the matrix by a scalar.
547
- *
548
- * @param {mat2d} out the receiving matrix
549
- * @param {ReadonlyMat2d} a the matrix to scale
550
- * @param {Number} b amount to scale the matrix's elements by
551
- * @returns {mat2d} out
552
- */
553
- export function multiplyScalar(out: mat2d, a: ReadonlyMat2d, b: number): mat2d;
554
- /**
555
- * Adds two mat2d's after multiplying each element of the second operand by a scalar value.
556
- *
557
- * @param {mat2d} out the receiving vector
558
- * @param {ReadonlyMat2d} a the first operand
559
- * @param {ReadonlyMat2d} b the second operand
560
- * @param {Number} scale the amount to scale b's elements by before adding
561
- * @returns {mat2d} out
562
- */
563
- export function multiplyScalarAndAdd(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d, scale: number): mat2d;
564
- /**
565
- * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
566
- *
567
- * @param {ReadonlyMat2d} a The first matrix.
568
- * @param {ReadonlyMat2d} b The second matrix.
569
- * @returns {Boolean} True if the matrices are equal, false otherwise.
570
- */
571
- export function exactEquals(a: ReadonlyMat2d, b: ReadonlyMat2d): boolean;
572
- /**
573
- * Returns whether or not the matrices have approximately the same elements in the same position.
574
- *
575
- * @param {ReadonlyMat2d} a The first matrix.
576
- * @param {ReadonlyMat2d} b The second matrix.
577
- * @returns {Boolean} True if the matrices are equal, false otherwise.
578
- */
579
- export function equals(a: ReadonlyMat2d, b: ReadonlyMat2d): boolean;
580
- /**
581
- * Multiplies two mat2d's
582
- *
583
- * @param {mat2d} out the receiving matrix
584
- * @param {ReadonlyMat2d} a the first operand
585
- * @param {ReadonlyMat2d} b the second operand
586
- * @returns {mat2d} out
587
- */
588
- export function mul(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d;
589
- /**
590
- * Subtracts matrix b from matrix a
591
- *
592
- * @param {mat2d} out the receiving matrix
593
- * @param {ReadonlyMat2d} a the first operand
594
- * @param {ReadonlyMat2d} b the second operand
595
- * @returns {mat2d} out
596
- */
597
- export function sub(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d;
598
- }
599
- export module mat3 {
600
- /**
601
- * 3x3 Matrix
602
- * @module mat3
603
- */
604
- /**
605
- * Creates a new identity mat3
606
- *
607
- * @returns {mat3} a new 3x3 matrix
608
- */
609
- export function create(): mat3;
610
- /**
611
- * Copies the upper-left 3x3 values into the given mat3.
612
- *
613
- * @param {mat3} out the receiving 3x3 matrix
614
- * @param {ReadonlyMat4} a the source 4x4 matrix
615
- * @returns {mat3} out
616
- */
617
- export function fromMat4(out: mat3, a: ReadonlyMat4): mat3;
618
- /**
619
- * Creates a new mat3 initialized with values from an existing matrix
620
- *
621
- * @param {ReadonlyMat3} a matrix to clone
622
- * @returns {mat3} a new 3x3 matrix
623
- */
624
- export function clone(a: ReadonlyMat3): mat3;
625
- /**
626
- * Copy the values from one mat3 to another
627
- *
628
- * @param {mat3} out the receiving matrix
629
- * @param {ReadonlyMat3} a the source matrix
630
- * @returns {mat3} out
631
- */
632
- export function copy(out: mat3, a: ReadonlyMat3): mat3;
633
- /**
634
- * Create a new mat3 with the given values
635
- *
636
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
637
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
638
- * @param {Number} m02 Component in column 0, row 2 position (index 2)
639
- * @param {Number} m10 Component in column 1, row 0 position (index 3)
640
- * @param {Number} m11 Component in column 1, row 1 position (index 4)
641
- * @param {Number} m12 Component in column 1, row 2 position (index 5)
642
- * @param {Number} m20 Component in column 2, row 0 position (index 6)
643
- * @param {Number} m21 Component in column 2, row 1 position (index 7)
644
- * @param {Number} m22 Component in column 2, row 2 position (index 8)
645
- * @returns {mat3} A new mat3
646
- */
647
- export function fromValues(m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): mat3;
648
- /**
649
- * Set the components of a mat3 to the given values
650
- *
651
- * @param {mat3} out the receiving matrix
652
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
653
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
654
- * @param {Number} m02 Component in column 0, row 2 position (index 2)
655
- * @param {Number} m10 Component in column 1, row 0 position (index 3)
656
- * @param {Number} m11 Component in column 1, row 1 position (index 4)
657
- * @param {Number} m12 Component in column 1, row 2 position (index 5)
658
- * @param {Number} m20 Component in column 2, row 0 position (index 6)
659
- * @param {Number} m21 Component in column 2, row 1 position (index 7)
660
- * @param {Number} m22 Component in column 2, row 2 position (index 8)
661
- * @returns {mat3} out
662
- */
663
- export function set(out: mat3, m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): mat3;
664
- /**
665
- * Set a mat3 to the identity matrix
666
- *
667
- * @param {mat3} out the receiving matrix
668
- * @returns {mat3} out
669
- */
670
- export function identity(out: mat3): mat3;
671
- /**
672
- * Transpose the values of a mat3
673
- *
674
- * @param {mat3} out the receiving matrix
675
- * @param {ReadonlyMat3} a the source matrix
676
- * @returns {mat3} out
677
- */
678
- export function transpose(out: mat3, a: ReadonlyMat3): mat3;
679
- /**
680
- * Inverts a mat3
681
- *
682
- * @param {mat3} out the receiving matrix
683
- * @param {ReadonlyMat3} a the source matrix
684
- * @returns {mat3} out
685
- */
686
- export function invert(out: mat3, a: ReadonlyMat3): mat3;
687
- /**
688
- * Calculates the adjugate of a mat3
689
- *
690
- * @param {mat3} out the receiving matrix
691
- * @param {ReadonlyMat3} a the source matrix
692
- * @returns {mat3} out
693
- */
694
- export function adjoint(out: mat3, a: ReadonlyMat3): mat3;
695
- /**
696
- * Calculates the determinant of a mat3
697
- *
698
- * @param {ReadonlyMat3} a the source matrix
699
- * @returns {Number} determinant of a
700
- */
701
- export function determinant(a: ReadonlyMat3): number;
702
- /**
703
- * Multiplies two mat3's
704
- *
705
- * @param {mat3} out the receiving matrix
706
- * @param {ReadonlyMat3} a the first operand
707
- * @param {ReadonlyMat3} b the second operand
708
- * @returns {mat3} out
709
- */
710
- export function multiply(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3;
711
- /**
712
- * Translate a mat3 by the given vector
713
- *
714
- * @param {mat3} out the receiving matrix
715
- * @param {ReadonlyMat3} a the matrix to translate
716
- * @param {ReadonlyVec2} v vector to translate by
717
- * @returns {mat3} out
718
- */
719
- export function translate(out: mat3, a: ReadonlyMat3, v: ReadonlyVec2): mat3;
720
- /**
721
- * Rotates a mat3 by the given angle
722
- *
723
- * @param {mat3} out the receiving matrix
724
- * @param {ReadonlyMat3} a the matrix to rotate
725
- * @param {Number} rad the angle to rotate the matrix by
726
- * @returns {mat3} out
727
- */
728
- export function rotate(out: mat3, a: ReadonlyMat3, rad: number): mat3;
729
- /**
730
- * Scales the mat3 by the dimensions in the given vec2
731
- *
732
- * @param {mat3} out the receiving matrix
733
- * @param {ReadonlyMat3} a the matrix to rotate
734
- * @param {ReadonlyVec2} v the vec2 to scale the matrix by
735
- * @returns {mat3} out
736
- **/
737
- export function scale(out: mat3, a: ReadonlyMat3, v: ReadonlyVec2): mat3;
738
- /**
739
- * Creates a matrix from a vector translation
740
- * This is equivalent to (but much faster than):
741
- *
742
- * mat3.identity(dest);
743
- * mat3.translate(dest, dest, vec);
744
- *
745
- * @param {mat3} out mat3 receiving operation result
746
- * @param {ReadonlyVec2} v Translation vector
747
- * @returns {mat3} out
748
- */
749
- export function fromTranslation(out: mat3, v: ReadonlyVec2): mat3;
750
- /**
751
- * Creates a matrix from a given angle
752
- * This is equivalent to (but much faster than):
753
- *
754
- * mat3.identity(dest);
755
- * mat3.rotate(dest, dest, rad);
756
- *
757
- * @param {mat3} out mat3 receiving operation result
758
- * @param {Number} rad the angle to rotate the matrix by
759
- * @returns {mat3} out
760
- */
761
- export function fromRotation(out: mat3, rad: number): mat3;
762
- /**
763
- * Creates a matrix from a vector scaling
764
- * This is equivalent to (but much faster than):
765
- *
766
- * mat3.identity(dest);
767
- * mat3.scale(dest, dest, vec);
768
- *
769
- * @param {mat3} out mat3 receiving operation result
770
- * @param {ReadonlyVec2} v Scaling vector
771
- * @returns {mat3} out
772
- */
773
- export function fromScaling(out: mat3, v: ReadonlyVec2): mat3;
774
- /**
775
- * Copies the values from a mat2d into a mat3
776
- *
777
- * @param {mat3} out the receiving matrix
778
- * @param {ReadonlyMat2d} a the matrix to copy
779
- * @returns {mat3} out
780
- **/
781
- export function fromMat2d(out: mat3, a: ReadonlyMat2d): mat3;
782
- /**
783
- * Calculates a 3x3 matrix from the given quaternion
784
- *
785
- * @param {mat3} out mat3 receiving operation result
786
- * @param {ReadonlyQuat} q Quaternion to create matrix from
787
- *
788
- * @returns {mat3} out
789
- */
790
- export function fromQuat(out: mat3, q: ReadonlyQuat): mat3;
791
- /**
792
- * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix
793
- *
794
- * @param {mat3} out mat3 receiving operation result
795
- * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from
796
- *
797
- * @returns {mat3} out
798
- */
799
- export function normalFromMat4(out: mat3, a: ReadonlyMat4): mat3;
800
- /**
801
- * Generates a 2D projection matrix with the given bounds
802
- *
803
- * @param {mat3} out mat3 frustum matrix will be written into
804
- * @param {number} width Width of your gl context
805
- * @param {number} height Height of gl context
806
- * @returns {mat3} out
807
- */
808
- export function projection(out: mat3, width: number, height: number): mat3;
809
- /**
810
- * Returns a string representation of a mat3
811
- *
812
- * @param {ReadonlyMat3} a matrix to represent as a string
813
- * @returns {String} string representation of the matrix
814
- */
815
- export function str(a: ReadonlyMat3): string;
816
- /**
817
- * Returns Frobenius norm of a mat3
818
- *
819
- * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of
820
- * @returns {Number} Frobenius norm
821
- */
822
- export function frob(a: ReadonlyMat3): number;
823
- /**
824
- * Adds two mat3's
825
- *
826
- * @param {mat3} out the receiving matrix
827
- * @param {ReadonlyMat3} a the first operand
828
- * @param {ReadonlyMat3} b the second operand
829
- * @returns {mat3} out
830
- */
831
- export function add(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3;
832
- /**
833
- * Subtracts matrix b from matrix a
834
- *
835
- * @param {mat3} out the receiving matrix
836
- * @param {ReadonlyMat3} a the first operand
837
- * @param {ReadonlyMat3} b the second operand
838
- * @returns {mat3} out
839
- */
840
- export function subtract(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3;
841
- /**
842
- * Multiply each element of the matrix by a scalar.
843
- *
844
- * @param {mat3} out the receiving matrix
845
- * @param {ReadonlyMat3} a the matrix to scale
846
- * @param {Number} b amount to scale the matrix's elements by
847
- * @returns {mat3} out
848
- */
849
- export function multiplyScalar(out: mat3, a: ReadonlyMat3, b: number): mat3;
850
- /**
851
- * Adds two mat3's after multiplying each element of the second operand by a scalar value.
852
- *
853
- * @param {mat3} out the receiving vector
854
- * @param {ReadonlyMat3} a the first operand
855
- * @param {ReadonlyMat3} b the second operand
856
- * @param {Number} scale the amount to scale b's elements by before adding
857
- * @returns {mat3} out
858
- */
859
- export function multiplyScalarAndAdd(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3, scale: number): mat3;
860
- /**
861
- * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
862
- *
863
- * @param {ReadonlyMat3} a The first matrix.
864
- * @param {ReadonlyMat3} b The second matrix.
865
- * @returns {Boolean} True if the matrices are equal, false otherwise.
866
- */
867
- export function exactEquals(a: ReadonlyMat3, b: ReadonlyMat3): boolean;
868
- /**
869
- * Returns whether or not the matrices have approximately the same elements in the same position.
870
- *
871
- * @param {ReadonlyMat3} a The first matrix.
872
- * @param {ReadonlyMat3} b The second matrix.
873
- * @returns {Boolean} True if the matrices are equal, false otherwise.
874
- */
875
- export function equals(a: ReadonlyMat3, b: ReadonlyMat3): boolean;
876
- /**
877
- * Multiplies two mat3's
878
- *
879
- * @param {mat3} out the receiving matrix
880
- * @param {ReadonlyMat3} a the first operand
881
- * @param {ReadonlyMat3} b the second operand
882
- * @returns {mat3} out
883
- */
884
- export function mul(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3;
885
- /**
886
- * Subtracts matrix b from matrix a
887
- *
888
- * @param {mat3} out the receiving matrix
889
- * @param {ReadonlyMat3} a the first operand
890
- * @param {ReadonlyMat3} b the second operand
891
- * @returns {mat3} out
892
- */
893
- export function sub(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3;
894
- }
895
- export module mat4 {
896
- /**
897
- * 4x4 Matrix<br>Format: column-major, when typed out it looks like row-major<br>The matrices are being post multiplied.
898
- * @module mat4
899
- */
900
- /**
901
- * Creates a new identity mat4
902
- *
903
- * @returns {mat4} a new 4x4 matrix
904
- */
905
- export function create(): mat4;
906
- /**
907
- * Creates a new mat4 initialized with values from an existing matrix
908
- *
909
- * @param {ReadonlyMat4} a matrix to clone
910
- * @returns {mat4} a new 4x4 matrix
911
- */
912
- export function clone(a: ReadonlyMat4): mat4;
913
- /**
914
- * Copy the values from one mat4 to another
915
- *
916
- * @param {mat4} out the receiving matrix
917
- * @param {ReadonlyMat4} a the source matrix
918
- * @returns {mat4} out
919
- */
920
- export function copy(out: mat4, a: ReadonlyMat4): mat4;
921
- /**
922
- * Create a new mat4 with the given values
923
- *
924
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
925
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
926
- * @param {Number} m02 Component in column 0, row 2 position (index 2)
927
- * @param {Number} m03 Component in column 0, row 3 position (index 3)
928
- * @param {Number} m10 Component in column 1, row 0 position (index 4)
929
- * @param {Number} m11 Component in column 1, row 1 position (index 5)
930
- * @param {Number} m12 Component in column 1, row 2 position (index 6)
931
- * @param {Number} m13 Component in column 1, row 3 position (index 7)
932
- * @param {Number} m20 Component in column 2, row 0 position (index 8)
933
- * @param {Number} m21 Component in column 2, row 1 position (index 9)
934
- * @param {Number} m22 Component in column 2, row 2 position (index 10)
935
- * @param {Number} m23 Component in column 2, row 3 position (index 11)
936
- * @param {Number} m30 Component in column 3, row 0 position (index 12)
937
- * @param {Number} m31 Component in column 3, row 1 position (index 13)
938
- * @param {Number} m32 Component in column 3, row 2 position (index 14)
939
- * @param {Number} m33 Component in column 3, row 3 position (index 15)
940
- * @returns {mat4} A new mat4
941
- */
942
- export function fromValues(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number): mat4;
943
- /**
944
- * Set the components of a mat4 to the given values
945
- *
946
- * @param {mat4} out the receiving matrix
947
- * @param {Number} m00 Component in column 0, row 0 position (index 0)
948
- * @param {Number} m01 Component in column 0, row 1 position (index 1)
949
- * @param {Number} m02 Component in column 0, row 2 position (index 2)
950
- * @param {Number} m03 Component in column 0, row 3 position (index 3)
951
- * @param {Number} m10 Component in column 1, row 0 position (index 4)
952
- * @param {Number} m11 Component in column 1, row 1 position (index 5)
953
- * @param {Number} m12 Component in column 1, row 2 position (index 6)
954
- * @param {Number} m13 Component in column 1, row 3 position (index 7)
955
- * @param {Number} m20 Component in column 2, row 0 position (index 8)
956
- * @param {Number} m21 Component in column 2, row 1 position (index 9)
957
- * @param {Number} m22 Component in column 2, row 2 position (index 10)
958
- * @param {Number} m23 Component in column 2, row 3 position (index 11)
959
- * @param {Number} m30 Component in column 3, row 0 position (index 12)
960
- * @param {Number} m31 Component in column 3, row 1 position (index 13)
961
- * @param {Number} m32 Component in column 3, row 2 position (index 14)
962
- * @param {Number} m33 Component in column 3, row 3 position (index 15)
963
- * @returns {mat4} out
964
- */
965
- export function set(out: mat4, m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number): mat4;
966
- /**
967
- * Set a mat4 to the identity matrix
968
- *
969
- * @param {mat4} out the receiving matrix
970
- * @returns {mat4} out
971
- */
972
- export function identity(out: mat4): mat4;
973
- /**
974
- * Transpose the values of a mat4
975
- *
976
- * @param {mat4} out the receiving matrix
977
- * @param {ReadonlyMat4} a the source matrix
978
- * @returns {mat4} out
979
- */
980
- export function transpose(out: mat4, a: ReadonlyMat4): mat4;
981
- /**
982
- * Inverts a mat4
983
- *
984
- * @param {mat4} out the receiving matrix
985
- * @param {ReadonlyMat4} a the source matrix
986
- * @returns {mat4} out
987
- */
988
- export function invert(out: mat4, a: ReadonlyMat4): mat4;
989
- /**
990
- * Calculates the adjugate of a mat4
991
- *
992
- * @param {mat4} out the receiving matrix
993
- * @param {ReadonlyMat4} a the source matrix
994
- * @returns {mat4} out
995
- */
996
- export function adjoint(out: mat4, a: ReadonlyMat4): mat4;
997
- /**
998
- * Calculates the determinant of a mat4
999
- *
1000
- * @param {ReadonlyMat4} a the source matrix
1001
- * @returns {Number} determinant of a
1002
- */
1003
- export function determinant(a: ReadonlyMat4): number;
1004
- /**
1005
- * Multiplies two mat4s
1006
- *
1007
- * @param {mat4} out the receiving matrix
1008
- * @param {ReadonlyMat4} a the first operand
1009
- * @param {ReadonlyMat4} b the second operand
1010
- * @returns {mat4} out
1011
- */
1012
- export function multiply(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4;
1013
- /**
1014
- * Translate a mat4 by the given vector
1015
- *
1016
- * @param {mat4} out the receiving matrix
1017
- * @param {ReadonlyMat4} a the matrix to translate
1018
- * @param {ReadonlyVec3} v vector to translate by
1019
- * @returns {mat4} out
1020
- */
1021
- export function translate(out: mat4, a: ReadonlyMat4, v: ReadonlyVec3): mat4;
1022
- /**
1023
- * Scales the mat4 by the dimensions in the given vec3 not using vectorization
1024
- *
1025
- * @param {mat4} out the receiving matrix
1026
- * @param {ReadonlyMat4} a the matrix to scale
1027
- * @param {ReadonlyVec3} v the vec3 to scale the matrix by
1028
- * @returns {mat4} out
1029
- **/
1030
- export function scale(out: mat4, a: ReadonlyMat4, v: ReadonlyVec3): mat4;
1031
- /**
1032
- * Rotates a mat4 by the given angle around the given axis
1033
- *
1034
- * @param {mat4} out the receiving matrix
1035
- * @param {ReadonlyMat4} a the matrix to rotate
1036
- * @param {Number} rad the angle to rotate the matrix by
1037
- * @param {ReadonlyVec3} axis the axis to rotate around
1038
- * @returns {mat4} out
1039
- */
1040
- export function rotate(out: mat4, a: ReadonlyMat4, rad: number, axis: ReadonlyVec3): mat4;
1041
- /**
1042
- * Rotates a matrix by the given angle around the X axis
1043
- *
1044
- * @param {mat4} out the receiving matrix
1045
- * @param {ReadonlyMat4} a the matrix to rotate
1046
- * @param {Number} rad the angle to rotate the matrix by
1047
- * @returns {mat4} out
1048
- */
1049
- export function rotateX(out: mat4, a: ReadonlyMat4, rad: number): mat4;
1050
- /**
1051
- * Rotates a matrix by the given angle around the Y axis
1052
- *
1053
- * @param {mat4} out the receiving matrix
1054
- * @param {ReadonlyMat4} a the matrix to rotate
1055
- * @param {Number} rad the angle to rotate the matrix by
1056
- * @returns {mat4} out
1057
- */
1058
- export function rotateY(out: mat4, a: ReadonlyMat4, rad: number): mat4;
1059
- /**
1060
- * Rotates a matrix by the given angle around the Z axis
1061
- *
1062
- * @param {mat4} out the receiving matrix
1063
- * @param {ReadonlyMat4} a the matrix to rotate
1064
- * @param {Number} rad the angle to rotate the matrix by
1065
- * @returns {mat4} out
1066
- */
1067
- export function rotateZ(out: mat4, a: ReadonlyMat4, rad: number): mat4;
1068
- /**
1069
- * Creates a matrix from a vector translation
1070
- * This is equivalent to (but much faster than):
1071
- *
1072
- * mat4.identity(dest);
1073
- * mat4.translate(dest, dest, vec);
1074
- *
1075
- * @param {mat4} out mat4 receiving operation result
1076
- * @param {ReadonlyVec3} v Translation vector
1077
- * @returns {mat4} out
1078
- */
1079
- export function fromTranslation(out: mat4, v: ReadonlyVec3): mat4;
1080
- /**
1081
- * Creates a matrix from a vector scaling
1082
- * This is equivalent to (but much faster than):
1083
- *
1084
- * mat4.identity(dest);
1085
- * mat4.scale(dest, dest, vec);
1086
- *
1087
- * @param {mat4} out mat4 receiving operation result
1088
- * @param {ReadonlyVec3} v Scaling vector
1089
- * @returns {mat4} out
1090
- */
1091
- export function fromScaling(out: mat4, v: ReadonlyVec3): mat4;
1092
- /**
1093
- * Creates a matrix from a given angle around a given axis
1094
- * This is equivalent to (but much faster than):
1095
- *
1096
- * mat4.identity(dest);
1097
- * mat4.rotate(dest, dest, rad, axis);
1098
- *
1099
- * @param {mat4} out mat4 receiving operation result
1100
- * @param {Number} rad the angle to rotate the matrix by
1101
- * @param {ReadonlyVec3} axis the axis to rotate around
1102
- * @returns {mat4} out
1103
- */
1104
- export function fromRotation(out: mat4, rad: number, axis: ReadonlyVec3): mat4;
1105
- /**
1106
- * Creates a matrix from the given angle around the X axis
1107
- * This is equivalent to (but much faster than):
1108
- *
1109
- * mat4.identity(dest);
1110
- * mat4.rotateX(dest, dest, rad);
1111
- *
1112
- * @param {mat4} out mat4 receiving operation result
1113
- * @param {Number} rad the angle to rotate the matrix by
1114
- * @returns {mat4} out
1115
- */
1116
- export function fromXRotation(out: mat4, rad: number): mat4;
1117
- /**
1118
- * Creates a matrix from the given angle around the Y axis
1119
- * This is equivalent to (but much faster than):
1120
- *
1121
- * mat4.identity(dest);
1122
- * mat4.rotateY(dest, dest, rad);
1123
- *
1124
- * @param {mat4} out mat4 receiving operation result
1125
- * @param {Number} rad the angle to rotate the matrix by
1126
- * @returns {mat4} out
1127
- */
1128
- export function fromYRotation(out: mat4, rad: number): mat4;
1129
- /**
1130
- * Creates a matrix from the given angle around the Z axis
1131
- * This is equivalent to (but much faster than):
1132
- *
1133
- * mat4.identity(dest);
1134
- * mat4.rotateZ(dest, dest, rad);
1135
- *
1136
- * @param {mat4} out mat4 receiving operation result
1137
- * @param {Number} rad the angle to rotate the matrix by
1138
- * @returns {mat4} out
1139
- */
1140
- export function fromZRotation(out: mat4, rad: number): mat4;
1141
- /**
1142
- * Creates a matrix from a quaternion rotation and vector translation
1143
- * This is equivalent to (but much faster than):
1144
- *
1145
- * mat4.identity(dest);
1146
- * mat4.translate(dest, vec);
1147
- * let quatMat = mat4.create();
1148
- * quat4.toMat4(quat, quatMat);
1149
- * mat4.multiply(dest, quatMat);
1150
- *
1151
- * @param {mat4} out mat4 receiving operation result
1152
- * @param {quat4} q Rotation quaternion
1153
- * @param {ReadonlyVec3} v Translation vector
1154
- * @returns {mat4} out
1155
- */
1156
- export function fromRotationTranslation(out: mat4, q: any, v: ReadonlyVec3): mat4;
1157
- /**
1158
- * Creates a new mat4 from a dual quat.
1159
- *
1160
- * @param {mat4} out Matrix
1161
- * @param {ReadonlyQuat2} a Dual Quaternion
1162
- * @returns {mat4} mat4 receiving operation result
1163
- */
1164
- export function fromQuat2(out: mat4, a: ReadonlyQuat2): mat4;
1165
- /**
1166
- * Returns the translation vector component of a transformation
1167
- * matrix. If a matrix is built with fromRotationTranslation,
1168
- * the returned vector will be the same as the translation vector
1169
- * originally supplied.
1170
- * @param {vec3} out Vector to receive translation component
1171
- * @param {ReadonlyMat4} mat Matrix to be decomposed (input)
1172
- * @return {vec3} out
1173
- */
1174
- export function getTranslation(out: vec3, mat: ReadonlyMat4): vec3;
1175
- /**
1176
- * Returns the scaling factor component of a transformation
1177
- * matrix. If a matrix is built with fromRotationTranslationScale
1178
- * with a normalized Quaternion paramter, the returned vector will be
1179
- * the same as the scaling vector
1180
- * originally supplied.
1181
- * @param {vec3} out Vector to receive scaling factor component
1182
- * @param {ReadonlyMat4} mat Matrix to be decomposed (input)
1183
- * @return {vec3} out
1184
- */
1185
- export function getScaling(out: vec3, mat: ReadonlyMat4): vec3;
1186
- /**
1187
- * Returns a quaternion representing the rotational component
1188
- * of a transformation matrix. If a matrix is built with
1189
- * fromRotationTranslation, the returned quaternion will be the
1190
- * same as the quaternion originally supplied.
1191
- * @param {quat} out Quaternion to receive the rotation component
1192
- * @param {ReadonlyMat4} mat Matrix to be decomposed (input)
1193
- * @return {quat} out
1194
- */
1195
- export function getRotation(out: quat, mat: ReadonlyMat4): quat;
1196
- /**
1197
- * Creates a matrix from a quaternion rotation, vector translation and vector scale
1198
- * This is equivalent to (but much faster than):
1199
- *
1200
- * mat4.identity(dest);
1201
- * mat4.translate(dest, vec);
1202
- * let quatMat = mat4.create();
1203
- * quat4.toMat4(quat, quatMat);
1204
- * mat4.multiply(dest, quatMat);
1205
- * mat4.scale(dest, scale)
1206
- *
1207
- * @param {mat4} out mat4 receiving operation result
1208
- * @param {quat4} q Rotation quaternion
1209
- * @param {ReadonlyVec3} v Translation vector
1210
- * @param {ReadonlyVec3} s Scaling vector
1211
- * @returns {mat4} out
1212
- */
1213
- export function fromRotationTranslationScale(out: mat4, q: any, v: ReadonlyVec3, s: ReadonlyVec3): mat4;
1214
- /**
1215
- * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin
1216
- * This is equivalent to (but much faster than):
1217
- *
1218
- * mat4.identity(dest);
1219
- * mat4.translate(dest, vec);
1220
- * mat4.translate(dest, origin);
1221
- * let quatMat = mat4.create();
1222
- * quat4.toMat4(quat, quatMat);
1223
- * mat4.multiply(dest, quatMat);
1224
- * mat4.scale(dest, scale)
1225
- * mat4.translate(dest, negativeOrigin);
1226
- *
1227
- * @param {mat4} out mat4 receiving operation result
1228
- * @param {quat4} q Rotation quaternion
1229
- * @param {ReadonlyVec3} v Translation vector
1230
- * @param {ReadonlyVec3} s Scaling vector
1231
- * @param {ReadonlyVec3} o The origin vector around which to scale and rotate
1232
- * @returns {mat4} out
1233
- */
1234
- export function fromRotationTranslationScaleOrigin(out: mat4, q: any, v: ReadonlyVec3, s: ReadonlyVec3, o: ReadonlyVec3): mat4;
1235
- /**
1236
- * Calculates a 4x4 matrix from the given quaternion
1237
- *
1238
- * @param {mat4} out mat4 receiving operation result
1239
- * @param {ReadonlyQuat} q Quaternion to create matrix from
1240
- *
1241
- * @returns {mat4} out
1242
- */
1243
- export function fromQuat(out: mat4, q: ReadonlyQuat): mat4;
1244
- /**
1245
- * Generates a frustum matrix with the given bounds
1246
- *
1247
- * @param {mat4} out mat4 frustum matrix will be written into
1248
- * @param {Number} left Left bound of the frustum
1249
- * @param {Number} right Right bound of the frustum
1250
- * @param {Number} bottom Bottom bound of the frustum
1251
- * @param {Number} top Top bound of the frustum
1252
- * @param {Number} near Near bound of the frustum
1253
- * @param {Number} far Far bound of the frustum
1254
- * @returns {mat4} out
1255
- */
1256
- export function frustum(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number): mat4;
1257
- /**
1258
- * Generates a perspective projection matrix with the given bounds.
1259
- * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],
1260
- * which matches WebGL/OpenGL's clip volume.
1261
- * Passing null/undefined/no value for far will generate infinite projection matrix.
1262
- *
1263
- * @param {mat4} out mat4 frustum matrix will be written into
1264
- * @param {number} fovy Vertical field of view in radians
1265
- * @param {number} aspect Aspect ratio. typically viewport width/height
1266
- * @param {number} near Near bound of the frustum
1267
- * @param {number} far Far bound of the frustum, can be null or Infinity
1268
- * @returns {mat4} out
1269
- */
1270
- export function perspectiveNO(out: mat4, fovy: number, aspect: number, near: number, far: number): mat4;
1271
- /**
1272
- * Generates a perspective projection matrix suitable for WebGPU with the given bounds.
1273
- * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],
1274
- * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.
1275
- * Passing null/undefined/no value for far will generate infinite projection matrix.
1276
- *
1277
- * @param {mat4} out mat4 frustum matrix will be written into
1278
- * @param {number} fovy Vertical field of view in radians
1279
- * @param {number} aspect Aspect ratio. typically viewport width/height
1280
- * @param {number} near Near bound of the frustum
1281
- * @param {number} far Far bound of the frustum, can be null or Infinity
1282
- * @returns {mat4} out
1283
- */
1284
- export function perspectiveZO(out: mat4, fovy: number, aspect: number, near: number, far: number): mat4;
1285
- /**
1286
- * Generates a perspective projection matrix with the given field of view.
1287
- * This is primarily useful for generating projection matrices to be used
1288
- * with the still experiemental WebVR API.
1289
- *
1290
- * @param {mat4} out mat4 frustum matrix will be written into
1291
- * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees
1292
- * @param {number} near Near bound of the frustum
1293
- * @param {number} far Far bound of the frustum
1294
- * @returns {mat4} out
1295
- */
1296
- export function perspectiveFromFieldOfView(out: mat4, fov: any, near: number, far: number): mat4;
1297
- /**
1298
- * Generates a orthogonal projection matrix with the given bounds.
1299
- * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],
1300
- * which matches WebGL/OpenGL's clip volume.
1301
- *
1302
- * @param {mat4} out mat4 frustum matrix will be written into
1303
- * @param {number} left Left bound of the frustum
1304
- * @param {number} right Right bound of the frustum
1305
- * @param {number} bottom Bottom bound of the frustum
1306
- * @param {number} top Top bound of the frustum
1307
- * @param {number} near Near bound of the frustum
1308
- * @param {number} far Far bound of the frustum
1309
- * @returns {mat4} out
1310
- */
1311
- export function orthoNO(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number): mat4;
1312
- /**
1313
- * Generates a orthogonal projection matrix with the given bounds.
1314
- * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],
1315
- * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.
1316
- *
1317
- * @param {mat4} out mat4 frustum matrix will be written into
1318
- * @param {number} left Left bound of the frustum
1319
- * @param {number} right Right bound of the frustum
1320
- * @param {number} bottom Bottom bound of the frustum
1321
- * @param {number} top Top bound of the frustum
1322
- * @param {number} near Near bound of the frustum
1323
- * @param {number} far Far bound of the frustum
1324
- * @returns {mat4} out
1325
- */
1326
- export function orthoZO(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number): mat4;
1327
- /**
1328
- * Generates a look-at matrix with the given eye position, focal point, and up axis.
1329
- * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.
1330
- *
1331
- * @param {mat4} out mat4 frustum matrix will be written into
1332
- * @param {ReadonlyVec3} eye Position of the viewer
1333
- * @param {ReadonlyVec3} center Point the viewer is looking at
1334
- * @param {ReadonlyVec3} up vec3 pointing up
1335
- * @returns {mat4} out
1336
- */
1337
- export function lookAt(out: mat4, eye: ReadonlyVec3, center: ReadonlyVec3, up: ReadonlyVec3): mat4;
1338
- /**
1339
- * Generates a matrix that makes something look at something else.
1340
- *
1341
- * @param {mat4} out mat4 frustum matrix will be written into
1342
- * @param {ReadonlyVec3} eye Position of the viewer
1343
- * @param {ReadonlyVec3} center Point the viewer is looking at
1344
- * @param {ReadonlyVec3} up vec3 pointing up
1345
- * @returns {mat4} out
1346
- */
1347
- export function targetTo(out: mat4, eye: ReadonlyVec3, target: any, up: ReadonlyVec3): mat4;
1348
- /**
1349
- * Returns a string representation of a mat4
1350
- *
1351
- * @param {ReadonlyMat4} a matrix to represent as a string
1352
- * @returns {String} string representation of the matrix
1353
- */
1354
- export function str(a: ReadonlyMat4): string;
1355
- /**
1356
- * Returns Frobenius norm of a mat4
1357
- *
1358
- * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of
1359
- * @returns {Number} Frobenius norm
1360
- */
1361
- export function frob(a: ReadonlyMat4): number;
1362
- /**
1363
- * Adds two mat4's
1364
- *
1365
- * @param {mat4} out the receiving matrix
1366
- * @param {ReadonlyMat4} a the first operand
1367
- * @param {ReadonlyMat4} b the second operand
1368
- * @returns {mat4} out
1369
- */
1370
- export function add(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4;
1371
- /**
1372
- * Subtracts matrix b from matrix a
1373
- *
1374
- * @param {mat4} out the receiving matrix
1375
- * @param {ReadonlyMat4} a the first operand
1376
- * @param {ReadonlyMat4} b the second operand
1377
- * @returns {mat4} out
1378
- */
1379
- export function subtract(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4;
1380
- /**
1381
- * Multiply each element of the matrix by a scalar.
1382
- *
1383
- * @param {mat4} out the receiving matrix
1384
- * @param {ReadonlyMat4} a the matrix to scale
1385
- * @param {Number} b amount to scale the matrix's elements by
1386
- * @returns {mat4} out
1387
- */
1388
- export function multiplyScalar(out: mat4, a: ReadonlyMat4, b: number): mat4;
1389
- /**
1390
- * Adds two mat4's after multiplying each element of the second operand by a scalar value.
1391
- *
1392
- * @param {mat4} out the receiving vector
1393
- * @param {ReadonlyMat4} a the first operand
1394
- * @param {ReadonlyMat4} b the second operand
1395
- * @param {Number} scale the amount to scale b's elements by before adding
1396
- * @returns {mat4} out
1397
- */
1398
- export function multiplyScalarAndAdd(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4, scale: number): mat4;
1399
- /**
1400
- * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
1401
- *
1402
- * @param {ReadonlyMat4} a The first matrix.
1403
- * @param {ReadonlyMat4} b The second matrix.
1404
- * @returns {Boolean} True if the matrices are equal, false otherwise.
1405
- */
1406
- export function exactEquals(a: ReadonlyMat4, b: ReadonlyMat4): boolean;
1407
- /**
1408
- * Returns whether or not the matrices have approximately the same elements in the same position.
1409
- *
1410
- * @param {ReadonlyMat4} a The first matrix.
1411
- * @param {ReadonlyMat4} b The second matrix.
1412
- * @returns {Boolean} True if the matrices are equal, false otherwise.
1413
- */
1414
- export function equals(a: ReadonlyMat4, b: ReadonlyMat4): boolean;
1415
- /**
1416
- * Generates a perspective projection matrix with the given bounds.
1417
- * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],
1418
- * which matches WebGL/OpenGL's clip volume.
1419
- * Passing null/undefined/no value for far will generate infinite projection matrix.
1420
- *
1421
- * @param {mat4} out mat4 frustum matrix will be written into
1422
- * @param {number} fovy Vertical field of view in radians
1423
- * @param {number} aspect Aspect ratio. typically viewport width/height
1424
- * @param {number} near Near bound of the frustum
1425
- * @param {number} far Far bound of the frustum, can be null or Infinity
1426
- * @returns {mat4} out
1427
- */
1428
- export function perspective(out: mat4, fovy: number, aspect: number, near: number, far: number): mat4;
1429
- /**
1430
- * Generates a orthogonal projection matrix with the given bounds.
1431
- * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],
1432
- * which matches WebGL/OpenGL's clip volume.
1433
- *
1434
- * @param {mat4} out mat4 frustum matrix will be written into
1435
- * @param {number} left Left bound of the frustum
1436
- * @param {number} right Right bound of the frustum
1437
- * @param {number} bottom Bottom bound of the frustum
1438
- * @param {number} top Top bound of the frustum
1439
- * @param {number} near Near bound of the frustum
1440
- * @param {number} far Far bound of the frustum
1441
- * @returns {mat4} out
1442
- */
1443
- export function ortho(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number): mat4;
1444
- /**
1445
- * Multiplies two mat4s
1446
- *
1447
- * @param {mat4} out the receiving matrix
1448
- * @param {ReadonlyMat4} a the first operand
1449
- * @param {ReadonlyMat4} b the second operand
1450
- * @returns {mat4} out
1451
- */
1452
- export function mul(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4;
1453
- /**
1454
- * Subtracts matrix b from matrix a
1455
- *
1456
- * @param {mat4} out the receiving matrix
1457
- * @param {ReadonlyMat4} a the first operand
1458
- * @param {ReadonlyMat4} b the second operand
1459
- * @returns {mat4} out
1460
- */
1461
- export function sub(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4;
1462
- }
1463
- export module vec3 {
1464
- /**
1465
- * 3 Dimensional Vector
1466
- * @module vec3
1467
- */
1468
- /**
1469
- * Creates a new, empty vec3
1470
- *
1471
- * @returns {vec3} a new 3D vector
1472
- */
1473
- export function create(): vec3;
1474
- /**
1475
- * Creates a new vec3 initialized with values from an existing vector
1476
- *
1477
- * @param {ReadonlyVec3} a vector to clone
1478
- * @returns {vec3} a new 3D vector
1479
- */
1480
- export function clone(a: ReadonlyVec3): vec3;
1481
- /**
1482
- * Calculates the length of a vec3
1483
- *
1484
- * @param {ReadonlyVec3} a vector to calculate length of
1485
- * @returns {Number} length of a
1486
- */
1487
- export function length(a: ReadonlyVec3): number;
1488
- /**
1489
- * Creates a new vec3 initialized with the given values
1490
- *
1491
- * @param {Number} x X component
1492
- * @param {Number} y Y component
1493
- * @param {Number} z Z component
1494
- * @returns {vec3} a new 3D vector
1495
- */
1496
- export function fromValues(x: number, y: number, z: number): vec3;
1497
- /**
1498
- * Copy the values from one vec3 to another
1499
- *
1500
- * @param {vec3} out the receiving vector
1501
- * @param {ReadonlyVec3} a the source vector
1502
- * @returns {vec3} out
1503
- */
1504
- export function copy(out: vec3, a: ReadonlyVec3): vec3;
1505
- /**
1506
- * Set the components of a vec3 to the given values
1507
- *
1508
- * @param {vec3} out the receiving vector
1509
- * @param {Number} x X component
1510
- * @param {Number} y Y component
1511
- * @param {Number} z Z component
1512
- * @returns {vec3} out
1513
- */
1514
- export function set(out: vec3, x: number, y: number, z: number): vec3;
1515
- /**
1516
- * Adds two vec3's
1517
- *
1518
- * @param {vec3} out the receiving vector
1519
- * @param {ReadonlyVec3} a the first operand
1520
- * @param {ReadonlyVec3} b the second operand
1521
- * @returns {vec3} out
1522
- */
1523
- export function add(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3;
1524
- /**
1525
- * Subtracts vector b from vector a
1526
- *
1527
- * @param {vec3} out the receiving vector
1528
- * @param {ReadonlyVec3} a the first operand
1529
- * @param {ReadonlyVec3} b the second operand
1530
- * @returns {vec3} out
1531
- */
1532
- export function subtract(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3;
1533
- /**
1534
- * Multiplies two vec3's
1535
- *
1536
- * @param {vec3} out the receiving vector
1537
- * @param {ReadonlyVec3} a the first operand
1538
- * @param {ReadonlyVec3} b the second operand
1539
- * @returns {vec3} out
1540
- */
1541
- export function multiply(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3;
1542
- /**
1543
- * Divides two vec3's
1544
- *
1545
- * @param {vec3} out the receiving vector
1546
- * @param {ReadonlyVec3} a the first operand
1547
- * @param {ReadonlyVec3} b the second operand
1548
- * @returns {vec3} out
1549
- */
1550
- export function divide(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3;
1551
- /**
1552
- * Math.ceil the components of a vec3
1553
- *
1554
- * @param {vec3} out the receiving vector
1555
- * @param {ReadonlyVec3} a vector to ceil
1556
- * @returns {vec3} out
1557
- */
1558
- export function ceil(out: vec3, a: ReadonlyVec3): vec3;
1559
- /**
1560
- * Math.floor the components of a vec3
1561
- *
1562
- * @param {vec3} out the receiving vector
1563
- * @param {ReadonlyVec3} a vector to floor
1564
- * @returns {vec3} out
1565
- */
1566
- export function floor(out: vec3, a: ReadonlyVec3): vec3;
1567
- /**
1568
- * Returns the minimum of two vec3's
1569
- *
1570
- * @param {vec3} out the receiving vector
1571
- * @param {ReadonlyVec3} a the first operand
1572
- * @param {ReadonlyVec3} b the second operand
1573
- * @returns {vec3} out
1574
- */
1575
- export function min(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3;
1576
- /**
1577
- * Returns the maximum of two vec3's
1578
- *
1579
- * @param {vec3} out the receiving vector
1580
- * @param {ReadonlyVec3} a the first operand
1581
- * @param {ReadonlyVec3} b the second operand
1582
- * @returns {vec3} out
1583
- */
1584
- export function max(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3;
1585
- /**
1586
- * Math.round the components of a vec3
1587
- *
1588
- * @param {vec3} out the receiving vector
1589
- * @param {ReadonlyVec3} a vector to round
1590
- * @returns {vec3} out
1591
- */
1592
- export function round(out: vec3, a: ReadonlyVec3): vec3;
1593
- /**
1594
- * Scales a vec3 by a scalar number
1595
- *
1596
- * @param {vec3} out the receiving vector
1597
- * @param {ReadonlyVec3} a the vector to scale
1598
- * @param {Number} b amount to scale the vector by
1599
- * @returns {vec3} out
1600
- */
1601
- export function scale(out: vec3, a: ReadonlyVec3, b: number): vec3;
1602
- /**
1603
- * Adds two vec3's after scaling the second operand by a scalar value
1604
- *
1605
- * @param {vec3} out the receiving vector
1606
- * @param {ReadonlyVec3} a the first operand
1607
- * @param {ReadonlyVec3} b the second operand
1608
- * @param {Number} scale the amount to scale b by before adding
1609
- * @returns {vec3} out
1610
- */
1611
- export function scaleAndAdd(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, scale: number): vec3;
1612
- /**
1613
- * Calculates the euclidian distance between two vec3's
1614
- *
1615
- * @param {ReadonlyVec3} a the first operand
1616
- * @param {ReadonlyVec3} b the second operand
1617
- * @returns {Number} distance between a and b
1618
- */
1619
- export function distance(a: ReadonlyVec3, b: ReadonlyVec3): number;
1620
- /**
1621
- * Calculates the squared euclidian distance between two vec3's
1622
- *
1623
- * @param {ReadonlyVec3} a the first operand
1624
- * @param {ReadonlyVec3} b the second operand
1625
- * @returns {Number} squared distance between a and b
1626
- */
1627
- export function squaredDistance(a: ReadonlyVec3, b: ReadonlyVec3): number;
1628
- /**
1629
- * Calculates the squared length of a vec3
1630
- *
1631
- * @param {ReadonlyVec3} a vector to calculate squared length of
1632
- * @returns {Number} squared length of a
1633
- */
1634
- export function squaredLength(a: ReadonlyVec3): number;
1635
- /**
1636
- * Negates the components of a vec3
1637
- *
1638
- * @param {vec3} out the receiving vector
1639
- * @param {ReadonlyVec3} a vector to negate
1640
- * @returns {vec3} out
1641
- */
1642
- export function negate(out: vec3, a: ReadonlyVec3): vec3;
1643
- /**
1644
- * Returns the inverse of the components of a vec3
1645
- *
1646
- * @param {vec3} out the receiving vector
1647
- * @param {ReadonlyVec3} a vector to invert
1648
- * @returns {vec3} out
1649
- */
1650
- export function inverse(out: vec3, a: ReadonlyVec3): vec3;
1651
- /**
1652
- * Normalize a vec3
1653
- *
1654
- * @param {vec3} out the receiving vector
1655
- * @param {ReadonlyVec3} a vector to normalize
1656
- * @returns {vec3} out
1657
- */
1658
- export function normalize(out: vec3, a: ReadonlyVec3): vec3;
1659
- /**
1660
- * Calculates the dot product of two vec3's
1661
- *
1662
- * @param {ReadonlyVec3} a the first operand
1663
- * @param {ReadonlyVec3} b the second operand
1664
- * @returns {Number} dot product of a and b
1665
- */
1666
- export function dot(a: ReadonlyVec3, b: ReadonlyVec3): number;
1667
- /**
1668
- * Computes the cross product of two vec3's
1669
- *
1670
- * @param {vec3} out the receiving vector
1671
- * @param {ReadonlyVec3} a the first operand
1672
- * @param {ReadonlyVec3} b the second operand
1673
- * @returns {vec3} out
1674
- */
1675
- export function cross(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3;
1676
- /**
1677
- * Performs a linear interpolation between two vec3's
1678
- *
1679
- * @param {vec3} out the receiving vector
1680
- * @param {ReadonlyVec3} a the first operand
1681
- * @param {ReadonlyVec3} b the second operand
1682
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
1683
- * @returns {vec3} out
1684
- */
1685
- export function lerp(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, t: number): vec3;
1686
- /**
1687
- * Performs a hermite interpolation with two control points
1688
- *
1689
- * @param {vec3} out the receiving vector
1690
- * @param {ReadonlyVec3} a the first operand
1691
- * @param {ReadonlyVec3} b the second operand
1692
- * @param {ReadonlyVec3} c the third operand
1693
- * @param {ReadonlyVec3} d the fourth operand
1694
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
1695
- * @returns {vec3} out
1696
- */
1697
- export function hermite(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, c: ReadonlyVec3, d: ReadonlyVec3, t: number): vec3;
1698
- /**
1699
- * Performs a bezier interpolation with two control points
1700
- *
1701
- * @param {vec3} out the receiving vector
1702
- * @param {ReadonlyVec3} a the first operand
1703
- * @param {ReadonlyVec3} b the second operand
1704
- * @param {ReadonlyVec3} c the third operand
1705
- * @param {ReadonlyVec3} d the fourth operand
1706
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
1707
- * @returns {vec3} out
1708
- */
1709
- export function bezier(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, c: ReadonlyVec3, d: ReadonlyVec3, t: number): vec3;
1710
- /**
1711
- * Generates a random vector with the given scale
1712
- *
1713
- * @param {vec3} out the receiving vector
1714
- * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
1715
- * @returns {vec3} out
1716
- */
1717
- export function random(out: vec3, scale?: number): vec3;
1718
- /**
1719
- * Transforms the vec3 with a mat4.
1720
- * 4th vector component is implicitly '1'
1721
- *
1722
- * @param {vec3} out the receiving vector
1723
- * @param {ReadonlyVec3} a the vector to transform
1724
- * @param {ReadonlyMat4} m matrix to transform with
1725
- * @returns {vec3} out
1726
- */
1727
- export function transformMat4(out: vec3, a: ReadonlyVec3, m: ReadonlyMat4): vec3;
1728
- /**
1729
- * Transforms the vec3 with a mat3.
1730
- *
1731
- * @param {vec3} out the receiving vector
1732
- * @param {ReadonlyVec3} a the vector to transform
1733
- * @param {ReadonlyMat3} m the 3x3 matrix to transform with
1734
- * @returns {vec3} out
1735
- */
1736
- export function transformMat3(out: vec3, a: ReadonlyVec3, m: ReadonlyMat3): vec3;
1737
- /**
1738
- * Transforms the vec3 with a quat
1739
- * Can also be used for dual quaternions. (Multiply it with the real part)
1740
- *
1741
- * @param {vec3} out the receiving vector
1742
- * @param {ReadonlyVec3} a the vector to transform
1743
- * @param {ReadonlyQuat} q quaternion to transform with
1744
- * @returns {vec3} out
1745
- */
1746
- export function transformQuat(out: vec3, a: ReadonlyVec3, q: ReadonlyQuat): vec3;
1747
- /**
1748
- * Rotate a 3D vector around the x-axis
1749
- * @param {vec3} out The receiving vec3
1750
- * @param {ReadonlyVec3} a The vec3 point to rotate
1751
- * @param {ReadonlyVec3} b The origin of the rotation
1752
- * @param {Number} rad The angle of rotation in radians
1753
- * @returns {vec3} out
1754
- */
1755
- export function rotateX(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, rad: number): vec3;
1756
- /**
1757
- * Rotate a 3D vector around the y-axis
1758
- * @param {vec3} out The receiving vec3
1759
- * @param {ReadonlyVec3} a The vec3 point to rotate
1760
- * @param {ReadonlyVec3} b The origin of the rotation
1761
- * @param {Number} rad The angle of rotation in radians
1762
- * @returns {vec3} out
1763
- */
1764
- export function rotateY(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, rad: number): vec3;
1765
- /**
1766
- * Rotate a 3D vector around the z-axis
1767
- * @param {vec3} out The receiving vec3
1768
- * @param {ReadonlyVec3} a The vec3 point to rotate
1769
- * @param {ReadonlyVec3} b The origin of the rotation
1770
- * @param {Number} rad The angle of rotation in radians
1771
- * @returns {vec3} out
1772
- */
1773
- export function rotateZ(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, rad: number): vec3;
1774
- /**
1775
- * Get the angle between two 3D vectors
1776
- * @param {ReadonlyVec3} a The first operand
1777
- * @param {ReadonlyVec3} b The second operand
1778
- * @returns {Number} The angle in radians
1779
- */
1780
- export function angle(a: ReadonlyVec3, b: ReadonlyVec3): number;
1781
- /**
1782
- * Set the components of a vec3 to zero
1783
- *
1784
- * @param {vec3} out the receiving vector
1785
- * @returns {vec3} out
1786
- */
1787
- export function zero(out: vec3): vec3;
1788
- /**
1789
- * Returns a string representation of a vector
1790
- *
1791
- * @param {ReadonlyVec3} a vector to represent as a string
1792
- * @returns {String} string representation of the vector
1793
- */
1794
- export function str(a: ReadonlyVec3): string;
1795
- /**
1796
- * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)
1797
- *
1798
- * @param {ReadonlyVec3} a The first vector.
1799
- * @param {ReadonlyVec3} b The second vector.
1800
- * @returns {Boolean} True if the vectors are equal, false otherwise.
1801
- */
1802
- export function exactEquals(a: ReadonlyVec3, b: ReadonlyVec3): boolean;
1803
- /**
1804
- * Returns whether or not the vectors have approximately the same elements in the same position.
1805
- *
1806
- * @param {ReadonlyVec3} a The first vector.
1807
- * @param {ReadonlyVec3} b The second vector.
1808
- * @returns {Boolean} True if the vectors are equal, false otherwise.
1809
- */
1810
- export function equals(a: ReadonlyVec3, b: ReadonlyVec3): boolean;
1811
- /**
1812
- * Subtracts vector b from vector a
1813
- *
1814
- * @param {vec3} out the receiving vector
1815
- * @param {ReadonlyVec3} a the first operand
1816
- * @param {ReadonlyVec3} b the second operand
1817
- * @returns {vec3} out
1818
- */
1819
- export function sub(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3;
1820
- /**
1821
- * Multiplies two vec3's
1822
- *
1823
- * @param {vec3} out the receiving vector
1824
- * @param {ReadonlyVec3} a the first operand
1825
- * @param {ReadonlyVec3} b the second operand
1826
- * @returns {vec3} out
1827
- */
1828
- export function mul(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3;
1829
- /**
1830
- * Divides two vec3's
1831
- *
1832
- * @param {vec3} out the receiving vector
1833
- * @param {ReadonlyVec3} a the first operand
1834
- * @param {ReadonlyVec3} b the second operand
1835
- * @returns {vec3} out
1836
- */
1837
- export function div(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3;
1838
- /**
1839
- * Calculates the euclidian distance between two vec3's
1840
- *
1841
- * @param {ReadonlyVec3} a the first operand
1842
- * @param {ReadonlyVec3} b the second operand
1843
- * @returns {Number} distance between a and b
1844
- */
1845
- export function dist(a: ReadonlyVec3, b: ReadonlyVec3): number;
1846
- /**
1847
- * Calculates the squared euclidian distance between two vec3's
1848
- *
1849
- * @param {ReadonlyVec3} a the first operand
1850
- * @param {ReadonlyVec3} b the second operand
1851
- * @returns {Number} squared distance between a and b
1852
- */
1853
- export function sqrDist(a: ReadonlyVec3, b: ReadonlyVec3): number;
1854
- /**
1855
- * Calculates the length of a vec3
1856
- *
1857
- * @param {ReadonlyVec3} a vector to calculate length of
1858
- * @returns {Number} length of a
1859
- */
1860
- export function len(a: ReadonlyVec3): number;
1861
- /**
1862
- * Calculates the squared length of a vec3
1863
- *
1864
- * @param {ReadonlyVec3} a vector to calculate squared length of
1865
- * @returns {Number} squared length of a
1866
- */
1867
- export function sqrLen(a: ReadonlyVec3): number;
1868
- export function forEach(a: any, stride: any, offset: any, count: any, fn: any, arg: any): any;
1869
- }
1870
- export module vec4 {
1871
- /**
1872
- * 4 Dimensional Vector
1873
- * @module vec4
1874
- */
1875
- /**
1876
- * Creates a new, empty vec4
1877
- *
1878
- * @returns {vec4} a new 4D vector
1879
- */
1880
- export function create(): vec4;
1881
- /**
1882
- * Creates a new vec4 initialized with values from an existing vector
1883
- *
1884
- * @param {ReadonlyVec4} a vector to clone
1885
- * @returns {vec4} a new 4D vector
1886
- */
1887
- export function clone(a: ReadonlyVec4): vec4;
1888
- /**
1889
- * Creates a new vec4 initialized with the given values
1890
- *
1891
- * @param {Number} x X component
1892
- * @param {Number} y Y component
1893
- * @param {Number} z Z component
1894
- * @param {Number} w W component
1895
- * @returns {vec4} a new 4D vector
1896
- */
1897
- export function fromValues(x: number, y: number, z: number, w: number): vec4;
1898
- /**
1899
- * Copy the values from one vec4 to another
1900
- *
1901
- * @param {vec4} out the receiving vector
1902
- * @param {ReadonlyVec4} a the source vector
1903
- * @returns {vec4} out
1904
- */
1905
- export function copy(out: vec4, a: ReadonlyVec4): vec4;
1906
- /**
1907
- * Set the components of a vec4 to the given values
1908
- *
1909
- * @param {vec4} out the receiving vector
1910
- * @param {Number} x X component
1911
- * @param {Number} y Y component
1912
- * @param {Number} z Z component
1913
- * @param {Number} w W component
1914
- * @returns {vec4} out
1915
- */
1916
- export function set(out: vec4, x: number, y: number, z: number, w: number): vec4;
1917
- /**
1918
- * Adds two vec4's
1919
- *
1920
- * @param {vec4} out the receiving vector
1921
- * @param {ReadonlyVec4} a the first operand
1922
- * @param {ReadonlyVec4} b the second operand
1923
- * @returns {vec4} out
1924
- */
1925
- export function add(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4;
1926
- /**
1927
- * Subtracts vector b from vector a
1928
- *
1929
- * @param {vec4} out the receiving vector
1930
- * @param {ReadonlyVec4} a the first operand
1931
- * @param {ReadonlyVec4} b the second operand
1932
- * @returns {vec4} out
1933
- */
1934
- export function subtract(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4;
1935
- /**
1936
- * Multiplies two vec4's
1937
- *
1938
- * @param {vec4} out the receiving vector
1939
- * @param {ReadonlyVec4} a the first operand
1940
- * @param {ReadonlyVec4} b the second operand
1941
- * @returns {vec4} out
1942
- */
1943
- export function multiply(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4;
1944
- /**
1945
- * Divides two vec4's
1946
- *
1947
- * @param {vec4} out the receiving vector
1948
- * @param {ReadonlyVec4} a the first operand
1949
- * @param {ReadonlyVec4} b the second operand
1950
- * @returns {vec4} out
1951
- */
1952
- export function divide(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4;
1953
- /**
1954
- * Math.ceil the components of a vec4
1955
- *
1956
- * @param {vec4} out the receiving vector
1957
- * @param {ReadonlyVec4} a vector to ceil
1958
- * @returns {vec4} out
1959
- */
1960
- export function ceil(out: vec4, a: ReadonlyVec4): vec4;
1961
- /**
1962
- * Math.floor the components of a vec4
1963
- *
1964
- * @param {vec4} out the receiving vector
1965
- * @param {ReadonlyVec4} a vector to floor
1966
- * @returns {vec4} out
1967
- */
1968
- export function floor(out: vec4, a: ReadonlyVec4): vec4;
1969
- /**
1970
- * Returns the minimum of two vec4's
1971
- *
1972
- * @param {vec4} out the receiving vector
1973
- * @param {ReadonlyVec4} a the first operand
1974
- * @param {ReadonlyVec4} b the second operand
1975
- * @returns {vec4} out
1976
- */
1977
- export function min(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4;
1978
- /**
1979
- * Returns the maximum of two vec4's
1980
- *
1981
- * @param {vec4} out the receiving vector
1982
- * @param {ReadonlyVec4} a the first operand
1983
- * @param {ReadonlyVec4} b the second operand
1984
- * @returns {vec4} out
1985
- */
1986
- export function max(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4;
1987
- /**
1988
- * Math.round the components of a vec4
1989
- *
1990
- * @param {vec4} out the receiving vector
1991
- * @param {ReadonlyVec4} a vector to round
1992
- * @returns {vec4} out
1993
- */
1994
- export function round(out: vec4, a: ReadonlyVec4): vec4;
1995
- /**
1996
- * Scales a vec4 by a scalar number
1997
- *
1998
- * @param {vec4} out the receiving vector
1999
- * @param {ReadonlyVec4} a the vector to scale
2000
- * @param {Number} b amount to scale the vector by
2001
- * @returns {vec4} out
2002
- */
2003
- export function scale(out: vec4, a: ReadonlyVec4, b: number): vec4;
2004
- /**
2005
- * Adds two vec4's after scaling the second operand by a scalar value
2006
- *
2007
- * @param {vec4} out the receiving vector
2008
- * @param {ReadonlyVec4} a the first operand
2009
- * @param {ReadonlyVec4} b the second operand
2010
- * @param {Number} scale the amount to scale b by before adding
2011
- * @returns {vec4} out
2012
- */
2013
- export function scaleAndAdd(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4, scale: number): vec4;
2014
- /**
2015
- * Calculates the euclidian distance between two vec4's
2016
- *
2017
- * @param {ReadonlyVec4} a the first operand
2018
- * @param {ReadonlyVec4} b the second operand
2019
- * @returns {Number} distance between a and b
2020
- */
2021
- export function distance(a: ReadonlyVec4, b: ReadonlyVec4): number;
2022
- /**
2023
- * Calculates the squared euclidian distance between two vec4's
2024
- *
2025
- * @param {ReadonlyVec4} a the first operand
2026
- * @param {ReadonlyVec4} b the second operand
2027
- * @returns {Number} squared distance between a and b
2028
- */
2029
- export function squaredDistance(a: ReadonlyVec4, b: ReadonlyVec4): number;
2030
- /**
2031
- * Calculates the length of a vec4
2032
- *
2033
- * @param {ReadonlyVec4} a vector to calculate length of
2034
- * @returns {Number} length of a
2035
- */
2036
- export function length(a: ReadonlyVec4): number;
2037
- /**
2038
- * Calculates the squared length of a vec4
2039
- *
2040
- * @param {ReadonlyVec4} a vector to calculate squared length of
2041
- * @returns {Number} squared length of a
2042
- */
2043
- export function squaredLength(a: ReadonlyVec4): number;
2044
- /**
2045
- * Negates the components of a vec4
2046
- *
2047
- * @param {vec4} out the receiving vector
2048
- * @param {ReadonlyVec4} a vector to negate
2049
- * @returns {vec4} out
2050
- */
2051
- export function negate(out: vec4, a: ReadonlyVec4): vec4;
2052
- /**
2053
- * Returns the inverse of the components of a vec4
2054
- *
2055
- * @param {vec4} out the receiving vector
2056
- * @param {ReadonlyVec4} a vector to invert
2057
- * @returns {vec4} out
2058
- */
2059
- export function inverse(out: vec4, a: ReadonlyVec4): vec4;
2060
- /**
2061
- * Normalize a vec4
2062
- *
2063
- * @param {vec4} out the receiving vector
2064
- * @param {ReadonlyVec4} a vector to normalize
2065
- * @returns {vec4} out
2066
- */
2067
- export function normalize(out: vec4, a: ReadonlyVec4): vec4;
2068
- /**
2069
- * Calculates the dot product of two vec4's
2070
- *
2071
- * @param {ReadonlyVec4} a the first operand
2072
- * @param {ReadonlyVec4} b the second operand
2073
- * @returns {Number} dot product of a and b
2074
- */
2075
- export function dot(a: ReadonlyVec4, b: ReadonlyVec4): number;
2076
- /**
2077
- * Returns the cross-product of three vectors in a 4-dimensional space
2078
- *
2079
- * @param {ReadonlyVec4} result the receiving vector
2080
- * @param {ReadonlyVec4} U the first vector
2081
- * @param {ReadonlyVec4} V the second vector
2082
- * @param {ReadonlyVec4} W the third vector
2083
- * @returns {vec4} result
2084
- */
2085
- export function cross(out: any, u: any, v: any, w: any): vec4;
2086
- /**
2087
- * Performs a linear interpolation between two vec4's
2088
- *
2089
- * @param {vec4} out the receiving vector
2090
- * @param {ReadonlyVec4} a the first operand
2091
- * @param {ReadonlyVec4} b the second operand
2092
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
2093
- * @returns {vec4} out
2094
- */
2095
- export function lerp(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4, t: number): vec4;
2096
- /**
2097
- * Generates a random vector with the given scale
2098
- *
2099
- * @param {vec4} out the receiving vector
2100
- * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
2101
- * @returns {vec4} out
2102
- */
2103
- export function random(out: vec4, scale?: number): vec4;
2104
- /**
2105
- * Transforms the vec4 with a mat4.
2106
- *
2107
- * @param {vec4} out the receiving vector
2108
- * @param {ReadonlyVec4} a the vector to transform
2109
- * @param {ReadonlyMat4} m matrix to transform with
2110
- * @returns {vec4} out
2111
- */
2112
- export function transformMat4(out: vec4, a: ReadonlyVec4, m: ReadonlyMat4): vec4;
2113
- /**
2114
- * Transforms the vec4 with a quat
2115
- *
2116
- * @param {vec4} out the receiving vector
2117
- * @param {ReadonlyVec4} a the vector to transform
2118
- * @param {ReadonlyQuat} q quaternion to transform with
2119
- * @returns {vec4} out
2120
- */
2121
- export function transformQuat(out: vec4, a: ReadonlyVec4, q: ReadonlyQuat): vec4;
2122
- /**
2123
- * Set the components of a vec4 to zero
2124
- *
2125
- * @param {vec4} out the receiving vector
2126
- * @returns {vec4} out
2127
- */
2128
- export function zero(out: vec4): vec4;
2129
- /**
2130
- * Returns a string representation of a vector
2131
- *
2132
- * @param {ReadonlyVec4} a vector to represent as a string
2133
- * @returns {String} string representation of the vector
2134
- */
2135
- export function str(a: ReadonlyVec4): string;
2136
- /**
2137
- * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)
2138
- *
2139
- * @param {ReadonlyVec4} a The first vector.
2140
- * @param {ReadonlyVec4} b The second vector.
2141
- * @returns {Boolean} True if the vectors are equal, false otherwise.
2142
- */
2143
- export function exactEquals(a: ReadonlyVec4, b: ReadonlyVec4): boolean;
2144
- /**
2145
- * Returns whether or not the vectors have approximately the same elements in the same position.
2146
- *
2147
- * @param {ReadonlyVec4} a The first vector.
2148
- * @param {ReadonlyVec4} b The second vector.
2149
- * @returns {Boolean} True if the vectors are equal, false otherwise.
2150
- */
2151
- export function equals(a: ReadonlyVec4, b: ReadonlyVec4): boolean;
2152
- /**
2153
- * Subtracts vector b from vector a
2154
- *
2155
- * @param {vec4} out the receiving vector
2156
- * @param {ReadonlyVec4} a the first operand
2157
- * @param {ReadonlyVec4} b the second operand
2158
- * @returns {vec4} out
2159
- */
2160
- export function sub(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4;
2161
- /**
2162
- * Multiplies two vec4's
2163
- *
2164
- * @param {vec4} out the receiving vector
2165
- * @param {ReadonlyVec4} a the first operand
2166
- * @param {ReadonlyVec4} b the second operand
2167
- * @returns {vec4} out
2168
- */
2169
- export function mul(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4;
2170
- /**
2171
- * Divides two vec4's
2172
- *
2173
- * @param {vec4} out the receiving vector
2174
- * @param {ReadonlyVec4} a the first operand
2175
- * @param {ReadonlyVec4} b the second operand
2176
- * @returns {vec4} out
2177
- */
2178
- export function div(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4;
2179
- /**
2180
- * Calculates the euclidian distance between two vec4's
2181
- *
2182
- * @param {ReadonlyVec4} a the first operand
2183
- * @param {ReadonlyVec4} b the second operand
2184
- * @returns {Number} distance between a and b
2185
- */
2186
- export function dist(a: ReadonlyVec4, b: ReadonlyVec4): number;
2187
- /**
2188
- * Calculates the squared euclidian distance between two vec4's
2189
- *
2190
- * @param {ReadonlyVec4} a the first operand
2191
- * @param {ReadonlyVec4} b the second operand
2192
- * @returns {Number} squared distance between a and b
2193
- */
2194
- export function sqrDist(a: ReadonlyVec4, b: ReadonlyVec4): number;
2195
- /**
2196
- * Calculates the length of a vec4
2197
- *
2198
- * @param {ReadonlyVec4} a vector to calculate length of
2199
- * @returns {Number} length of a
2200
- */
2201
- export function len(a: ReadonlyVec4): number;
2202
- /**
2203
- * Calculates the squared length of a vec4
2204
- *
2205
- * @param {ReadonlyVec4} a vector to calculate squared length of
2206
- * @returns {Number} squared length of a
2207
- */
2208
- export function sqrLen(a: ReadonlyVec4): number;
2209
- export function forEach(a: any, stride: any, offset: any, count: any, fn: any, arg: any): any;
2210
- }
2211
- export module quat {
2212
- /**
2213
- * Quaternion
2214
- * @module quat
2215
- */
2216
- /**
2217
- * Creates a new identity quat
2218
- *
2219
- * @returns {quat} a new quaternion
2220
- */
2221
- export function create(): quat;
2222
- /**
2223
- * Set a quat to the identity quaternion
2224
- *
2225
- * @param {quat} out the receiving quaternion
2226
- * @returns {quat} out
2227
- */
2228
- export function identity(out: quat): quat;
2229
- /**
2230
- * Sets a quat from the given angle and rotation axis,
2231
- * then returns it.
2232
- *
2233
- * @param {quat} out the receiving quaternion
2234
- * @param {ReadonlyVec3} axis the axis around which to rotate
2235
- * @param {Number} rad the angle in radians
2236
- * @returns {quat} out
2237
- **/
2238
- export function setAxisAngle(out: quat, axis: ReadonlyVec3, rad: number): quat;
2239
- /**
2240
- * Gets the rotation axis and angle for a given
2241
- * quaternion. If a quaternion is created with
2242
- * setAxisAngle, this method will return the same
2243
- * values as providied in the original parameter list
2244
- * OR functionally equivalent values.
2245
- * Example: The quaternion formed by axis [0, 0, 1] and
2246
- * angle -90 is the same as the quaternion formed by
2247
- * [0, 0, 1] and 270. This method favors the latter.
2248
- * @param {vec3} out_axis Vector receiving the axis of rotation
2249
- * @param {ReadonlyQuat} q Quaternion to be decomposed
2250
- * @return {Number} Angle, in radians, of the rotation
2251
- */
2252
- export function getAxisAngle(out_axis: vec3, q: ReadonlyQuat): number;
2253
- /**
2254
- * Gets the angular distance between two unit quaternions
2255
- *
2256
- * @param {ReadonlyQuat} a Origin unit quaternion
2257
- * @param {ReadonlyQuat} b Destination unit quaternion
2258
- * @return {Number} Angle, in radians, between the two quaternions
2259
- */
2260
- export function getAngle(a: ReadonlyQuat, b: ReadonlyQuat): number;
2261
- /**
2262
- * Multiplies two quat's
2263
- *
2264
- * @param {quat} out the receiving quaternion
2265
- * @param {ReadonlyQuat} a the first operand
2266
- * @param {ReadonlyQuat} b the second operand
2267
- * @returns {quat} out
2268
- */
2269
- export function multiply(out: quat, a: ReadonlyQuat, b: ReadonlyQuat): quat;
2270
- /**
2271
- * Rotates a quaternion by the given angle about the X axis
2272
- *
2273
- * @param {quat} out quat receiving operation result
2274
- * @param {ReadonlyQuat} a quat to rotate
2275
- * @param {number} rad angle (in radians) to rotate
2276
- * @returns {quat} out
2277
- */
2278
- export function rotateX(out: quat, a: ReadonlyQuat, rad: number): quat;
2279
- /**
2280
- * Rotates a quaternion by the given angle about the Y axis
2281
- *
2282
- * @param {quat} out quat receiving operation result
2283
- * @param {ReadonlyQuat} a quat to rotate
2284
- * @param {number} rad angle (in radians) to rotate
2285
- * @returns {quat} out
2286
- */
2287
- export function rotateY(out: quat, a: ReadonlyQuat, rad: number): quat;
2288
- /**
2289
- * Rotates a quaternion by the given angle about the Z axis
2290
- *
2291
- * @param {quat} out quat receiving operation result
2292
- * @param {ReadonlyQuat} a quat to rotate
2293
- * @param {number} rad angle (in radians) to rotate
2294
- * @returns {quat} out
2295
- */
2296
- export function rotateZ(out: quat, a: ReadonlyQuat, rad: number): quat;
2297
- /**
2298
- * Calculates the W component of a quat from the X, Y, and Z components.
2299
- * Assumes that quaternion is 1 unit in length.
2300
- * Any existing W component will be ignored.
2301
- *
2302
- * @param {quat} out the receiving quaternion
2303
- * @param {ReadonlyQuat} a quat to calculate W component of
2304
- * @returns {quat} out
2305
- */
2306
- export function calculateW(out: quat, a: ReadonlyQuat): quat;
2307
- /**
2308
- * Calculate the exponential of a unit quaternion.
2309
- *
2310
- * @param {quat} out the receiving quaternion
2311
- * @param {ReadonlyQuat} a quat to calculate the exponential of
2312
- * @returns {quat} out
2313
- */
2314
- export function exp(out: quat, a: ReadonlyQuat): quat;
2315
- /**
2316
- * Calculate the natural logarithm of a unit quaternion.
2317
- *
2318
- * @param {quat} out the receiving quaternion
2319
- * @param {ReadonlyQuat} a quat to calculate the exponential of
2320
- * @returns {quat} out
2321
- */
2322
- export function ln(out: quat, a: ReadonlyQuat): quat;
2323
- /**
2324
- * Calculate the scalar power of a unit quaternion.
2325
- *
2326
- * @param {quat} out the receiving quaternion
2327
- * @param {ReadonlyQuat} a quat to calculate the exponential of
2328
- * @param {Number} b amount to scale the quaternion by
2329
- * @returns {quat} out
2330
- */
2331
- export function pow(out: quat, a: ReadonlyQuat, b: number): quat;
2332
- /**
2333
- * Performs a spherical linear interpolation between two quat
2334
- *
2335
- * @param {quat} out the receiving quaternion
2336
- * @param {ReadonlyQuat} a the first operand
2337
- * @param {ReadonlyQuat} b the second operand
2338
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
2339
- * @returns {quat} out
2340
- */
2341
- export function slerp(out: quat, a: ReadonlyQuat, b: ReadonlyQuat, t: number): quat;
2342
- /**
2343
- * Generates a random unit quaternion
2344
- *
2345
- * @param {quat} out the receiving quaternion
2346
- * @returns {quat} out
2347
- */
2348
- export function random(out: quat): quat;
2349
- /**
2350
- * Calculates the inverse of a quat
2351
- *
2352
- * @param {quat} out the receiving quaternion
2353
- * @param {ReadonlyQuat} a quat to calculate inverse of
2354
- * @returns {quat} out
2355
- */
2356
- export function invert(out: quat, a: ReadonlyQuat): quat;
2357
- /**
2358
- * Calculates the conjugate of a quat
2359
- * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.
2360
- *
2361
- * @param {quat} out the receiving quaternion
2362
- * @param {ReadonlyQuat} a quat to calculate conjugate of
2363
- * @returns {quat} out
2364
- */
2365
- export function conjugate(out: quat, a: ReadonlyQuat): quat;
2366
- /**
2367
- * Creates a quaternion from the given 3x3 rotation matrix.
2368
- *
2369
- * NOTE: The resultant quaternion is not normalized, so you should be sure
2370
- * to renormalize the quaternion yourself where necessary.
2371
- *
2372
- * @param {quat} out the receiving quaternion
2373
- * @param {ReadonlyMat3} m rotation matrix
2374
- * @returns {quat} out
2375
- * @function
2376
- */
2377
- export function fromMat3(out: quat, m: ReadonlyMat3): quat;
2378
- /**
2379
- * Creates a quaternion from the given euler angle x, y, z.
2380
- *
2381
- * @param {quat} out the receiving quaternion
2382
- * @param {x} Angle to rotate around X axis in degrees.
2383
- * @param {y} Angle to rotate around Y axis in degrees.
2384
- * @param {z} Angle to rotate around Z axis in degrees.
2385
- * @returns {quat} out
2386
- * @function
2387
- */
2388
- export function fromEuler(out: quat, x: any, y: any, z: any): quat;
2389
- /**
2390
- * Returns a string representation of a quatenion
2391
- *
2392
- * @param {ReadonlyQuat} a vector to represent as a string
2393
- * @returns {String} string representation of the vector
2394
- */
2395
- export function str(a: ReadonlyQuat): string;
2396
- /**
2397
- * Creates a new quat initialized with values from an existing quaternion
2398
- *
2399
- * @param {ReadonlyQuat} a quaternion to clone
2400
- * @returns {quat} a new quaternion
2401
- * @function
2402
- */
2403
- export const clone: typeof vec4.clone;
2404
- /**
2405
- * Creates a new quat initialized with the given values
2406
- *
2407
- * @param {Number} x X component
2408
- * @param {Number} y Y component
2409
- * @param {Number} z Z component
2410
- * @param {Number} w W component
2411
- * @returns {quat} a new quaternion
2412
- * @function
2413
- */
2414
- export const fromValues: typeof vec4.fromValues;
2415
- /**
2416
- * Copy the values from one quat to another
2417
- *
2418
- * @param {quat} out the receiving quaternion
2419
- * @param {ReadonlyQuat} a the source quaternion
2420
- * @returns {quat} out
2421
- * @function
2422
- */
2423
- export const copy: typeof vec4.copy;
2424
- /**
2425
- * Set the components of a quat to the given values
2426
- *
2427
- * @param {quat} out the receiving quaternion
2428
- * @param {Number} x X component
2429
- * @param {Number} y Y component
2430
- * @param {Number} z Z component
2431
- * @param {Number} w W component
2432
- * @returns {quat} out
2433
- * @function
2434
- */
2435
- export const set: typeof vec4.set;
2436
- /**
2437
- * Adds two quat's
2438
- *
2439
- * @param {quat} out the receiving quaternion
2440
- * @param {ReadonlyQuat} a the first operand
2441
- * @param {ReadonlyQuat} b the second operand
2442
- * @returns {quat} out
2443
- * @function
2444
- */
2445
- export const add: typeof vec4.add;
2446
- /**
2447
- * Multiplies two quat's
2448
- *
2449
- * @param {quat} out the receiving quaternion
2450
- * @param {ReadonlyQuat} a the first operand
2451
- * @param {ReadonlyQuat} b the second operand
2452
- * @returns {quat} out
2453
- */
2454
- export function mul(out: quat, a: ReadonlyQuat, b: ReadonlyQuat): quat;
2455
- /**
2456
- * Scales a quat by a scalar number
2457
- *
2458
- * @param {quat} out the receiving vector
2459
- * @param {ReadonlyQuat} a the vector to scale
2460
- * @param {Number} b amount to scale the vector by
2461
- * @returns {quat} out
2462
- * @function
2463
- */
2464
- export const scale: typeof vec4.scale;
2465
- /**
2466
- * Calculates the dot product of two quat's
2467
- *
2468
- * @param {ReadonlyQuat} a the first operand
2469
- * @param {ReadonlyQuat} b the second operand
2470
- * @returns {Number} dot product of a and b
2471
- * @function
2472
- */
2473
- export const dot: typeof vec4.dot;
2474
- /**
2475
- * Performs a linear interpolation between two quat's
2476
- *
2477
- * @param {quat} out the receiving quaternion
2478
- * @param {ReadonlyQuat} a the first operand
2479
- * @param {ReadonlyQuat} b the second operand
2480
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
2481
- * @returns {quat} out
2482
- * @function
2483
- */
2484
- export const lerp: typeof vec4.lerp;
2485
- /**
2486
- * Calculates the length of a quat
2487
- *
2488
- * @param {ReadonlyQuat} a vector to calculate length of
2489
- * @returns {Number} length of a
2490
- */
2491
- export const length: typeof vec4.length;
2492
- /**
2493
- * Alias for {@link quat.length}
2494
- * @function
2495
- */
2496
- export const len: typeof vec4.length;
2497
- /**
2498
- * Calculates the squared length of a quat
2499
- *
2500
- * @param {ReadonlyQuat} a vector to calculate squared length of
2501
- * @returns {Number} squared length of a
2502
- * @function
2503
- */
2504
- export const squaredLength: typeof vec4.squaredLength;
2505
- /**
2506
- * Alias for {@link quat.squaredLength}
2507
- * @function
2508
- */
2509
- export const sqrLen: typeof vec4.squaredLength;
2510
- /**
2511
- * Normalize a quat
2512
- *
2513
- * @param {quat} out the receiving quaternion
2514
- * @param {ReadonlyQuat} a quaternion to normalize
2515
- * @returns {quat} out
2516
- * @function
2517
- */
2518
- export const normalize: typeof vec4.normalize;
2519
- /**
2520
- * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)
2521
- *
2522
- * @param {ReadonlyQuat} a The first quaternion.
2523
- * @param {ReadonlyQuat} b The second quaternion.
2524
- * @returns {Boolean} True if the vectors are equal, false otherwise.
2525
- */
2526
- export const exactEquals: typeof vec4.exactEquals;
2527
- /**
2528
- * Returns whether or not the quaternions have approximately the same elements in the same position.
2529
- *
2530
- * @param {ReadonlyQuat} a The first vector.
2531
- * @param {ReadonlyQuat} b The second vector.
2532
- * @returns {Boolean} True if the vectors are equal, false otherwise.
2533
- */
2534
- export const equals: typeof vec4.equals;
2535
- export function rotationTo(out: any, a: any, b: any): any;
2536
- export function sqlerp(out: any, a: any, b: any, c: any, d: any, t: any): any;
2537
- export function setAxes(out: any, view: any, right: any, up: any): vec4;
2538
-
2539
- }
2540
- export module quat2 {
2541
- /**
2542
- * Dual Quaternion<br>
2543
- * Format: [real, dual]<br>
2544
- * Quaternion format: XYZW<br>
2545
- * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.<br>
2546
- * @module quat2
2547
- */
2548
- /**
2549
- * Creates a new identity dual quat
2550
- *
2551
- * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]
2552
- */
2553
- export function create(): quat2;
2554
- /**
2555
- * Creates a new quat initialized with values from an existing quaternion
2556
- *
2557
- * @param {ReadonlyQuat2} a dual quaternion to clone
2558
- * @returns {quat2} new dual quaternion
2559
- * @function
2560
- */
2561
- export function clone(a: ReadonlyQuat2): quat2;
2562
- /**
2563
- * Creates a new dual quat initialized with the given values
2564
- *
2565
- * @param {Number} x1 X component
2566
- * @param {Number} y1 Y component
2567
- * @param {Number} z1 Z component
2568
- * @param {Number} w1 W component
2569
- * @param {Number} x2 X component
2570
- * @param {Number} y2 Y component
2571
- * @param {Number} z2 Z component
2572
- * @param {Number} w2 W component
2573
- * @returns {quat2} new dual quaternion
2574
- * @function
2575
- */
2576
- export function fromValues(x1: number, y1: number, z1: number, w1: number, x2: number, y2: number, z2: number, w2: number): quat2;
2577
- /**
2578
- * Creates a new dual quat from the given values (quat and translation)
2579
- *
2580
- * @param {Number} x1 X component
2581
- * @param {Number} y1 Y component
2582
- * @param {Number} z1 Z component
2583
- * @param {Number} w1 W component
2584
- * @param {Number} x2 X component (translation)
2585
- * @param {Number} y2 Y component (translation)
2586
- * @param {Number} z2 Z component (translation)
2587
- * @returns {quat2} new dual quaternion
2588
- * @function
2589
- */
2590
- export function fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number, x2: number, y2: number, z2: number): quat2;
2591
- /**
2592
- * Creates a dual quat from a quaternion and a translation
2593
- *
2594
- * @param {ReadonlyQuat2} dual quaternion receiving operation result
2595
- * @param {ReadonlyQuat} q a normalized quaternion
2596
- * @param {ReadonlyVec3} t tranlation vector
2597
- * @returns {quat2} dual quaternion receiving operation result
2598
- * @function
2599
- */
2600
- export function fromRotationTranslation(out: any, q: ReadonlyQuat, t: ReadonlyVec3): quat2;
2601
- /**
2602
- * Creates a dual quat from a translation
2603
- *
2604
- * @param {ReadonlyQuat2} dual quaternion receiving operation result
2605
- * @param {ReadonlyVec3} t translation vector
2606
- * @returns {quat2} dual quaternion receiving operation result
2607
- * @function
2608
- */
2609
- export function fromTranslation(out: any, t: ReadonlyVec3): quat2;
2610
- /**
2611
- * Creates a dual quat from a quaternion
2612
- *
2613
- * @param {ReadonlyQuat2} dual quaternion receiving operation result
2614
- * @param {ReadonlyQuat} q the quaternion
2615
- * @returns {quat2} dual quaternion receiving operation result
2616
- * @function
2617
- */
2618
- export function fromRotation(out: any, q: ReadonlyQuat): quat2;
2619
- /**
2620
- * Creates a new dual quat from a matrix (4x4)
2621
- *
2622
- * @param {quat2} out the dual quaternion
2623
- * @param {ReadonlyMat4} a the matrix
2624
- * @returns {quat2} dual quat receiving operation result
2625
- * @function
2626
- */
2627
- export function fromMat4(out: quat2, a: ReadonlyMat4): quat2;
2628
- /**
2629
- * Copy the values from one dual quat to another
2630
- *
2631
- * @param {quat2} out the receiving dual quaternion
2632
- * @param {ReadonlyQuat2} a the source dual quaternion
2633
- * @returns {quat2} out
2634
- * @function
2635
- */
2636
- export function copy(out: quat2, a: ReadonlyQuat2): quat2;
2637
- /**
2638
- * Set a dual quat to the identity dual quaternion
2639
- *
2640
- * @param {quat2} out the receiving quaternion
2641
- * @returns {quat2} out
2642
- */
2643
- export function identity(out: quat2): quat2;
2644
- /**
2645
- * Set the components of a dual quat to the given values
2646
- *
2647
- * @param {quat2} out the receiving quaternion
2648
- * @param {Number} x1 X component
2649
- * @param {Number} y1 Y component
2650
- * @param {Number} z1 Z component
2651
- * @param {Number} w1 W component
2652
- * @param {Number} x2 X component
2653
- * @param {Number} y2 Y component
2654
- * @param {Number} z2 Z component
2655
- * @param {Number} w2 W component
2656
- * @returns {quat2} out
2657
- * @function
2658
- */
2659
- export function set(out: quat2, x1: number, y1: number, z1: number, w1: number, x2: number, y2: number, z2: number, w2: number): quat2;
2660
- /**
2661
- * Gets the dual part of a dual quat
2662
- * @param {quat} out dual part
2663
- * @param {ReadonlyQuat2} a Dual Quaternion
2664
- * @return {quat} dual part
2665
- */
2666
- export function getDual(out: quat, a: ReadonlyQuat2): quat;
2667
- /**
2668
- * Set the dual component of a dual quat to the given quaternion
2669
- *
2670
- * @param {quat2} out the receiving quaternion
2671
- * @param {ReadonlyQuat} q a quaternion representing the dual part
2672
- * @returns {quat2} out
2673
- * @function
2674
- */
2675
- export function setDual(out: quat2, q: ReadonlyQuat): quat2;
2676
- /**
2677
- * Gets the translation of a normalized dual quat
2678
- * @param {vec3} out translation
2679
- * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed
2680
- * @return {vec3} translation
2681
- */
2682
- export function getTranslation(out: vec3, a: ReadonlyQuat2): vec3;
2683
- /**
2684
- * Translates a dual quat by the given vector
2685
- *
2686
- * @param {quat2} out the receiving dual quaternion
2687
- * @param {ReadonlyQuat2} a the dual quaternion to translate
2688
- * @param {ReadonlyVec3} v vector to translate by
2689
- * @returns {quat2} out
2690
- */
2691
- export function translate(out: quat2, a: ReadonlyQuat2, v: ReadonlyVec3): quat2;
2692
- /**
2693
- * Rotates a dual quat around the X axis
2694
- *
2695
- * @param {quat2} out the receiving dual quaternion
2696
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
2697
- * @param {number} rad how far should the rotation be
2698
- * @returns {quat2} out
2699
- */
2700
- export function rotateX(out: quat2, a: ReadonlyQuat2, rad: number): quat2;
2701
- /**
2702
- * Rotates a dual quat around the Y axis
2703
- *
2704
- * @param {quat2} out the receiving dual quaternion
2705
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
2706
- * @param {number} rad how far should the rotation be
2707
- * @returns {quat2} out
2708
- */
2709
- export function rotateY(out: quat2, a: ReadonlyQuat2, rad: number): quat2;
2710
- /**
2711
- * Rotates a dual quat around the Z axis
2712
- *
2713
- * @param {quat2} out the receiving dual quaternion
2714
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
2715
- * @param {number} rad how far should the rotation be
2716
- * @returns {quat2} out
2717
- */
2718
- export function rotateZ(out: quat2, a: ReadonlyQuat2, rad: number): quat2;
2719
- /**
2720
- * Rotates a dual quat by a given quaternion (a * q)
2721
- *
2722
- * @param {quat2} out the receiving dual quaternion
2723
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
2724
- * @param {ReadonlyQuat} q quaternion to rotate by
2725
- * @returns {quat2} out
2726
- */
2727
- export function rotateByQuatAppend(out: quat2, a: ReadonlyQuat2, q: ReadonlyQuat): quat2;
2728
- /**
2729
- * Rotates a dual quat by a given quaternion (q * a)
2730
- *
2731
- * @param {quat2} out the receiving dual quaternion
2732
- * @param {ReadonlyQuat} q quaternion to rotate by
2733
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
2734
- * @returns {quat2} out
2735
- */
2736
- export function rotateByQuatPrepend(out: quat2, q: ReadonlyQuat, a: ReadonlyQuat2): quat2;
2737
- /**
2738
- * Rotates a dual quat around a given axis. Does the normalisation automatically
2739
- *
2740
- * @param {quat2} out the receiving dual quaternion
2741
- * @param {ReadonlyQuat2} a the dual quaternion to rotate
2742
- * @param {ReadonlyVec3} axis the axis to rotate around
2743
- * @param {Number} rad how far the rotation should be
2744
- * @returns {quat2} out
2745
- */
2746
- export function rotateAroundAxis(out: quat2, a: ReadonlyQuat2, axis: ReadonlyVec3, rad: number): quat2;
2747
- /**
2748
- * Adds two dual quat's
2749
- *
2750
- * @param {quat2} out the receiving dual quaternion
2751
- * @param {ReadonlyQuat2} a the first operand
2752
- * @param {ReadonlyQuat2} b the second operand
2753
- * @returns {quat2} out
2754
- * @function
2755
- */
2756
- export function add(out: quat2, a: ReadonlyQuat2, b: ReadonlyQuat2): quat2;
2757
- /**
2758
- * Multiplies two dual quat's
2759
- *
2760
- * @param {quat2} out the receiving dual quaternion
2761
- * @param {ReadonlyQuat2} a the first operand
2762
- * @param {ReadonlyQuat2} b the second operand
2763
- * @returns {quat2} out
2764
- */
2765
- export function multiply(out: quat2, a: ReadonlyQuat2, b: ReadonlyQuat2): quat2;
2766
- /**
2767
- * Scales a dual quat by a scalar number
2768
- *
2769
- * @param {quat2} out the receiving dual quat
2770
- * @param {ReadonlyQuat2} a the dual quat to scale
2771
- * @param {Number} b amount to scale the dual quat by
2772
- * @returns {quat2} out
2773
- * @function
2774
- */
2775
- export function scale(out: quat2, a: ReadonlyQuat2, b: number): quat2;
2776
- /**
2777
- * Performs a linear interpolation between two dual quats's
2778
- * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)
2779
- *
2780
- * @param {quat2} out the receiving dual quat
2781
- * @param {ReadonlyQuat2} a the first operand
2782
- * @param {ReadonlyQuat2} b the second operand
2783
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
2784
- * @returns {quat2} out
2785
- */
2786
- export function lerp(out: quat2, a: ReadonlyQuat2, b: ReadonlyQuat2, t: number): quat2;
2787
- /**
2788
- * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper
2789
- *
2790
- * @param {quat2} out the receiving dual quaternion
2791
- * @param {ReadonlyQuat2} a dual quat to calculate inverse of
2792
- * @returns {quat2} out
2793
- */
2794
- export function invert(out: quat2, a: ReadonlyQuat2): quat2;
2795
- /**
2796
- * Calculates the conjugate of a dual quat
2797
- * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.
2798
- *
2799
- * @param {quat2} out the receiving quaternion
2800
- * @param {ReadonlyQuat2} a quat to calculate conjugate of
2801
- * @returns {quat2} out
2802
- */
2803
- export function conjugate(out: quat2, a: ReadonlyQuat2): quat2;
2804
- /**
2805
- * Normalize a dual quat
2806
- *
2807
- * @param {quat2} out the receiving dual quaternion
2808
- * @param {ReadonlyQuat2} a dual quaternion to normalize
2809
- * @returns {quat2} out
2810
- * @function
2811
- */
2812
- export function normalize(out: quat2, a: ReadonlyQuat2): quat2;
2813
- /**
2814
- * Returns a string representation of a dual quatenion
2815
- *
2816
- * @param {ReadonlyQuat2} a dual quaternion to represent as a string
2817
- * @returns {String} string representation of the dual quat
2818
- */
2819
- export function str(a: ReadonlyQuat2): string;
2820
- /**
2821
- * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)
2822
- *
2823
- * @param {ReadonlyQuat2} a the first dual quaternion.
2824
- * @param {ReadonlyQuat2} b the second dual quaternion.
2825
- * @returns {Boolean} true if the dual quaternions are equal, false otherwise.
2826
- */
2827
- export function exactEquals(a: ReadonlyQuat2, b: ReadonlyQuat2): boolean;
2828
- /**
2829
- * Returns whether or not the dual quaternions have approximately the same elements in the same position.
2830
- *
2831
- * @param {ReadonlyQuat2} a the first dual quat.
2832
- * @param {ReadonlyQuat2} b the second dual quat.
2833
- * @returns {Boolean} true if the dual quats are equal, false otherwise.
2834
- */
2835
- export function equals(a: ReadonlyQuat2, b: ReadonlyQuat2): boolean;
2836
- /**
2837
- * Gets the real part of a dual quat
2838
- * @param {quat} out real part
2839
- * @param {ReadonlyQuat2} a Dual Quaternion
2840
- * @return {quat} real part
2841
- */
2842
- export const getReal: typeof vec4.copy;
2843
- /**
2844
- * Set the real component of a dual quat to the given quaternion
2845
- *
2846
- * @param {quat2} out the receiving quaternion
2847
- * @param {ReadonlyQuat} q a quaternion representing the real part
2848
- * @returns {quat2} out
2849
- * @function
2850
- */
2851
- export const setReal: typeof vec4.copy;
2852
- /**
2853
- * Multiplies two dual quat's
2854
- *
2855
- * @param {quat2} out the receiving dual quaternion
2856
- * @param {ReadonlyQuat2} a the first operand
2857
- * @param {ReadonlyQuat2} b the second operand
2858
- * @returns {quat2} out
2859
- */
2860
- export function mul(out: quat2, a: ReadonlyQuat2, b: ReadonlyQuat2): quat2;
2861
- /**
2862
- * Calculates the dot product of two dual quat's (The dot product of the real parts)
2863
- *
2864
- * @param {ReadonlyQuat2} a the first operand
2865
- * @param {ReadonlyQuat2} b the second operand
2866
- * @returns {Number} dot product of a and b
2867
- * @function
2868
- */
2869
- export const dot: typeof vec4.dot;
2870
- /**
2871
- * Calculates the length of a dual quat
2872
- *
2873
- * @param {ReadonlyQuat2} a dual quat to calculate length of
2874
- * @returns {Number} length of a
2875
- * @function
2876
- */
2877
- export const length: typeof vec4.length;
2878
- /**
2879
- * Alias for {@link quat2.length}
2880
- * @function
2881
- */
2882
- export const len: typeof vec4.length;
2883
- /**
2884
- * Calculates the squared length of a dual quat
2885
- *
2886
- * @param {ReadonlyQuat2} a dual quat to calculate squared length of
2887
- * @returns {Number} squared length of a
2888
- * @function
2889
- */
2890
- export const squaredLength: typeof vec4.squaredLength;
2891
- /**
2892
- * Alias for {@link quat2.squaredLength}
2893
- * @function
2894
- */
2895
- export const sqrLen: typeof vec4.squaredLength;
2896
- }
2897
- export module vec2 {
2898
- /**
2899
- * 2 Dimensional Vector
2900
- * @module vec2
2901
- */
2902
- /**
2903
- * Creates a new, empty vec2
2904
- *
2905
- * @returns {vec2} a new 2D vector
2906
- */
2907
- export function create(): vec2;
2908
- /**
2909
- * Creates a new vec2 initialized with values from an existing vector
2910
- *
2911
- * @param {ReadonlyVec2} a vector to clone
2912
- * @returns {vec2} a new 2D vector
2913
- */
2914
- export function clone(a: ReadonlyVec2): vec2;
2915
- /**
2916
- * Creates a new vec2 initialized with the given values
2917
- *
2918
- * @param {Number} x X component
2919
- * @param {Number} y Y component
2920
- * @returns {vec2} a new 2D vector
2921
- */
2922
- export function fromValues(x: number, y: number): vec2;
2923
- /**
2924
- * Copy the values from one vec2 to another
2925
- *
2926
- * @param {vec2} out the receiving vector
2927
- * @param {ReadonlyVec2} a the source vector
2928
- * @returns {vec2} out
2929
- */
2930
- export function copy(out: vec2, a: ReadonlyVec2): vec2;
2931
- /**
2932
- * Set the components of a vec2 to the given values
2933
- *
2934
- * @param {vec2} out the receiving vector
2935
- * @param {Number} x X component
2936
- * @param {Number} y Y component
2937
- * @returns {vec2} out
2938
- */
2939
- export function set(out: vec2, x: number, y: number): vec2;
2940
- /**
2941
- * Adds two vec2's
2942
- *
2943
- * @param {vec2} out the receiving vector
2944
- * @param {ReadonlyVec2} a the first operand
2945
- * @param {ReadonlyVec2} b the second operand
2946
- * @returns {vec2} out
2947
- */
2948
- export function add(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2;
2949
- /**
2950
- * Subtracts vector b from vector a
2951
- *
2952
- * @param {vec2} out the receiving vector
2953
- * @param {ReadonlyVec2} a the first operand
2954
- * @param {ReadonlyVec2} b the second operand
2955
- * @returns {vec2} out
2956
- */
2957
- export function subtract(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2;
2958
- /**
2959
- * Multiplies two vec2's
2960
- *
2961
- * @param {vec2} out the receiving vector
2962
- * @param {ReadonlyVec2} a the first operand
2963
- * @param {ReadonlyVec2} b the second operand
2964
- * @returns {vec2} out
2965
- */
2966
- export function multiply(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2;
2967
- /**
2968
- * Divides two vec2's
2969
- *
2970
- * @param {vec2} out the receiving vector
2971
- * @param {ReadonlyVec2} a the first operand
2972
- * @param {ReadonlyVec2} b the second operand
2973
- * @returns {vec2} out
2974
- */
2975
- export function divide(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2;
2976
- /**
2977
- * Math.ceil the components of a vec2
2978
- *
2979
- * @param {vec2} out the receiving vector
2980
- * @param {ReadonlyVec2} a vector to ceil
2981
- * @returns {vec2} out
2982
- */
2983
- export function ceil(out: vec2, a: ReadonlyVec2): vec2;
2984
- /**
2985
- * Math.floor the components of a vec2
2986
- *
2987
- * @param {vec2} out the receiving vector
2988
- * @param {ReadonlyVec2} a vector to floor
2989
- * @returns {vec2} out
2990
- */
2991
- export function floor(out: vec2, a: ReadonlyVec2): vec2;
2992
- /**
2993
- * Returns the minimum of two vec2's
2994
- *
2995
- * @param {vec2} out the receiving vector
2996
- * @param {ReadonlyVec2} a the first operand
2997
- * @param {ReadonlyVec2} b the second operand
2998
- * @returns {vec2} out
2999
- */
3000
- export function min(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2;
3001
- /**
3002
- * Returns the maximum of two vec2's
3003
- *
3004
- * @param {vec2} out the receiving vector
3005
- * @param {ReadonlyVec2} a the first operand
3006
- * @param {ReadonlyVec2} b the second operand
3007
- * @returns {vec2} out
3008
- */
3009
- export function max(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2;
3010
- /**
3011
- * Math.round the components of a vec2
3012
- *
3013
- * @param {vec2} out the receiving vector
3014
- * @param {ReadonlyVec2} a vector to round
3015
- * @returns {vec2} out
3016
- */
3017
- export function round(out: vec2, a: ReadonlyVec2): vec2;
3018
- /**
3019
- * Scales a vec2 by a scalar number
3020
- *
3021
- * @param {vec2} out the receiving vector
3022
- * @param {ReadonlyVec2} a the vector to scale
3023
- * @param {Number} b amount to scale the vector by
3024
- * @returns {vec2} out
3025
- */
3026
- export function scale(out: vec2, a: ReadonlyVec2, b: number): vec2;
3027
- /**
3028
- * Adds two vec2's after scaling the second operand by a scalar value
3029
- *
3030
- * @param {vec2} out the receiving vector
3031
- * @param {ReadonlyVec2} a the first operand
3032
- * @param {ReadonlyVec2} b the second operand
3033
- * @param {Number} scale the amount to scale b by before adding
3034
- * @returns {vec2} out
3035
- */
3036
- export function scaleAndAdd(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2, scale: number): vec2;
3037
- /**
3038
- * Calculates the euclidian distance between two vec2's
3039
- *
3040
- * @param {ReadonlyVec2} a the first operand
3041
- * @param {ReadonlyVec2} b the second operand
3042
- * @returns {Number} distance between a and b
3043
- */
3044
- export function distance(a: ReadonlyVec2, b: ReadonlyVec2): number;
3045
- /**
3046
- * Calculates the squared euclidian distance between two vec2's
3047
- *
3048
- * @param {ReadonlyVec2} a the first operand
3049
- * @param {ReadonlyVec2} b the second operand
3050
- * @returns {Number} squared distance between a and b
3051
- */
3052
- export function squaredDistance(a: ReadonlyVec2, b: ReadonlyVec2): number;
3053
- /**
3054
- * Calculates the length of a vec2
3055
- *
3056
- * @param {ReadonlyVec2} a vector to calculate length of
3057
- * @returns {Number} length of a
3058
- */
3059
- export function length(a: ReadonlyVec2): number;
3060
- /**
3061
- * Calculates the squared length of a vec2
3062
- *
3063
- * @param {ReadonlyVec2} a vector to calculate squared length of
3064
- * @returns {Number} squared length of a
3065
- */
3066
- export function squaredLength(a: ReadonlyVec2): number;
3067
- /**
3068
- * Negates the components of a vec2
3069
- *
3070
- * @param {vec2} out the receiving vector
3071
- * @param {ReadonlyVec2} a vector to negate
3072
- * @returns {vec2} out
3073
- */
3074
- export function negate(out: vec2, a: ReadonlyVec2): vec2;
3075
- /**
3076
- * Returns the inverse of the components of a vec2
3077
- *
3078
- * @param {vec2} out the receiving vector
3079
- * @param {ReadonlyVec2} a vector to invert
3080
- * @returns {vec2} out
3081
- */
3082
- export function inverse(out: vec2, a: ReadonlyVec2): vec2;
3083
- /**
3084
- * Normalize a vec2
3085
- *
3086
- * @param {vec2} out the receiving vector
3087
- * @param {ReadonlyVec2} a vector to normalize
3088
- * @returns {vec2} out
3089
- */
3090
- export function normalize(out: vec2, a: ReadonlyVec2): vec2;
3091
- /**
3092
- * Calculates the dot product of two vec2's
3093
- *
3094
- * @param {ReadonlyVec2} a the first operand
3095
- * @param {ReadonlyVec2} b the second operand
3096
- * @returns {Number} dot product of a and b
3097
- */
3098
- export function dot(a: ReadonlyVec2, b: ReadonlyVec2): number;
3099
- /**
3100
- * Computes the cross product of two vec2's
3101
- * Note that the cross product must by definition produce a 3D vector
3102
- *
3103
- * @param {vec3} out the receiving vector
3104
- * @param {ReadonlyVec2} a the first operand
3105
- * @param {ReadonlyVec2} b the second operand
3106
- * @returns {vec3} out
3107
- */
3108
- export function cross(out: vec3, a: ReadonlyVec2, b: ReadonlyVec2): vec3;
3109
- /**
3110
- * Performs a linear interpolation between two vec2's
3111
- *
3112
- * @param {vec2} out the receiving vector
3113
- * @param {ReadonlyVec2} a the first operand
3114
- * @param {ReadonlyVec2} b the second operand
3115
- * @param {Number} t interpolation amount, in the range [0-1], between the two inputs
3116
- * @returns {vec2} out
3117
- */
3118
- export function lerp(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2, t: number): vec2;
3119
- /**
3120
- * Generates a random vector with the given scale
3121
- *
3122
- * @param {vec2} out the receiving vector
3123
- * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned
3124
- * @returns {vec2} out
3125
- */
3126
- export function random(out: vec2, scale?: number): vec2;
3127
- /**
3128
- * Transforms the vec2 with a mat2
3129
- *
3130
- * @param {vec2} out the receiving vector
3131
- * @param {ReadonlyVec2} a the vector to transform
3132
- * @param {ReadonlyMat2} m matrix to transform with
3133
- * @returns {vec2} out
3134
- */
3135
- export function transformMat2(out: vec2, a: ReadonlyVec2, m: ReadonlyMat2): vec2;
3136
- /**
3137
- * Transforms the vec2 with a mat2d
3138
- *
3139
- * @param {vec2} out the receiving vector
3140
- * @param {ReadonlyVec2} a the vector to transform
3141
- * @param {ReadonlyMat2d} m matrix to transform with
3142
- * @returns {vec2} out
3143
- */
3144
- export function transformMat2d(out: vec2, a: ReadonlyVec2, m: ReadonlyMat2d): vec2;
3145
- /**
3146
- * Transforms the vec2 with a mat3
3147
- * 3rd vector component is implicitly '1'
3148
- *
3149
- * @param {vec2} out the receiving vector
3150
- * @param {ReadonlyVec2} a the vector to transform
3151
- * @param {ReadonlyMat3} m matrix to transform with
3152
- * @returns {vec2} out
3153
- */
3154
- export function transformMat3(out: vec2, a: ReadonlyVec2, m: ReadonlyMat3): vec2;
3155
- /**
3156
- * Transforms the vec2 with a mat4
3157
- * 3rd vector component is implicitly '0'
3158
- * 4th vector component is implicitly '1'
3159
- *
3160
- * @param {vec2} out the receiving vector
3161
- * @param {ReadonlyVec2} a the vector to transform
3162
- * @param {ReadonlyMat4} m matrix to transform with
3163
- * @returns {vec2} out
3164
- */
3165
- export function transformMat4(out: vec2, a: ReadonlyVec2, m: ReadonlyMat4): vec2;
3166
- /**
3167
- * Rotate a 2D vector
3168
- * @param {vec2} out The receiving vec2
3169
- * @param {ReadonlyVec2} a The vec2 point to rotate
3170
- * @param {ReadonlyVec2} b The origin of the rotation
3171
- * @param {Number} rad The angle of rotation in radians
3172
- * @returns {vec2} out
3173
- */
3174
- export function rotate(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2, rad: number): vec2;
3175
- /**
3176
- * Get the angle between two 2D vectors
3177
- * @param {ReadonlyVec2} a The first operand
3178
- * @param {ReadonlyVec2} b The second operand
3179
- * @returns {Number} The angle in radians
3180
- */
3181
- export function angle(a: ReadonlyVec2, b: ReadonlyVec2): number;
3182
- /**
3183
- * Set the components of a vec2 to zero
3184
- *
3185
- * @param {vec2} out the receiving vector
3186
- * @returns {vec2} out
3187
- */
3188
- export function zero(out: vec2): vec2;
3189
- /**
3190
- * Returns a string representation of a vector
3191
- *
3192
- * @param {ReadonlyVec2} a vector to represent as a string
3193
- * @returns {String} string representation of the vector
3194
- */
3195
- export function str(a: ReadonlyVec2): string;
3196
- /**
3197
- * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
3198
- *
3199
- * @param {ReadonlyVec2} a The first vector.
3200
- * @param {ReadonlyVec2} b The second vector.
3201
- * @returns {Boolean} True if the vectors are equal, false otherwise.
3202
- */
3203
- export function exactEquals(a: ReadonlyVec2, b: ReadonlyVec2): boolean;
3204
- /**
3205
- * Returns whether or not the vectors have approximately the same elements in the same position.
3206
- *
3207
- * @param {ReadonlyVec2} a The first vector.
3208
- * @param {ReadonlyVec2} b The second vector.
3209
- * @returns {Boolean} True if the vectors are equal, false otherwise.
3210
- */
3211
- export function equals(a: ReadonlyVec2, b: ReadonlyVec2): boolean;
3212
- /**
3213
- * Calculates the length of a vec2
3214
- *
3215
- * @param {ReadonlyVec2} a vector to calculate length of
3216
- * @returns {Number} length of a
3217
- */
3218
- export function len(a: ReadonlyVec2): number;
3219
- /**
3220
- * Subtracts vector b from vector a
3221
- *
3222
- * @param {vec2} out the receiving vector
3223
- * @param {ReadonlyVec2} a the first operand
3224
- * @param {ReadonlyVec2} b the second operand
3225
- * @returns {vec2} out
3226
- */
3227
- export function sub(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2;
3228
- /**
3229
- * Multiplies two vec2's
3230
- *
3231
- * @param {vec2} out the receiving vector
3232
- * @param {ReadonlyVec2} a the first operand
3233
- * @param {ReadonlyVec2} b the second operand
3234
- * @returns {vec2} out
3235
- */
3236
- export function mul(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2;
3237
- /**
3238
- * Divides two vec2's
3239
- *
3240
- * @param {vec2} out the receiving vector
3241
- * @param {ReadonlyVec2} a the first operand
3242
- * @param {ReadonlyVec2} b the second operand
3243
- * @returns {vec2} out
3244
- */
3245
- export function div(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2;
3246
- /**
3247
- * Calculates the euclidian distance between two vec2's
3248
- *
3249
- * @param {ReadonlyVec2} a the first operand
3250
- * @param {ReadonlyVec2} b the second operand
3251
- * @returns {Number} distance between a and b
3252
- */
3253
- export function dist(a: ReadonlyVec2, b: ReadonlyVec2): number;
3254
- /**
3255
- * Calculates the squared euclidian distance between two vec2's
3256
- *
3257
- * @param {ReadonlyVec2} a the first operand
3258
- * @param {ReadonlyVec2} b the second operand
3259
- * @returns {Number} squared distance between a and b
3260
- */
3261
- export function sqrDist(a: ReadonlyVec2, b: ReadonlyVec2): number;
3262
- /**
3263
- * Calculates the squared length of a vec2
3264
- *
3265
- * @param {ReadonlyVec2} a vector to calculate squared length of
3266
- * @returns {Number} squared length of a
3267
- */
3268
- export function sqrLen(a: ReadonlyVec2): number;
3269
- export function forEach(a: any, stride: any, offset: any, count: any, fn: any, arg: any): any;
3270
- }
3271
-
3272
-
3273
- }