@vived/core 1.4.2 → 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 (378) hide show
  1. package/README.md +118 -20
  2. package/dist/cjs/AppObject/AppObject.js +53 -0
  3. package/dist/cjs/AppObject/AppObject.js.map +1 -1
  4. package/dist/cjs/AppObject/AppObjectComponent.js +78 -0
  5. package/dist/cjs/AppObject/AppObjectComponent.js.map +1 -1
  6. package/dist/cjs/AppObject/AppObjectController.js +22 -0
  7. package/dist/cjs/AppObject/AppObjectController.js.map +1 -1
  8. package/dist/cjs/AppObject/AppObjectEntity.js +52 -0
  9. package/dist/cjs/AppObject/AppObjectEntity.js.map +1 -1
  10. package/dist/cjs/AppObject/AppObjectEntityRepo.js +75 -1
  11. package/dist/cjs/AppObject/AppObjectEntityRepo.js.map +1 -1
  12. package/dist/cjs/AppObject/AppObjectPM.js +46 -0
  13. package/dist/cjs/AppObject/AppObjectPM.js.map +1 -1
  14. package/dist/cjs/AppObject/AppObjectRepo.js +20 -0
  15. package/dist/cjs/AppObject/AppObjectRepo.js.map +1 -1
  16. package/dist/cjs/AppObject/AppObjectUC.js +23 -0
  17. package/dist/cjs/AppObject/AppObjectUC.js.map +1 -1
  18. package/dist/cjs/AppObject/AppObjectView.js +22 -0
  19. package/dist/cjs/AppObject/AppObjectView.js.map +1 -1
  20. package/dist/cjs/AppObject/getSingletonComponent.js +19 -0
  21. package/dist/cjs/AppObject/getSingletonComponent.js.map +1 -1
  22. package/dist/cjs/Entities/MemoizedAngle.js +21 -0
  23. package/dist/cjs/Entities/MemoizedAngle.js.map +1 -1
  24. package/dist/cjs/Entities/MemoizedBoolean.js +21 -0
  25. package/dist/cjs/Entities/MemoizedBoolean.js.map +1 -1
  26. package/dist/cjs/Entities/MemoizedColor.js +21 -0
  27. package/dist/cjs/Entities/MemoizedColor.js.map +1 -1
  28. package/dist/cjs/Entities/MemoizedNumber.js +21 -0
  29. package/dist/cjs/Entities/MemoizedNumber.js.map +1 -1
  30. package/dist/cjs/Entities/MemoizedQuaternion.js +21 -0
  31. package/dist/cjs/Entities/MemoizedQuaternion.js.map +1 -1
  32. package/dist/cjs/Entities/MemoizedString.js +21 -0
  33. package/dist/cjs/Entities/MemoizedString.js.map +1 -1
  34. package/dist/cjs/Entities/MemoizedVector2.js +21 -0
  35. package/dist/cjs/Entities/MemoizedVector2.js.map +1 -1
  36. package/dist/cjs/Entities/MemoizedVector3.js +21 -0
  37. package/dist/cjs/Entities/MemoizedVector3.js.map +1 -1
  38. package/dist/cjs/Entities/ObservableEntity.js +17 -0
  39. package/dist/cjs/Entities/ObservableEntity.js.map +1 -1
  40. package/dist/cjs/Entities/ObserverList.js +21 -0
  41. package/dist/cjs/Entities/ObserverList.js.map +1 -1
  42. package/dist/cjs/Entities/RangedNumber.js +29 -0
  43. package/dist/cjs/Entities/RangedNumber.js.map +1 -1
  44. package/dist/cjs/Types/PmAdapter.js.map +1 -1
  45. package/dist/cjs/Types/SingletonPmAdapter.js.map +1 -1
  46. package/dist/cjs/ValueObjects/Angle.js +1 -1
  47. package/dist/cjs/ValueObjects/Angle.js.map +1 -1
  48. package/dist/cjs/ValueObjects/LineSegment2D.js +6 -6
  49. package/dist/cjs/ValueObjects/LineSegment2D.js.map +1 -1
  50. package/dist/cjs/ValueObjects/Matrix.js +6 -6
  51. package/dist/cjs/ValueObjects/Matrix.js.map +1 -1
  52. package/dist/cjs/ValueObjects/Quaternion.js +17 -17
  53. package/dist/cjs/ValueObjects/Quaternion.js.map +1 -1
  54. package/dist/cjs/ValueObjects/Vector2.js +15 -8
  55. package/dist/cjs/ValueObjects/Vector2.js.map +1 -1
  56. package/dist/esm/AppObject/AppObject.js +53 -0
  57. package/dist/esm/AppObject/AppObject.js.map +1 -1
  58. package/dist/esm/AppObject/AppObjectComponent.js +78 -0
  59. package/dist/esm/AppObject/AppObjectComponent.js.map +1 -1
  60. package/dist/esm/AppObject/AppObjectController.js +22 -0
  61. package/dist/esm/AppObject/AppObjectController.js.map +1 -1
  62. package/dist/esm/AppObject/AppObjectEntity.js +52 -0
  63. package/dist/esm/AppObject/AppObjectEntity.js.map +1 -1
  64. package/dist/esm/AppObject/AppObjectEntityRepo.js +75 -1
  65. package/dist/esm/AppObject/AppObjectEntityRepo.js.map +1 -1
  66. package/dist/esm/AppObject/AppObjectPM.js +46 -0
  67. package/dist/esm/AppObject/AppObjectPM.js.map +1 -1
  68. package/dist/esm/AppObject/AppObjectRepo.js +20 -0
  69. package/dist/esm/AppObject/AppObjectRepo.js.map +1 -1
  70. package/dist/esm/AppObject/AppObjectUC.js +24 -1
  71. package/dist/esm/AppObject/AppObjectUC.js.map +1 -1
  72. package/dist/esm/AppObject/AppObjectView.js +23 -1
  73. package/dist/esm/AppObject/AppObjectView.js.map +1 -1
  74. package/dist/esm/AppObject/getSingletonComponent.js +19 -0
  75. package/dist/esm/AppObject/getSingletonComponent.js.map +1 -1
  76. package/dist/esm/Entities/MemoizedAngle.js +21 -0
  77. package/dist/esm/Entities/MemoizedAngle.js.map +1 -1
  78. package/dist/esm/Entities/MemoizedBoolean.js +21 -0
  79. package/dist/esm/Entities/MemoizedBoolean.js.map +1 -1
  80. package/dist/esm/Entities/MemoizedColor.js +21 -0
  81. package/dist/esm/Entities/MemoizedColor.js.map +1 -1
  82. package/dist/esm/Entities/MemoizedNumber.js +21 -0
  83. package/dist/esm/Entities/MemoizedNumber.js.map +1 -1
  84. package/dist/esm/Entities/MemoizedQuaternion.js +21 -0
  85. package/dist/esm/Entities/MemoizedQuaternion.js.map +1 -1
  86. package/dist/esm/Entities/MemoizedString.js +21 -0
  87. package/dist/esm/Entities/MemoizedString.js.map +1 -1
  88. package/dist/esm/Entities/MemoizedVector2.js +21 -0
  89. package/dist/esm/Entities/MemoizedVector2.js.map +1 -1
  90. package/dist/esm/Entities/MemoizedVector3.js +21 -0
  91. package/dist/esm/Entities/MemoizedVector3.js.map +1 -1
  92. package/dist/esm/Entities/ObservableEntity.js +17 -0
  93. package/dist/esm/Entities/ObservableEntity.js.map +1 -1
  94. package/dist/esm/Entities/ObserverList.js +21 -0
  95. package/dist/esm/Entities/ObserverList.js.map +1 -1
  96. package/dist/esm/Entities/RangedNumber.js +29 -0
  97. package/dist/esm/Entities/RangedNumber.js.map +1 -1
  98. package/dist/esm/Types/PmAdapter.js.map +1 -1
  99. package/dist/esm/Types/SingletonPmAdapter.js.map +1 -1
  100. package/dist/esm/ValueObjects/Angle.js +1 -1
  101. package/dist/esm/ValueObjects/Angle.js.map +1 -1
  102. package/dist/esm/ValueObjects/LineSegment2D.js +6 -6
  103. package/dist/esm/ValueObjects/LineSegment2D.js.map +1 -1
  104. package/dist/esm/ValueObjects/Matrix.js +6 -6
  105. package/dist/esm/ValueObjects/Matrix.js.map +1 -1
  106. package/dist/esm/ValueObjects/Quaternion.js +17 -17
  107. package/dist/esm/ValueObjects/Quaternion.js.map +1 -1
  108. package/dist/esm/ValueObjects/Vector2.js +15 -8
  109. package/dist/esm/ValueObjects/Vector2.js.map +1 -1
  110. package/dist/types/AppObject/AppObject.d.ts +42 -0
  111. package/dist/types/AppObject/AppObject.d.ts.map +1 -1
  112. package/dist/types/AppObject/AppObjectComponent.d.ts +80 -0
  113. package/dist/types/AppObject/AppObjectComponent.d.ts.map +1 -1
  114. package/dist/types/AppObject/AppObjectController.d.ts +22 -0
  115. package/dist/types/AppObject/AppObjectController.d.ts.map +1 -1
  116. package/dist/types/AppObject/AppObjectEntity.d.ts +55 -0
  117. package/dist/types/AppObject/AppObjectEntity.d.ts.map +1 -1
  118. package/dist/types/AppObject/AppObjectEntityRepo.d.ts +75 -0
  119. package/dist/types/AppObject/AppObjectEntityRepo.d.ts.map +1 -1
  120. package/dist/types/AppObject/AppObjectPM.d.ts +53 -0
  121. package/dist/types/AppObject/AppObjectPM.d.ts.map +1 -1
  122. package/dist/types/AppObject/AppObjectRepo.d.ts +124 -0
  123. package/dist/types/AppObject/AppObjectRepo.d.ts.map +1 -1
  124. package/dist/types/AppObject/AppObjectUC.d.ts +23 -0
  125. package/dist/types/AppObject/AppObjectUC.d.ts.map +1 -1
  126. package/dist/types/AppObject/AppObjectView.d.ts +22 -0
  127. package/dist/types/AppObject/AppObjectView.d.ts.map +1 -1
  128. package/dist/types/AppObject/getSingletonComponent.d.ts +19 -0
  129. package/dist/types/AppObject/getSingletonComponent.d.ts.map +1 -1
  130. package/dist/types/Entities/MemoizedAngle.d.ts +21 -0
  131. package/dist/types/Entities/MemoizedAngle.d.ts.map +1 -1
  132. package/dist/types/Entities/MemoizedBoolean.d.ts +21 -0
  133. package/dist/types/Entities/MemoizedBoolean.d.ts.map +1 -1
  134. package/dist/types/Entities/MemoizedColor.d.ts +21 -0
  135. package/dist/types/Entities/MemoizedColor.d.ts.map +1 -1
  136. package/dist/types/Entities/MemoizedNumber.d.ts +21 -0
  137. package/dist/types/Entities/MemoizedNumber.d.ts.map +1 -1
  138. package/dist/types/Entities/MemoizedQuaternion.d.ts +21 -0
  139. package/dist/types/Entities/MemoizedQuaternion.d.ts.map +1 -1
  140. package/dist/types/Entities/MemoizedString.d.ts +21 -0
  141. package/dist/types/Entities/MemoizedString.d.ts.map +1 -1
  142. package/dist/types/Entities/MemoizedVector2.d.ts +21 -0
  143. package/dist/types/Entities/MemoizedVector2.d.ts.map +1 -1
  144. package/dist/types/Entities/MemoizedVector3.d.ts +21 -0
  145. package/dist/types/Entities/MemoizedVector3.d.ts.map +1 -1
  146. package/dist/types/Entities/ObservableEntity.d.ts +20 -0
  147. package/dist/types/Entities/ObservableEntity.d.ts.map +1 -1
  148. package/dist/types/Entities/ObserverList.d.ts +21 -0
  149. package/dist/types/Entities/ObserverList.d.ts.map +1 -1
  150. package/dist/types/Entities/RangedNumber.d.ts +37 -0
  151. package/dist/types/Entities/RangedNumber.d.ts.map +1 -1
  152. package/dist/types/Types/PmAdapter.d.ts +60 -0
  153. package/dist/types/Types/PmAdapter.d.ts.map +1 -1
  154. package/dist/types/Types/SingletonPmAdapter.d.ts +55 -0
  155. package/dist/types/Types/SingletonPmAdapter.d.ts.map +1 -1
  156. package/dist/types/ValueObjects/Angle.d.ts +1 -1
  157. package/dist/types/ValueObjects/Matrix.d.ts +5 -5
  158. package/dist/types/ValueObjects/Matrix.d.ts.map +1 -1
  159. package/dist/types/ValueObjects/Quaternion.d.ts +17 -17
  160. package/dist/types/ValueObjects/Vector2.d.ts +8 -3
  161. package/dist/types/ValueObjects/Vector2.d.ts.map +1 -1
  162. package/package.json +1 -1
  163. package/dist/cjs/AppObject/AppObject.test.js +0 -113
  164. package/dist/cjs/AppObject/AppObject.test.js.map +0 -1
  165. package/dist/cjs/AppObject/AppObjectComponent.test.js +0 -132
  166. package/dist/cjs/AppObject/AppObjectComponent.test.js.map +0 -1
  167. package/dist/cjs/AppObject/AppObjectEntity.test.js +0 -108
  168. package/dist/cjs/AppObject/AppObjectEntity.test.js.map +0 -1
  169. package/dist/cjs/AppObject/AppObjectEntityRepo.test.js +0 -149
  170. package/dist/cjs/AppObject/AppObjectEntityRepo.test.js.map +0 -1
  171. package/dist/cjs/AppObject/AppObjectPM.test.js +0 -103
  172. package/dist/cjs/AppObject/AppObjectPM.test.js.map +0 -1
  173. package/dist/cjs/AppObject/AppObjectRepo.test.js +0 -213
  174. package/dist/cjs/AppObject/AppObjectRepo.test.js.map +0 -1
  175. package/dist/cjs/AppObject/getSingletonComponent.test.js +0 -13
  176. package/dist/cjs/AppObject/getSingletonComponent.test.js.map +0 -1
  177. package/dist/cjs/Entities/MemoizedAngle.test.js +0 -30
  178. package/dist/cjs/Entities/MemoizedAngle.test.js.map +0 -1
  179. package/dist/cjs/Entities/MemoizedBoolean.test.js +0 -34
  180. package/dist/cjs/Entities/MemoizedBoolean.test.js.map +0 -1
  181. package/dist/cjs/Entities/MemoizedColor.test.js +0 -32
  182. package/dist/cjs/Entities/MemoizedColor.test.js.map +0 -1
  183. package/dist/cjs/Entities/MemoizedNumber.test.js +0 -29
  184. package/dist/cjs/Entities/MemoizedNumber.test.js.map +0 -1
  185. package/dist/cjs/Entities/MemoizedQuaternion.test.js +0 -32
  186. package/dist/cjs/Entities/MemoizedQuaternion.test.js.map +0 -1
  187. package/dist/cjs/Entities/MemoizedString.test.js +0 -29
  188. package/dist/cjs/Entities/MemoizedString.test.js.map +0 -1
  189. package/dist/cjs/Entities/MemoizedVector2.test.js +0 -32
  190. package/dist/cjs/Entities/MemoizedVector2.test.js.map +0 -1
  191. package/dist/cjs/Entities/MemoizedVector3.test.js +0 -32
  192. package/dist/cjs/Entities/MemoizedVector3.test.js.map +0 -1
  193. package/dist/cjs/Entities/ObservableEntity.test.js +0 -25
  194. package/dist/cjs/Entities/ObservableEntity.test.js.map +0 -1
  195. package/dist/cjs/Entities/ObserverList.test.js +0 -44
  196. package/dist/cjs/Entities/ObserverList.test.js.map +0 -1
  197. package/dist/cjs/Entities/RangedNumber.test.js +0 -96
  198. package/dist/cjs/Entities/RangedNumber.test.js.map +0 -1
  199. package/dist/cjs/Utilities/LengthConverters.test.js +0 -24
  200. package/dist/cjs/Utilities/LengthConverters.test.js.map +0 -1
  201. package/dist/cjs/Utilities/LerpNumber.test.js +0 -90
  202. package/dist/cjs/Utilities/LerpNumber.test.js.map +0 -1
  203. package/dist/cjs/Utilities/addAlphaToHex.test.js +0 -34
  204. package/dist/cjs/Utilities/addAlphaToHex.test.js.map +0 -1
  205. package/dist/cjs/Utilities/alphaToHex.test.js +0 -75
  206. package/dist/cjs/Utilities/alphaToHex.test.js.map +0 -1
  207. package/dist/cjs/Utilities/degreesToRadians.test.js +0 -9
  208. package/dist/cjs/Utilities/degreesToRadians.test.js.map +0 -1
  209. package/dist/cjs/Utilities/easeFunctions.test.js +0 -209
  210. package/dist/cjs/Utilities/easeFunctions.test.js.map +0 -1
  211. package/dist/cjs/Utilities/interpolateNumber.test.js +0 -26
  212. package/dist/cjs/Utilities/interpolateNumber.test.js.map +0 -1
  213. package/dist/cjs/ValueObjects/Angle.test.js +0 -28
  214. package/dist/cjs/ValueObjects/Angle.test.js.map +0 -1
  215. package/dist/cjs/ValueObjects/Color.test.js +0 -147
  216. package/dist/cjs/ValueObjects/Color.test.js.map +0 -1
  217. package/dist/cjs/ValueObjects/LineSegment2D.test.js +0 -102
  218. package/dist/cjs/ValueObjects/LineSegment2D.test.js.map +0 -1
  219. package/dist/cjs/ValueObjects/Matrix.test.js +0 -385
  220. package/dist/cjs/ValueObjects/Matrix.test.js.map +0 -1
  221. package/dist/cjs/ValueObjects/ParametricLine.test.js +0 -126
  222. package/dist/cjs/ValueObjects/ParametricLine.test.js.map +0 -1
  223. package/dist/cjs/ValueObjects/ParametricPlane.test.js +0 -101
  224. package/dist/cjs/ValueObjects/ParametricPlane.test.js.map +0 -1
  225. package/dist/cjs/ValueObjects/Quaternion.test.js +0 -240
  226. package/dist/cjs/ValueObjects/Quaternion.test.js.map +0 -1
  227. package/dist/cjs/ValueObjects/Rectangle.test.js +0 -32
  228. package/dist/cjs/ValueObjects/Rectangle.test.js.map +0 -1
  229. package/dist/cjs/ValueObjects/Vector2.test.js +0 -136
  230. package/dist/cjs/ValueObjects/Vector2.test.js.map +0 -1
  231. package/dist/cjs/ValueObjects/Vector3.test.js +0 -188
  232. package/dist/cjs/ValueObjects/Vector3.test.js.map +0 -1
  233. package/dist/cjs/ValueObjects/Version.test.js +0 -310
  234. package/dist/cjs/ValueObjects/Version.test.js.map +0 -1
  235. package/dist/esm/AppObject/AppObject.test.js +0 -110
  236. package/dist/esm/AppObject/AppObject.test.js.map +0 -1
  237. package/dist/esm/AppObject/AppObjectComponent.test.js +0 -130
  238. package/dist/esm/AppObject/AppObjectComponent.test.js.map +0 -1
  239. package/dist/esm/AppObject/AppObjectEntity.test.js +0 -106
  240. package/dist/esm/AppObject/AppObjectEntity.test.js.map +0 -1
  241. package/dist/esm/AppObject/AppObjectEntityRepo.test.js +0 -147
  242. package/dist/esm/AppObject/AppObjectEntityRepo.test.js.map +0 -1
  243. package/dist/esm/AppObject/AppObjectPM.test.js +0 -101
  244. package/dist/esm/AppObject/AppObjectPM.test.js.map +0 -1
  245. package/dist/esm/AppObject/AppObjectRepo.test.js +0 -211
  246. package/dist/esm/AppObject/AppObjectRepo.test.js.map +0 -1
  247. package/dist/esm/AppObject/getSingletonComponent.test.js +0 -11
  248. package/dist/esm/AppObject/getSingletonComponent.test.js.map +0 -1
  249. package/dist/esm/Entities/MemoizedAngle.test.js +0 -28
  250. package/dist/esm/Entities/MemoizedAngle.test.js.map +0 -1
  251. package/dist/esm/Entities/MemoizedBoolean.test.js +0 -32
  252. package/dist/esm/Entities/MemoizedBoolean.test.js.map +0 -1
  253. package/dist/esm/Entities/MemoizedColor.test.js +0 -30
  254. package/dist/esm/Entities/MemoizedColor.test.js.map +0 -1
  255. package/dist/esm/Entities/MemoizedNumber.test.js +0 -27
  256. package/dist/esm/Entities/MemoizedNumber.test.js.map +0 -1
  257. package/dist/esm/Entities/MemoizedQuaternion.test.js +0 -30
  258. package/dist/esm/Entities/MemoizedQuaternion.test.js.map +0 -1
  259. package/dist/esm/Entities/MemoizedString.test.js +0 -27
  260. package/dist/esm/Entities/MemoizedString.test.js.map +0 -1
  261. package/dist/esm/Entities/MemoizedVector2.test.js +0 -30
  262. package/dist/esm/Entities/MemoizedVector2.test.js.map +0 -1
  263. package/dist/esm/Entities/MemoizedVector3.test.js +0 -30
  264. package/dist/esm/Entities/MemoizedVector3.test.js.map +0 -1
  265. package/dist/esm/Entities/ObservableEntity.test.js +0 -23
  266. package/dist/esm/Entities/ObservableEntity.test.js.map +0 -1
  267. package/dist/esm/Entities/ObserverList.test.js +0 -42
  268. package/dist/esm/Entities/ObserverList.test.js.map +0 -1
  269. package/dist/esm/Entities/RangedNumber.test.js +0 -94
  270. package/dist/esm/Entities/RangedNumber.test.js.map +0 -1
  271. package/dist/esm/Utilities/LengthConverters.test.js +0 -22
  272. package/dist/esm/Utilities/LengthConverters.test.js.map +0 -1
  273. package/dist/esm/Utilities/LerpNumber.test.js +0 -88
  274. package/dist/esm/Utilities/LerpNumber.test.js.map +0 -1
  275. package/dist/esm/Utilities/addAlphaToHex.test.js +0 -32
  276. package/dist/esm/Utilities/addAlphaToHex.test.js.map +0 -1
  277. package/dist/esm/Utilities/alphaToHex.test.js +0 -73
  278. package/dist/esm/Utilities/alphaToHex.test.js.map +0 -1
  279. package/dist/esm/Utilities/degreesToRadians.test.js +0 -7
  280. package/dist/esm/Utilities/degreesToRadians.test.js.map +0 -1
  281. package/dist/esm/Utilities/easeFunctions.test.js +0 -207
  282. package/dist/esm/Utilities/easeFunctions.test.js.map +0 -1
  283. package/dist/esm/Utilities/interpolateNumber.test.js +0 -24
  284. package/dist/esm/Utilities/interpolateNumber.test.js.map +0 -1
  285. package/dist/esm/ValueObjects/Angle.test.js +0 -26
  286. package/dist/esm/ValueObjects/Angle.test.js.map +0 -1
  287. package/dist/esm/ValueObjects/Color.test.js +0 -145
  288. package/dist/esm/ValueObjects/Color.test.js.map +0 -1
  289. package/dist/esm/ValueObjects/LineSegment2D.test.js +0 -100
  290. package/dist/esm/ValueObjects/LineSegment2D.test.js.map +0 -1
  291. package/dist/esm/ValueObjects/Matrix.test.js +0 -383
  292. package/dist/esm/ValueObjects/Matrix.test.js.map +0 -1
  293. package/dist/esm/ValueObjects/ParametricLine.test.js +0 -124
  294. package/dist/esm/ValueObjects/ParametricLine.test.js.map +0 -1
  295. package/dist/esm/ValueObjects/ParametricPlane.test.js +0 -99
  296. package/dist/esm/ValueObjects/ParametricPlane.test.js.map +0 -1
  297. package/dist/esm/ValueObjects/Quaternion.test.js +0 -238
  298. package/dist/esm/ValueObjects/Quaternion.test.js.map +0 -1
  299. package/dist/esm/ValueObjects/Rectangle.test.js +0 -30
  300. package/dist/esm/ValueObjects/Rectangle.test.js.map +0 -1
  301. package/dist/esm/ValueObjects/Vector2.test.js +0 -134
  302. package/dist/esm/ValueObjects/Vector2.test.js.map +0 -1
  303. package/dist/esm/ValueObjects/Vector3.test.js +0 -186
  304. package/dist/esm/ValueObjects/Vector3.test.js.map +0 -1
  305. package/dist/esm/ValueObjects/Version.test.js +0 -308
  306. package/dist/esm/ValueObjects/Version.test.js.map +0 -1
  307. package/dist/types/AppObject/AppObject.test.d.ts +0 -7
  308. package/dist/types/AppObject/AppObject.test.d.ts.map +0 -1
  309. package/dist/types/AppObject/AppObjectComponent.test.d.ts +0 -2
  310. package/dist/types/AppObject/AppObjectComponent.test.d.ts.map +0 -1
  311. package/dist/types/AppObject/AppObjectEntity.test.d.ts +0 -2
  312. package/dist/types/AppObject/AppObjectEntity.test.d.ts.map +0 -1
  313. package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts +0 -2
  314. package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts.map +0 -1
  315. package/dist/types/AppObject/AppObjectPM.test.d.ts +0 -2
  316. package/dist/types/AppObject/AppObjectPM.test.d.ts.map +0 -1
  317. package/dist/types/AppObject/AppObjectRepo.test.d.ts +0 -2
  318. package/dist/types/AppObject/AppObjectRepo.test.d.ts.map +0 -1
  319. package/dist/types/AppObject/getSingletonComponent.test.d.ts +0 -2
  320. package/dist/types/AppObject/getSingletonComponent.test.d.ts.map +0 -1
  321. package/dist/types/Entities/MemoizedAngle.test.d.ts +0 -2
  322. package/dist/types/Entities/MemoizedAngle.test.d.ts.map +0 -1
  323. package/dist/types/Entities/MemoizedBoolean.test.d.ts +0 -2
  324. package/dist/types/Entities/MemoizedBoolean.test.d.ts.map +0 -1
  325. package/dist/types/Entities/MemoizedColor.test.d.ts +0 -2
  326. package/dist/types/Entities/MemoizedColor.test.d.ts.map +0 -1
  327. package/dist/types/Entities/MemoizedNumber.test.d.ts +0 -2
  328. package/dist/types/Entities/MemoizedNumber.test.d.ts.map +0 -1
  329. package/dist/types/Entities/MemoizedQuaternion.test.d.ts +0 -2
  330. package/dist/types/Entities/MemoizedQuaternion.test.d.ts.map +0 -1
  331. package/dist/types/Entities/MemoizedString.test.d.ts +0 -2
  332. package/dist/types/Entities/MemoizedString.test.d.ts.map +0 -1
  333. package/dist/types/Entities/MemoizedVector2.test.d.ts +0 -2
  334. package/dist/types/Entities/MemoizedVector2.test.d.ts.map +0 -1
  335. package/dist/types/Entities/MemoizedVector3.test.d.ts +0 -2
  336. package/dist/types/Entities/MemoizedVector3.test.d.ts.map +0 -1
  337. package/dist/types/Entities/ObservableEntity.test.d.ts +0 -2
  338. package/dist/types/Entities/ObservableEntity.test.d.ts.map +0 -1
  339. package/dist/types/Entities/ObserverList.test.d.ts +0 -2
  340. package/dist/types/Entities/ObserverList.test.d.ts.map +0 -1
  341. package/dist/types/Entities/RangedNumber.test.d.ts +0 -2
  342. package/dist/types/Entities/RangedNumber.test.d.ts.map +0 -1
  343. package/dist/types/Utilities/LengthConverters.test.d.ts +0 -2
  344. package/dist/types/Utilities/LengthConverters.test.d.ts.map +0 -1
  345. package/dist/types/Utilities/LerpNumber.test.d.ts +0 -2
  346. package/dist/types/Utilities/LerpNumber.test.d.ts.map +0 -1
  347. package/dist/types/Utilities/addAlphaToHex.test.d.ts +0 -2
  348. package/dist/types/Utilities/addAlphaToHex.test.d.ts.map +0 -1
  349. package/dist/types/Utilities/alphaToHex.test.d.ts +0 -2
  350. package/dist/types/Utilities/alphaToHex.test.d.ts.map +0 -1
  351. package/dist/types/Utilities/degreesToRadians.test.d.ts +0 -2
  352. package/dist/types/Utilities/degreesToRadians.test.d.ts.map +0 -1
  353. package/dist/types/Utilities/easeFunctions.test.d.ts +0 -2
  354. package/dist/types/Utilities/easeFunctions.test.d.ts.map +0 -1
  355. package/dist/types/Utilities/interpolateNumber.test.d.ts +0 -2
  356. package/dist/types/Utilities/interpolateNumber.test.d.ts.map +0 -1
  357. package/dist/types/ValueObjects/Angle.test.d.ts +0 -2
  358. package/dist/types/ValueObjects/Angle.test.d.ts.map +0 -1
  359. package/dist/types/ValueObjects/Color.test.d.ts +0 -2
  360. package/dist/types/ValueObjects/Color.test.d.ts.map +0 -1
  361. package/dist/types/ValueObjects/LineSegment2D.test.d.ts +0 -2
  362. package/dist/types/ValueObjects/LineSegment2D.test.d.ts.map +0 -1
  363. package/dist/types/ValueObjects/Matrix.test.d.ts +0 -2
  364. package/dist/types/ValueObjects/Matrix.test.d.ts.map +0 -1
  365. package/dist/types/ValueObjects/ParametricLine.test.d.ts +0 -2
  366. package/dist/types/ValueObjects/ParametricLine.test.d.ts.map +0 -1
  367. package/dist/types/ValueObjects/ParametricPlane.test.d.ts +0 -2
  368. package/dist/types/ValueObjects/ParametricPlane.test.d.ts.map +0 -1
  369. package/dist/types/ValueObjects/Quaternion.test.d.ts +0 -2
  370. package/dist/types/ValueObjects/Quaternion.test.d.ts.map +0 -1
  371. package/dist/types/ValueObjects/Rectangle.test.d.ts +0 -2
  372. package/dist/types/ValueObjects/Rectangle.test.d.ts.map +0 -1
  373. package/dist/types/ValueObjects/Vector2.test.d.ts +0 -2
  374. package/dist/types/ValueObjects/Vector2.test.d.ts.map +0 -1
  375. package/dist/types/ValueObjects/Vector3.test.d.ts +0 -2
  376. package/dist/types/ValueObjects/Vector3.test.d.ts.map +0 -1
  377. package/dist/types/ValueObjects/Version.test.d.ts +0 -2
  378. package/dist/types/ValueObjects/Version.test.d.ts.map +0 -1
