@vived/core 1.2.2 → 1.2.4

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 (570) hide show
  1. package/dist/cjs/AppObject/AppObject.js +59 -0
  2. package/dist/cjs/AppObject/AppObject.js.map +1 -0
  3. package/dist/cjs/AppObject/AppObject.test.js +113 -0
  4. package/dist/cjs/AppObject/AppObject.test.js.map +1 -0
  5. package/dist/cjs/AppObject/AppObjectComponent.js +82 -0
  6. package/dist/cjs/AppObject/AppObjectComponent.js.map +1 -0
  7. package/dist/cjs/AppObject/AppObjectComponent.test.js +132 -0
  8. package/dist/cjs/AppObject/AppObjectComponent.test.js.map +1 -0
  9. package/dist/cjs/AppObject/AppObjectController.js +12 -0
  10. package/dist/cjs/AppObject/AppObjectController.js.map +1 -0
  11. package/dist/cjs/AppObject/AppObjectEntity.js +38 -0
  12. package/dist/cjs/AppObject/AppObjectEntity.js.map +1 -0
  13. package/dist/cjs/AppObject/AppObjectEntity.test.js +108 -0
  14. package/dist/cjs/AppObject/AppObjectEntity.test.js.map +1 -0
  15. package/dist/cjs/AppObject/AppObjectEntityRepo.js +56 -0
  16. package/dist/cjs/AppObject/AppObjectEntityRepo.js.map +1 -0
  17. package/dist/cjs/AppObject/AppObjectEntityRepo.test.js +149 -0
  18. package/dist/cjs/AppObject/AppObjectEntityRepo.test.js.map +1 -0
  19. package/dist/cjs/AppObject/AppObjectPM.js +40 -0
  20. package/dist/cjs/AppObject/AppObjectPM.js.map +1 -0
  21. package/dist/cjs/AppObject/AppObjectPM.test.js +103 -0
  22. package/dist/cjs/AppObject/AppObjectPM.test.js.map +1 -0
  23. package/dist/cjs/AppObject/AppObjectRepo.js +133 -0
  24. package/dist/cjs/AppObject/AppObjectRepo.js.map +1 -0
  25. package/dist/cjs/AppObject/AppObjectRepo.test.js +213 -0
  26. package/dist/cjs/AppObject/AppObjectRepo.test.js.map +1 -0
  27. package/dist/cjs/AppObject/AppObjectUC.js +12 -0
  28. package/dist/cjs/AppObject/AppObjectUC.js.map +1 -0
  29. package/dist/cjs/AppObject/AppObjectView.js +12 -0
  30. package/dist/cjs/AppObject/AppObjectView.js.map +1 -0
  31. package/dist/cjs/AppObject/getSingletonComponent.js +7 -0
  32. package/dist/cjs/AppObject/getSingletonComponent.js.map +1 -0
  33. package/dist/cjs/AppObject/getSingletonComponent.test.js +13 -0
  34. package/dist/cjs/AppObject/getSingletonComponent.test.js.map +1 -0
  35. package/dist/cjs/AppObject/index.js +27 -0
  36. package/dist/cjs/AppObject/index.js.map +1 -0
  37. package/dist/cjs/AppObject/printAppObjectDetails.js +18 -0
  38. package/dist/cjs/AppObject/printAppObjectDetails.js.map +1 -0
  39. package/dist/cjs/Entities/MemoizedAngle.js +23 -0
  40. package/dist/cjs/Entities/MemoizedAngle.js.map +1 -0
  41. package/dist/cjs/Entities/MemoizedAngle.test.js +30 -0
  42. package/dist/cjs/Entities/MemoizedAngle.test.js.map +1 -0
  43. package/dist/cjs/Entities/MemoizedBoolean.js +23 -0
  44. package/dist/cjs/Entities/MemoizedBoolean.js.map +1 -0
  45. package/dist/cjs/Entities/MemoizedBoolean.test.js +34 -0
  46. package/dist/cjs/Entities/MemoizedBoolean.test.js.map +1 -0
  47. package/dist/cjs/Entities/MemoizedColor.js +24 -0
  48. package/dist/cjs/Entities/MemoizedColor.js.map +1 -0
  49. package/dist/cjs/Entities/MemoizedColor.test.js +32 -0
  50. package/dist/cjs/Entities/MemoizedColor.test.js.map +1 -0
  51. package/dist/cjs/Entities/MemoizedNumber.js +23 -0
  52. package/dist/cjs/Entities/MemoizedNumber.js.map +1 -0
  53. package/dist/cjs/Entities/MemoizedNumber.test.js +29 -0
  54. package/dist/cjs/Entities/MemoizedNumber.test.js.map +1 -0
  55. package/dist/cjs/Entities/MemoizedQuaternion.js +24 -0
  56. package/dist/cjs/Entities/MemoizedQuaternion.js.map +1 -0
  57. package/dist/cjs/Entities/MemoizedQuaternion.test.js +32 -0
  58. package/dist/cjs/Entities/MemoizedQuaternion.test.js.map +1 -0
  59. package/dist/cjs/Entities/MemoizedString.js +23 -0
  60. package/dist/cjs/Entities/MemoizedString.js.map +1 -0
  61. package/dist/cjs/Entities/MemoizedString.test.js +29 -0
  62. package/dist/cjs/Entities/MemoizedString.test.js.map +1 -0
  63. package/dist/cjs/Entities/MemoizedVector2.js +24 -0
  64. package/dist/cjs/Entities/MemoizedVector2.js.map +1 -0
  65. package/dist/cjs/Entities/MemoizedVector2.test.js +32 -0
  66. package/dist/cjs/Entities/MemoizedVector2.test.js.map +1 -0
  67. package/dist/cjs/Entities/MemoizedVector3.js +24 -0
  68. package/dist/cjs/Entities/MemoizedVector3.js.map +1 -0
  69. package/dist/cjs/Entities/MemoizedVector3.test.js +32 -0
  70. package/dist/cjs/Entities/MemoizedVector3.test.js.map +1 -0
  71. package/dist/cjs/Entities/ObservableEntity.js +20 -0
  72. package/dist/cjs/Entities/ObservableEntity.js.map +1 -0
  73. package/dist/cjs/Entities/ObservableEntity.test.js +25 -0
  74. package/dist/cjs/Entities/ObservableEntity.test.js.map +1 -0
  75. package/dist/cjs/Entities/ObserverList.js +27 -0
  76. package/dist/cjs/Entities/ObserverList.js.map +1 -0
  77. package/dist/cjs/Entities/ObserverList.test.js +44 -0
  78. package/dist/cjs/Entities/ObserverList.test.js.map +1 -0
  79. package/dist/cjs/Entities/RangedNumber.js +36 -0
  80. package/dist/cjs/Entities/RangedNumber.js.map +1 -0
  81. package/dist/cjs/Entities/RangedNumber.test.js +96 -0
  82. package/dist/cjs/Entities/RangedNumber.test.js.map +1 -0
  83. package/dist/cjs/Entities/index.js +28 -0
  84. package/dist/cjs/Entities/index.js.map +1 -0
  85. package/dist/cjs/Types/AppBoundary.js +3 -0
  86. package/dist/cjs/Types/AppBoundary.js.map +1 -0
  87. package/dist/cjs/Types/EaseFn.js +3 -0
  88. package/dist/cjs/Types/EaseFn.js.map +1 -0
  89. package/dist/cjs/Types/PmAdapter.js +3 -0
  90. package/dist/cjs/Types/PmAdapter.js.map +1 -0
  91. package/dist/cjs/Types/SingletonPmAdapter.js +3 -0
  92. package/dist/cjs/Types/SingletonPmAdapter.js.map +1 -0
  93. package/dist/cjs/Types/index.js +21 -0
  94. package/dist/cjs/Types/index.js.map +1 -0
  95. package/dist/cjs/Utilities/LengthConverters.js +21 -0
  96. package/dist/cjs/Utilities/LengthConverters.js.map +1 -0
  97. package/dist/cjs/Utilities/LengthConverters.test.js +24 -0
  98. package/dist/cjs/Utilities/LengthConverters.test.js.map +1 -0
  99. package/dist/cjs/Utilities/LerpNumber.js +85 -0
  100. package/dist/cjs/Utilities/LerpNumber.js.map +1 -0
  101. package/dist/cjs/Utilities/LerpNumber.test.js +90 -0
  102. package/dist/cjs/Utilities/LerpNumber.test.js.map +1 -0
  103. package/dist/cjs/Utilities/degreesToRadians.js +7 -0
  104. package/dist/cjs/Utilities/degreesToRadians.js.map +1 -0
  105. package/dist/cjs/Utilities/degreesToRadians.test.js +9 -0
  106. package/dist/cjs/Utilities/degreesToRadians.test.js.map +1 -0
  107. package/dist/cjs/Utilities/easeFunctions.js +208 -0
  108. package/dist/cjs/Utilities/easeFunctions.js.map +1 -0
  109. package/dist/cjs/Utilities/easeFunctions.test.js +209 -0
  110. package/dist/cjs/Utilities/easeFunctions.test.js.map +1 -0
  111. package/dist/cjs/Utilities/generateUniqueID.js +8 -0
  112. package/dist/cjs/Utilities/generateUniqueID.js.map +1 -0
  113. package/dist/cjs/Utilities/index.js +22 -0
  114. package/dist/cjs/Utilities/index.js.map +1 -0
  115. package/dist/cjs/Utilities/interpolateNumber.js +18 -0
  116. package/dist/cjs/Utilities/interpolateNumber.js.map +1 -0
  117. package/dist/cjs/Utilities/interpolateNumber.test.js +26 -0
  118. package/dist/cjs/Utilities/interpolateNumber.test.js.map +1 -0
  119. package/dist/cjs/ValueObjects/Angle.js +47 -0
  120. package/dist/cjs/ValueObjects/Angle.js.map +1 -0
  121. package/dist/cjs/ValueObjects/Angle.test.js +28 -0
  122. package/dist/cjs/ValueObjects/Angle.test.js.map +1 -0
  123. package/dist/cjs/ValueObjects/Color.js +859 -0
  124. package/dist/cjs/ValueObjects/Color.js.map +1 -0
  125. package/dist/cjs/ValueObjects/Color.test.js +147 -0
  126. package/dist/cjs/ValueObjects/Color.test.js.map +1 -0
  127. package/dist/cjs/ValueObjects/LineSegment2D.js +72 -0
  128. package/dist/cjs/ValueObjects/LineSegment2D.js.map +1 -0
  129. package/dist/cjs/ValueObjects/LineSegment2D.test.js +102 -0
  130. package/dist/cjs/ValueObjects/LineSegment2D.test.js.map +1 -0
  131. package/dist/cjs/ValueObjects/Matrix.js +466 -0
  132. package/dist/cjs/ValueObjects/Matrix.js.map +1 -0
  133. package/dist/cjs/ValueObjects/Matrix.test.js +385 -0
  134. package/dist/cjs/ValueObjects/Matrix.test.js.map +1 -0
  135. package/dist/cjs/ValueObjects/ParametricLine.js +77 -0
  136. package/dist/cjs/ValueObjects/ParametricLine.js.map +1 -0
  137. package/dist/cjs/ValueObjects/ParametricLine.test.js +126 -0
  138. package/dist/cjs/ValueObjects/ParametricLine.test.js.map +1 -0
  139. package/dist/cjs/ValueObjects/ParametricPlane.js +65 -0
  140. package/dist/cjs/ValueObjects/ParametricPlane.js.map +1 -0
  141. package/dist/cjs/ValueObjects/ParametricPlane.test.js +101 -0
  142. package/dist/cjs/ValueObjects/ParametricPlane.test.js.map +1 -0
  143. package/dist/cjs/ValueObjects/Quaternion.js +290 -0
  144. package/dist/cjs/ValueObjects/Quaternion.js.map +1 -0
  145. package/dist/cjs/ValueObjects/Quaternion.test.js +240 -0
  146. package/dist/cjs/ValueObjects/Quaternion.test.js.map +1 -0
  147. package/dist/cjs/ValueObjects/Rectangle.js +24 -0
  148. package/dist/cjs/ValueObjects/Rectangle.js.map +1 -0
  149. package/dist/cjs/ValueObjects/Rectangle.test.js +32 -0
  150. package/dist/cjs/ValueObjects/Rectangle.test.js.map +1 -0
  151. package/dist/cjs/ValueObjects/Vector2.js +184 -0
  152. package/dist/cjs/ValueObjects/Vector2.js.map +1 -0
  153. package/dist/cjs/ValueObjects/Vector2.test.js +136 -0
  154. package/dist/cjs/ValueObjects/Vector2.test.js.map +1 -0
  155. package/dist/cjs/ValueObjects/Vector3.js +231 -0
  156. package/dist/cjs/ValueObjects/Vector3.js.map +1 -0
  157. package/dist/cjs/ValueObjects/Vector3.test.js +188 -0
  158. package/dist/cjs/ValueObjects/Vector3.test.js.map +1 -0
  159. package/dist/cjs/ValueObjects/index.js +27 -0
  160. package/dist/cjs/ValueObjects/index.js.map +1 -0
  161. package/dist/cjs/index.js +22 -0
  162. package/dist/cjs/index.js.map +1 -0
  163. package/dist/esm/AppObject/AppObject.js +54 -0
  164. package/dist/esm/AppObject/AppObject.js.map +1 -0
  165. package/dist/esm/AppObject/AppObject.test.js +110 -0
  166. package/dist/esm/AppObject/AppObject.test.js.map +1 -0
  167. package/dist/esm/AppObject/AppObjectComponent.js +78 -0
  168. package/dist/esm/AppObject/AppObjectComponent.js.map +1 -0
  169. package/dist/esm/AppObject/AppObjectComponent.test.js +130 -0
  170. package/dist/esm/AppObject/AppObjectComponent.test.js.map +1 -0
  171. package/dist/esm/AppObject/AppObjectController.js +8 -0
  172. package/dist/esm/AppObject/AppObjectController.js.map +1 -0
  173. package/dist/esm/AppObject/AppObjectEntity.js +34 -0
  174. package/dist/esm/AppObject/AppObjectEntity.js.map +1 -0
  175. package/dist/esm/AppObject/AppObjectEntity.test.js +106 -0
  176. package/dist/esm/AppObject/AppObjectEntity.test.js.map +1 -0
  177. package/dist/esm/AppObject/AppObjectEntityRepo.js +52 -0
  178. package/dist/esm/AppObject/AppObjectEntityRepo.js.map +1 -0
  179. package/dist/esm/AppObject/AppObjectEntityRepo.test.js +147 -0
  180. package/dist/esm/AppObject/AppObjectEntityRepo.test.js.map +1 -0
  181. package/dist/esm/AppObject/AppObjectPM.js +36 -0
  182. package/dist/esm/AppObject/AppObjectPM.js.map +1 -0
  183. package/dist/esm/AppObject/AppObjectPM.test.js +101 -0
  184. package/dist/esm/AppObject/AppObjectPM.test.js.map +1 -0
  185. package/dist/esm/AppObject/AppObjectRepo.js +128 -0
  186. package/dist/esm/AppObject/AppObjectRepo.js.map +1 -0
  187. package/dist/esm/AppObject/AppObjectRepo.test.js +211 -0
  188. package/dist/esm/AppObject/AppObjectRepo.test.js.map +1 -0
  189. package/dist/esm/AppObject/AppObjectUC.js +8 -0
  190. package/dist/esm/AppObject/AppObjectUC.js.map +1 -0
  191. package/dist/esm/AppObject/AppObjectView.js +8 -0
  192. package/dist/esm/AppObject/AppObjectView.js.map +1 -0
  193. package/dist/esm/AppObject/getSingletonComponent.js +4 -0
  194. package/dist/esm/AppObject/getSingletonComponent.js.map +1 -0
  195. package/dist/esm/AppObject/getSingletonComponent.test.js +11 -0
  196. package/dist/esm/AppObject/getSingletonComponent.test.js.map +1 -0
  197. package/dist/esm/AppObject/index.js +11 -0
  198. package/dist/esm/AppObject/index.js.map +1 -0
  199. package/dist/esm/AppObject/printAppObjectDetails.js +15 -0
  200. package/dist/esm/AppObject/printAppObjectDetails.js.map +1 -0
  201. package/dist/esm/Entities/MemoizedAngle.js +19 -0
  202. package/dist/esm/Entities/MemoizedAngle.js.map +1 -0
  203. package/dist/esm/Entities/MemoizedAngle.test.js +28 -0
  204. package/dist/esm/Entities/MemoizedAngle.test.js.map +1 -0
  205. package/dist/esm/Entities/MemoizedBoolean.js +19 -0
  206. package/dist/esm/Entities/MemoizedBoolean.js.map +1 -0
  207. package/dist/esm/Entities/MemoizedBoolean.test.js +32 -0
  208. package/dist/esm/Entities/MemoizedBoolean.test.js.map +1 -0
  209. package/dist/esm/Entities/MemoizedColor.js +20 -0
  210. package/dist/esm/Entities/MemoizedColor.js.map +1 -0
  211. package/dist/esm/Entities/MemoizedColor.test.js +30 -0
  212. package/dist/esm/Entities/MemoizedColor.test.js.map +1 -0
  213. package/dist/esm/Entities/MemoizedNumber.js +19 -0
  214. package/dist/esm/Entities/MemoizedNumber.js.map +1 -0
  215. package/dist/esm/Entities/MemoizedNumber.test.js +27 -0
  216. package/dist/esm/Entities/MemoizedNumber.test.js.map +1 -0
  217. package/dist/esm/Entities/MemoizedQuaternion.js +20 -0
  218. package/dist/esm/Entities/MemoizedQuaternion.js.map +1 -0
  219. package/dist/esm/Entities/MemoizedQuaternion.test.js +30 -0
  220. package/dist/esm/Entities/MemoizedQuaternion.test.js.map +1 -0
  221. package/dist/esm/Entities/MemoizedString.js +19 -0
  222. package/dist/esm/Entities/MemoizedString.js.map +1 -0
  223. package/dist/esm/Entities/MemoizedString.test.js +27 -0
  224. package/dist/esm/Entities/MemoizedString.test.js.map +1 -0
  225. package/dist/esm/Entities/MemoizedVector2.js +20 -0
  226. package/dist/esm/Entities/MemoizedVector2.js.map +1 -0
  227. package/dist/esm/Entities/MemoizedVector2.test.js +30 -0
  228. package/dist/esm/Entities/MemoizedVector2.test.js.map +1 -0
  229. package/dist/esm/Entities/MemoizedVector3.js +20 -0
  230. package/dist/esm/Entities/MemoizedVector3.js.map +1 -0
  231. package/dist/esm/Entities/MemoizedVector3.test.js +30 -0
  232. package/dist/esm/Entities/MemoizedVector3.test.js.map +1 -0
  233. package/dist/esm/Entities/ObservableEntity.js +16 -0
  234. package/dist/esm/Entities/ObservableEntity.js.map +1 -0
  235. package/dist/esm/Entities/ObservableEntity.test.js +23 -0
  236. package/dist/esm/Entities/ObservableEntity.test.js.map +1 -0
  237. package/dist/esm/Entities/ObserverList.js +23 -0
  238. package/dist/esm/Entities/ObserverList.js.map +1 -0
  239. package/dist/esm/Entities/ObserverList.test.js +42 -0
  240. package/dist/esm/Entities/ObserverList.test.js.map +1 -0
  241. package/dist/esm/Entities/RangedNumber.js +32 -0
  242. package/dist/esm/Entities/RangedNumber.js.map +1 -0
  243. package/dist/esm/Entities/RangedNumber.test.js +94 -0
  244. package/dist/esm/Entities/RangedNumber.test.js.map +1 -0
  245. package/{src/Entities/index.ts → dist/esm/Entities/index.js} +12 -11
  246. package/dist/esm/Entities/index.js.map +1 -0
  247. package/dist/esm/Types/AppBoundary.js +2 -0
  248. package/dist/esm/Types/AppBoundary.js.map +1 -0
  249. package/dist/esm/Types/EaseFn.js +2 -0
  250. package/dist/esm/Types/EaseFn.js.map +1 -0
  251. package/dist/esm/Types/PmAdapter.js +2 -0
  252. package/dist/esm/Types/PmAdapter.js.map +1 -0
  253. package/dist/esm/Types/SingletonPmAdapter.js +2 -0
  254. package/dist/esm/Types/SingletonPmAdapter.js.map +1 -0
  255. package/{src/Types/index.ts → dist/esm/Types/index.js} +5 -4
  256. package/dist/esm/Types/index.js.map +1 -0
  257. package/dist/esm/Utilities/LengthConverters.js +15 -0
  258. package/dist/esm/Utilities/LengthConverters.js.map +1 -0
  259. package/dist/esm/Utilities/LengthConverters.test.js +22 -0
  260. package/dist/esm/Utilities/LengthConverters.test.js.map +1 -0
  261. package/dist/esm/Utilities/LerpNumber.js +81 -0
  262. package/dist/esm/Utilities/LerpNumber.js.map +1 -0
  263. package/dist/esm/Utilities/LerpNumber.test.js +88 -0
  264. package/dist/esm/Utilities/LerpNumber.test.js.map +1 -0
  265. package/dist/esm/Utilities/degreesToRadians.js +4 -0
  266. package/dist/esm/Utilities/degreesToRadians.js.map +1 -0
  267. package/dist/esm/Utilities/degreesToRadians.test.js +7 -0
  268. package/dist/esm/Utilities/degreesToRadians.test.js.map +1 -0
  269. package/dist/esm/Utilities/easeFunctions.js +183 -0
  270. package/dist/esm/Utilities/easeFunctions.js.map +1 -0
  271. package/dist/esm/Utilities/easeFunctions.test.js +207 -0
  272. package/dist/esm/Utilities/easeFunctions.test.js.map +1 -0
  273. package/dist/esm/Utilities/generateUniqueID.js +5 -0
  274. package/dist/esm/Utilities/generateUniqueID.js.map +1 -0
  275. package/{src/Utilities/index.ts → dist/esm/Utilities/index.js} +6 -6
  276. package/dist/esm/Utilities/index.js.map +1 -0
  277. package/dist/esm/Utilities/interpolateNumber.js +15 -0
  278. package/dist/esm/Utilities/interpolateNumber.js.map +1 -0
  279. package/dist/esm/Utilities/interpolateNumber.test.js +24 -0
  280. package/dist/esm/Utilities/interpolateNumber.test.js.map +1 -0
  281. package/dist/esm/ValueObjects/Angle.js +43 -0
  282. package/dist/esm/ValueObjects/Angle.js.map +1 -0
  283. package/dist/esm/ValueObjects/Angle.test.js +26 -0
  284. package/dist/esm/ValueObjects/Angle.test.js.map +1 -0
  285. package/dist/esm/ValueObjects/Color.js +855 -0
  286. package/dist/esm/ValueObjects/Color.js.map +1 -0
  287. package/dist/esm/ValueObjects/Color.test.js +145 -0
  288. package/dist/esm/ValueObjects/Color.test.js.map +1 -0
  289. package/dist/esm/ValueObjects/LineSegment2D.js +68 -0
  290. package/dist/esm/ValueObjects/LineSegment2D.js.map +1 -0
  291. package/dist/esm/ValueObjects/LineSegment2D.test.js +100 -0
  292. package/dist/esm/ValueObjects/LineSegment2D.test.js.map +1 -0
  293. package/dist/esm/ValueObjects/Matrix.js +462 -0
  294. package/dist/esm/ValueObjects/Matrix.js.map +1 -0
  295. package/dist/esm/ValueObjects/Matrix.test.js +383 -0
  296. package/dist/esm/ValueObjects/Matrix.test.js.map +1 -0
  297. package/dist/esm/ValueObjects/ParametricLine.js +73 -0
  298. package/dist/esm/ValueObjects/ParametricLine.js.map +1 -0
  299. package/dist/esm/ValueObjects/ParametricLine.test.js +124 -0
  300. package/dist/esm/ValueObjects/ParametricLine.test.js.map +1 -0
  301. package/dist/esm/ValueObjects/ParametricPlane.js +61 -0
  302. package/dist/esm/ValueObjects/ParametricPlane.js.map +1 -0
  303. package/dist/esm/ValueObjects/ParametricPlane.test.js +99 -0
  304. package/dist/esm/ValueObjects/ParametricPlane.test.js.map +1 -0
  305. package/dist/esm/ValueObjects/Quaternion.js +286 -0
  306. package/dist/esm/ValueObjects/Quaternion.js.map +1 -0
  307. package/dist/esm/ValueObjects/Quaternion.test.js +238 -0
  308. package/dist/esm/ValueObjects/Quaternion.test.js.map +1 -0
  309. package/dist/esm/ValueObjects/Rectangle.js +20 -0
  310. package/dist/esm/ValueObjects/Rectangle.js.map +1 -0
  311. package/dist/esm/ValueObjects/Rectangle.test.js +30 -0
  312. package/dist/esm/ValueObjects/Rectangle.test.js.map +1 -0
  313. package/dist/esm/ValueObjects/Vector2.js +180 -0
  314. package/dist/esm/ValueObjects/Vector2.js.map +1 -0
  315. package/dist/esm/ValueObjects/Vector2.test.js +134 -0
  316. package/dist/esm/ValueObjects/Vector2.test.js.map +1 -0
  317. package/dist/esm/ValueObjects/Vector3.js +227 -0
  318. package/dist/esm/ValueObjects/Vector3.js.map +1 -0
  319. package/dist/esm/ValueObjects/Vector3.test.js +186 -0
  320. package/dist/esm/ValueObjects/Vector3.test.js.map +1 -0
  321. package/{src/ValueObjects/index.ts → dist/esm/ValueObjects/index.js} +11 -14
  322. package/dist/esm/ValueObjects/index.js.map +1 -0
  323. package/{src/index.ts → dist/esm/index.js} +6 -5
  324. package/dist/esm/index.js.map +1 -0
  325. package/dist/types/AppObject/AppObject.d.ts +15 -0
  326. package/dist/types/AppObject/AppObject.d.ts.map +1 -0
  327. package/dist/types/AppObject/AppObject.test.d.ts +7 -0
  328. package/dist/types/AppObject/AppObject.test.d.ts.map +1 -0
  329. package/dist/types/AppObject/AppObjectComponent.d.ts +26 -0
  330. package/dist/types/AppObject/AppObjectComponent.d.ts.map +1 -0
  331. package/dist/types/AppObject/AppObjectComponent.test.d.ts +2 -0
  332. package/dist/types/AppObject/AppObjectComponent.test.d.ts.map +1 -0
  333. package/dist/types/AppObject/AppObjectController.d.ts +5 -0
  334. package/dist/types/AppObject/AppObjectController.d.ts.map +1 -0
  335. package/dist/types/AppObject/AppObjectEntity.d.ts +16 -0
  336. package/dist/types/AppObject/AppObjectEntity.d.ts.map +1 -0
  337. package/dist/types/AppObject/AppObjectEntity.test.d.ts +2 -0
  338. package/dist/types/AppObject/AppObjectEntity.test.d.ts.map +1 -0
  339. package/dist/types/AppObject/AppObjectEntityRepo.d.ts +16 -0
  340. package/dist/types/AppObject/AppObjectEntityRepo.d.ts.map +1 -0
  341. package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts +2 -0
  342. package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts.map +1 -0
  343. package/dist/types/AppObject/AppObjectPM.d.ts +13 -0
  344. package/dist/types/AppObject/AppObjectPM.d.ts.map +1 -0
  345. package/dist/types/AppObject/AppObjectPM.test.d.ts +2 -0
  346. package/dist/types/AppObject/AppObjectPM.test.d.ts.map +1 -0
  347. package/dist/types/AppObject/AppObjectRepo.d.ts +26 -0
  348. package/dist/types/AppObject/AppObjectRepo.d.ts.map +1 -0
  349. package/dist/types/AppObject/AppObjectRepo.test.d.ts +2 -0
  350. package/dist/types/AppObject/AppObjectRepo.test.d.ts.map +1 -0
  351. package/dist/types/AppObject/AppObjectUC.d.ts +5 -0
  352. package/dist/types/AppObject/AppObjectUC.d.ts.map +1 -0
  353. package/dist/types/AppObject/AppObjectView.d.ts +5 -0
  354. package/dist/types/AppObject/AppObjectView.d.ts.map +1 -0
  355. package/dist/types/AppObject/getSingletonComponent.d.ts +4 -0
  356. package/dist/types/AppObject/getSingletonComponent.d.ts.map +1 -0
  357. package/dist/types/AppObject/getSingletonComponent.test.d.ts +2 -0
  358. package/dist/types/AppObject/getSingletonComponent.test.d.ts.map +1 -0
  359. package/dist/types/AppObject/index.d.ts +11 -0
  360. package/dist/types/AppObject/index.d.ts.map +1 -0
  361. package/dist/types/AppObject/printAppObjectDetails.d.ts +3 -0
  362. package/dist/types/AppObject/printAppObjectDetails.d.ts.map +1 -0
  363. package/dist/types/Entities/MemoizedAngle.d.ts +10 -0
  364. package/dist/types/Entities/MemoizedAngle.d.ts.map +1 -0
  365. package/dist/types/Entities/MemoizedAngle.test.d.ts +2 -0
  366. package/dist/types/Entities/MemoizedAngle.test.d.ts.map +1 -0
  367. package/dist/types/Entities/MemoizedBoolean.d.ts +9 -0
  368. package/dist/types/Entities/MemoizedBoolean.d.ts.map +1 -0
  369. package/dist/types/Entities/MemoizedBoolean.test.d.ts +2 -0
  370. package/dist/types/Entities/MemoizedBoolean.test.d.ts.map +1 -0
  371. package/dist/types/Entities/MemoizedColor.d.ts +10 -0
  372. package/dist/types/Entities/MemoizedColor.d.ts.map +1 -0
  373. package/dist/types/Entities/MemoizedColor.test.d.ts +2 -0
  374. package/dist/types/Entities/MemoizedColor.test.d.ts.map +1 -0
  375. package/dist/types/Entities/MemoizedNumber.d.ts +9 -0
  376. package/dist/types/Entities/MemoizedNumber.d.ts.map +1 -0
  377. package/dist/types/Entities/MemoizedNumber.test.d.ts +2 -0
  378. package/dist/types/Entities/MemoizedNumber.test.d.ts.map +1 -0
  379. package/dist/types/Entities/MemoizedQuaternion.d.ts +10 -0
  380. package/dist/types/Entities/MemoizedQuaternion.d.ts.map +1 -0
  381. package/dist/types/Entities/MemoizedQuaternion.test.d.ts +2 -0
  382. package/dist/types/Entities/MemoizedQuaternion.test.d.ts.map +1 -0
  383. package/dist/types/Entities/MemoizedString.d.ts +9 -0
  384. package/dist/types/Entities/MemoizedString.d.ts.map +1 -0
  385. package/dist/types/Entities/MemoizedString.test.d.ts +2 -0
  386. package/dist/types/Entities/MemoizedString.test.d.ts.map +1 -0
  387. package/dist/types/Entities/MemoizedVector2.d.ts +10 -0
  388. package/dist/types/Entities/MemoizedVector2.d.ts.map +1 -0
  389. package/dist/types/Entities/MemoizedVector2.test.d.ts +2 -0
  390. package/dist/types/Entities/MemoizedVector2.test.d.ts.map +1 -0
  391. package/dist/types/Entities/MemoizedVector3.d.ts +10 -0
  392. package/dist/types/Entities/MemoizedVector3.d.ts.map +1 -0
  393. package/dist/types/Entities/MemoizedVector3.test.d.ts +2 -0
  394. package/dist/types/Entities/MemoizedVector3.test.d.ts.map +1 -0
  395. package/dist/types/Entities/ObservableEntity.d.ts +8 -0
  396. package/dist/types/Entities/ObservableEntity.d.ts.map +1 -0
  397. package/dist/types/Entities/ObservableEntity.test.d.ts +2 -0
  398. package/dist/types/Entities/ObservableEntity.test.d.ts.map +1 -0
  399. package/dist/types/Entities/ObserverList.d.ts +8 -0
  400. package/dist/types/Entities/ObserverList.d.ts.map +1 -0
  401. package/dist/types/Entities/ObserverList.test.d.ts +2 -0
  402. package/dist/types/Entities/ObserverList.test.d.ts.map +1 -0
  403. package/dist/types/Entities/RangedNumber.d.ts +17 -0
  404. package/dist/types/Entities/RangedNumber.d.ts.map +1 -0
  405. package/dist/types/Entities/RangedNumber.test.d.ts +2 -0
  406. package/dist/types/Entities/RangedNumber.test.d.ts.map +1 -0
  407. package/dist/types/Entities/index.d.ts +12 -0
  408. package/dist/types/Entities/index.d.ts.map +1 -0
  409. package/dist/types/Types/AppBoundary.d.ts +11 -0
  410. package/dist/types/Types/AppBoundary.d.ts.map +1 -0
  411. package/dist/types/Types/EaseFn.d.ts +2 -0
  412. package/dist/types/Types/EaseFn.d.ts.map +1 -0
  413. package/dist/types/Types/PmAdapter.d.ts +7 -0
  414. package/dist/types/Types/PmAdapter.d.ts.map +1 -0
  415. package/dist/types/Types/SingletonPmAdapter.d.ts +7 -0
  416. package/dist/types/Types/SingletonPmAdapter.d.ts.map +1 -0
  417. package/dist/types/Types/index.d.ts +5 -0
  418. package/dist/types/Types/index.d.ts.map +1 -0
  419. package/dist/types/Utilities/LengthConverters.d.ts +5 -0
  420. package/dist/types/Utilities/LengthConverters.d.ts.map +1 -0
  421. package/dist/types/Utilities/LengthConverters.test.d.ts +2 -0
  422. package/dist/types/Utilities/LengthConverters.test.d.ts.map +1 -0
  423. package/dist/types/Utilities/LerpNumber.d.ts +57 -0
  424. package/dist/types/Utilities/LerpNumber.d.ts.map +1 -0
  425. package/dist/types/Utilities/LerpNumber.test.d.ts +2 -0
  426. package/dist/types/Utilities/LerpNumber.test.d.ts.map +1 -0
  427. package/dist/types/Utilities/degreesToRadians.d.ts +2 -0
  428. package/dist/types/Utilities/degreesToRadians.d.ts.map +1 -0
  429. package/dist/types/Utilities/degreesToRadians.test.d.ts +2 -0
  430. package/dist/types/Utilities/degreesToRadians.test.d.ts.map +1 -0
  431. package/dist/types/Utilities/easeFunctions.d.ts +24 -0
  432. package/dist/types/Utilities/easeFunctions.d.ts.map +1 -0
  433. package/dist/types/Utilities/easeFunctions.test.d.ts +2 -0
  434. package/dist/types/Utilities/easeFunctions.test.d.ts.map +1 -0
  435. package/dist/types/Utilities/generateUniqueID.d.ts +2 -0
  436. package/dist/types/Utilities/generateUniqueID.d.ts.map +1 -0
  437. package/dist/types/Utilities/index.d.ts +6 -0
  438. package/dist/types/Utilities/index.d.ts.map +1 -0
  439. package/dist/types/Utilities/interpolateNumber.d.ts +2 -0
  440. package/dist/types/Utilities/interpolateNumber.d.ts.map +1 -0
  441. package/dist/types/Utilities/interpolateNumber.test.d.ts +2 -0
  442. package/dist/types/Utilities/interpolateNumber.test.d.ts.map +1 -0
  443. package/dist/types/ValueObjects/Angle.d.ts +27 -0
  444. package/dist/types/ValueObjects/Angle.d.ts.map +1 -0
  445. package/dist/types/ValueObjects/Angle.test.d.ts +2 -0
  446. package/dist/types/ValueObjects/Angle.test.d.ts.map +1 -0
  447. package/dist/types/ValueObjects/Color.d.ts +83 -0
  448. package/dist/types/ValueObjects/Color.d.ts.map +1 -0
  449. package/dist/types/ValueObjects/Color.test.d.ts +2 -0
  450. package/dist/types/ValueObjects/Color.test.d.ts.map +1 -0
  451. package/dist/types/ValueObjects/LineSegment2D.d.ts +12 -0
  452. package/dist/types/ValueObjects/LineSegment2D.d.ts.map +1 -0
  453. package/dist/types/ValueObjects/LineSegment2D.test.d.ts +2 -0
  454. package/dist/types/ValueObjects/LineSegment2D.test.d.ts.map +1 -0
  455. package/dist/types/ValueObjects/Matrix.d.ts +124 -0
  456. package/dist/types/ValueObjects/Matrix.d.ts.map +1 -0
  457. package/dist/types/ValueObjects/Matrix.test.d.ts +2 -0
  458. package/dist/types/ValueObjects/Matrix.test.d.ts.map +1 -0
  459. package/dist/types/ValueObjects/ParametricLine.d.ts +31 -0
  460. package/dist/types/ValueObjects/ParametricLine.d.ts.map +1 -0
  461. package/dist/types/ValueObjects/ParametricLine.test.d.ts +2 -0
  462. package/dist/types/ValueObjects/ParametricLine.test.d.ts.map +1 -0
  463. package/dist/types/ValueObjects/ParametricPlane.d.ts +21 -0
  464. package/dist/types/ValueObjects/ParametricPlane.d.ts.map +1 -0
  465. package/dist/types/ValueObjects/ParametricPlane.test.d.ts +2 -0
  466. package/dist/types/ValueObjects/ParametricPlane.test.d.ts.map +1 -0
  467. package/dist/types/ValueObjects/Quaternion.d.ts +113 -0
  468. package/dist/types/ValueObjects/Quaternion.d.ts.map +1 -0
  469. package/dist/types/ValueObjects/Quaternion.test.d.ts +2 -0
  470. package/dist/types/ValueObjects/Quaternion.test.d.ts.map +1 -0
  471. package/dist/types/ValueObjects/Rectangle.d.ts +16 -0
  472. package/dist/types/ValueObjects/Rectangle.d.ts.map +1 -0
  473. package/dist/types/ValueObjects/Rectangle.test.d.ts +2 -0
  474. package/dist/types/ValueObjects/Rectangle.test.d.ts.map +1 -0
  475. package/dist/types/ValueObjects/Vector2.d.ts +121 -0
  476. package/dist/types/ValueObjects/Vector2.d.ts.map +1 -0
  477. package/dist/types/ValueObjects/Vector2.test.d.ts +2 -0
  478. package/dist/types/ValueObjects/Vector2.test.d.ts.map +1 -0
  479. package/dist/types/ValueObjects/Vector3.d.ts +150 -0
  480. package/dist/types/ValueObjects/Vector3.d.ts.map +1 -0
  481. package/dist/types/ValueObjects/Vector3.test.d.ts +2 -0
  482. package/dist/types/ValueObjects/Vector3.test.d.ts.map +1 -0
  483. package/dist/types/ValueObjects/index.d.ts +11 -0
  484. package/dist/types/ValueObjects/index.d.ts.map +1 -0
  485. package/dist/types/index.d.ts +6 -0
  486. package/dist/types/index.d.ts.map +1 -0
  487. package/package.json +5 -2
  488. package/babel.config.js +0 -12
  489. package/jestconfig.json +0 -10
  490. package/src/AppObject/AppObject.test.ts +0 -158
  491. package/src/AppObject/AppObject.ts +0 -83
  492. package/src/AppObject/AppObjectComponent.test.ts +0 -219
  493. package/src/AppObject/AppObjectComponent.ts +0 -100
  494. package/src/AppObject/AppObjectController.ts +0 -8
  495. package/src/AppObject/AppObjectEntity.test.ts +0 -151
  496. package/src/AppObject/AppObjectEntity.ts +0 -45
  497. package/src/AppObject/AppObjectEntityRepo.test.ts +0 -211
  498. package/src/AppObject/AppObjectEntityRepo.ts +0 -61
  499. package/src/AppObject/AppObjectPM.test.ts +0 -152
  500. package/src/AppObject/AppObjectPM.ts +0 -43
  501. package/src/AppObject/AppObjectRepo.test.ts +0 -317
  502. package/src/AppObject/AppObjectRepo.ts +0 -203
  503. package/src/AppObject/AppObjectUC.ts +0 -5
  504. package/src/AppObject/AppObjectView.ts +0 -5
  505. package/src/AppObject/getSingletonComponent.test.ts +0 -17
  506. package/src/AppObject/getSingletonComponent.ts +0 -9
  507. package/src/AppObject/index.ts +0 -10
  508. package/src/AppObject/printAppObjectDetails.ts +0 -17
  509. package/src/Entities/MemoizedAngle.test.ts +0 -38
  510. package/src/Entities/MemoizedAngle.ts +0 -25
  511. package/src/Entities/MemoizedBoolean.test.ts +0 -45
  512. package/src/Entities/MemoizedBoolean.ts +0 -23
  513. package/src/Entities/MemoizedColor.test.ts +0 -39
  514. package/src/Entities/MemoizedColor.ts +0 -27
  515. package/src/Entities/MemoizedNumber.test.ts +0 -37
  516. package/src/Entities/MemoizedNumber.ts +0 -23
  517. package/src/Entities/MemoizedQuaternion.test.ts +0 -39
  518. package/src/Entities/MemoizedQuaternion.ts +0 -27
  519. package/src/Entities/MemoizedString.test.ts +0 -37
  520. package/src/Entities/MemoizedString.ts +0 -23
  521. package/src/Entities/MemoizedVector2.test.ts +0 -39
  522. package/src/Entities/MemoizedVector2.ts +0 -27
  523. package/src/Entities/MemoizedVector3.test.ts +0 -39
  524. package/src/Entities/MemoizedVector3.ts +0 -27
  525. package/src/Entities/ObservableEntity.test.ts +0 -28
  526. package/src/Entities/ObservableEntity.ts +0 -17
  527. package/src/Entities/ObserverList.test.ts +0 -61
  528. package/src/Entities/ObserverList.ts +0 -24
  529. package/src/Entities/RangedNumber.test.ts +0 -118
  530. package/src/Entities/RangedNumber.ts +0 -45
  531. package/src/Types/AppBoundary.ts +0 -13
  532. package/src/Types/EaseFn.ts +0 -1
  533. package/src/Types/PmAdapter.ts +0 -15
  534. package/src/Types/SingletonPmAdapter.ts +0 -7
  535. package/src/Utilities/LengthConverters.test.ts +0 -30
  536. package/src/Utilities/LengthConverters.ts +0 -18
  537. package/src/Utilities/LerpNumber.test.ts +0 -109
  538. package/src/Utilities/LerpNumber.ts +0 -109
  539. package/src/Utilities/degreesToRadians.test.ts +0 -8
  540. package/src/Utilities/degreesToRadians.ts +0 -3
  541. package/src/Utilities/easeFunctions.test.ts +0 -251
  542. package/src/Utilities/easeFunctions.ts +0 -180
  543. package/src/Utilities/generateUniqueID.ts +0 -5
  544. package/src/Utilities/interpolateNumber.test.ts +0 -28
  545. package/src/Utilities/interpolateNumber.ts +0 -21
  546. package/src/ValueObjects/Angle.test.ts +0 -30
  547. package/src/ValueObjects/Angle.ts +0 -47
  548. package/src/ValueObjects/Color.test.ts +0 -181
  549. package/src/ValueObjects/Color.ts +0 -891
  550. package/src/ValueObjects/LineSegment2D.test.ts +0 -144
  551. package/src/ValueObjects/LineSegment2D.ts +0 -93
  552. package/src/ValueObjects/Matrix.test.ts +0 -498
  553. package/src/ValueObjects/Matrix.ts +0 -567
  554. package/src/ValueObjects/ParametricLine.test.ts +0 -155
  555. package/src/ValueObjects/ParametricLine.ts +0 -114
  556. package/src/ValueObjects/ParametricPlane.test.ts +0 -122
  557. package/src/ValueObjects/ParametricPlane.ts +0 -82
  558. package/src/ValueObjects/Quaternion.test.ts +0 -356
  559. package/src/ValueObjects/Quaternion.ts +0 -353
  560. package/src/ValueObjects/Rectangle.test.ts +0 -32
  561. package/src/ValueObjects/Rectangle.ts +0 -33
  562. package/src/ValueObjects/Vector2.test.ts +0 -167
  563. package/src/ValueObjects/Vector2.ts +0 -209
  564. package/src/ValueObjects/Vector3.test.ts +0 -228
  565. package/src/ValueObjects/Vector3.ts +0 -269
  566. package/tsconfig.build.json +0 -7
  567. package/tsconfig.cjs.json +0 -9
  568. package/tsconfig.esm.json +0 -12
  569. package/tsconfig.json +0 -19
  570. package/tslint.json +0 -11
