@vived/core 1.4.1 → 1.4.3

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 (356) hide show
  1. package/README.md +118 -20
  2. package/dist/cjs/AppObject/AppObject.js +112 -0
  3. package/dist/cjs/AppObject/AppObject.js.map +1 -0
  4. package/dist/cjs/AppObject/AppObjectComponent.js +160 -0
  5. package/dist/cjs/AppObject/AppObjectComponent.js.map +1 -0
  6. package/dist/cjs/AppObject/AppObjectController.js +34 -0
  7. package/dist/cjs/AppObject/AppObjectController.js.map +1 -0
  8. package/dist/cjs/AppObject/AppObjectEntity.js +90 -0
  9. package/dist/cjs/AppObject/AppObjectEntity.js.map +1 -0
  10. package/dist/cjs/AppObject/AppObjectEntityRepo.js +130 -0
  11. package/dist/cjs/AppObject/AppObjectEntityRepo.js.map +1 -0
  12. package/dist/cjs/AppObject/AppObjectPM.js +86 -0
  13. package/dist/cjs/AppObject/AppObjectPM.js.map +1 -0
  14. package/dist/cjs/AppObject/AppObjectRepo.js +153 -0
  15. package/dist/cjs/AppObject/AppObjectRepo.js.map +1 -0
  16. package/dist/cjs/AppObject/AppObjectUC.js +35 -0
  17. package/dist/cjs/AppObject/AppObjectUC.js.map +1 -0
  18. package/dist/cjs/AppObject/AppObjectView.js +34 -0
  19. package/dist/cjs/AppObject/AppObjectView.js.map +1 -0
  20. package/dist/cjs/AppObject/getSingletonComponent.js +26 -0
  21. package/dist/cjs/AppObject/getSingletonComponent.js.map +1 -0
  22. package/dist/cjs/AppObject/index.js +27 -0
  23. package/dist/cjs/AppObject/index.js.map +1 -0
  24. package/dist/cjs/AppObject/printAppObjectDetails.js +18 -0
  25. package/dist/cjs/AppObject/printAppObjectDetails.js.map +1 -0
  26. package/dist/cjs/Entities/MemoizedAngle.js +44 -0
  27. package/dist/cjs/Entities/MemoizedAngle.js.map +1 -0
  28. package/dist/cjs/Entities/MemoizedBoolean.js +44 -0
  29. package/dist/cjs/Entities/MemoizedBoolean.js.map +1 -0
  30. package/dist/cjs/Entities/MemoizedColor.js +45 -0
  31. package/dist/cjs/Entities/MemoizedColor.js.map +1 -0
  32. package/dist/cjs/Entities/MemoizedNumber.js +44 -0
  33. package/dist/cjs/Entities/MemoizedNumber.js.map +1 -0
  34. package/dist/cjs/Entities/MemoizedQuaternion.js +45 -0
  35. package/dist/cjs/Entities/MemoizedQuaternion.js.map +1 -0
  36. package/dist/cjs/Entities/MemoizedString.js +44 -0
  37. package/dist/cjs/Entities/MemoizedString.js.map +1 -0
  38. package/dist/cjs/Entities/MemoizedVector2.js +45 -0
  39. package/dist/cjs/Entities/MemoizedVector2.js.map +1 -0
  40. package/dist/cjs/Entities/MemoizedVector3.js +45 -0
  41. package/dist/cjs/Entities/MemoizedVector3.js.map +1 -0
  42. package/dist/cjs/Entities/ObservableEntity.js +37 -0
  43. package/dist/cjs/Entities/ObservableEntity.js.map +1 -0
  44. package/dist/cjs/Entities/ObserverList.js +48 -0
  45. package/dist/cjs/Entities/ObserverList.js.map +1 -0
  46. package/dist/cjs/Entities/RangedNumber.js +65 -0
  47. package/dist/cjs/Entities/RangedNumber.js.map +1 -0
  48. package/dist/cjs/Entities/index.js +28 -0
  49. package/dist/cjs/Entities/index.js.map +1 -0
  50. package/dist/cjs/Types/AppBoundary.js +3 -0
  51. package/dist/cjs/Types/AppBoundary.js.map +1 -0
  52. package/dist/cjs/Types/EaseFn.js +3 -0
  53. package/dist/cjs/Types/EaseFn.js.map +1 -0
  54. package/dist/cjs/Types/PmAdapter.js +3 -0
  55. package/dist/cjs/Types/PmAdapter.js.map +1 -0
  56. package/dist/cjs/Types/SingletonPmAdapter.js +3 -0
  57. package/dist/cjs/Types/SingletonPmAdapter.js.map +1 -0
  58. package/dist/cjs/Types/index.js +21 -0
  59. package/dist/cjs/Types/index.js.map +1 -0
  60. package/dist/cjs/Utilities/LengthConverters.js +21 -0
  61. package/dist/cjs/Utilities/LengthConverters.js.map +1 -0
  62. package/dist/cjs/Utilities/LerpNumber.js +85 -0
  63. package/dist/cjs/Utilities/LerpNumber.js.map +1 -0
  64. package/dist/cjs/Utilities/addAlphaToHex.js +16 -0
  65. package/dist/cjs/Utilities/addAlphaToHex.js.map +1 -0
  66. package/dist/cjs/Utilities/alphaToHex.js +21 -0
  67. package/dist/cjs/Utilities/alphaToHex.js.map +1 -0
  68. package/dist/cjs/Utilities/degreesToRadians.js +7 -0
  69. package/dist/cjs/Utilities/degreesToRadians.js.map +1 -0
  70. package/dist/cjs/Utilities/downloadFile.js +14 -0
  71. package/dist/cjs/Utilities/downloadFile.js.map +1 -0
  72. package/dist/cjs/Utilities/easeFunctions.js +208 -0
  73. package/dist/cjs/Utilities/easeFunctions.js.map +1 -0
  74. package/dist/cjs/Utilities/generateUniqueID.js +8 -0
  75. package/dist/cjs/Utilities/generateUniqueID.js.map +1 -0
  76. package/dist/cjs/Utilities/index.js +25 -0
  77. package/dist/cjs/Utilities/index.js.map +1 -0
  78. package/dist/cjs/Utilities/interpolateNumber.js +18 -0
  79. package/dist/cjs/Utilities/interpolateNumber.js.map +1 -0
  80. package/dist/cjs/ValueObjects/Angle.js +47 -0
  81. package/dist/cjs/ValueObjects/Angle.js.map +1 -0
  82. package/dist/cjs/ValueObjects/Color.js +859 -0
  83. package/dist/cjs/ValueObjects/Color.js.map +1 -0
  84. package/dist/cjs/ValueObjects/LineSegment2D.js +72 -0
  85. package/dist/cjs/ValueObjects/LineSegment2D.js.map +1 -0
  86. package/dist/cjs/ValueObjects/Matrix.js +466 -0
  87. package/dist/cjs/ValueObjects/Matrix.js.map +1 -0
  88. package/dist/cjs/ValueObjects/ParametricLine.js +77 -0
  89. package/dist/cjs/ValueObjects/ParametricLine.js.map +1 -0
  90. package/dist/cjs/ValueObjects/ParametricPlane.js +65 -0
  91. package/dist/cjs/ValueObjects/ParametricPlane.js.map +1 -0
  92. package/dist/cjs/ValueObjects/Quaternion.js +290 -0
  93. package/dist/cjs/ValueObjects/Quaternion.js.map +1 -0
  94. package/dist/cjs/ValueObjects/Rectangle.js +24 -0
  95. package/dist/cjs/ValueObjects/Rectangle.js.map +1 -0
  96. package/dist/cjs/ValueObjects/Vector2.js +191 -0
  97. package/dist/cjs/ValueObjects/Vector2.js.map +1 -0
  98. package/dist/cjs/ValueObjects/Vector3.js +231 -0
  99. package/dist/cjs/ValueObjects/Vector3.js.map +1 -0
  100. package/dist/cjs/ValueObjects/Version.js +171 -0
  101. package/dist/cjs/ValueObjects/Version.js.map +1 -0
  102. package/dist/cjs/ValueObjects/index.js +28 -0
  103. package/dist/cjs/ValueObjects/index.js.map +1 -0
  104. package/dist/cjs/index.js +22 -0
  105. package/dist/cjs/index.js.map +1 -0
  106. package/dist/esm/AppObject/AppObject.js +53 -0
  107. package/dist/esm/AppObject/AppObject.js.map +1 -1
  108. package/dist/esm/AppObject/AppObjectComponent.js +78 -0
  109. package/dist/esm/AppObject/AppObjectComponent.js.map +1 -1
  110. package/dist/esm/AppObject/AppObjectController.js +22 -0
  111. package/dist/esm/AppObject/AppObjectController.js.map +1 -1
  112. package/dist/esm/AppObject/AppObjectEntity.js +52 -0
  113. package/dist/esm/AppObject/AppObjectEntity.js.map +1 -1
  114. package/dist/esm/AppObject/AppObjectEntityRepo.js +75 -1
  115. package/dist/esm/AppObject/AppObjectEntityRepo.js.map +1 -1
  116. package/dist/esm/AppObject/AppObjectPM.js +46 -0
  117. package/dist/esm/AppObject/AppObjectPM.js.map +1 -1
  118. package/dist/esm/AppObject/AppObjectRepo.js +20 -0
  119. package/dist/esm/AppObject/AppObjectRepo.js.map +1 -1
  120. package/dist/esm/AppObject/AppObjectUC.js +24 -1
  121. package/dist/esm/AppObject/AppObjectUC.js.map +1 -1
  122. package/dist/esm/AppObject/AppObjectView.js +23 -1
  123. package/dist/esm/AppObject/AppObjectView.js.map +1 -1
  124. package/dist/esm/AppObject/getSingletonComponent.js +19 -0
  125. package/dist/esm/AppObject/getSingletonComponent.js.map +1 -1
  126. package/dist/esm/Entities/MemoizedAngle.js +21 -0
  127. package/dist/esm/Entities/MemoizedAngle.js.map +1 -1
  128. package/dist/esm/Entities/MemoizedBoolean.js +21 -0
  129. package/dist/esm/Entities/MemoizedBoolean.js.map +1 -1
  130. package/dist/esm/Entities/MemoizedColor.js +21 -0
  131. package/dist/esm/Entities/MemoizedColor.js.map +1 -1
  132. package/dist/esm/Entities/MemoizedNumber.js +21 -0
  133. package/dist/esm/Entities/MemoizedNumber.js.map +1 -1
  134. package/dist/esm/Entities/MemoizedQuaternion.js +21 -0
  135. package/dist/esm/Entities/MemoizedQuaternion.js.map +1 -1
  136. package/dist/esm/Entities/MemoizedString.js +21 -0
  137. package/dist/esm/Entities/MemoizedString.js.map +1 -1
  138. package/dist/esm/Entities/MemoizedVector2.js +21 -0
  139. package/dist/esm/Entities/MemoizedVector2.js.map +1 -1
  140. package/dist/esm/Entities/MemoizedVector3.js +21 -0
  141. package/dist/esm/Entities/MemoizedVector3.js.map +1 -1
  142. package/dist/esm/Entities/ObservableEntity.js +17 -0
  143. package/dist/esm/Entities/ObservableEntity.js.map +1 -1
  144. package/dist/esm/Entities/ObserverList.js +21 -0
  145. package/dist/esm/Entities/ObserverList.js.map +1 -1
  146. package/dist/esm/Entities/RangedNumber.js +29 -0
  147. package/dist/esm/Entities/RangedNumber.js.map +1 -1
  148. package/dist/esm/Types/PmAdapter.js.map +1 -1
  149. package/dist/esm/Types/SingletonPmAdapter.js.map +1 -1
  150. package/dist/esm/ValueObjects/Angle.js +1 -1
  151. package/dist/esm/ValueObjects/Angle.js.map +1 -1
  152. package/dist/esm/ValueObjects/LineSegment2D.js +6 -6
  153. package/dist/esm/ValueObjects/LineSegment2D.js.map +1 -1
  154. package/dist/esm/ValueObjects/Matrix.js +6 -6
  155. package/dist/esm/ValueObjects/Matrix.js.map +1 -1
  156. package/dist/esm/ValueObjects/Quaternion.js +17 -17
  157. package/dist/esm/ValueObjects/Quaternion.js.map +1 -1
  158. package/dist/esm/ValueObjects/Vector2.js +15 -8
  159. package/dist/esm/ValueObjects/Vector2.js.map +1 -1
  160. package/dist/types/AppObject/AppObject.d.ts +42 -0
  161. package/dist/types/AppObject/AppObject.d.ts.map +1 -1
  162. package/dist/types/AppObject/AppObjectComponent.d.ts +80 -0
  163. package/dist/types/AppObject/AppObjectComponent.d.ts.map +1 -1
  164. package/dist/types/AppObject/AppObjectController.d.ts +22 -0
  165. package/dist/types/AppObject/AppObjectController.d.ts.map +1 -1
  166. package/dist/types/AppObject/AppObjectEntity.d.ts +55 -0
  167. package/dist/types/AppObject/AppObjectEntity.d.ts.map +1 -1
  168. package/dist/types/AppObject/AppObjectEntityRepo.d.ts +75 -0
  169. package/dist/types/AppObject/AppObjectEntityRepo.d.ts.map +1 -1
  170. package/dist/types/AppObject/AppObjectPM.d.ts +53 -0
  171. package/dist/types/AppObject/AppObjectPM.d.ts.map +1 -1
  172. package/dist/types/AppObject/AppObjectRepo.d.ts +124 -0
  173. package/dist/types/AppObject/AppObjectRepo.d.ts.map +1 -1
  174. package/dist/types/AppObject/AppObjectUC.d.ts +23 -0
  175. package/dist/types/AppObject/AppObjectUC.d.ts.map +1 -1
  176. package/dist/types/AppObject/AppObjectView.d.ts +22 -0
  177. package/dist/types/AppObject/AppObjectView.d.ts.map +1 -1
  178. package/dist/types/AppObject/getSingletonComponent.d.ts +19 -0
  179. package/dist/types/AppObject/getSingletonComponent.d.ts.map +1 -1
  180. package/dist/types/Entities/MemoizedAngle.d.ts +21 -0
  181. package/dist/types/Entities/MemoizedAngle.d.ts.map +1 -1
  182. package/dist/types/Entities/MemoizedBoolean.d.ts +21 -0
  183. package/dist/types/Entities/MemoizedBoolean.d.ts.map +1 -1
  184. package/dist/types/Entities/MemoizedColor.d.ts +21 -0
  185. package/dist/types/Entities/MemoizedColor.d.ts.map +1 -1
  186. package/dist/types/Entities/MemoizedNumber.d.ts +21 -0
  187. package/dist/types/Entities/MemoizedNumber.d.ts.map +1 -1
  188. package/dist/types/Entities/MemoizedQuaternion.d.ts +21 -0
  189. package/dist/types/Entities/MemoizedQuaternion.d.ts.map +1 -1
  190. package/dist/types/Entities/MemoizedString.d.ts +21 -0
  191. package/dist/types/Entities/MemoizedString.d.ts.map +1 -1
  192. package/dist/types/Entities/MemoizedVector2.d.ts +21 -0
  193. package/dist/types/Entities/MemoizedVector2.d.ts.map +1 -1
  194. package/dist/types/Entities/MemoizedVector3.d.ts +21 -0
  195. package/dist/types/Entities/MemoizedVector3.d.ts.map +1 -1
  196. package/dist/types/Entities/ObservableEntity.d.ts +20 -0
  197. package/dist/types/Entities/ObservableEntity.d.ts.map +1 -1
  198. package/dist/types/Entities/ObserverList.d.ts +21 -0
  199. package/dist/types/Entities/ObserverList.d.ts.map +1 -1
  200. package/dist/types/Entities/RangedNumber.d.ts +37 -0
  201. package/dist/types/Entities/RangedNumber.d.ts.map +1 -1
  202. package/dist/types/Types/PmAdapter.d.ts +60 -0
  203. package/dist/types/Types/PmAdapter.d.ts.map +1 -1
  204. package/dist/types/Types/SingletonPmAdapter.d.ts +55 -0
  205. package/dist/types/Types/SingletonPmAdapter.d.ts.map +1 -1
  206. package/dist/types/ValueObjects/Angle.d.ts +1 -1
  207. package/dist/types/ValueObjects/Matrix.d.ts +5 -5
  208. package/dist/types/ValueObjects/Matrix.d.ts.map +1 -1
  209. package/dist/types/ValueObjects/Quaternion.d.ts +17 -17
  210. package/dist/types/ValueObjects/Vector2.d.ts +8 -3
  211. package/dist/types/ValueObjects/Vector2.d.ts.map +1 -1
  212. package/package.json +58 -55
  213. package/dist/esm/AppObject/AppObject.test.js +0 -110
  214. package/dist/esm/AppObject/AppObject.test.js.map +0 -1
  215. package/dist/esm/AppObject/AppObjectComponent.test.js +0 -130
  216. package/dist/esm/AppObject/AppObjectComponent.test.js.map +0 -1
  217. package/dist/esm/AppObject/AppObjectEntity.test.js +0 -106
  218. package/dist/esm/AppObject/AppObjectEntity.test.js.map +0 -1
  219. package/dist/esm/AppObject/AppObjectEntityRepo.test.js +0 -147
  220. package/dist/esm/AppObject/AppObjectEntityRepo.test.js.map +0 -1
  221. package/dist/esm/AppObject/AppObjectPM.test.js +0 -101
  222. package/dist/esm/AppObject/AppObjectPM.test.js.map +0 -1
  223. package/dist/esm/AppObject/AppObjectRepo.test.js +0 -211
  224. package/dist/esm/AppObject/AppObjectRepo.test.js.map +0 -1
  225. package/dist/esm/AppObject/getSingletonComponent.test.js +0 -11
  226. package/dist/esm/AppObject/getSingletonComponent.test.js.map +0 -1
  227. package/dist/esm/Entities/MemoizedAngle.test.js +0 -28
  228. package/dist/esm/Entities/MemoizedAngle.test.js.map +0 -1
  229. package/dist/esm/Entities/MemoizedBoolean.test.js +0 -32
  230. package/dist/esm/Entities/MemoizedBoolean.test.js.map +0 -1
  231. package/dist/esm/Entities/MemoizedColor.test.js +0 -30
  232. package/dist/esm/Entities/MemoizedColor.test.js.map +0 -1
  233. package/dist/esm/Entities/MemoizedNumber.test.js +0 -27
  234. package/dist/esm/Entities/MemoizedNumber.test.js.map +0 -1
  235. package/dist/esm/Entities/MemoizedQuaternion.test.js +0 -30
  236. package/dist/esm/Entities/MemoizedQuaternion.test.js.map +0 -1
  237. package/dist/esm/Entities/MemoizedString.test.js +0 -27
  238. package/dist/esm/Entities/MemoizedString.test.js.map +0 -1
  239. package/dist/esm/Entities/MemoizedVector2.test.js +0 -30
  240. package/dist/esm/Entities/MemoizedVector2.test.js.map +0 -1
  241. package/dist/esm/Entities/MemoizedVector3.test.js +0 -30
  242. package/dist/esm/Entities/MemoizedVector3.test.js.map +0 -1
  243. package/dist/esm/Entities/ObservableEntity.test.js +0 -23
  244. package/dist/esm/Entities/ObservableEntity.test.js.map +0 -1
  245. package/dist/esm/Entities/ObserverList.test.js +0 -42
  246. package/dist/esm/Entities/ObserverList.test.js.map +0 -1
  247. package/dist/esm/Entities/RangedNumber.test.js +0 -94
  248. package/dist/esm/Entities/RangedNumber.test.js.map +0 -1
  249. package/dist/esm/Utilities/LengthConverters.test.js +0 -22
  250. package/dist/esm/Utilities/LengthConverters.test.js.map +0 -1
  251. package/dist/esm/Utilities/LerpNumber.test.js +0 -88
  252. package/dist/esm/Utilities/LerpNumber.test.js.map +0 -1
  253. package/dist/esm/Utilities/addAlphaToHex.test.js +0 -32
  254. package/dist/esm/Utilities/addAlphaToHex.test.js.map +0 -1
  255. package/dist/esm/Utilities/alphaToHex.test.js +0 -73
  256. package/dist/esm/Utilities/alphaToHex.test.js.map +0 -1
  257. package/dist/esm/Utilities/degreesToRadians.test.js +0 -7
  258. package/dist/esm/Utilities/degreesToRadians.test.js.map +0 -1
  259. package/dist/esm/Utilities/easeFunctions.test.js +0 -207
  260. package/dist/esm/Utilities/easeFunctions.test.js.map +0 -1
  261. package/dist/esm/Utilities/interpolateNumber.test.js +0 -24
  262. package/dist/esm/Utilities/interpolateNumber.test.js.map +0 -1
  263. package/dist/esm/ValueObjects/Angle.test.js +0 -26
  264. package/dist/esm/ValueObjects/Angle.test.js.map +0 -1
  265. package/dist/esm/ValueObjects/Color.test.js +0 -145
  266. package/dist/esm/ValueObjects/Color.test.js.map +0 -1
  267. package/dist/esm/ValueObjects/LineSegment2D.test.js +0 -100
  268. package/dist/esm/ValueObjects/LineSegment2D.test.js.map +0 -1
  269. package/dist/esm/ValueObjects/Matrix.test.js +0 -383
  270. package/dist/esm/ValueObjects/Matrix.test.js.map +0 -1
  271. package/dist/esm/ValueObjects/ParametricLine.test.js +0 -124
  272. package/dist/esm/ValueObjects/ParametricLine.test.js.map +0 -1
  273. package/dist/esm/ValueObjects/ParametricPlane.test.js +0 -99
  274. package/dist/esm/ValueObjects/ParametricPlane.test.js.map +0 -1
  275. package/dist/esm/ValueObjects/Quaternion.test.js +0 -238
  276. package/dist/esm/ValueObjects/Quaternion.test.js.map +0 -1
  277. package/dist/esm/ValueObjects/Rectangle.test.js +0 -30
  278. package/dist/esm/ValueObjects/Rectangle.test.js.map +0 -1
  279. package/dist/esm/ValueObjects/Vector2.test.js +0 -134
  280. package/dist/esm/ValueObjects/Vector2.test.js.map +0 -1
  281. package/dist/esm/ValueObjects/Vector3.test.js +0 -186
  282. package/dist/esm/ValueObjects/Vector3.test.js.map +0 -1
  283. package/dist/esm/ValueObjects/Version.test.js +0 -308
  284. package/dist/esm/ValueObjects/Version.test.js.map +0 -1
  285. package/dist/types/AppObject/AppObject.test.d.ts +0 -7
  286. package/dist/types/AppObject/AppObject.test.d.ts.map +0 -1
  287. package/dist/types/AppObject/AppObjectComponent.test.d.ts +0 -2
  288. package/dist/types/AppObject/AppObjectComponent.test.d.ts.map +0 -1
  289. package/dist/types/AppObject/AppObjectEntity.test.d.ts +0 -2
  290. package/dist/types/AppObject/AppObjectEntity.test.d.ts.map +0 -1
  291. package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts +0 -2
  292. package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts.map +0 -1
  293. package/dist/types/AppObject/AppObjectPM.test.d.ts +0 -2
  294. package/dist/types/AppObject/AppObjectPM.test.d.ts.map +0 -1
  295. package/dist/types/AppObject/AppObjectRepo.test.d.ts +0 -2
  296. package/dist/types/AppObject/AppObjectRepo.test.d.ts.map +0 -1
  297. package/dist/types/AppObject/getSingletonComponent.test.d.ts +0 -2
  298. package/dist/types/AppObject/getSingletonComponent.test.d.ts.map +0 -1
  299. package/dist/types/Entities/MemoizedAngle.test.d.ts +0 -2
  300. package/dist/types/Entities/MemoizedAngle.test.d.ts.map +0 -1
  301. package/dist/types/Entities/MemoizedBoolean.test.d.ts +0 -2
  302. package/dist/types/Entities/MemoizedBoolean.test.d.ts.map +0 -1
  303. package/dist/types/Entities/MemoizedColor.test.d.ts +0 -2
  304. package/dist/types/Entities/MemoizedColor.test.d.ts.map +0 -1
  305. package/dist/types/Entities/MemoizedNumber.test.d.ts +0 -2
  306. package/dist/types/Entities/MemoizedNumber.test.d.ts.map +0 -1
  307. package/dist/types/Entities/MemoizedQuaternion.test.d.ts +0 -2
  308. package/dist/types/Entities/MemoizedQuaternion.test.d.ts.map +0 -1
  309. package/dist/types/Entities/MemoizedString.test.d.ts +0 -2
  310. package/dist/types/Entities/MemoizedString.test.d.ts.map +0 -1
  311. package/dist/types/Entities/MemoizedVector2.test.d.ts +0 -2
  312. package/dist/types/Entities/MemoizedVector2.test.d.ts.map +0 -1
  313. package/dist/types/Entities/MemoizedVector3.test.d.ts +0 -2
  314. package/dist/types/Entities/MemoizedVector3.test.d.ts.map +0 -1
  315. package/dist/types/Entities/ObservableEntity.test.d.ts +0 -2
  316. package/dist/types/Entities/ObservableEntity.test.d.ts.map +0 -1
  317. package/dist/types/Entities/ObserverList.test.d.ts +0 -2
  318. package/dist/types/Entities/ObserverList.test.d.ts.map +0 -1
  319. package/dist/types/Entities/RangedNumber.test.d.ts +0 -2
  320. package/dist/types/Entities/RangedNumber.test.d.ts.map +0 -1
  321. package/dist/types/Utilities/LengthConverters.test.d.ts +0 -2
  322. package/dist/types/Utilities/LengthConverters.test.d.ts.map +0 -1
  323. package/dist/types/Utilities/LerpNumber.test.d.ts +0 -2
  324. package/dist/types/Utilities/LerpNumber.test.d.ts.map +0 -1
  325. package/dist/types/Utilities/addAlphaToHex.test.d.ts +0 -2
  326. package/dist/types/Utilities/addAlphaToHex.test.d.ts.map +0 -1
  327. package/dist/types/Utilities/alphaToHex.test.d.ts +0 -2
  328. package/dist/types/Utilities/alphaToHex.test.d.ts.map +0 -1
  329. package/dist/types/Utilities/degreesToRadians.test.d.ts +0 -2
  330. package/dist/types/Utilities/degreesToRadians.test.d.ts.map +0 -1
  331. package/dist/types/Utilities/easeFunctions.test.d.ts +0 -2
  332. package/dist/types/Utilities/easeFunctions.test.d.ts.map +0 -1
  333. package/dist/types/Utilities/interpolateNumber.test.d.ts +0 -2
  334. package/dist/types/Utilities/interpolateNumber.test.d.ts.map +0 -1
  335. package/dist/types/ValueObjects/Angle.test.d.ts +0 -2
  336. package/dist/types/ValueObjects/Angle.test.d.ts.map +0 -1
  337. package/dist/types/ValueObjects/Color.test.d.ts +0 -2
  338. package/dist/types/ValueObjects/Color.test.d.ts.map +0 -1
  339. package/dist/types/ValueObjects/LineSegment2D.test.d.ts +0 -2
  340. package/dist/types/ValueObjects/LineSegment2D.test.d.ts.map +0 -1
  341. package/dist/types/ValueObjects/Matrix.test.d.ts +0 -2
  342. package/dist/types/ValueObjects/Matrix.test.d.ts.map +0 -1
  343. package/dist/types/ValueObjects/ParametricLine.test.d.ts +0 -2
  344. package/dist/types/ValueObjects/ParametricLine.test.d.ts.map +0 -1
  345. package/dist/types/ValueObjects/ParametricPlane.test.d.ts +0 -2
  346. package/dist/types/ValueObjects/ParametricPlane.test.d.ts.map +0 -1
  347. package/dist/types/ValueObjects/Quaternion.test.d.ts +0 -2
  348. package/dist/types/ValueObjects/Quaternion.test.d.ts.map +0 -1
  349. package/dist/types/ValueObjects/Rectangle.test.d.ts +0 -2
  350. package/dist/types/ValueObjects/Rectangle.test.d.ts.map +0 -1
  351. package/dist/types/ValueObjects/Vector2.test.d.ts +0 -2
  352. package/dist/types/ValueObjects/Vector2.test.d.ts.map +0 -1
  353. package/dist/types/ValueObjects/Vector3.test.d.ts +0 -2
  354. package/dist/types/ValueObjects/Vector3.test.d.ts.map +0 -1
  355. package/dist/types/ValueObjects/Version.test.d.ts +0 -2
  356. package/dist/types/ValueObjects/Version.test.d.ts.map +0 -1
