@vived/core 1.4.2 → 1.4.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 (528) hide show
  1. package/README.md +142 -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/ExampleFeature/Adapters/examplePmAdapter.js +64 -0
  45. package/dist/cjs/ExampleFeature/Adapters/examplePmAdapter.js.map +1 -0
  46. package/dist/cjs/ExampleFeature/Adapters/exampleSingletonPmAdapter.js +60 -0
  47. package/dist/cjs/ExampleFeature/Adapters/exampleSingletonPmAdapter.js.map +1 -0
  48. package/dist/cjs/ExampleFeature/Adapters/index.js +19 -0
  49. package/dist/cjs/ExampleFeature/Adapters/index.js.map +1 -0
  50. package/dist/cjs/ExampleFeature/Controllers/index.js +19 -0
  51. package/dist/cjs/ExampleFeature/Controllers/index.js.map +1 -0
  52. package/dist/cjs/ExampleFeature/Controllers/setExampleText.js +48 -0
  53. package/dist/cjs/ExampleFeature/Controllers/setExampleText.js.map +1 -0
  54. package/dist/cjs/ExampleFeature/Controllers/toggleExampleBoolean.js +47 -0
  55. package/dist/cjs/ExampleFeature/Controllers/toggleExampleBoolean.js.map +1 -0
  56. package/dist/cjs/ExampleFeature/Entities/ExampleEntity.js +90 -0
  57. package/dist/cjs/ExampleFeature/Entities/ExampleEntity.js.map +1 -0
  58. package/dist/cjs/ExampleFeature/Entities/ExampleRepo.js +113 -0
  59. package/dist/cjs/ExampleFeature/Entities/ExampleRepo.js.map +1 -0
  60. package/dist/cjs/ExampleFeature/Entities/ExampleSingletonEntity.js +69 -0
  61. package/dist/cjs/ExampleFeature/Entities/ExampleSingletonEntity.js.map +1 -0
  62. package/dist/cjs/ExampleFeature/Entities/index.js +20 -0
  63. package/dist/cjs/ExampleFeature/Entities/index.js.map +1 -0
  64. package/dist/cjs/ExampleFeature/Factory/index.js +18 -0
  65. package/dist/cjs/ExampleFeature/Factory/index.js.map +1 -0
  66. package/dist/cjs/ExampleFeature/Factory/setupExampleFeature.js +29 -0
  67. package/dist/cjs/ExampleFeature/Factory/setupExampleFeature.js.map +1 -0
  68. package/dist/cjs/ExampleFeature/Mocks/MockEditExampleStringUC.js +47 -0
  69. package/dist/cjs/ExampleFeature/Mocks/MockEditExampleStringUC.js.map +1 -0
  70. package/dist/cjs/ExampleFeature/Mocks/MockExamplePM.js +48 -0
  71. package/dist/cjs/ExampleFeature/Mocks/MockExamplePM.js.map +1 -0
  72. package/dist/cjs/ExampleFeature/Mocks/MockExampleSingletonPM.js +59 -0
  73. package/dist/cjs/ExampleFeature/Mocks/MockExampleSingletonPM.js.map +1 -0
  74. package/dist/cjs/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js +57 -0
  75. package/dist/cjs/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js.map +1 -0
  76. package/dist/cjs/ExampleFeature/Mocks/index.js +21 -0
  77. package/dist/cjs/ExampleFeature/Mocks/index.js.map +1 -0
  78. package/dist/cjs/ExampleFeature/PMs/ExamplePM.js +97 -0
  79. package/dist/cjs/ExampleFeature/PMs/ExamplePM.js.map +1 -0
  80. package/dist/cjs/ExampleFeature/PMs/ExampleSingletonPM.js +102 -0
  81. package/dist/cjs/ExampleFeature/PMs/ExampleSingletonPM.js.map +1 -0
  82. package/dist/cjs/ExampleFeature/PMs/index.js +19 -0
  83. package/dist/cjs/ExampleFeature/PMs/index.js.map +1 -0
  84. package/dist/cjs/ExampleFeature/UCs/EditExampleStringUC.js +87 -0
  85. package/dist/cjs/ExampleFeature/UCs/EditExampleStringUC.js.map +1 -0
  86. package/dist/cjs/ExampleFeature/UCs/ToggleExampleBooleanUC.js +79 -0
  87. package/dist/cjs/ExampleFeature/UCs/ToggleExampleBooleanUC.js.map +1 -0
  88. package/dist/cjs/ExampleFeature/UCs/index.js +19 -0
  89. package/dist/cjs/ExampleFeature/UCs/index.js.map +1 -0
  90. package/dist/cjs/ExampleFeature/index.js +24 -0
  91. package/dist/cjs/ExampleFeature/index.js.map +1 -0
  92. package/dist/cjs/Types/PmAdapter.js.map +1 -1
  93. package/dist/cjs/Types/SingletonPmAdapter.js.map +1 -1
  94. package/dist/cjs/ValueObjects/Angle.js +1 -1
  95. package/dist/cjs/ValueObjects/Angle.js.map +1 -1
  96. package/dist/cjs/ValueObjects/LineSegment2D.js +6 -6
  97. package/dist/cjs/ValueObjects/LineSegment2D.js.map +1 -1
  98. package/dist/cjs/ValueObjects/Matrix.js +6 -6
  99. package/dist/cjs/ValueObjects/Matrix.js.map +1 -1
  100. package/dist/cjs/ValueObjects/Quaternion.js +17 -17
  101. package/dist/cjs/ValueObjects/Quaternion.js.map +1 -1
  102. package/dist/cjs/ValueObjects/Vector2.js +15 -8
  103. package/dist/cjs/ValueObjects/Vector2.js.map +1 -1
  104. package/dist/cjs/index.js +1 -0
  105. package/dist/cjs/index.js.map +1 -1
  106. package/dist/esm/AppObject/AppObject.js +53 -0
  107. package/dist/esm/AppObject/AppObject.js.map +1 -1
  108. package/dist/esm/AppObject/AppObjectComponent.js +78 -0
  109. package/dist/esm/AppObject/AppObjectComponent.js.map +1 -1
  110. package/dist/esm/AppObject/AppObjectController.js +22 -0
  111. package/dist/esm/AppObject/AppObjectController.js.map +1 -1
  112. package/dist/esm/AppObject/AppObjectEntity.js +52 -0
  113. package/dist/esm/AppObject/AppObjectEntity.js.map +1 -1
  114. package/dist/esm/AppObject/AppObjectEntityRepo.js +75 -1
  115. package/dist/esm/AppObject/AppObjectEntityRepo.js.map +1 -1
  116. package/dist/esm/AppObject/AppObjectPM.js +46 -0
  117. package/dist/esm/AppObject/AppObjectPM.js.map +1 -1
  118. package/dist/esm/AppObject/AppObjectRepo.js +20 -0
  119. package/dist/esm/AppObject/AppObjectRepo.js.map +1 -1
  120. package/dist/esm/AppObject/AppObjectUC.js +24 -1
  121. package/dist/esm/AppObject/AppObjectUC.js.map +1 -1
  122. package/dist/esm/AppObject/AppObjectView.js +23 -1
  123. package/dist/esm/AppObject/AppObjectView.js.map +1 -1
  124. package/dist/esm/AppObject/getSingletonComponent.js +19 -0
  125. package/dist/esm/AppObject/getSingletonComponent.js.map +1 -1
  126. package/dist/esm/Entities/MemoizedAngle.js +21 -0
  127. package/dist/esm/Entities/MemoizedAngle.js.map +1 -1
  128. package/dist/esm/Entities/MemoizedBoolean.js +21 -0
  129. package/dist/esm/Entities/MemoizedBoolean.js.map +1 -1
  130. package/dist/esm/Entities/MemoizedColor.js +21 -0
  131. package/dist/esm/Entities/MemoizedColor.js.map +1 -1
  132. package/dist/esm/Entities/MemoizedNumber.js +21 -0
  133. package/dist/esm/Entities/MemoizedNumber.js.map +1 -1
  134. package/dist/esm/Entities/MemoizedQuaternion.js +21 -0
  135. package/dist/esm/Entities/MemoizedQuaternion.js.map +1 -1
  136. package/dist/esm/Entities/MemoizedString.js +21 -0
  137. package/dist/esm/Entities/MemoizedString.js.map +1 -1
  138. package/dist/esm/Entities/MemoizedVector2.js +21 -0
  139. package/dist/esm/Entities/MemoizedVector2.js.map +1 -1
  140. package/dist/esm/Entities/MemoizedVector3.js +21 -0
  141. package/dist/esm/Entities/MemoizedVector3.js.map +1 -1
  142. package/dist/esm/Entities/ObservableEntity.js +17 -0
  143. package/dist/esm/Entities/ObservableEntity.js.map +1 -1
  144. package/dist/esm/Entities/ObserverList.js +21 -0
  145. package/dist/esm/Entities/ObserverList.js.map +1 -1
  146. package/dist/esm/Entities/RangedNumber.js +29 -0
  147. package/dist/esm/Entities/RangedNumber.js.map +1 -1
  148. package/dist/esm/ExampleFeature/Adapters/examplePmAdapter.js +61 -0
  149. package/dist/esm/ExampleFeature/Adapters/examplePmAdapter.js.map +1 -0
  150. package/dist/esm/ExampleFeature/Adapters/exampleSingletonPmAdapter.js +57 -0
  151. package/dist/esm/ExampleFeature/Adapters/exampleSingletonPmAdapter.js.map +1 -0
  152. package/dist/esm/ExampleFeature/Adapters/index.js +3 -0
  153. package/dist/esm/ExampleFeature/Adapters/index.js.map +1 -0
  154. package/dist/esm/ExampleFeature/Controllers/index.js +3 -0
  155. package/dist/esm/ExampleFeature/Controllers/index.js.map +1 -0
  156. package/dist/esm/ExampleFeature/Controllers/setExampleText.js +45 -0
  157. package/dist/esm/ExampleFeature/Controllers/setExampleText.js.map +1 -0
  158. package/dist/esm/ExampleFeature/Controllers/toggleExampleBoolean.js +44 -0
  159. package/dist/esm/ExampleFeature/Controllers/toggleExampleBoolean.js.map +1 -0
  160. package/dist/esm/ExampleFeature/Entities/ExampleEntity.js +85 -0
  161. package/dist/esm/ExampleFeature/Entities/ExampleEntity.js.map +1 -0
  162. package/dist/esm/ExampleFeature/Entities/ExampleRepo.js +108 -0
  163. package/dist/esm/ExampleFeature/Entities/ExampleRepo.js.map +1 -0
  164. package/dist/esm/ExampleFeature/Entities/ExampleSingletonEntity.js +64 -0
  165. package/dist/esm/ExampleFeature/Entities/ExampleSingletonEntity.js.map +1 -0
  166. package/dist/esm/ExampleFeature/Entities/index.js +4 -0
  167. package/dist/esm/ExampleFeature/Entities/index.js.map +1 -0
  168. package/dist/esm/ExampleFeature/Factory/index.js +2 -0
  169. package/dist/esm/ExampleFeature/Factory/index.js.map +1 -0
  170. package/dist/esm/ExampleFeature/Factory/setupExampleFeature.js +26 -0
  171. package/dist/esm/ExampleFeature/Factory/setupExampleFeature.js.map +1 -0
  172. package/dist/esm/ExampleFeature/Mocks/MockEditExampleStringUC.js +43 -0
  173. package/dist/esm/ExampleFeature/Mocks/MockEditExampleStringUC.js.map +1 -0
  174. package/dist/esm/ExampleFeature/Mocks/MockExamplePM.js +44 -0
  175. package/dist/esm/ExampleFeature/Mocks/MockExamplePM.js.map +1 -0
  176. package/dist/esm/ExampleFeature/Mocks/MockExampleSingletonPM.js +54 -0
  177. package/dist/esm/ExampleFeature/Mocks/MockExampleSingletonPM.js.map +1 -0
  178. package/dist/esm/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js +52 -0
  179. package/dist/esm/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js.map +1 -0
  180. package/dist/esm/ExampleFeature/Mocks/index.js +5 -0
  181. package/dist/esm/ExampleFeature/Mocks/index.js.map +1 -0
  182. package/dist/esm/ExampleFeature/PMs/ExamplePM.js +92 -0
  183. package/dist/esm/ExampleFeature/PMs/ExamplePM.js.map +1 -0
  184. package/dist/esm/ExampleFeature/PMs/ExampleSingletonPM.js +97 -0
  185. package/dist/esm/ExampleFeature/PMs/ExampleSingletonPM.js.map +1 -0
  186. package/dist/esm/ExampleFeature/PMs/index.js +3 -0
  187. package/dist/esm/ExampleFeature/PMs/index.js.map +1 -0
  188. package/dist/esm/ExampleFeature/UCs/EditExampleStringUC.js +82 -0
  189. package/dist/esm/ExampleFeature/UCs/EditExampleStringUC.js.map +1 -0
  190. package/dist/esm/ExampleFeature/UCs/ToggleExampleBooleanUC.js +74 -0
  191. package/dist/esm/ExampleFeature/UCs/ToggleExampleBooleanUC.js.map +1 -0
  192. package/dist/esm/ExampleFeature/UCs/index.js +3 -0
  193. package/dist/esm/ExampleFeature/UCs/index.js.map +1 -0
  194. package/dist/esm/ExampleFeature/index.js +8 -0
  195. package/dist/esm/ExampleFeature/index.js.map +1 -0
  196. package/dist/esm/Types/PmAdapter.js.map +1 -1
  197. package/dist/esm/Types/SingletonPmAdapter.js.map +1 -1
  198. package/dist/esm/ValueObjects/Angle.js +1 -1
  199. package/dist/esm/ValueObjects/Angle.js.map +1 -1
  200. package/dist/esm/ValueObjects/LineSegment2D.js +6 -6
  201. package/dist/esm/ValueObjects/LineSegment2D.js.map +1 -1
  202. package/dist/esm/ValueObjects/Matrix.js +6 -6
  203. package/dist/esm/ValueObjects/Matrix.js.map +1 -1
  204. package/dist/esm/ValueObjects/Quaternion.js +17 -17
  205. package/dist/esm/ValueObjects/Quaternion.js.map +1 -1
  206. package/dist/esm/ValueObjects/Vector2.js +15 -8
  207. package/dist/esm/ValueObjects/Vector2.js.map +1 -1
  208. package/dist/esm/index.js +1 -0
  209. package/dist/esm/index.js.map +1 -1
  210. package/dist/types/AppObject/AppObject.d.ts +42 -0
  211. package/dist/types/AppObject/AppObject.d.ts.map +1 -1
  212. package/dist/types/AppObject/AppObjectComponent.d.ts +80 -0
  213. package/dist/types/AppObject/AppObjectComponent.d.ts.map +1 -1
  214. package/dist/types/AppObject/AppObjectController.d.ts +22 -0
  215. package/dist/types/AppObject/AppObjectController.d.ts.map +1 -1
  216. package/dist/types/AppObject/AppObjectEntity.d.ts +55 -0
  217. package/dist/types/AppObject/AppObjectEntity.d.ts.map +1 -1
  218. package/dist/types/AppObject/AppObjectEntityRepo.d.ts +75 -0
  219. package/dist/types/AppObject/AppObjectEntityRepo.d.ts.map +1 -1
  220. package/dist/types/AppObject/AppObjectPM.d.ts +53 -0
  221. package/dist/types/AppObject/AppObjectPM.d.ts.map +1 -1
  222. package/dist/types/AppObject/AppObjectRepo.d.ts +124 -0
  223. package/dist/types/AppObject/AppObjectRepo.d.ts.map +1 -1
  224. package/dist/types/AppObject/AppObjectUC.d.ts +23 -0
  225. package/dist/types/AppObject/AppObjectUC.d.ts.map +1 -1
  226. package/dist/types/AppObject/AppObjectView.d.ts +22 -0
  227. package/dist/types/AppObject/AppObjectView.d.ts.map +1 -1
  228. package/dist/types/AppObject/getSingletonComponent.d.ts +19 -0
  229. package/dist/types/AppObject/getSingletonComponent.d.ts.map +1 -1
  230. package/dist/types/Entities/MemoizedAngle.d.ts +21 -0
  231. package/dist/types/Entities/MemoizedAngle.d.ts.map +1 -1
  232. package/dist/types/Entities/MemoizedBoolean.d.ts +21 -0
  233. package/dist/types/Entities/MemoizedBoolean.d.ts.map +1 -1
  234. package/dist/types/Entities/MemoizedColor.d.ts +21 -0
  235. package/dist/types/Entities/MemoizedColor.d.ts.map +1 -1
  236. package/dist/types/Entities/MemoizedNumber.d.ts +21 -0
  237. package/dist/types/Entities/MemoizedNumber.d.ts.map +1 -1
  238. package/dist/types/Entities/MemoizedQuaternion.d.ts +21 -0
  239. package/dist/types/Entities/MemoizedQuaternion.d.ts.map +1 -1
  240. package/dist/types/Entities/MemoizedString.d.ts +21 -0
  241. package/dist/types/Entities/MemoizedString.d.ts.map +1 -1
  242. package/dist/types/Entities/MemoizedVector2.d.ts +21 -0
  243. package/dist/types/Entities/MemoizedVector2.d.ts.map +1 -1
  244. package/dist/types/Entities/MemoizedVector3.d.ts +21 -0
  245. package/dist/types/Entities/MemoizedVector3.d.ts.map +1 -1
  246. package/dist/types/Entities/ObservableEntity.d.ts +20 -0
  247. package/dist/types/Entities/ObservableEntity.d.ts.map +1 -1
  248. package/dist/types/Entities/ObserverList.d.ts +21 -0
  249. package/dist/types/Entities/ObserverList.d.ts.map +1 -1
  250. package/dist/types/Entities/RangedNumber.d.ts +37 -0
  251. package/dist/types/Entities/RangedNumber.d.ts.map +1 -1
  252. package/dist/types/ExampleFeature/Adapters/examplePmAdapter.d.ts +29 -0
  253. package/dist/types/ExampleFeature/Adapters/examplePmAdapter.d.ts.map +1 -0
  254. package/dist/types/ExampleFeature/Adapters/exampleSingletonPmAdapter.d.ts +31 -0
  255. package/dist/types/ExampleFeature/Adapters/exampleSingletonPmAdapter.d.ts.map +1 -0
  256. package/dist/types/ExampleFeature/Adapters/index.d.ts +3 -0
  257. package/dist/types/ExampleFeature/Adapters/index.d.ts.map +1 -0
  258. package/dist/types/ExampleFeature/Controllers/index.d.ts +3 -0
  259. package/dist/types/ExampleFeature/Controllers/index.d.ts.map +1 -0
  260. package/dist/types/ExampleFeature/Controllers/setExampleText.d.ts +35 -0
  261. package/dist/types/ExampleFeature/Controllers/setExampleText.d.ts.map +1 -0
  262. package/dist/types/ExampleFeature/Controllers/toggleExampleBoolean.d.ts +34 -0
  263. package/dist/types/ExampleFeature/Controllers/toggleExampleBoolean.d.ts.map +1 -0
  264. package/dist/types/ExampleFeature/Entities/ExampleEntity.d.ts +55 -0
  265. package/dist/types/ExampleFeature/Entities/ExampleEntity.d.ts.map +1 -0
  266. package/dist/types/ExampleFeature/Entities/ExampleRepo.d.ts +62 -0
  267. package/dist/types/ExampleFeature/Entities/ExampleRepo.d.ts.map +1 -0
  268. package/dist/types/ExampleFeature/Entities/ExampleSingletonEntity.d.ts +43 -0
  269. package/dist/types/ExampleFeature/Entities/ExampleSingletonEntity.d.ts.map +1 -0
  270. package/dist/types/ExampleFeature/Entities/index.d.ts +4 -0
  271. package/dist/types/ExampleFeature/Entities/index.d.ts.map +1 -0
  272. package/dist/types/ExampleFeature/Factory/index.d.ts +2 -0
  273. package/dist/types/ExampleFeature/Factory/index.d.ts.map +1 -0
  274. package/dist/types/ExampleFeature/Factory/setupExampleFeature.d.ts +17 -0
  275. package/dist/types/ExampleFeature/Factory/setupExampleFeature.d.ts.map +1 -0
  276. package/dist/types/ExampleFeature/Mocks/MockEditExampleStringUC.d.ts +42 -0
  277. package/dist/types/ExampleFeature/Mocks/MockEditExampleStringUC.d.ts.map +1 -0
  278. package/dist/types/ExampleFeature/Mocks/MockExamplePM.d.ts +41 -0
  279. package/dist/types/ExampleFeature/Mocks/MockExamplePM.d.ts.map +1 -0
  280. package/dist/types/ExampleFeature/Mocks/MockExampleSingletonPM.d.ts +49 -0
  281. package/dist/types/ExampleFeature/Mocks/MockExampleSingletonPM.d.ts.map +1 -0
  282. package/dist/types/ExampleFeature/Mocks/MockToggleExampleBooleanUC.d.ts +47 -0
  283. package/dist/types/ExampleFeature/Mocks/MockToggleExampleBooleanUC.d.ts.map +1 -0
  284. package/dist/types/ExampleFeature/Mocks/index.d.ts +5 -0
  285. package/dist/types/ExampleFeature/Mocks/index.d.ts.map +1 -0
  286. package/dist/types/ExampleFeature/PMs/ExamplePM.d.ts +42 -0
  287. package/dist/types/ExampleFeature/PMs/ExamplePM.d.ts.map +1 -0
  288. package/dist/types/ExampleFeature/PMs/ExampleSingletonPM.d.ts +52 -0
  289. package/dist/types/ExampleFeature/PMs/ExampleSingletonPM.d.ts.map +1 -0
  290. package/dist/types/ExampleFeature/PMs/index.d.ts +3 -0
  291. package/dist/types/ExampleFeature/PMs/index.d.ts.map +1 -0
  292. package/dist/types/ExampleFeature/UCs/EditExampleStringUC.d.ts +52 -0
  293. package/dist/types/ExampleFeature/UCs/EditExampleStringUC.d.ts.map +1 -0
  294. package/dist/types/ExampleFeature/UCs/ToggleExampleBooleanUC.d.ts +44 -0
  295. package/dist/types/ExampleFeature/UCs/ToggleExampleBooleanUC.d.ts.map +1 -0
  296. package/dist/types/ExampleFeature/UCs/index.d.ts +3 -0
  297. package/dist/types/ExampleFeature/UCs/index.d.ts.map +1 -0
  298. package/dist/types/ExampleFeature/index.d.ts +8 -0
  299. package/dist/types/ExampleFeature/index.d.ts.map +1 -0
  300. package/dist/types/Types/PmAdapter.d.ts +60 -0
  301. package/dist/types/Types/PmAdapter.d.ts.map +1 -1
  302. package/dist/types/Types/SingletonPmAdapter.d.ts +55 -0
  303. package/dist/types/Types/SingletonPmAdapter.d.ts.map +1 -1
  304. package/dist/types/ValueObjects/Angle.d.ts +1 -1
  305. package/dist/types/ValueObjects/Matrix.d.ts +5 -5
  306. package/dist/types/ValueObjects/Matrix.d.ts.map +1 -1
  307. package/dist/types/ValueObjects/Quaternion.d.ts +17 -17
  308. package/dist/types/ValueObjects/Vector2.d.ts +8 -3
  309. package/dist/types/ValueObjects/Vector2.d.ts.map +1 -1
  310. package/dist/types/index.d.ts +1 -0
  311. package/dist/types/index.d.ts.map +1 -1
  312. package/package.json +6 -4
  313. package/dist/cjs/AppObject/AppObject.test.js +0 -113
  314. package/dist/cjs/AppObject/AppObject.test.js.map +0 -1
  315. package/dist/cjs/AppObject/AppObjectComponent.test.js +0 -132
  316. package/dist/cjs/AppObject/AppObjectComponent.test.js.map +0 -1
  317. package/dist/cjs/AppObject/AppObjectEntity.test.js +0 -108
  318. package/dist/cjs/AppObject/AppObjectEntity.test.js.map +0 -1
  319. package/dist/cjs/AppObject/AppObjectEntityRepo.test.js +0 -149
  320. package/dist/cjs/AppObject/AppObjectEntityRepo.test.js.map +0 -1
  321. package/dist/cjs/AppObject/AppObjectPM.test.js +0 -103
  322. package/dist/cjs/AppObject/AppObjectPM.test.js.map +0 -1
  323. package/dist/cjs/AppObject/AppObjectRepo.test.js +0 -213
  324. package/dist/cjs/AppObject/AppObjectRepo.test.js.map +0 -1
  325. package/dist/cjs/AppObject/getSingletonComponent.test.js +0 -13
  326. package/dist/cjs/AppObject/getSingletonComponent.test.js.map +0 -1
  327. package/dist/cjs/Entities/MemoizedAngle.test.js +0 -30
  328. package/dist/cjs/Entities/MemoizedAngle.test.js.map +0 -1
  329. package/dist/cjs/Entities/MemoizedBoolean.test.js +0 -34
  330. package/dist/cjs/Entities/MemoizedBoolean.test.js.map +0 -1
  331. package/dist/cjs/Entities/MemoizedColor.test.js +0 -32
  332. package/dist/cjs/Entities/MemoizedColor.test.js.map +0 -1
  333. package/dist/cjs/Entities/MemoizedNumber.test.js +0 -29
  334. package/dist/cjs/Entities/MemoizedNumber.test.js.map +0 -1
  335. package/dist/cjs/Entities/MemoizedQuaternion.test.js +0 -32
  336. package/dist/cjs/Entities/MemoizedQuaternion.test.js.map +0 -1
  337. package/dist/cjs/Entities/MemoizedString.test.js +0 -29
  338. package/dist/cjs/Entities/MemoizedString.test.js.map +0 -1
  339. package/dist/cjs/Entities/MemoizedVector2.test.js +0 -32
  340. package/dist/cjs/Entities/MemoizedVector2.test.js.map +0 -1
  341. package/dist/cjs/Entities/MemoizedVector3.test.js +0 -32
  342. package/dist/cjs/Entities/MemoizedVector3.test.js.map +0 -1
  343. package/dist/cjs/Entities/ObservableEntity.test.js +0 -25
  344. package/dist/cjs/Entities/ObservableEntity.test.js.map +0 -1
  345. package/dist/cjs/Entities/ObserverList.test.js +0 -44
  346. package/dist/cjs/Entities/ObserverList.test.js.map +0 -1
  347. package/dist/cjs/Entities/RangedNumber.test.js +0 -96
  348. package/dist/cjs/Entities/RangedNumber.test.js.map +0 -1
  349. package/dist/cjs/Utilities/LengthConverters.test.js +0 -24
  350. package/dist/cjs/Utilities/LengthConverters.test.js.map +0 -1
  351. package/dist/cjs/Utilities/LerpNumber.test.js +0 -90
  352. package/dist/cjs/Utilities/LerpNumber.test.js.map +0 -1
  353. package/dist/cjs/Utilities/addAlphaToHex.test.js +0 -34
  354. package/dist/cjs/Utilities/addAlphaToHex.test.js.map +0 -1
  355. package/dist/cjs/Utilities/alphaToHex.test.js +0 -75
  356. package/dist/cjs/Utilities/alphaToHex.test.js.map +0 -1
  357. package/dist/cjs/Utilities/degreesToRadians.test.js +0 -9
  358. package/dist/cjs/Utilities/degreesToRadians.test.js.map +0 -1
  359. package/dist/cjs/Utilities/easeFunctions.test.js +0 -209
  360. package/dist/cjs/Utilities/easeFunctions.test.js.map +0 -1
  361. package/dist/cjs/Utilities/interpolateNumber.test.js +0 -26
  362. package/dist/cjs/Utilities/interpolateNumber.test.js.map +0 -1
  363. package/dist/cjs/ValueObjects/Angle.test.js +0 -28
  364. package/dist/cjs/ValueObjects/Angle.test.js.map +0 -1
  365. package/dist/cjs/ValueObjects/Color.test.js +0 -147
  366. package/dist/cjs/ValueObjects/Color.test.js.map +0 -1
  367. package/dist/cjs/ValueObjects/LineSegment2D.test.js +0 -102
  368. package/dist/cjs/ValueObjects/LineSegment2D.test.js.map +0 -1
  369. package/dist/cjs/ValueObjects/Matrix.test.js +0 -385
  370. package/dist/cjs/ValueObjects/Matrix.test.js.map +0 -1
  371. package/dist/cjs/ValueObjects/ParametricLine.test.js +0 -126
  372. package/dist/cjs/ValueObjects/ParametricLine.test.js.map +0 -1
  373. package/dist/cjs/ValueObjects/ParametricPlane.test.js +0 -101
  374. package/dist/cjs/ValueObjects/ParametricPlane.test.js.map +0 -1
  375. package/dist/cjs/ValueObjects/Quaternion.test.js +0 -240
  376. package/dist/cjs/ValueObjects/Quaternion.test.js.map +0 -1
  377. package/dist/cjs/ValueObjects/Rectangle.test.js +0 -32
  378. package/dist/cjs/ValueObjects/Rectangle.test.js.map +0 -1
  379. package/dist/cjs/ValueObjects/Vector2.test.js +0 -136
  380. package/dist/cjs/ValueObjects/Vector2.test.js.map +0 -1
  381. package/dist/cjs/ValueObjects/Vector3.test.js +0 -188
  382. package/dist/cjs/ValueObjects/Vector3.test.js.map +0 -1
  383. package/dist/cjs/ValueObjects/Version.test.js +0 -310
  384. package/dist/cjs/ValueObjects/Version.test.js.map +0 -1
  385. package/dist/esm/AppObject/AppObject.test.js +0 -110
  386. package/dist/esm/AppObject/AppObject.test.js.map +0 -1
  387. package/dist/esm/AppObject/AppObjectComponent.test.js +0 -130
  388. package/dist/esm/AppObject/AppObjectComponent.test.js.map +0 -1
  389. package/dist/esm/AppObject/AppObjectEntity.test.js +0 -106
  390. package/dist/esm/AppObject/AppObjectEntity.test.js.map +0 -1
  391. package/dist/esm/AppObject/AppObjectEntityRepo.test.js +0 -147
  392. package/dist/esm/AppObject/AppObjectEntityRepo.test.js.map +0 -1
  393. package/dist/esm/AppObject/AppObjectPM.test.js +0 -101
  394. package/dist/esm/AppObject/AppObjectPM.test.js.map +0 -1
  395. package/dist/esm/AppObject/AppObjectRepo.test.js +0 -211
  396. package/dist/esm/AppObject/AppObjectRepo.test.js.map +0 -1
  397. package/dist/esm/AppObject/getSingletonComponent.test.js +0 -11
  398. package/dist/esm/AppObject/getSingletonComponent.test.js.map +0 -1
  399. package/dist/esm/Entities/MemoizedAngle.test.js +0 -28
  400. package/dist/esm/Entities/MemoizedAngle.test.js.map +0 -1
  401. package/dist/esm/Entities/MemoizedBoolean.test.js +0 -32
  402. package/dist/esm/Entities/MemoizedBoolean.test.js.map +0 -1
  403. package/dist/esm/Entities/MemoizedColor.test.js +0 -30
  404. package/dist/esm/Entities/MemoizedColor.test.js.map +0 -1
  405. package/dist/esm/Entities/MemoizedNumber.test.js +0 -27
  406. package/dist/esm/Entities/MemoizedNumber.test.js.map +0 -1
  407. package/dist/esm/Entities/MemoizedQuaternion.test.js +0 -30
  408. package/dist/esm/Entities/MemoizedQuaternion.test.js.map +0 -1
  409. package/dist/esm/Entities/MemoizedString.test.js +0 -27
  410. package/dist/esm/Entities/MemoizedString.test.js.map +0 -1
  411. package/dist/esm/Entities/MemoizedVector2.test.js +0 -30
  412. package/dist/esm/Entities/MemoizedVector2.test.js.map +0 -1
  413. package/dist/esm/Entities/MemoizedVector3.test.js +0 -30
  414. package/dist/esm/Entities/MemoizedVector3.test.js.map +0 -1
  415. package/dist/esm/Entities/ObservableEntity.test.js +0 -23
  416. package/dist/esm/Entities/ObservableEntity.test.js.map +0 -1
  417. package/dist/esm/Entities/ObserverList.test.js +0 -42
  418. package/dist/esm/Entities/ObserverList.test.js.map +0 -1
  419. package/dist/esm/Entities/RangedNumber.test.js +0 -94
  420. package/dist/esm/Entities/RangedNumber.test.js.map +0 -1
  421. package/dist/esm/Utilities/LengthConverters.test.js +0 -22
  422. package/dist/esm/Utilities/LengthConverters.test.js.map +0 -1
  423. package/dist/esm/Utilities/LerpNumber.test.js +0 -88
  424. package/dist/esm/Utilities/LerpNumber.test.js.map +0 -1
  425. package/dist/esm/Utilities/addAlphaToHex.test.js +0 -32
  426. package/dist/esm/Utilities/addAlphaToHex.test.js.map +0 -1
  427. package/dist/esm/Utilities/alphaToHex.test.js +0 -73
  428. package/dist/esm/Utilities/alphaToHex.test.js.map +0 -1
  429. package/dist/esm/Utilities/degreesToRadians.test.js +0 -7
  430. package/dist/esm/Utilities/degreesToRadians.test.js.map +0 -1
  431. package/dist/esm/Utilities/easeFunctions.test.js +0 -207
  432. package/dist/esm/Utilities/easeFunctions.test.js.map +0 -1
  433. package/dist/esm/Utilities/interpolateNumber.test.js +0 -24
  434. package/dist/esm/Utilities/interpolateNumber.test.js.map +0 -1
  435. package/dist/esm/ValueObjects/Angle.test.js +0 -26
  436. package/dist/esm/ValueObjects/Angle.test.js.map +0 -1
  437. package/dist/esm/ValueObjects/Color.test.js +0 -145
  438. package/dist/esm/ValueObjects/Color.test.js.map +0 -1
  439. package/dist/esm/ValueObjects/LineSegment2D.test.js +0 -100
  440. package/dist/esm/ValueObjects/LineSegment2D.test.js.map +0 -1
  441. package/dist/esm/ValueObjects/Matrix.test.js +0 -383
  442. package/dist/esm/ValueObjects/Matrix.test.js.map +0 -1
  443. package/dist/esm/ValueObjects/ParametricLine.test.js +0 -124
  444. package/dist/esm/ValueObjects/ParametricLine.test.js.map +0 -1
  445. package/dist/esm/ValueObjects/ParametricPlane.test.js +0 -99
  446. package/dist/esm/ValueObjects/ParametricPlane.test.js.map +0 -1
  447. package/dist/esm/ValueObjects/Quaternion.test.js +0 -238
  448. package/dist/esm/ValueObjects/Quaternion.test.js.map +0 -1
  449. package/dist/esm/ValueObjects/Rectangle.test.js +0 -30
  450. package/dist/esm/ValueObjects/Rectangle.test.js.map +0 -1
  451. package/dist/esm/ValueObjects/Vector2.test.js +0 -134
  452. package/dist/esm/ValueObjects/Vector2.test.js.map +0 -1
  453. package/dist/esm/ValueObjects/Vector3.test.js +0 -186
  454. package/dist/esm/ValueObjects/Vector3.test.js.map +0 -1
  455. package/dist/esm/ValueObjects/Version.test.js +0 -308
  456. package/dist/esm/ValueObjects/Version.test.js.map +0 -1
  457. package/dist/types/AppObject/AppObject.test.d.ts +0 -7
  458. package/dist/types/AppObject/AppObject.test.d.ts.map +0 -1
  459. package/dist/types/AppObject/AppObjectComponent.test.d.ts +0 -2
  460. package/dist/types/AppObject/AppObjectComponent.test.d.ts.map +0 -1
  461. package/dist/types/AppObject/AppObjectEntity.test.d.ts +0 -2
  462. package/dist/types/AppObject/AppObjectEntity.test.d.ts.map +0 -1
  463. package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts +0 -2
  464. package/dist/types/AppObject/AppObjectEntityRepo.test.d.ts.map +0 -1
  465. package/dist/types/AppObject/AppObjectPM.test.d.ts +0 -2
  466. package/dist/types/AppObject/AppObjectPM.test.d.ts.map +0 -1
  467. package/dist/types/AppObject/AppObjectRepo.test.d.ts +0 -2
  468. package/dist/types/AppObject/AppObjectRepo.test.d.ts.map +0 -1
  469. package/dist/types/AppObject/getSingletonComponent.test.d.ts +0 -2
  470. package/dist/types/AppObject/getSingletonComponent.test.d.ts.map +0 -1
  471. package/dist/types/Entities/MemoizedAngle.test.d.ts +0 -2
  472. package/dist/types/Entities/MemoizedAngle.test.d.ts.map +0 -1
  473. package/dist/types/Entities/MemoizedBoolean.test.d.ts +0 -2
  474. package/dist/types/Entities/MemoizedBoolean.test.d.ts.map +0 -1
  475. package/dist/types/Entities/MemoizedColor.test.d.ts +0 -2
  476. package/dist/types/Entities/MemoizedColor.test.d.ts.map +0 -1
  477. package/dist/types/Entities/MemoizedNumber.test.d.ts +0 -2
  478. package/dist/types/Entities/MemoizedNumber.test.d.ts.map +0 -1
  479. package/dist/types/Entities/MemoizedQuaternion.test.d.ts +0 -2
  480. package/dist/types/Entities/MemoizedQuaternion.test.d.ts.map +0 -1
  481. package/dist/types/Entities/MemoizedString.test.d.ts +0 -2
  482. package/dist/types/Entities/MemoizedString.test.d.ts.map +0 -1
  483. package/dist/types/Entities/MemoizedVector2.test.d.ts +0 -2
  484. package/dist/types/Entities/MemoizedVector2.test.d.ts.map +0 -1
  485. package/dist/types/Entities/MemoizedVector3.test.d.ts +0 -2
  486. package/dist/types/Entities/MemoizedVector3.test.d.ts.map +0 -1
  487. package/dist/types/Entities/ObservableEntity.test.d.ts +0 -2
  488. package/dist/types/Entities/ObservableEntity.test.d.ts.map +0 -1
  489. package/dist/types/Entities/ObserverList.test.d.ts +0 -2
  490. package/dist/types/Entities/ObserverList.test.d.ts.map +0 -1
  491. package/dist/types/Entities/RangedNumber.test.d.ts +0 -2
  492. package/dist/types/Entities/RangedNumber.test.d.ts.map +0 -1
  493. package/dist/types/Utilities/LengthConverters.test.d.ts +0 -2
  494. package/dist/types/Utilities/LengthConverters.test.d.ts.map +0 -1
  495. package/dist/types/Utilities/LerpNumber.test.d.ts +0 -2
  496. package/dist/types/Utilities/LerpNumber.test.d.ts.map +0 -1
  497. package/dist/types/Utilities/addAlphaToHex.test.d.ts +0 -2
  498. package/dist/types/Utilities/addAlphaToHex.test.d.ts.map +0 -1
  499. package/dist/types/Utilities/alphaToHex.test.d.ts +0 -2
  500. package/dist/types/Utilities/alphaToHex.test.d.ts.map +0 -1
  501. package/dist/types/Utilities/degreesToRadians.test.d.ts +0 -2
  502. package/dist/types/Utilities/degreesToRadians.test.d.ts.map +0 -1
  503. package/dist/types/Utilities/easeFunctions.test.d.ts +0 -2
  504. package/dist/types/Utilities/easeFunctions.test.d.ts.map +0 -1
  505. package/dist/types/Utilities/interpolateNumber.test.d.ts +0 -2
  506. package/dist/types/Utilities/interpolateNumber.test.d.ts.map +0 -1
  507. package/dist/types/ValueObjects/Angle.test.d.ts +0 -2
  508. package/dist/types/ValueObjects/Angle.test.d.ts.map +0 -1
  509. package/dist/types/ValueObjects/Color.test.d.ts +0 -2
  510. package/dist/types/ValueObjects/Color.test.d.ts.map +0 -1
  511. package/dist/types/ValueObjects/LineSegment2D.test.d.ts +0 -2
  512. package/dist/types/ValueObjects/LineSegment2D.test.d.ts.map +0 -1
  513. package/dist/types/ValueObjects/Matrix.test.d.ts +0 -2
  514. package/dist/types/ValueObjects/Matrix.test.d.ts.map +0 -1
  515. package/dist/types/ValueObjects/ParametricLine.test.d.ts +0 -2
  516. package/dist/types/ValueObjects/ParametricLine.test.d.ts.map +0 -1
  517. package/dist/types/ValueObjects/ParametricPlane.test.d.ts +0 -2
  518. package/dist/types/ValueObjects/ParametricPlane.test.d.ts.map +0 -1
  519. package/dist/types/ValueObjects/Quaternion.test.d.ts +0 -2
  520. package/dist/types/ValueObjects/Quaternion.test.d.ts.map +0 -1
  521. package/dist/types/ValueObjects/Rectangle.test.d.ts +0 -2
  522. package/dist/types/ValueObjects/Rectangle.test.d.ts.map +0 -1
  523. package/dist/types/ValueObjects/Vector2.test.d.ts +0 -2
  524. package/dist/types/ValueObjects/Vector2.test.d.ts.map +0 -1
  525. package/dist/types/ValueObjects/Vector3.test.d.ts +0 -2
  526. package/dist/types/ValueObjects/Vector3.test.d.ts.map +0 -1
  527. package/dist/types/ValueObjects/Version.test.d.ts +0 -2
  528. 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/Val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atrixArray } 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/ParametricLine.test.ts"],"names":[],"mappings":";;AAAA,wBAA4B;AAC5B,qDAAkE;AAElE,IAAI,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAC9C,MAAM,eAAe,GAAmB;QACtC,EAAE,EAAE,CAAC;QACL,EAAE,EAAE,CAAC;QACL,EAAE,EAAE,CAAC;QACL,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAC;IACF,MAAM,IAAI,GAAG,IAAI,+BAAc,CAAC,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C,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"]}