@@ -1,385 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const Angle_1 = require("./Angle");
4
- const Matrix_1 = require("./Matrix");
5
- const Quaternion_1 = require("./Quaternion");
6
- const Vector3_1 = require("./Vector3");
7
- describe("Matrix Value Object", () => {
8
- it("Forms an identity matrix", () => {
9
- const identity = Matrix_1.Matrix.Identity();
10
- const expected = new Matrix_1.Matrix(identityArray);
11
- expect(identity).toEqual(expected);
12
- });
13
- it("Forms a zero matrix", () => {
14
- const identity = Matrix_1.Matrix.Zero();
15
- const expected = new Matrix_1.Matrix(zeroArray);
16
- expect(identity).toEqual(expected);
17
- });
18
- it("Checks to see if two matricies are equal", () => {
19
- const m1 = new Matrix_1.Matrix(sequentialArray);
20
- const m2 = new Matrix_1.Matrix(sequentialArray);
21
- const m3 = new Matrix_1.Matrix(zeroArray);
22
- expect(Matrix_1.Matrix.Equal(m1, m2)).toEqual(true);
23
- expect(Matrix_1.Matrix.Equal(m1, m3)).toEqual(false);
24
- });
25
- it("Checks for eqaulity during tests", () => {
26
- const m1 = new Matrix_1.Matrix(sequentialArray);
27
- const m2 = new Matrix_1.Matrix(sequentialArray);
28
- expect(m1).toEqual(m2);
29
- });
30
- it("Returns the translation", () => {
31
- const m1 = new Matrix_1.Matrix(sequentialArray);
32
- expect(m1.translation).toEqual(new Vector3_1.Vector3(13, 14, 15));
33
- });
34
- it("Multipiles two matricies", () => {
35
- const m1 = new Matrix_1.Matrix(sequentialArray);
36
- const m2 = new Matrix_1.Matrix([
37
- 16,
38
- 15,
39
- 14,
40
- 13,
41
- 12,
42
- 11,
43
- 10,
44
- 9,
45
- 8,
46
- 7,
47
- 6,
48
- 5,
49
- 4,
50
- 3,
51
- 2,
52
- 1,
53
- ]);
54
- const expected = new Matrix_1.Matrix([
55
- 386,
56
- 444,
57
- 502,
58
- 560,
59
- 274,
60
- 316,
61
- 358,
62
- 400,
63
- 162,
64
- 188,
65
- 214,
66
- 240,
67
- 50,
68
- 60,
69
- 70,
70
- 80,
71
- ]);
72
- const result = Matrix_1.Matrix.Multiply(m1, m2);
73
- expect(result.m).toEqual(expected.m);
74
- });
75
- it("Composes an Identity matrix", () => {
76
- const pos = Vector3_1.Vector3.Zero();
77
- const scale = Vector3_1.Vector3.One();
78
- const rot = Quaternion_1.Quaternion.Identity();
79
- const mat = Matrix_1.Matrix.Compose(scale, rot, pos);
80
- expect(mat).toEqual(Matrix_1.Matrix.Identity());
81
- });
82
- it("Composes a matrix with a position", () => {
83
- const pos = new Vector3_1.Vector3(11, 22, 33);
84
- const scale = Vector3_1.Vector3.One();
85
- const rot = Quaternion_1.Quaternion.Identity();
86
- const composed = Matrix_1.Matrix.Compose(scale, rot, pos);
87
- const expected = new Matrix_1.Matrix([
88
- 1,
89
- 0,
90
- 0,
91
- 0,
92
- 0,
93
- 1,
94
- 0,
95
- 0,
96
- 0,
97
- 0,
98
- 1,
99
- 0,
100
- 11,
101
- 22,
102
- 33,
103
- 1,
104
- ]);
105
- expect(composed).toEqual(expected);
106
- });
107
- it("Composes a matrix with scale", () => {
108
- const pos = Vector3_1.Vector3.Zero();
109
- const scale = new Vector3_1.Vector3(6, 7, 8);
110
- const rot = Quaternion_1.Quaternion.Identity();
111
- const composed = Matrix_1.Matrix.Compose(scale, rot, pos);
112
- const expected = new Matrix_1.Matrix([
113
- 6,
114
- 0,
115
- 0,
116
- 0,
117
- 0,
118
- 7,
119
- 0,
120
- 0,
121
- 0,
122
- 0,
123
- 8,
124
- 0,
125
- 0,
126
- 0,
127
- 0,
128
- 1,
129
- ]);
130
- expect(composed).toEqual(expected);
131
- });
132
- it("Composes a matrix with rotation", () => {
133
- // Number are from Babylon
134
- const pos = Vector3_1.Vector3.Zero();
135
- const scale = Vector3_1.Vector3.One();
136
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
137
- const composed = Matrix_1.Matrix.Compose(scale, rot, pos);
138
- expect(composed.m[0]).toBeCloseTo(0.5199598670005798);
139
- expect(composed.m[1]).toBeCloseTo(0.07624746859073639);
140
- expect(composed.m[2]).toBeCloseTo(0.8507808446884155);
141
- expect(composed.m[4]).toBeCloseTo(-0.6987635493278503);
142
- expect(composed.m[5]).toBeCloseTo(-0.5348952412605286);
143
- expect(composed.m[6]).toBeCloseTo(0.47499117255210876);
144
- expect(composed.m[8]).toBeCloseTo(0.4912954866886139);
145
- expect(composed.m[9]).toBeCloseTo(-0.8414709568023682);
146
- expect(composed.m[10]).toBeCloseTo(-0.22484509646892548);
147
- });
148
- it("Calculates a determinant", () => {
149
- const sequential = new Matrix_1.Matrix(sequentialArray);
150
- expect(sequential.determinate).toEqual(0);
151
- const identity = Matrix_1.Matrix.Identity();
152
- expect(identity.determinate).toEqual(1);
153
- const pos = new Vector3_1.Vector3(23, 26, 29);
154
- const scale = new Vector3_1.Vector3(6, 7, 8);
155
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
156
- const composed = Matrix_1.Matrix.Compose(scale, rot, pos);
157
- expect(composed.determinate).toBeCloseTo(335.99999908851385); // Number is from babylon
158
- });
159
- it("Returns the translation", () => {
160
- const pos = new Vector3_1.Vector3(23, 26, 29);
161
- const scale = new Vector3_1.Vector3(6, 7, 8);
162
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
163
- const composed = Matrix_1.Matrix.Compose(scale, rot, pos);
164
- expect(composed.translation).toEqual(pos);
165
- });
166
- it("Returns the scale", () => {
167
- const pos = new Vector3_1.Vector3(23, 26, 29);
168
- const scale = new Vector3_1.Vector3(6, 7, 8);
169
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
170
- const composed = Matrix_1.Matrix.Compose(scale, rot, pos);
171
- expect(composed.scale.x).toBeCloseTo(scale.x);
172
- expect(composed.scale.y).toBeCloseTo(scale.y);
173
- expect(composed.scale.z).toBeCloseTo(scale.z);
174
- });
175
- it("Returns the negative scale", () => {
176
- const pos = new Vector3_1.Vector3(23, 26, 29);
177
- const scale = new Vector3_1.Vector3(6, -7, 8);
178
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
179
- const composed = Matrix_1.Matrix.Compose(scale, rot, pos);
180
- expect(composed.scale.x).toBeCloseTo(scale.x);
181
- expect(composed.scale.y).toBeCloseTo(scale.y);
182
- expect(composed.scale.z).toBeCloseTo(scale.z);
183
- });
184
- it("Returns a rotation matrix", () => {
185
- const pos = new Vector3_1.Vector3(23, 26, 29);
186
- const scale = new Vector3_1.Vector3(6, -7, 8);
187
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
188
- const composed = Matrix_1.Matrix.Compose(scale, rot, pos);
189
- const expected = Matrix_1.Matrix.Compose(Vector3_1.Vector3.One(), rot, Vector3_1.Vector3.Zero());
190
- expect(Matrix_1.Matrix.Close(composed.rotationMatrix, expected)).toEqual(true);
191
- });
192
- it("Returns the rotation", () => {
193
- const pos = new Vector3_1.Vector3(23, 26, 29);
194
- const scale = new Vector3_1.Vector3(6, 7, 8);
195
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
196
- const composed = Matrix_1.Matrix.Compose(scale, rot, pos);
197
- expect(Quaternion_1.Quaternion.Close(composed.rotation, rot)).toEqual(true);
198
- });
199
- it("Checks if matricies are close", () => {
200
- const m1 = new Matrix_1.Matrix(sequentialArray);
201
- const biggerValues = [...sequentialArray];
202
- biggerValues.forEach((val, i) => {
203
- biggerValues[i] = val + 0.01; // Just a little bump
204
- });
205
- const bigger = new Matrix_1.Matrix(biggerValues);
206
- const smallerValues = [...sequentialArray];
207
- smallerValues.forEach((val, i) => {
208
- smallerValues[i] = val - 0.01; // Just a little bump
209
- });
210
- const smaller = new Matrix_1.Matrix(smallerValues);
211
- expect(Matrix_1.Matrix.Close(m1, bigger, 0.0101)).toEqual(true);
212
- expect(Matrix_1.Matrix.Close(m1, bigger, 0.0099)).toEqual(false);
213
- expect(Matrix_1.Matrix.Close(m1, smaller, 0.0101)).toEqual(true);
214
- expect(Matrix_1.Matrix.Close(m1, smaller, 0.0099)).toEqual(false);
215
- });
216
- it("Results in an Identity if we invert the identity", () => {
217
- const identity = Matrix_1.Matrix.Identity();
218
- const inverted = Matrix_1.Matrix.Invert(identity);
219
- expect(Matrix_1.Matrix.Close(inverted, identity)).toEqual(true);
220
- });
221
- it("Inverts a matrix", () => {
222
- const pos = new Vector3_1.Vector3(23, 26, 29);
223
- const scale = new Vector3_1.Vector3(6, 7, 8);
224
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
225
- const mat = Matrix_1.Matrix.Compose(scale, rot, pos);
226
- const inverted = Matrix_1.Matrix.Invert(mat);
227
- // Numbers are from babylon
228
- const expected = new Matrix_1.Matrix([
229
- 0.08665996789932251,
230
- -0.09982336312532425,
231
- 0.061411935836076736,
232
- -0,
233
- 0.0127079077064991,
234
- -0.0764136016368866,
235
- -0.10518387705087662,
236
- 0,
237
- 0.14179681241512299,
238
- 0.06785587966442108,
239
- -0.028105635195970535,
240
- -0,
241
- -6.435692310333252,
242
- 2.314870595932007,
243
- 2.1373696327209473,
244
- 1,
245
- ]);
246
- expect(Matrix_1.Matrix.Close(inverted, expected)).toEqual(true);
247
- });
248
- it("Creates a rotation matrix from an axis ange angle", () => {
249
- const axis = new Vector3_1.Vector3(1, 2, 3);
250
- const angle = Angle_1.Angle.FromRadians(1.3);
251
- const rotationMatrix = Matrix_1.Matrix.FromRotationAxisAngle(axis, angle);
252
- // Numbers are from babylon
253
- const expected = new Matrix_1.Matrix([
254
- 0.3198203444480896,
255
- 0.8772082924842834,
256
- -0.3580789864063263,
257
- 0,
258
- -0.6679222583770752,
259
- 0.476784884929657,
260
- 0.5714508295059204,
261
- 0,
262
- 0.6720080375671387,
263
- 0.05640731751918793,
264
- 0.7383924126625061,
265
- 0,
266
- 0,
267
- 0,
268
- 0,
269
- 1,
270
- ]);
271
- expect(Matrix_1.Matrix.Close(rotationMatrix, expected)).toEqual(true);
272
- });
273
- it("Sets the transformation of a matrix", () => {
274
- const pos = new Vector3_1.Vector3(23, 26, 29);
275
- const scale = new Vector3_1.Vector3(6, 7, 8);
276
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
277
- const mat = Matrix_1.Matrix.Compose(scale, rot, pos);
278
- const newTrans = new Vector3_1.Vector3(3, 2, 1);
279
- const newMat = Matrix_1.Matrix.SetMatrixTranslation(mat, newTrans);
280
- expect(Quaternion_1.Quaternion.Close(newMat.rotation, rot)).toEqual(true);
281
- expect(Vector3_1.Vector3.Close(newMat.translation, newTrans)).toEqual(true);
282
- expect(Vector3_1.Vector3.Close(newMat.scale, scale)).toEqual(true);
283
- });
284
- it("Sets the rotation of a matrix", () => {
285
- const pos = new Vector3_1.Vector3(23, 26, 29);
286
- const scale = new Vector3_1.Vector3(6, 7, 8);
287
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
288
- const mat = Matrix_1.Matrix.Compose(scale, rot, pos);
289
- const newRotation = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1.1), Angle_1.Angle.FromRadians(2.2), Angle_1.Angle.FromRadians(3.3));
290
- const newMat = Matrix_1.Matrix.SetMatrixRotation(mat, newRotation);
291
- expect(Quaternion_1.Quaternion.Close(newMat.rotation, newRotation)).toEqual(true);
292
- expect(Vector3_1.Vector3.Close(newMat.translation, pos)).toEqual(true);
293
- expect(Vector3_1.Vector3.Close(newMat.scale, scale)).toEqual(true);
294
- });
295
- it("Sets the scale of a matrix", () => {
296
- const pos = new Vector3_1.Vector3(23, 26, 29);
297
- const scale = new Vector3_1.Vector3(6, 7, 8);
298
- const rot = Quaternion_1.Quaternion.FromEuler(Angle_1.Angle.FromRadians(1), Angle_1.Angle.FromRadians(2), Angle_1.Angle.FromRadians(3));
299
- const mat = Matrix_1.Matrix.Compose(scale, rot, pos);
300
- const newScale = new Vector3_1.Vector3(1, 2, 3);
301
- const newMat = Matrix_1.Matrix.SetMatrixScale(mat, newScale);
302
- expect(Quaternion_1.Quaternion.Close(newMat.rotation, rot)).toEqual(true);
303
- expect(Vector3_1.Vector3.Close(newMat.translation, pos)).toEqual(true);
304
- expect(Vector3_1.Vector3.Close(newMat.scale, newScale)).toEqual(true);
305
- });
306
- it("Makes a Matrix from a Float 32 Array", () => {
307
- const float32Array = new Float32Array(16);
308
- for (let index = 0; index < 16; index++) {
309
- float32Array[index] = index * 2;
310
- }
311
- const matrix = Matrix_1.Matrix.FromFloat32Array(float32Array);
312
- for (let index = 0; index < 16; index++) {
313
- expect(matrix.m[index]).toEqual(index * 2);
314
- }
315
- });
316
- it("Logs an error and return the identity if the float 32 array does not have 16 itesm", () => {
317
- const float32Array = new Float32Array(1);
318
- console.error = jest.fn();
319
- const matrix = Matrix_1.Matrix.FromFloat32Array(float32Array);
320
- expect(console.error).toBeCalled();
321
- expect(matrix).toEqual(Matrix_1.Matrix.Identity());
322
- });
323
- it("Flips the handedness of a transform matrix", () => {
324
- const matrix = new Matrix_1.Matrix(sequentialArray);
325
- const flipped = Matrix_1.Matrix.FlipTransformMatrixHand(matrix);
326
- for (let index = 0; index < 16; index++) {
327
- if (index === 2 || index === 6 || index === 8 || index === 9 || index === 14) {
328
- expect(matrix.m[index]).toEqual(-flipped.m[index]);
329
- }
330
- else {
331
- expect(matrix.m[index]).toEqual(flipped.m[index]);
332
- }
333
- }
334
- });
335
- it("Flips the handedness of a projection matrix", () => {
336
- const matrix = new Matrix_1.Matrix(sequentialArray);
337
- const flipped = Matrix_1.Matrix.FlipProjectionMatrixHand(matrix);
338
- for (let index = 0; index < 16; index++) {
339
- if (index === 8 || index === 9 || index === 10 || index === 11) {
340
- expect(matrix.m[index]).toEqual(-flipped.m[index]);
341
- }
342
- else {
343
- expect(matrix.m[index]).toEqual(flipped.m[index]);
344
- }
345
- }
346
- });
347
- });
348
- const identityArray = [
349
- 1,
350
- 0,
351
- 0,
352
- 0,
353
- 0,
354
- 1,
355
- 0,
356
- 0,
357
- 0,
358
- 0,
359
- 1,
360
- 0,
361
- 0,
362
- 0,
363
- 0,
364
- 1,
365
- ];
366
- const zeroArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
367
- const sequentialArray = [
368
- 1,
369
- 2,
370
- 3,
371
- 4,
372
- 5,
373
- 6,
374
- 7,
375
- 8,
376
- 9,
377
- 10,
378
- 11,
379
- 12,
380
- 13,
381
- 14,
382
- 15,
383
- 16,
384
- ];
385
- //# 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,mCAAgC;AAChC,qCAA+C;AAC/C,6CAA0C;AAC1C,uCAAoC;AAEpC,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,QAAQ,GAAG,eAAM,CAAC,QAAQ,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,IAAI,eAAM,CAAC,aAAa,CAAC,CAAC;QAC3C,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;QAC7B,MAAM,QAAQ,GAAG,eAAM,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,CAAC;QACvC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,EAAE,GAAG,IAAI,eAAM,CAAC,eAAe,CAAC,CAAC;QACvC,MAAM,EAAE,GAAG,IAAI,eAAM,CAAC,eAAe,CAAC,CAAC;QACvC,MAAM,EAAE,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,CAAC;QAEjC,MAAM,CAAC,eAAM,CAA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AE,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"]}
@@ -1,126 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const _1 = require(".");
4
- const ParametricLine_1 = require("./ParametricLine");
5
- test("Setting and getting the parameters", () => {
6
- const inputParameters = {
7
- x0: 1,
8
- y0: 2,
9
- z0: 3,
10
- a: 4,
11
- b: 5,
12
- c: 6,
13
- };
14
- const line = new ParametricLine_1.ParametricLine(inputParameters);
15
- const dirUnit = new _1.Vector3(4, 5, 6).unit;
16
- expect(line.x0).toEqual(inputParameters.x0);
17
- expect(line.y0).toEqual(inputParameters.y0);
18
- expect(line.z0).toEqual(inputParameters.z0);
19
- expect(line.a).toBeCloseTo(dirUnit.x);
20
- expect(line.b).toBeCloseTo(dirUnit.y);
21
- expect(line.c).toBeCloseTo(dirUnit.z);
22
- });
23
- test("Line from point and direction", () => {
24
- const point = new _1.Vector3(1, 2, 3);
25
- const dir = new _1.Vector3(10, 20, 30).unit;
26
- const line = ParametricLine_1.ParametricLine.FromPointDirection(point, dir);
27
- expect(line.x0).toEqual(1);
28
- expect(line.y0).toEqual(2);
29
- expect(line.z0).toEqual(3);
30
- expect(line.a).toBeCloseTo(dir.x);
31
- expect(line.b).toBeCloseTo(dir.y);
32
- expect(line.c).toBeCloseTo(dir.z);
33
- });
34
- test("From two points", () => {
35
- const p1 = new _1.Vector3(1, 2, 3);
36
- const p2 = new _1.Vector3(4, 5, 6);
37
- const line = ParametricLine_1.ParametricLine.FromTwoPoint(p1, p2);
38
- const dir = _1.Vector3.Subtract(p2, p1).unit;
39
- expect(line.x0).toEqual(1);
40
- expect(line.y0).toEqual(2);
41
- expect(line.z0).toEqual(3);
42
- expect(line.a).toEqual(dir.x);
43
- expect(line.b).toEqual(dir.y);
44
- expect(line.c).toEqual(dir.z);
45
- });
46
- test("Get point", () => {
47
- const p1 = new _1.Vector3(1, 2, 3);
48
- const p2 = new _1.Vector3(4, 5, 6);
49
- let dir = _1.Vector3.Subtract(p2, p1).unit;
50
- const distance = 11;
51
- dir = _1.Vector3.NewVectorOfLength(dir, distance);
52
- const expectedPoint = _1.Vector3.Add(p1, dir);
53
- const line = ParametricLine_1.ParametricLine.FromTwoPoint(p1, p2);
54
- const point = ParametricLine_1.ParametricLine.GetPointAtDistance(line, distance);
55
- expect(point.array).toEqual(expectedPoint.array);
56
- });
57
- test("Get point along forward", () => {
58
- const line = ParametricLine_1.ParametricLine.Forward();
59
- const point = ParametricLine_1.ParametricLine.GetPointAtDistance(line, 11);
60
- expect(point.array).toEqual([0, 0, 11]);
61
- });
62
- test("Get point along backwards", () => {
63
- const line = ParametricLine_1.ParametricLine.Backward();
64
- const point = ParametricLine_1.ParametricLine.GetPointAtDistance(line, 11);
65
- expect(point.array).toEqual([0, 0, -11]);
66
- });
67
- test("Get point along up", () => {
68
- const line = ParametricLine_1.ParametricLine.Up();
69
- const point = ParametricLine_1.ParametricLine.GetPointAtDistance(line, 11);
70
- expect(point.array).toEqual([0, 11, 0]);
71
- });
72
- test("Get point along down", () => {
73
- const line = ParametricLine_1.ParametricLine.Down();
74
- const point = ParametricLine_1.ParametricLine.GetPointAtDistance(line, 11);
75
- expect(point.array).toEqual([0, -11, 0]);
76
- });
77
- test("Get point along left", () => {
78
- const line = ParametricLine_1.ParametricLine.Left();
79
- const point = ParametricLine_1.ParametricLine.GetPointAtDistance(line, 11);
80
- expect(point.array).toEqual([-11, 0, 0]);
81
- });
82
- test("Get point along right", () => {
83
- const line = ParametricLine_1.ParametricLine.Right();
84
- const point = ParametricLine_1.ParametricLine.GetPointAtDistance(line, 11);
85
- expect(point.array).toEqual([11, 0, 0]);
86
- });
87
- test("Check for equality", () => {
88
- const inputParameters = {
89
- x0: 1,
90
- y0: 2,
91
- z0: 3,
92
- a: 4,
93
- b: 5,
94
- c: 6,
95
- };
96
- const line1 = new ParametricLine_1.ParametricLine(inputParameters);
97
- const line2 = new ParametricLine_1.ParametricLine(inputParameters);
98
- expect(line1).toEqual(line2);
99
- });
100
- test("Geting the origin", () => {
101
- const origin = new _1.Vector3(1, 2, 3);
102
- const direction = new _1.Vector3(4, 5, 6).unit;
103
- const line = ParametricLine_1.ParametricLine.FromPointDirection(origin, direction);
104
- expect(line.origin).toEqual(origin);
105
- });
106
- test("Getting the direction", () => {
107
- const origin = new _1.Vector3(1, 2, 3);
108
- const direction = new _1.Vector3(4, 5, 6).unit;
109
- const line = ParametricLine_1.ParametricLine.FromPointDirection(origin, direction);
110
- expect(_1.Vector3.Close(line.direction, direction)).toEqual(true);
111
- });
112
- test("Ensures the direction is unit", () => {
113
- const origin = new _1.Vector3(1, 2, 3);
114
- const direction = new _1.Vector3(4, 5, 6);
115
- const line = ParametricLine_1.ParametricLine.FromPointDirection(origin, direction);
116
- expect(line.direction).toEqual(direction.unit);
117
- });
118
- test("Get distance to point", () => {
119
- const origin = new _1.Vector3(1, 2, 3);
120
- const direction = new _1.Vector3(4, 5, 6);
121
- const line = ParametricLine_1.ParametricLine.FromPointDirection(origin, direction);
122
- const point = new _1.Vector3(10, 20, 30);
123
- const expected = _1.Vector3.Subtract(point, origin).magnitude;
124
- expect(ParametricLine_1.ParametricLine.GetDistanceToPoint(line, point)).toEqual(expected);
125
- });
126
- //# sourceMappingURL=ParametricLine.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParametricLine.test.js","sourceRoot":"","sources":["../../../src/ValueObjects/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AAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,+BAAc,CAAC,kBAAkB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAElE,MAAM,KAAK,GAAG,IAAI,UAAO,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAEtC,MAAM,QAAQ,GAAG,UAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,SAAS,CAAC;IAE3D,MAAM,CAAC,+BAAc,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3E,CAAC,CAAC,CAAC","sourcesContent":["import { Vector3 } from \".\";\r\nimport { LineParameters, ParametricLine } from \"./ParametricLine\";\r\n\r\ntest(\"Setting and getting the parameters\", () => {\r\n const inputParameters: LineParameters = {\r\n x0: 1,\r\n y0: 2,\r\n z0: 3,\r\n a: 4,\r\n b: 5,\r\n c: 6,\r\n };\r\n const line = new ParametricLine(inputParameters);\r\n\r\n const dirUnit = new Vector3(4, 5, 6).unit;\r\n\r\n expect(line.x0).toEqual(inputParameters.x0);\r\n expect(line.y0).toEqual(inputParameters.y0);\r\n expect(line.z0).toEqual(inputParameters.z0);\r\n expect(line.a).toBeCloseTo(dirUnit.x);\r\n expect(line.b).toBeCloseTo(dirUnit.y);\r\n expect(line.c).toBeCloseTo(dirUnit.z);\r\n});\r\n\r\ntest(\"Line from point and direction\", () => {\r\n const point = new Vector3(1, 2, 3);\r\n const dir = new Vector3(10, 20, 30).unit;\r\n\r\n const line = ParametricLine.FromPointDirection(point, dir);\r\n\r\n expect(line.x0).toEqual(1);\r\n expect(line.y0).toEqual(2);\r\n expect(line.z0).toEqual(3);\r\n expect(line.a).toBeCloseTo(dir.x);\r\n expect(line.b).toBeCloseTo(dir.y);\r\n expect(line.c).toBeCloseTo(dir.z);\r\n});\r\n\r\ntest(\"From two points\", () => {\r\n const p1 = new Vector3(1, 2, 3);\r\n const p2 = new Vector3(4, 5, 6);\r\n\r\n const line = ParametricLine.FromTwoPoint(p1, p2);\r\n\r\n const dir = Vector3.Subtract(p2, p1).unit;\r\n\r\n expect(line.x0).toEqual(1);\r\n expect(line.y0).toEqual(2);\r\n expect(line.z0).toEqual(3);\r\n expect(line.a).toEqual(dir.x);\r\n expect(line.b).toEqual(dir.y);\r\n expect(line.c).toEqual(dir.z);\r\n});\r\n\r\ntest(\"Get point\", () => {\r\n const p1 = new Vector3(1, 2, 3);\r\n const p2 = new Vector3(4, 5, 6);\r\n\r\n let dir = Vector3.Subtract(p2, p1).unit;\r\n\r\n const distance = 11;\r\n dir = Vector3.NewVectorOfLength(dir, distance);\r\n const expectedPoint = Vector3.Add(p1, dir);\r\n\r\n const line = ParametricLine.FromTwoPoint(p1, p2);\r\n const point = ParametricLine.GetPointAtDistance(line, distance);\r\n expect(point.array).toEqual(expectedPoint.array);\r\n});\r\n\r\ntest(\"Get point along forward\", () => {\r\n const line = ParametricLine.Forward();\r\n const point = ParametricLine.GetPointAtDistance(line, 11);\r\n expect(point.array).toEqual([0, 0, 11]);\r\n});\r\n\r\ntest(\"Get point along backwards\", () => {\r\n const line = ParametricLine.Backward();\r\n const point = ParametricLine.GetPointAtDistance(line, 11);\r\n expect(point.array).toEqual([0, 0, -11]);\r\n});\r\n\r\ntest(\"Get point along up\", () => {\r\n const line = ParametricLine.Up();\r\n const point = ParametricLine.GetPointAtDistance(line, 11);\r\n expect(point.array).toEqual([0, 11, 0]);\r\n});\r\n\r\ntest(\"Get point along down\", () => {\r\n const line = ParametricLine.Down();\r\n const point = ParametricLine.GetPointAtDistance(line, 11);\r\n expect(point.array).toEqual([0, -11, 0]);\r\n});\r\n\r\ntest(\"Get point along left\", () => {\r\n const line = ParametricLine.Left();\r\n const point = ParametricLine.GetPointAtDistance(line, 11);\r\n expect(point.array).toEqual([-11, 0, 0]);\r\n});\r\n\r\ntest(\"Get point along right\", () => {\r\n const line = ParametricLine.Right();\r\n const point = ParametricLine.GetPointAtDistance(line, 11);\r\n expect(point.array).toEqual([11, 0, 0]);\r\n});\r\n\r\ntest(\"Check for equality\", () => {\r\n const inputParameters: LineParameters = {\r\n x0: 1,\r\n y0: 2,\r\n z0: 3,\r\n a: 4,\r\n b: 5,\r\n c: 6,\r\n };\r\n const line1 = new ParametricLine(inputParameters);\r\n const line2 = new ParametricLine(inputParameters);\r\n\r\n expect(line1).toEqual(line2);\r\n});\r\n\r\ntest(\"Geting the origin\", () => {\r\n const origin = new Vector3(1, 2, 3);\r\n const direction = new Vector3(4, 5, 6).unit;\r\n const line = ParametricLine.FromPointDirection(origin, direction);\r\n\r\n expect(line.origin).toEqual(origin);\r\n});\r\n\r\ntest(\"Getting the direction\", () => {\r\n const origin = new Vector3(1, 2, 3);\r\n const direction = new Vector3(4, 5, 6).unit;\r\n const line = ParametricLine.FromPointDirection(origin, direction);\r\n\r\n expect(Vector3.Close(line.direction, direction)).toEqual(true);\r\n});\r\n\r\ntest(\"Ensures the direction is unit\", () => {\r\n const origin = new Vector3(1, 2, 3);\r\n const direction = new Vector3(4, 5, 6);\r\n const line = ParametricLine.FromPointDirection(origin, direction);\r\n\r\n expect(line.direction).toEqual(direction.unit);\r\n});\r\n\r\ntest(\"Get distance to point\", () => {\r\n const origin = new Vector3(1, 2, 3);\r\n const direction = new Vector3(4, 5, 6);\r\n const line = ParametricLine.FromPointDirection(origin, direction);\r\n\r\n const point = new Vector3(10, 20, 30);\r\n\r\n const expected = Vector3.Subtract(point, origin).magnitude;\r\n\r\n expect(ParametricLine.GetDistanceToPoint(line, point)).toEqual(expected);\r\n});\r\n"]}