@@ -1,100 +0,0 @@
1
- import { Vector2 } from "./Vector2";
2
- import { LineSegment2D } from "./LineSegment2D";
3
- test("Construction stores the start and end pos", () => {
4
- const start = new Vector2(2, 3);
5
- const end = new Vector2(4, 5);
6
- const seg = new LineSegment2D(start, end);
7
- expect(seg.end.x).toEqual(4);
8
- expect(seg.end.y).toEqual(5);
9
- expect(seg.start.x).toEqual(2);
10
- expect(seg.start.y).toEqual(3);
11
- });
12
- test("Direction", () => {
13
- const start = new Vector2(2, 3);
14
- const end = new Vector2(2, 5);
15
- const seg = new LineSegment2D(start, end);
16
- expect(seg.direction.x).toEqual(0);
17
- expect(seg.direction.y).toEqual(1);
18
- });
19
- test("Direction", () => {
20
- const start = new Vector2(2, 3);
21
- const end = new Vector2(-10, 3);
22
- const seg = new LineSegment2D(start, end);
23
- expect(seg.direction.x).toEqual(-1);
24
- expect(seg.direction.y).toEqual(0);
25
- });
26
- test("Length", () => {
27
- const start = new Vector2(0, 0);
28
- const end = new Vector2(10, 0);
29
- const seg = new LineSegment2D(start, end);
30
- expect(seg.length).toEqual(10);
31
- });
32
- test("Position at percent", () => {
33
- const start = new Vector2(0, 0);
34
- const end = new Vector2(10, 0);
35
- const seg = new LineSegment2D(start, end);
36
- const zero = LineSegment2D.GetPositionAtPercent(seg, 0);
37
- expect(zero.x).toEqual(0);
38
- expect(zero.y).toEqual(0);
39
- const one = LineSegment2D.GetPositionAtPercent(seg, 1);
40
- expect(one.x).toEqual(10);
41
- expect(one.y).toEqual(0);
42
- });
43
- test("Intersect", () => {
44
- const lineA = new LineSegment2D(new Vector2(1, 1), new Vector2(15, 1));
45
- const lineB = new LineSegment2D(new Vector2(10, -2), new Vector2(10, 2));
46
- const intersection = LineSegment2D.Intersect(lineA, lineB);
47
- expect(intersection?.x).toEqual(10);
48
- expect(intersection?.y).toEqual(1);
49
- });
50
- test("Intersect with tolerance", () => {
51
- const lineA = new LineSegment2D(new Vector2(1, 1), new Vector2(9.5, 1));
52
- const lineB = new LineSegment2D(new Vector2(10, -2), new Vector2(10, 2));
53
- const intersection1 = LineSegment2D.Intersect(lineA, lineB, 0.2);
54
- expect(intersection1).toBeUndefined();
55
- const intersection2 = LineSegment2D.Intersect(lineA, lineB, 0.5);
56
- expect(intersection2?.x).toEqual(10);
57
- expect(intersection2?.y).toEqual(1);
58
- });
59
- test("Parallel line should not intersect", () => {
60
- const lineA = new LineSegment2D(new Vector2(1, 0), new Vector2(15, 0));
61
- const lineB = new LineSegment2D(new Vector2(0, 0), new Vector2(10, 0));
62
- const intersection = LineSegment2D.Intersect(lineA, lineB);
63
- expect(intersection).toBeUndefined();
64
- });
65
- test("Short segments should not intersect", () => {
66
- const lineA = new LineSegment2D(new Vector2(1, 1), new Vector2(9, 1));
67
- const lineB = new LineSegment2D(new Vector2(10, -2), new Vector2(10, 2));
68
- const intersection = LineSegment2D.Intersect(lineA, lineB);
69
- expect(intersection).toBeUndefined();
70
- });
71
- test("Equality", () => {
72
- const lineA = new LineSegment2D(new Vector2(1, 0), new Vector2(15, 0));
73
- const lineB = new LineSegment2D(new Vector2(1, 0), new Vector2(15, 0));
74
- expect(lineA).toEqual(lineB);
75
- });
76
- test("Closest point", () => {
77
- const startPosition = new Vector2(-9, 2);
78
- const endPosition = new Vector2(3, 2);
79
- const line = new LineSegment2D(startPosition, endPosition);
80
- const closestPoint = LineSegment2D.ClosestPointOnLine(line, new Vector2(1, 1));
81
- expect(closestPoint.x).toEqual(1);
82
- expect(closestPoint.y).toEqual(2);
83
- });
84
- test("Closest point should be clamped to the start", () => {
85
- const startPosition = new Vector2(-9, 2);
86
- const endPosition = new Vector2(3, 2);
87
- const line = new LineSegment2D(startPosition, endPosition);
88
- const closestPoint = LineSegment2D.ClosestPointOnLine(line, new Vector2(-12, 2));
89
- expect(closestPoint.x).toEqual(-9);
90
- expect(closestPoint.y).toEqual(2);
91
- });
92
- test("Closest point should be clamped to the end", () => {
93
- const startPosition = new Vector2(-9, 2);
94
- const endPosition = new Vector2(3, 2);
95
- const line = new LineSegment2D(startPosition, endPosition);
96
- const closestPoint = LineSegment2D.ClosestPointOnLine(line, new Vector2(5, 2));
97
- expect(closestPoint.x).toEqual(3);
98
- expect(closestPoint.y).toEqual(2);
99
- });
100
- //# sourceMappingURL=LineSegment2D.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LineSegment2D.test.js","sourceRoot":"","sources":["../../../src/ValueObjects/LineSegment2D.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,IAAI,CAAC,2CAA2C,EAAE,GAAG,EAAE;IACrD,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,CA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,CAAC;IACtC,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAE3D,MAAM,YAAY,GAAG,aAAa,CAAC,kBAAkB,CACnD,IAAI,EACJ,IAAI,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CACpB,CAAC;IAEF,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,4CAA4C,EAAE,GAAG,EAAE;IACtD,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAE3D,MAAM,YAAY,GAAG,aAAa,CAAC,kBAAkB,CACnD,IAAI,EACJ,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAClB,CAAC;IAEF,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC,CAAC","sourcesContent":["import { Vector2 } from \"./Vector2\";\r\nimport { LineSegment2D } from \"./LineSegment2D\";\r\n\r\ntest(\"Construction stores the start and end pos\", () => {\r\n const start = new Vector2(2, 3);\r\n const end = new Vector2(4, 5);\r\n const seg = new LineSegment2D(start, end);\r\n\r\n expect(seg.end.x).toEqual(4);\r\n expect(seg.end.y).toEqual(5);\r\n\r\n expect(seg.start.x).toEqual(2);\r\n expect(seg.start.y).toEqual(3);\r\n});\r\n\r\ntest(\"Direction\", () => {\r\n const start = new Vector2(2, 3);\r\n const end = new Vector2(2, 5);\r\n const seg = new LineSegment2D(start, end);\r\n\r\n expect(seg.direction.x).toEqual(0);\r\n expect(seg.direction.y).toEqual(1);\r\n});\r\n\r\ntest(\"Direction\", () => {\r\n const start = new Vector2(2, 3);\r\n const end = new Vector2(-10, 3);\r\n const seg = new LineSegment2D(start, end);\r\n\r\n expect(seg.direction.x).toEqual(-1);\r\n expect(seg.direction.y).toEqual(0);\r\n});\r\n\r\ntest(\"Length\", () => {\r\n const start = new Vector2(0, 0);\r\n const end = new Vector2(10, 0);\r\n const seg = new LineSegment2D(start, end);\r\n\r\n expect(seg.length).toEqual(10);\r\n});\r\n\r\ntest(\"Position at percent\", () => {\r\n const start = new Vector2(0, 0);\r\n const end = new Vector2(10, 0);\r\n const seg = new LineSegment2D(start, end);\r\n\r\n const zero = LineSegment2D.GetPositionAtPercent(seg, 0);\r\n expect(zero.x).toEqual(0);\r\n expect(zero.y).toEqual(0);\r\n\r\n const one = LineSegment2D.GetPositionAtPercent(seg, 1);\r\n expect(one.x).toEqual(10);\r\n expect(one.y).toEqual(0);\r\n});\r\n\r\ntest(\"Intersect\", () => {\r\n const lineA = new LineSegment2D(new Vector2(1, 1), new Vector2(15, 1));\r\n const lineB = new LineSegment2D(new Vector2(10, -2), new Vector2(10, 2));\r\n\r\n const intersection = LineSegment2D.Intersect(lineA, lineB);\r\n\r\n expect(intersection?.x).toEqual(10);\r\n expect(intersection?.y).toEqual(1);\r\n});\r\n\r\ntest(\"Intersect with tolerance\", () => {\r\n const lineA = new LineSegment2D(new Vector2(1, 1), new Vector2(9.5, 1));\r\n const lineB = new LineSegment2D(new Vector2(10, -2), new Vector2(10, 2));\r\n\r\n const intersection1 = LineSegment2D.Intersect(lineA, lineB, 0.2);\r\n expect(intersection1).toBeUndefined();\r\n\r\n const intersection2 = LineSegment2D.Intersect(lineA, lineB, 0.5);\r\n\r\n expect(intersection2?.x).toEqual(10);\r\n expect(intersection2?.y).toEqual(1);\r\n});\r\n\r\ntest(\"Parallel line should not intersect\", () => {\r\n const lineA = new LineSegment2D(new Vector2(1, 0), new Vector2(15, 0));\r\n const lineB = new LineSegment2D(new Vector2(0, 0), new Vector2(10, 0));\r\n\r\n const intersection = LineSegment2D.Intersect(lineA, lineB);\r\n\r\n expect(intersection).toBeUndefined();\r\n});\r\n\r\ntest(\"Short segments should not intersect\", () => {\r\n const lineA = new LineSegment2D(new Vector2(1, 1), new Vector2(9, 1));\r\n const lineB = new LineSegment2D(new Vector2(10, -2), new Vector2(10, 2));\r\n\r\n const intersection = LineSegment2D.Intersect(lineA, lineB);\r\n\r\n expect(intersection).toBeUndefined();\r\n});\r\n\r\ntest(\"Equality\", () => {\r\n const lineA = new LineSegment2D(new Vector2(1, 0), new Vector2(15, 0));\r\n const lineB = new LineSegment2D(new Vector2(1, 0), new Vector2(15, 0));\r\n\r\n expect(lineA).toEqual(lineB);\r\n});\r\n\r\ntest(\"Closest point\", () => {\r\n const startPosition = new Vector2(-9, 2);\r\n const endPosition = new Vector2(3, 2);\r\n const line = new LineSegment2D(startPosition, endPosition);\r\n\r\n const closestPoint = LineSegment2D.ClosestPointOnLine(\r\n line,\r\n new Vector2(1, 1)\r\n );\r\n\r\n expect(closestPoint.x).toEqual(1);\r\n expect(closestPoint.y).toEqual(2);\r\n});\r\n\r\ntest(\"Closest point should be clamped to the start\", () => {\r\n const startPosition = new Vector2(-9, 2);\r\n const endPosition = new Vector2(3, 2);\r\n const line = new LineSegment2D(startPosition, endPosition);\r\n\r\n const closestPoint = LineSegment2D.ClosestPointOnLine(\r\n line,\r\n new Vector2(-12, 2)\r\n );\r\n\r\n expect(closestPoint.x).toEqual(-9);\r\n expect(closestPoint.y).toEqual(2);\r\n});\r\n\r\ntest(\"Closest point should be clamped to the end\", () => {\r\n const startPosition = new Vector2(-9, 2);\r\n const endPosition = new Vector2(3, 2);\r\n const line = new LineSegment2D(startPosition, endPosition);\r\n\r\n const closestPoint = LineSegment2D.ClosestPointOnLine(\r\n line,\r\n new Vector2(5, 2)\r\n );\r\n\r\n expect(closestPoint.x).toEqual(3);\r\n expect(closestPoint.y).toEqual(2);\r\n});\r\n"]}
@@ -1,383 +0,0 @@
1
- import { Angle } from "./Angle";
2
- import { Matrix } from "./Matrix";
3
- import { Quaternion } from "./Quaternion";
4
- import { Vector3 } from "./Vector3";
5
- describe("Matrix Value Object", () => {
6
- it("Forms an identity matrix", () => {
7
- const identity = Matrix.Identity();
8
- const expected = new Matrix(identityArray);
9
- expect(identity).toEqual(expected);
10
- });
11
- it("Forms a zero matrix", () => {
12
- const identity = Matrix.Zero();
13
- const expected = new Matrix(zeroArray);
14
- expect(identity).toEqual(expected);
15
- });
16
- it("Checks to see if two matricies are equal", () => {
17
- const m1 = new Matrix(sequentialArray);
18
- const m2 = new Matrix(sequentialArray);
19
- const m3 = new Matrix(zeroArray);
20
- expect(Matrix.Equal(m1, m2)).toEqual(true);
21
- expect(Matrix.Equal(m1, m3)).toEqual(false);
22
- });
23
- it("Checks for eqaulity during tests", () => {
24
- const m1 = new Matrix(sequentialArray);
25
- const m2 = new Matrix(sequentialArray);
26
- expect(m1).toEqual(m2);
27
- });
28
- it("Returns the translation", () => {
29
- const m1 = new Matrix(sequentialArray);
30
- expect(m1.translation).toEqual(new Vector3(13, 14, 15));
31
- });
32
- it("Multipiles two matricies", () => {
33
- const m1 = new Matrix(sequentialArray);
34
- const m2 = new Matrix([
35
- 16,
36
- 15,
37
- 14,
38
- 13,
39
- 12,
40
- 11,
41
- 10,
42
- 9,
43
- 8,
44
- 7,
45
- 6,
46
- 5,
47
- 4,
48
- 3,
49
- 2,
50
- 1,
51
- ]);
52
- const expected = new Matrix([
53
- 386,
54
- 444,
55
- 502,
56
- 560,
57
- 274,
58
- 316,
59
- 358,
60
- 400,
61
- 162,
62
- 188,
63
- 214,
64
- 240,
65
- 50,
66
- 60,
67
- 70,
68
- 80,
69
- ]);
70
- const result = Matrix.Multiply(m1, m2);
71
- expect(result.m).toEqual(expected.m);
72
- });
73
- it("Composes an Identity matrix", () => {
74
- const pos = Vector3.Zero();
75
- const scale = Vector3.One();
76
- const rot = Quaternion.Identity();
77
- const mat = Matrix.Compose(scale, rot, pos);
78
- expect(mat).toEqual(Matrix.Identity());
79
- });
80
- it("Composes a matrix with a position", () => {
81
- const pos = new Vector3(11, 22, 33);
82
- const scale = Vector3.One();
83
- const rot = Quaternion.Identity();
84
- const composed = Matrix.Compose(scale, rot, pos);
85
- const expected = new Matrix([
86
- 1,
87
- 0,
88
- 0,
89
- 0,
90
- 0,
91
- 1,
92
- 0,
93
- 0,
94
- 0,
95
- 0,
96
- 1,
97
- 0,
98
- 11,
99
- 22,
100
- 33,
101
- 1,
102
- ]);
103
- expect(composed).toEqual(expected);
104
- });
105
- it("Composes a matrix with scale", () => {
106
- const pos = Vector3.Zero();
107
- const scale = new Vector3(6, 7, 8);
108
- const rot = Quaternion.Identity();
109
- const composed = Matrix.Compose(scale, rot, pos);
110
- const expected = new Matrix([
111
- 6,
112
- 0,
113
- 0,
114
- 0,
115
- 0,
116
- 7,
117
- 0,
118
- 0,
119
- 0,
120
- 0,
121
- 8,
122
- 0,
123
- 0,
124
- 0,
125
- 0,
126
- 1,
127
- ]);
128
- expect(composed).toEqual(expected);
129
- });
130
- it("Composes a matrix with rotation", () => {
131
- // Number are from Babylon
132
- const pos = Vector3.Zero();
133
- const scale = Vector3.One();
134
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
135
- const composed = Matrix.Compose(scale, rot, pos);
136
- expect(composed.m[0]).toBeCloseTo(0.5199598670005798);
137
- expect(composed.m[1]).toBeCloseTo(0.07624746859073639);
138
- expect(composed.m[2]).toBeCloseTo(0.8507808446884155);
139
- expect(composed.m[4]).toBeCloseTo(-0.6987635493278503);
140
- expect(composed.m[5]).toBeCloseTo(-0.5348952412605286);
141
- expect(composed.m[6]).toBeCloseTo(0.47499117255210876);
142
- expect(composed.m[8]).toBeCloseTo(0.4912954866886139);
143
- expect(composed.m[9]).toBeCloseTo(-0.8414709568023682);
144
- expect(composed.m[10]).toBeCloseTo(-0.22484509646892548);
145
- });
146
- it("Calculates a determinant", () => {
147
- const sequential = new Matrix(sequentialArray);
148
- expect(sequential.determinate).toEqual(0);
149
- const identity = Matrix.Identity();
150
- expect(identity.determinate).toEqual(1);
151
- const pos = new Vector3(23, 26, 29);
152
- const scale = new Vector3(6, 7, 8);
153
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
154
- const composed = Matrix.Compose(scale, rot, pos);
155
- expect(composed.determinate).toBeCloseTo(335.99999908851385); // Number is from babylon
156
- });
157
- it("Returns the translation", () => {
158
- const pos = new Vector3(23, 26, 29);
159
- const scale = new Vector3(6, 7, 8);
160
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
161
- const composed = Matrix.Compose(scale, rot, pos);
162
- expect(composed.translation).toEqual(pos);
163
- });
164
- it("Returns the scale", () => {
165
- const pos = new Vector3(23, 26, 29);
166
- const scale = new Vector3(6, 7, 8);
167
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
168
- const composed = Matrix.Compose(scale, rot, pos);
169
- expect(composed.scale.x).toBeCloseTo(scale.x);
170
- expect(composed.scale.y).toBeCloseTo(scale.y);
171
- expect(composed.scale.z).toBeCloseTo(scale.z);
172
- });
173
- it("Returns the negative scale", () => {
174
- const pos = new Vector3(23, 26, 29);
175
- const scale = new Vector3(6, -7, 8);
176
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
177
- const composed = Matrix.Compose(scale, rot, pos);
178
- expect(composed.scale.x).toBeCloseTo(scale.x);
179
- expect(composed.scale.y).toBeCloseTo(scale.y);
180
- expect(composed.scale.z).toBeCloseTo(scale.z);
181
- });
182
- it("Returns a rotation matrix", () => {
183
- const pos = new Vector3(23, 26, 29);
184
- const scale = new Vector3(6, -7, 8);
185
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
186
- const composed = Matrix.Compose(scale, rot, pos);
187
- const expected = Matrix.Compose(Vector3.One(), rot, Vector3.Zero());
188
- expect(Matrix.Close(composed.rotationMatrix, expected)).toEqual(true);
189
- });
190
- it("Returns the rotation", () => {
191
- const pos = new Vector3(23, 26, 29);
192
- const scale = new Vector3(6, 7, 8);
193
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
194
- const composed = Matrix.Compose(scale, rot, pos);
195
- expect(Quaternion.Close(composed.rotation, rot)).toEqual(true);
196
- });
197
- it("Checks if matricies are close", () => {
198
- const m1 = new Matrix(sequentialArray);
199
- const biggerValues = [...sequentialArray];
200
- biggerValues.forEach((val, i) => {
201
- biggerValues[i] = val + 0.01; // Just a little bump
202
- });
203
- const bigger = new Matrix(biggerValues);
204
- const smallerValues = [...sequentialArray];
205
- smallerValues.forEach((val, i) => {
206
- smallerValues[i] = val - 0.01; // Just a little bump
207
- });
208
- const smaller = new Matrix(smallerValues);
209
- expect(Matrix.Close(m1, bigger, 0.0101)).toEqual(true);
210
- expect(Matrix.Close(m1, bigger, 0.0099)).toEqual(false);
211
- expect(Matrix.Close(m1, smaller, 0.0101)).toEqual(true);
212
- expect(Matrix.Close(m1, smaller, 0.0099)).toEqual(false);
213
- });
214
- it("Results in an Identity if we invert the identity", () => {
215
- const identity = Matrix.Identity();
216
- const inverted = Matrix.Invert(identity);
217
- expect(Matrix.Close(inverted, identity)).toEqual(true);
218
- });
219
- it("Inverts a matrix", () => {
220
- const pos = new Vector3(23, 26, 29);
221
- const scale = new Vector3(6, 7, 8);
222
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
223
- const mat = Matrix.Compose(scale, rot, pos);
224
- const inverted = Matrix.Invert(mat);
225
- // Numbers are from babylon
226
- const expected = new Matrix([
227
- 0.08665996789932251,
228
- -0.09982336312532425,
229
- 0.061411935836076736,
230
- -0,
231
- 0.0127079077064991,
232
- -0.0764136016368866,
233
- -0.10518387705087662,
234
- 0,
235
- 0.14179681241512299,
236
- 0.06785587966442108,
237
- -0.028105635195970535,
238
- -0,
239
- -6.435692310333252,
240
- 2.314870595932007,
241
- 2.1373696327209473,
242
- 1,
243
- ]);
244
- expect(Matrix.Close(inverted, expected)).toEqual(true);
245
- });
246
- it("Creates a rotation matrix from an axis ange angle", () => {
247
- const axis = new Vector3(1, 2, 3);
248
- const angle = Angle.FromRadians(1.3);
249
- const rotationMatrix = Matrix.FromRotationAxisAngle(axis, angle);
250
- // Numbers are from babylon
251
- const expected = new Matrix([
252
- 0.3198203444480896,
253
- 0.8772082924842834,
254
- -0.3580789864063263,
255
- 0,
256
- -0.6679222583770752,
257
- 0.476784884929657,
258
- 0.5714508295059204,
259
- 0,
260
- 0.6720080375671387,
261
- 0.05640731751918793,
262
- 0.7383924126625061,
263
- 0,
264
- 0,
265
- 0,
266
- 0,
267
- 1,
268
- ]);
269
- expect(Matrix.Close(rotationMatrix, expected)).toEqual(true);
270
- });
271
- it("Sets the transformation of a matrix", () => {
272
- const pos = new Vector3(23, 26, 29);
273
- const scale = new Vector3(6, 7, 8);
274
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
275
- const mat = Matrix.Compose(scale, rot, pos);
276
- const newTrans = new Vector3(3, 2, 1);
277
- const newMat = Matrix.SetMatrixTranslation(mat, newTrans);
278
- expect(Quaternion.Close(newMat.rotation, rot)).toEqual(true);
279
- expect(Vector3.Close(newMat.translation, newTrans)).toEqual(true);
280
- expect(Vector3.Close(newMat.scale, scale)).toEqual(true);
281
- });
282
- it("Sets the rotation of a matrix", () => {
283
- const pos = new Vector3(23, 26, 29);
284
- const scale = new Vector3(6, 7, 8);
285
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
286
- const mat = Matrix.Compose(scale, rot, pos);
287
- const newRotation = Quaternion.FromEuler(Angle.FromRadians(1.1), Angle.FromRadians(2.2), Angle.FromRadians(3.3));
288
- const newMat = Matrix.SetMatrixRotation(mat, newRotation);
289
- expect(Quaternion.Close(newMat.rotation, newRotation)).toEqual(true);
290
- expect(Vector3.Close(newMat.translation, pos)).toEqual(true);
291
- expect(Vector3.Close(newMat.scale, scale)).toEqual(true);
292
- });
293
- it("Sets the scale of a matrix", () => {
294
- const pos = new Vector3(23, 26, 29);
295
- const scale = new Vector3(6, 7, 8);
296
- const rot = Quaternion.FromEuler(Angle.FromRadians(1), Angle.FromRadians(2), Angle.FromRadians(3));
297
- const mat = Matrix.Compose(scale, rot, pos);
298
- const newScale = new Vector3(1, 2, 3);
299
- const newMat = Matrix.SetMatrixScale(mat, newScale);
300
- expect(Quaternion.Close(newMat.rotation, rot)).toEqual(true);
301
- expect(Vector3.Close(newMat.translation, pos)).toEqual(true);
302
- expect(Vector3.Close(newMat.scale, newScale)).toEqual(true);
303
- });
304
- it("Makes a Matrix from a Float 32 Array", () => {
305
- const float32Array = new Float32Array(16);
306
- for (let index = 0; index < 16; index++) {
307
- float32Array[index] = index * 2;
308
- }
309
- const matrix = Matrix.FromFloat32Array(float32Array);
310
- for (let index = 0; index < 16; index++) {
311
- expect(matrix.m[index]).toEqual(index * 2);
312
- }
313
- });
314
- it("Logs an error and return the identity if the float 32 array does not have 16 itesm", () => {
315
- const float32Array = new Float32Array(1);
316
- console.error = jest.fn();
317
- const matrix = Matrix.FromFloat32Array(float32Array);
318
- expect(console.error).toBeCalled();
319
- expect(matrix).toEqual(Matrix.Identity());
320
- });
321
- it("Flips the handedness of a transform matrix", () => {
322
- const matrix = new Matrix(sequentialArray);
323
- const flipped = Matrix.FlipTransformMatrixHand(matrix);
324
- for (let index = 0; index < 16; index++) {
325
- if (index === 2 || index === 6 || index === 8 || index === 9 || index === 14) {
326
- expect(matrix.m[index]).toEqual(-flipped.m[index]);
327
- }
328
- else {
329
- expect(matrix.m[index]).toEqual(flipped.m[index]);
330
- }
331
- }
332
- });
333
- it("Flips the handedness of a projection matrix", () => {
334
- const matrix = new Matrix(sequentialArray);
335
- const flipped = Matrix.FlipProjectionMatrixHand(matrix);
336
- for (let index = 0; index < 16; index++) {
337
- if (index === 8 || index === 9 || index === 10 || index === 11) {
338
- expect(matrix.m[index]).toEqual(-flipped.m[index]);
339
- }
340
- else {
341
- expect(matrix.m[index]).toEqual(flipped.m[index]);
342
- }
343
- }
344
- });
345
- });
346
- const identityArray = [
347
- 1,
348
- 0,
349
- 0,
350
- 0,
351
- 0,
352
- 1,
353
- 0,
354
- 0,
355
- 0,
356
- 0,
357
- 1,
358
- 0,
359
- 0,
360
- 0,
361
- 0,
362
- 1,
363
- ];
364
- const zeroArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
365
- const sequentialArray = [
366
- 1,
367
- 2,
368
- 3,
369
- 4,
370
- 5,
371
- 6,
372
- 7,
373
- 8,
374
- 9,
375
- 10,
376
- 11,
377
- 12,
378
- 13,
379
- 14,
380
- 15,
381
- 16,
382
- ];
383
- //# sourceMappingURL=Matrix.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Matrix.test.js","sourceRoot":"","sources":["../../../src/ValueObjects/Matrix.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE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AC,CAAC;YACrD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,aAAa,GAAgB;IACjC,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;CACF,CAAC;AAEF,MAAM,SAAS,GAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAEhF,MAAM,eAAe,GAAgB;IACnC,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE;CACH,CAAC","sourcesContent":["import { Angle } from \"./Angle\";\r\nimport { Matrix, MatrixArray } from \"./Matrix\";\r\nimport { Quaternion } from \"./Quaternion\";\r\nimport { Vector3 } from \"./Vector3\";\r\n\r\ndescribe(\"Matrix Value Object\", () => {\r\n it(\"Forms an identity matrix\", () => {\r\n const identity = Matrix.Identity();\r\n const expected = new Matrix(identityArray);\r\n expect(identity).toEqual(expected);\r\n });\r\n\r\n it(\"Forms a zero matrix\", () => {\r\n const identity = Matrix.Zero();\r\n const expected = new Matrix(zeroArray);\r\n expect(identity).toEqual(expected);\r\n });\r\n\r\n it(\"Checks to see if two matricies are equal\", () => {\r\n const m1 = new Matrix(sequentialArray);\r\n const m2 = new Matrix(sequentialArray);\r\n const m3 = new Matrix(zeroArray);\r\n\r\n expect(Matrix.Equal(m1, m2)).toEqual(true);\r\n expect(Matrix.Equal(m1, m3)).toEqual(false);\r\n });\r\n\r\n it(\"Checks for eqaulity during tests\", () => {\r\n const m1 = new Matrix(sequentialArray);\r\n const m2 = new Matrix(sequentialArray);\r\n\r\n expect(m1).toEqual(m2);\r\n });\r\n\r\n it(\"Returns the translation\", () => {\r\n const m1 = new Matrix(sequentialArray);\r\n\r\n expect(m1.translation).toEqual(new Vector3(13, 14, 15));\r\n });\r\n\r\n it(\"Multipiles two matricies\", () => {\r\n const m1 = new Matrix(sequentialArray);\r\n const m2 = new Matrix([\r\n 16,\r\n 15,\r\n 14,\r\n 13,\r\n 12,\r\n 11,\r\n 10,\r\n 9,\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n 1,\r\n ]);\r\n const expected = new Matrix([\r\n 386,\r\n 444,\r\n 502,\r\n 560,\r\n 274,\r\n 316,\r\n 358,\r\n 400,\r\n 162,\r\n 188,\r\n 214,\r\n 240,\r\n 50,\r\n 60,\r\n 70,\r\n 80,\r\n ]);\r\n const result = Matrix.Multiply(m1, m2);\r\n expect(result.m).toEqual(expected.m);\r\n });\r\n\r\n it(\"Composes an Identity matrix\", () => {\r\n const pos = Vector3.Zero();\r\n const scale = Vector3.One();\r\n const rot = Quaternion.Identity();\r\n\r\n const mat = Matrix.Compose(scale, rot, pos);\r\n expect(mat).toEqual(Matrix.Identity());\r\n });\r\n\r\n it(\"Composes a matrix with a position\", () => {\r\n const pos = new Vector3(11, 22, 33);\r\n const scale = Vector3.One();\r\n const rot = Quaternion.Identity();\r\n\r\n const composed = Matrix.Compose(scale, rot, pos);\r\n const expected = new Matrix([\r\n 1,\r\n 0,\r\n 0,\r\n 0,\r\n\r\n 0,\r\n 1,\r\n 0,\r\n 0,\r\n\r\n 0,\r\n 0,\r\n 1,\r\n 0,\r\n\r\n 11,\r\n 22,\r\n 33,\r\n 1,\r\n ]);\r\n expect(composed).toEqual(expected);\r\n });\r\n\r\n it(\"Composes a matrix with scale\", () => {\r\n const pos = Vector3.Zero();\r\n const scale = new Vector3(6, 7, 8);\r\n const rot = Quaternion.Identity();\r\n\r\n const composed = Matrix.Compose(scale, rot, pos);\r\n const expected = new Matrix([\r\n 6,\r\n 0,\r\n 0,\r\n 0,\r\n\r\n 0,\r\n 7,\r\n 0,\r\n 0,\r\n\r\n 0,\r\n 0,\r\n 8,\r\n 0,\r\n\r\n 0,\r\n 0,\r\n 0,\r\n 1,\r\n ]);\r\n expect(composed).toEqual(expected);\r\n });\r\n\r\n it(\"Composes a matrix with rotation\", () => {\r\n // Number are from Babylon\r\n const pos = Vector3.Zero();\r\n const scale = Vector3.One();\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n\r\n const composed = Matrix.Compose(scale, rot, pos);\r\n expect(composed.m[0]).toBeCloseTo(0.5199598670005798);\r\n expect(composed.m[1]).toBeCloseTo(0.07624746859073639);\r\n expect(composed.m[2]).toBeCloseTo(0.8507808446884155);\r\n\r\n expect(composed.m[4]).toBeCloseTo(-0.6987635493278503);\r\n expect(composed.m[5]).toBeCloseTo(-0.5348952412605286);\r\n expect(composed.m[6]).toBeCloseTo(0.47499117255210876);\r\n\r\n expect(composed.m[8]).toBeCloseTo(0.4912954866886139);\r\n expect(composed.m[9]).toBeCloseTo(-0.8414709568023682);\r\n expect(composed.m[10]).toBeCloseTo(-0.22484509646892548);\r\n });\r\n\r\n it(\"Calculates a determinant\", () => {\r\n const sequential = new Matrix(sequentialArray);\r\n expect(sequential.determinate).toEqual(0);\r\n\r\n const identity = Matrix.Identity();\r\n expect(identity.determinate).toEqual(1);\r\n\r\n const pos = new Vector3(23, 26, 29);\r\n const scale = new Vector3(6, 7, 8);\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n\r\n const composed = Matrix.Compose(scale, rot, pos);\r\n expect(composed.determinate).toBeCloseTo(335.99999908851385); // Number is from babylon\r\n });\r\n\r\n it(\"Returns the translation\", () => {\r\n const pos = new Vector3(23, 26, 29);\r\n const scale = new Vector3(6, 7, 8);\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n\r\n const composed = Matrix.Compose(scale, rot, pos);\r\n expect(composed.translation).toEqual(pos);\r\n });\r\n\r\n it(\"Returns the scale\", () => {\r\n const pos = new Vector3(23, 26, 29);\r\n const scale = new Vector3(6, 7, 8);\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n\r\n const composed = Matrix.Compose(scale, rot, pos);\r\n expect(composed.scale.x).toBeCloseTo(scale.x);\r\n expect(composed.scale.y).toBeCloseTo(scale.y);\r\n expect(composed.scale.z).toBeCloseTo(scale.z);\r\n });\r\n\r\n it(\"Returns the negative scale\", () => {\r\n const pos = new Vector3(23, 26, 29);\r\n const scale = new Vector3(6, -7, 8);\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n\r\n const composed = Matrix.Compose(scale, rot, pos);\r\n expect(composed.scale.x).toBeCloseTo(scale.x);\r\n expect(composed.scale.y).toBeCloseTo(scale.y);\r\n expect(composed.scale.z).toBeCloseTo(scale.z);\r\n });\r\n\r\n it(\"Returns a rotation matrix\", () => {\r\n const pos = new Vector3(23, 26, 29);\r\n const scale = new Vector3(6, -7, 8);\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n\r\n const composed = Matrix.Compose(scale, rot, pos);\r\n const expected = Matrix.Compose(Vector3.One(), rot, Vector3.Zero());\r\n\r\n expect(Matrix.Close(composed.rotationMatrix, expected)).toEqual(true);\r\n });\r\n\r\n it(\"Returns the rotation\", () => {\r\n const pos = new Vector3(23, 26, 29);\r\n const scale = new Vector3(6, 7, 8);\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n const composed = Matrix.Compose(scale, rot, pos);\r\n\r\n expect(Quaternion.Close(composed.rotation, rot)).toEqual(true);\r\n });\r\n\r\n it(\"Checks if matricies are close\", () => {\r\n const m1 = new Matrix(sequentialArray);\r\n const biggerValues: MatrixArray = [...sequentialArray];\r\n biggerValues.forEach((val, i) => {\r\n biggerValues[i] = val + 0.01; // Just a little bump\r\n });\r\n const bigger = new Matrix(biggerValues);\r\n\r\n const smallerValues: MatrixArray = [...sequentialArray];\r\n smallerValues.forEach((val, i) => {\r\n smallerValues[i] = val - 0.01; // Just a little bump\r\n });\r\n const smaller = new Matrix(smallerValues);\r\n\r\n expect(Matrix.Close(m1, bigger, 0.0101)).toEqual(true);\r\n expect(Matrix.Close(m1, bigger, 0.0099)).toEqual(false);\r\n\r\n expect(Matrix.Close(m1, smaller, 0.0101)).toEqual(true);\r\n expect(Matrix.Close(m1, smaller, 0.0099)).toEqual(false);\r\n });\r\n\r\n it(\"Results in an Identity if we invert the identity\", () => {\r\n const identity = Matrix.Identity();\r\n const inverted = Matrix.Invert(identity);\r\n\r\n expect(Matrix.Close(inverted, identity)).toEqual(true);\r\n });\r\n\r\n it(\"Inverts a matrix\", () => {\r\n const pos = new Vector3(23, 26, 29);\r\n const scale = new Vector3(6, 7, 8);\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n const mat = Matrix.Compose(scale, rot, pos);\r\n const inverted = Matrix.Invert(mat);\r\n\r\n // Numbers are from babylon\r\n const expected = new Matrix([\r\n 0.08665996789932251,\r\n -0.09982336312532425,\r\n 0.061411935836076736,\r\n -0,\r\n 0.0127079077064991,\r\n -0.0764136016368866,\r\n -0.10518387705087662,\r\n 0,\r\n 0.14179681241512299,\r\n 0.06785587966442108,\r\n -0.028105635195970535,\r\n -0,\r\n -6.435692310333252,\r\n 2.314870595932007,\r\n 2.1373696327209473,\r\n 1,\r\n ]);\r\n\r\n expect(Matrix.Close(inverted, expected)).toEqual(true);\r\n });\r\n\r\n it(\"Creates a rotation matrix from an axis ange angle\", () => {\r\n const axis = new Vector3(1, 2, 3);\r\n const angle = Angle.FromRadians(1.3);\r\n const rotationMatrix = Matrix.FromRotationAxisAngle(axis, angle);\r\n\r\n // Numbers are from babylon\r\n const expected = new Matrix([\r\n 0.3198203444480896,\r\n 0.8772082924842834,\r\n -0.3580789864063263,\r\n 0,\r\n -0.6679222583770752,\r\n 0.476784884929657,\r\n 0.5714508295059204,\r\n 0,\r\n 0.6720080375671387,\r\n 0.05640731751918793,\r\n 0.7383924126625061,\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 1,\r\n ]);\r\n\r\n expect(Matrix.Close(rotationMatrix, expected)).toEqual(true);\r\n });\r\n\r\n it(\"Sets the transformation of a matrix\", () => {\r\n const pos = new Vector3(23, 26, 29);\r\n const scale = new Vector3(6, 7, 8);\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n const mat = Matrix.Compose(scale, rot, pos);\r\n\r\n const newTrans = new Vector3(3, 2, 1);\r\n const newMat = Matrix.SetMatrixTranslation(mat, newTrans);\r\n expect(Quaternion.Close(newMat.rotation, rot)).toEqual(true);\r\n expect(Vector3.Close(newMat.translation, newTrans)).toEqual(true);\r\n expect(Vector3.Close(newMat.scale, scale)).toEqual(true);\r\n });\r\n\r\n it(\"Sets the rotation of a matrix\", () => {\r\n const pos = new Vector3(23, 26, 29);\r\n const scale = new Vector3(6, 7, 8);\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n const mat = Matrix.Compose(scale, rot, pos);\r\n\r\n const newRotation = Quaternion.FromEuler(\r\n Angle.FromRadians(1.1),\r\n Angle.FromRadians(2.2),\r\n Angle.FromRadians(3.3)\r\n );\r\n const newMat = Matrix.SetMatrixRotation(mat, newRotation);\r\n expect(Quaternion.Close(newMat.rotation, newRotation)).toEqual(true);\r\n expect(Vector3.Close(newMat.translation, pos)).toEqual(true);\r\n expect(Vector3.Close(newMat.scale, scale)).toEqual(true);\r\n });\r\n\r\n it(\"Sets the scale of a matrix\", () => {\r\n const pos = new Vector3(23, 26, 29);\r\n const scale = new Vector3(6, 7, 8);\r\n const rot = Quaternion.FromEuler(\r\n Angle.FromRadians(1),\r\n Angle.FromRadians(2),\r\n Angle.FromRadians(3)\r\n );\r\n const mat = Matrix.Compose(scale, rot, pos);\r\n\r\n const newScale = new Vector3(1, 2, 3);\r\n const newMat = Matrix.SetMatrixScale(mat, newScale);\r\n expect(Quaternion.Close(newMat.rotation, rot)).toEqual(true);\r\n expect(Vector3.Close(newMat.translation, pos)).toEqual(true);\r\n expect(Vector3.Close(newMat.scale, newScale)).toEqual(true);\r\n });\r\n\r\n it(\"Makes a Matrix from a Float 32 Array\", () => {\r\n const float32Array = new Float32Array(16);\r\n for (let index = 0; index < 16; index++) {\r\n float32Array[index] = index * 2;\r\n }\r\n\r\n const matrix = Matrix.FromFloat32Array(float32Array);\r\n\r\n for (let index = 0; index < 16; index++) {\r\n expect(matrix.m[index]).toEqual(index * 2);\r\n }\r\n })\r\n\r\n it(\"Logs an error and return the identity if the float 32 array does not have 16 itesm\", () => {\r\n const float32Array = new Float32Array(1);\r\n console.error = jest.fn();\r\n const matrix = Matrix.FromFloat32Array(float32Array);\r\n\r\n expect(console.error).toBeCalled();\r\n expect(matrix).toEqual(Matrix.Identity());\r\n })\r\n\r\n it(\"Flips the handedness of a transform matrix\", () => {\r\n const matrix = new Matrix(sequentialArray);\r\n const flipped = Matrix.FlipTransformMatrixHand(matrix);\r\n\r\n for (let index = 0; index < 16; index++) {\r\n if (index === 2 || index === 6 || index === 8 || index === 9 || index === 14) {\r\n expect(matrix.m[index]).toEqual(-flipped.m[index]);\r\n } else {\r\n expect(matrix.m[index]).toEqual(flipped.m[index]);\r\n }\r\n }\r\n })\r\n\r\n it(\"Flips the handedness of a projection matrix\", () => {\r\n const matrix = new Matrix(sequentialArray);\r\n const flipped = Matrix.FlipProjectionMatrixHand(matrix);\r\n\r\n for (let index = 0; index < 16; index++) {\r\n if (index === 8 || index === 9 || index === 10 || index === 11) {\r\n expect(matrix.m[index]).toEqual(-flipped.m[index]);\r\n } else {\r\n expect(matrix.m[index]).toEqual(flipped.m[index]);\r\n }\r\n }\r\n })\r\n});\r\n\r\nconst identityArray: MatrixArray = [\r\n 1,\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 1,\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 1,\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 1,\r\n];\r\n\r\nconst zeroArray: MatrixArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\r\n\r\nconst sequentialArray: MatrixArray = [\r\n 1,\r\n 2,\r\n 3,\r\n 4,\r\n 5,\r\n 6,\r\n 7,\r\n 8,\r\n 9,\r\n 10,\r\n 11,\r\n 12,\r\n 13,\r\n 14,\r\n 15,\r\n 16,\r\n];\r\n"]}