@@ -0,0 +1,383 @@
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
@@ -0,0 +1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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"]}
@@ -0,0 +1,73 @@
1
+ import { Vector3 } from "../ValueObjects/Vector3";
2
+ export class ParametricLine {
3
+ // See https://planetcalc.com/8253/
4
+ static FromTwoPoint(p1, p2) {
5
+ const dir = Vector3.Subtract(p2, p1).unit;
6
+ return this.FromPointDirection(p1, dir);
7
+ }
8
+ static FromPointDirection(point, direction) {
9
+ return new ParametricLine({
10
+ x0: point.x,
11
+ y0: point.y,
12
+ z0: point.z,
13
+ a: direction.x,
14
+ b: direction.y,
15
+ c: direction.z,
16
+ });
17
+ }
18
+ static Forward() {
19
+ const p = Vector3.Zero();
20
+ const d = new Vector3(0, 0, 1);
21
+ return this.FromPointDirection(p, d);
22
+ }
23
+ static Backward() {
24
+ const p = Vector3.Zero();
25
+ const d = new Vector3(0, 0, -1);
26
+ return this.FromPointDirection(p, d);
27
+ }
28
+ static Up() {
29
+ const p = Vector3.Zero();
30
+ const d = new Vector3(0, 1, 0);
31
+ return this.FromPointDirection(p, d);
32
+ }
33
+ static Down() {
34
+ const p = Vector3.Zero();
35
+ const d = new Vector3(0, -1, 0);
36
+ return this.FromPointDirection(p, d);
37
+ }
38
+ static Left() {
39
+ const p = Vector3.Zero();
40
+ const d = new Vector3(-1, 0, 0);
41
+ return this.FromPointDirection(p, d);
42
+ }
43
+ static Right() {
44
+ const p = Vector3.Zero();
45
+ const d = new Vector3(1, 0, 0);
46
+ return this.FromPointDirection(p, d);
47
+ }
48
+ static GetPointAtDistance(line, distance) {
49
+ const x = line.x0 + line.a * distance;
50
+ const y = line.y0 + line.b * distance;
51
+ const z = line.z0 + line.c * distance;
52
+ return new Vector3(x, y, z);
53
+ }
54
+ static GetDistanceToPoint(line, point) {
55
+ return Vector3.Subtract(line.origin, point).magnitude;
56
+ }
57
+ get origin() {
58
+ return new Vector3(this.x0, this.y0, this.z0);
59
+ }
60
+ get direction() {
61
+ return new Vector3(this.a, this.b, this.c);
62
+ }
63
+ constructor(parameters) {
64
+ this.x0 = parameters.x0;
65
+ this.y0 = parameters.y0;
66
+ this.z0 = parameters.z0;
67
+ const dir = new Vector3(parameters.a, parameters.b, parameters.c).unit;
68
+ this.a = dir.x;
69
+ this.b = dir.y;
70
+ this.c = dir.z;
71
+ }
72
+ }
73
+ //# sourceMappingURL=ParametricLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParametricLine.js","sourceRoot":"","sources":["../../../src/ValueObjects/ParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAWlD,MAAM,OAAO,cAAc;IACzB,mCAAmC;IAE5B,MAAM,CAAC,YAAY,CAAC,EAAW,EAAE,EAAW;QACjD,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC;QAC1C,OAAO,IAAI,CAAC,kBAAkB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAC9B,KAAc,EACd,SAAkB;QAElB,OAAO,IAAI,cAAc,CAAC;YACxB,EAAE,EAAE,KAAK,CAAC,CAAC;YACX,EAAE,EAAE,KAAK,CAAC,CAAC;YACX,EAAE,EAAE,KAAK,CAAC,CAAC;YACX,CAAC,EAAE,SAAS,CAAC,CAAC;YACd,CAAC,EAAE,SAAS,CAAC,CAAC;YACd,CAAC,EAAE,SAAS,CAAC,CAAC;SACf,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,OAAO;QACnB,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,CAAC,EAA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C,CAAC,CAAC,IAAI,CAAC;QAEvE,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACf,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACf,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { Vector3 } from \"../ValueObjects/Vector3\";\r\n\r\nexport interface LineParameters {\r\n x0: number;\r\n y0: number;\r\n z0: number;\r\n a: number;\r\n b: number;\r\n c: number;\r\n}\r\n\r\nexport class ParametricLine {\r\n // See https://planetcalc.com/8253/\r\n\r\n public static FromTwoPoint(p1: Vector3, p2: Vector3): ParametricLine {\r\n const dir = Vector3.Subtract(p2, p1).unit;\r\n return this.FromPointDirection(p1, dir);\r\n }\r\n\r\n public static FromPointDirection(\r\n point: Vector3,\r\n direction: Vector3\r\n ): ParametricLine {\r\n return new ParametricLine({\r\n x0: point.x,\r\n y0: point.y,\r\n z0: point.z,\r\n a: direction.x,\r\n b: direction.y,\r\n c: direction.z,\r\n });\r\n }\r\n\r\n public static Forward(): ParametricLine {\r\n const p = Vector3.Zero();\r\n const d = new Vector3(0, 0, 1);\r\n return this.FromPointDirection(p, d);\r\n }\r\n\r\n public static Backward(): ParametricLine {\r\n const p = Vector3.Zero();\r\n const d = new Vector3(0, 0, -1);\r\n return this.FromPointDirection(p, d);\r\n }\r\n\r\n public static Up(): ParametricLine {\r\n const p = Vector3.Zero();\r\n const d = new Vector3(0, 1, 0);\r\n return this.FromPointDirection(p, d);\r\n }\r\n\r\n public static Down(): ParametricLine {\r\n const p = Vector3.Zero();\r\n const d = new Vector3(0, -1, 0);\r\n return this.FromPointDirection(p, d);\r\n }\r\n\r\n public static Left(): ParametricLine {\r\n const p = Vector3.Zero();\r\n const d = new Vector3(-1, 0, 0);\r\n return this.FromPointDirection(p, d);\r\n }\r\n\r\n public static Right(): ParametricLine {\r\n const p = Vector3.Zero();\r\n const d = new Vector3(1, 0, 0);\r\n return this.FromPointDirection(p, d);\r\n }\r\n\r\n public static GetPointAtDistance(\r\n line: ParametricLine,\r\n distance: number\r\n ): Vector3 {\r\n const x = line.x0 + line.a * distance;\r\n const y = line.y0 + line.b * distance;\r\n const z = line.z0 + line.c * distance;\r\n\r\n return new Vector3(x, y, z);\r\n }\r\n\r\n public static GetDistanceToPoint(\r\n line: ParametricLine,\r\n point: Vector3\r\n ): number {\r\n return Vector3.Subtract(line.origin, point).magnitude;\r\n }\r\n\r\n readonly x0: number;\r\n readonly y0: number;\r\n readonly z0: number;\r\n readonly a: number;\r\n readonly b: number;\r\n readonly c: number;\r\n\r\n get origin(): Vector3 {\r\n return new Vector3(this.x0, this.y0, this.z0);\r\n }\r\n\r\n get direction(): Vector3 {\r\n return new Vector3(this.a, this.b, this.c);\r\n }\r\n\r\n constructor(parameters: LineParameters) {\r\n this.x0 = parameters.x0;\r\n this.y0 = parameters.y0;\r\n this.z0 = parameters.z0;\r\n\r\n const dir = new Vector3(parameters.a, parameters.b, parameters.c).unit;\r\n\r\n this.a = dir.x;\r\n this.b = dir.y;\r\n this.c = dir.z;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,124 @@
1
+ import { Vector3 } from ".";
2
+ import { ParametricLine } from "./ParametricLine";
3
+ test("Setting and getting the parameters", () => {
4
+ const inputParameters = {
5
+ x0: 1,
6
+ y0: 2,
7
+ z0: 3,
8
+ a: 4,
9
+ b: 5,
10
+ c: 6,
11
+ };
12
+ const line = new ParametricLine(inputParameters);
13
+ const dirUnit = new Vector3(4, 5, 6).unit;
14
+ expect(line.x0).toEqual(inputParameters.x0);
15
+ expect(line.y0).toEqual(inputParameters.y0);
16
+ expect(line.z0).toEqual(inputParameters.z0);
17
+ expect(line.a).toBeCloseTo(dirUnit.x);
18
+ expect(line.b).toBeCloseTo(dirUnit.y);
19
+ expect(line.c).toBeCloseTo(dirUnit.z);
20
+ });
21
+ test("Line from point and direction", () => {
22
+ const point = new Vector3(1, 2, 3);
23
+ const dir = new Vector3(10, 20, 30).unit;
24
+ const line = ParametricLine.FromPointDirection(point, dir);
25
+ expect(line.x0).toEqual(1);
26
+ expect(line.y0).toEqual(2);
27
+ expect(line.z0).toEqual(3);
28
+ expect(line.a).toBeCloseTo(dir.x);
29
+ expect(line.b).toBeCloseTo(dir.y);
30
+ expect(line.c).toBeCloseTo(dir.z);
31
+ });
32
+ test("From two points", () => {
33
+ const p1 = new Vector3(1, 2, 3);
34
+ const p2 = new Vector3(4, 5, 6);
35
+ const line = ParametricLine.FromTwoPoint(p1, p2);
36
+ const dir = Vector3.Subtract(p2, p1).unit;
37
+ expect(line.x0).toEqual(1);
38
+ expect(line.y0).toEqual(2);
39
+ expect(line.z0).toEqual(3);
40
+ expect(line.a).toEqual(dir.x);
41
+ expect(line.b).toEqual(dir.y);
42
+ expect(line.c).toEqual(dir.z);
43
+ });
44
+ test("Get point", () => {
45
+ const p1 = new Vector3(1, 2, 3);
46
+ const p2 = new Vector3(4, 5, 6);
47
+ let dir = Vector3.Subtract(p2, p1).unit;
48
+ const distance = 11;
49
+ dir = Vector3.NewVectorOfLength(dir, distance);
50
+ const expectedPoint = Vector3.Add(p1, dir);
51
+ const line = ParametricLine.FromTwoPoint(p1, p2);
52
+ const point = ParametricLine.GetPointAtDistance(line, distance);
53
+ expect(point.array).toEqual(expectedPoint.array);
54
+ });
55
+ test("Get point along forward", () => {
56
+ const line = ParametricLine.Forward();
57
+ const point = ParametricLine.GetPointAtDistance(line, 11);
58
+ expect(point.array).toEqual([0, 0, 11]);
59
+ });
60
+ test("Get point along backwards", () => {
61
+ const line = ParametricLine.Backward();
62
+ const point = ParametricLine.GetPointAtDistance(line, 11);
63
+ expect(point.array).toEqual([0, 0, -11]);
64
+ });
65
+ test("Get point along up", () => {
66
+ const line = ParametricLine.Up();
67
+ const point = ParametricLine.GetPointAtDistance(line, 11);
68
+ expect(point.array).toEqual([0, 11, 0]);
69
+ });
70
+ test("Get point along down", () => {
71
+ const line = ParametricLine.Down();
72
+ const point = ParametricLine.GetPointAtDistance(line, 11);
73
+ expect(point.array).toEqual([0, -11, 0]);
74
+ });
75
+ test("Get point along left", () => {
76
+ const line = ParametricLine.Left();
77
+ const point = ParametricLine.GetPointAtDistance(line, 11);
78
+ expect(point.array).toEqual([-11, 0, 0]);
79
+ });
80
+ test("Get point along right", () => {
81
+ const line = ParametricLine.Right();
82
+ const point = ParametricLine.GetPointAtDistance(line, 11);
83
+ expect(point.array).toEqual([11, 0, 0]);
84
+ });
85
+ test("Check for equality", () => {
86
+ const inputParameters = {
87
+ x0: 1,
88
+ y0: 2,
89
+ z0: 3,
90
+ a: 4,
91
+ b: 5,
92
+ c: 6,
93
+ };
94
+ const line1 = new ParametricLine(inputParameters);
95
+ const line2 = new ParametricLine(inputParameters);
96
+ expect(line1).toEqual(line2);
97
+ });
98
+ test("Geting the origin", () => {
99
+ const origin = new Vector3(1, 2, 3);
100
+ const direction = new Vector3(4, 5, 6).unit;
101
+ const line = ParametricLine.FromPointDirection(origin, direction);
102
+ expect(line.origin).toEqual(origin);
103
+ });
104
+ test("Getting the direction", () => {
105
+ const origin = new Vector3(1, 2, 3);
106
+ const direction = new Vector3(4, 5, 6).unit;
107
+ const line = ParametricLine.FromPointDirection(origin, direction);
108
+ expect(Vector3.Close(line.direction, direction)).toEqual(true);
109
+ });
110
+ test("Ensures the direction is unit", () => {
111
+ const origin = new Vector3(1, 2, 3);
112
+ const direction = new Vector3(4, 5, 6);
113
+ const line = ParametricLine.FromPointDirection(origin, direction);
114
+ expect(line.direction).toEqual(direction.unit);
115
+ });
116
+ test("Get distance to point", () => {
117
+ const origin = new Vector3(1, 2, 3);
118
+ const direction = new Vector3(4, 5, 6);
119
+ const line = ParametricLine.FromPointDirection(origin, direction);
120
+ const point = new Vector3(10, 20, 30);
121
+ const expected = Vector3.Subtract(point, origin).magnitude;
122
+ expect(ParametricLine.GetDistanceToPoint(line, point)).toEqual(expected);
123
+ });
124
+ //# sourceMappingURL=ParametricLine.test.js.map