@p100-web/core 100.2.1 → 100.2.2

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 (429) hide show
  1. package/dist/AdaptivePerformance.d.ts +20 -0
  2. package/dist/AdaptivePerformance.d.ts.map +1 -0
  3. package/dist/AdaptivePerformance.js +110 -0
  4. package/dist/AdaptivePerformance.js.map +1 -0
  5. package/dist/DevTools.d.ts +4 -0
  6. package/dist/DevTools.d.ts.map +1 -0
  7. package/dist/DevTools.js +10 -0
  8. package/dist/DevTools.js.map +1 -0
  9. package/dist/GameContext.d.ts +202 -0
  10. package/dist/GameContext.d.ts.map +1 -0
  11. package/dist/GameContext.js +694 -0
  12. package/dist/GameContext.js.map +1 -0
  13. package/dist/IAudioListener.d.ts +4 -0
  14. package/dist/IAudioListener.d.ts.map +1 -0
  15. package/dist/IAudioListener.js +2 -0
  16. package/dist/IAudioListener.js.map +1 -0
  17. package/dist/ICameraControls.d.ts +17 -0
  18. package/dist/ICameraControls.d.ts.map +1 -0
  19. package/dist/ICameraControls.js +2 -0
  20. package/dist/ICameraControls.js.map +1 -0
  21. package/dist/IComponentFactory.d.ts +8 -0
  22. package/dist/IComponentFactory.d.ts.map +1 -0
  23. package/dist/IComponentFactory.js +2 -0
  24. package/dist/IComponentFactory.js.map +1 -0
  25. package/dist/IDBApp.d.ts +21 -0
  26. package/dist/IDBApp.d.ts.map +1 -0
  27. package/dist/IDBApp.js +2 -0
  28. package/dist/IDBApp.js.map +1 -0
  29. package/dist/IDBEvent.d.ts +10 -0
  30. package/dist/IDBEvent.d.ts.map +1 -0
  31. package/dist/IDBEvent.js +2 -0
  32. package/dist/IDBEvent.js.map +1 -0
  33. package/dist/IDBFileUsage.d.ts +9 -0
  34. package/dist/IDBFileUsage.d.ts.map +1 -0
  35. package/dist/IDBFileUsage.js +2 -0
  36. package/dist/IDBFileUsage.js.map +1 -0
  37. package/dist/IDBItem.d.ts +9 -0
  38. package/dist/IDBItem.d.ts.map +1 -0
  39. package/dist/IDBItem.js +2 -0
  40. package/dist/IDBItem.js.map +1 -0
  41. package/dist/IDBNode.d.ts +21 -0
  42. package/dist/IDBNode.d.ts.map +1 -0
  43. package/dist/IDBNode.js +42 -0
  44. package/dist/IDBNode.js.map +1 -0
  45. package/dist/IDBScene.d.ts +7 -0
  46. package/dist/IDBScene.d.ts.map +1 -0
  47. package/dist/IDBScene.js +2 -0
  48. package/dist/IDBScene.js.map +1 -0
  49. package/dist/IDBVariable.d.ts +10 -0
  50. package/dist/IDBVariable.d.ts.map +1 -0
  51. package/dist/IDBVariable.js +2 -0
  52. package/dist/IDBVariable.js.map +1 -0
  53. package/dist/IEngine.d.ts +23 -0
  54. package/dist/IEngine.d.ts.map +1 -0
  55. package/dist/IEngine.js +2 -0
  56. package/dist/IEngine.js.map +1 -0
  57. package/dist/IPMaterial.d.ts +12 -0
  58. package/dist/IPMaterial.d.ts.map +1 -0
  59. package/dist/IPMaterial.js +2 -0
  60. package/dist/IPMaterial.js.map +1 -0
  61. package/dist/IPNodeRenderer.d.ts +25 -0
  62. package/dist/IPNodeRenderer.d.ts.map +1 -0
  63. package/dist/IPNodeRenderer.js +2 -0
  64. package/dist/IPNodeRenderer.js.map +1 -0
  65. package/dist/IStats.d.ts +9 -0
  66. package/dist/IStats.d.ts.map +1 -0
  67. package/dist/IStats.js +3 -0
  68. package/dist/IStats.js.map +1 -0
  69. package/dist/MathTools.d.ts +8 -0
  70. package/dist/MathTools.d.ts.map +1 -0
  71. package/dist/MathTools.js +20 -0
  72. package/dist/MathTools.js.map +1 -0
  73. package/dist/PCanvas.d.ts +171 -0
  74. package/dist/PCanvas.d.ts.map +1 -0
  75. package/dist/PCanvas.js +648 -0
  76. package/dist/PCanvas.js.map +1 -0
  77. package/dist/PComponent.d.ts +73 -0
  78. package/dist/PComponent.d.ts.map +1 -0
  79. package/dist/PComponent.js +152 -0
  80. package/dist/PComponent.js.map +1 -0
  81. package/dist/PEnums.d.ts +116 -0
  82. package/dist/PEnums.d.ts.map +1 -0
  83. package/dist/PEnums.js +145 -0
  84. package/dist/PEnums.js.map +1 -0
  85. package/dist/PEvent.d.ts +21 -0
  86. package/dist/PEvent.d.ts.map +1 -0
  87. package/dist/PEvent.js +35 -0
  88. package/dist/PEvent.js.map +1 -0
  89. package/dist/PFileSlot.d.ts +14 -0
  90. package/dist/PFileSlot.d.ts.map +1 -0
  91. package/dist/PFileSlot.js +14 -0
  92. package/dist/PFileSlot.js.map +1 -0
  93. package/dist/PFileUsage.d.ts +11 -0
  94. package/dist/PFileUsage.d.ts.map +1 -0
  95. package/dist/PFileUsage.js +24 -0
  96. package/dist/PFileUsage.js.map +1 -0
  97. package/dist/PItem.d.ts +14 -0
  98. package/dist/PItem.d.ts.map +1 -0
  99. package/dist/PItem.js +36 -0
  100. package/dist/PItem.js.map +1 -0
  101. package/dist/PNode.d.ts +116 -0
  102. package/dist/PNode.d.ts.map +1 -0
  103. package/dist/PNode.js +458 -0
  104. package/dist/PNode.js.map +1 -0
  105. package/dist/PPayload.d.ts +7 -0
  106. package/dist/PPayload.d.ts.map +1 -0
  107. package/dist/PPayload.js +19 -0
  108. package/dist/PPayload.js.map +1 -0
  109. package/dist/PScene.d.ts +8 -0
  110. package/dist/PScene.d.ts.map +1 -0
  111. package/dist/PScene.js +12 -0
  112. package/dist/PScene.js.map +1 -0
  113. package/dist/PTypes.d.ts +50 -0
  114. package/dist/PTypes.d.ts.map +1 -0
  115. package/dist/PTypes.js +2 -0
  116. package/dist/PTypes.js.map +1 -0
  117. package/dist/PVariable.d.ts +28 -0
  118. package/dist/PVariable.d.ts.map +1 -0
  119. package/dist/PVariable.js +49 -0
  120. package/dist/PVariable.js.map +1 -0
  121. package/dist/PVector2.d.ts +14 -0
  122. package/dist/PVector2.d.ts.map +1 -0
  123. package/dist/PVector2.js +25 -0
  124. package/dist/PVector2.js.map +1 -0
  125. package/dist/PVector3.d.ts +19 -0
  126. package/dist/PVector3.d.ts.map +1 -0
  127. package/dist/PVector3.js +44 -0
  128. package/dist/PVector3.js.map +1 -0
  129. package/dist/animations/AnimationTools.d.ts +3 -0
  130. package/dist/animations/AnimationTools.d.ts.map +1 -0
  131. package/dist/animations/AnimationTools.js +12 -0
  132. package/dist/animations/AnimationTools.js.map +1 -0
  133. package/dist/animations/IModelAnimation.d.ts +17 -0
  134. package/dist/animations/IModelAnimation.d.ts.map +1 -0
  135. package/dist/animations/IModelAnimation.js +2 -0
  136. package/dist/animations/IModelAnimation.js.map +1 -0
  137. package/dist/assets/AssetLoader.d.ts +10 -0
  138. package/dist/assets/AssetLoader.d.ts.map +1 -0
  139. package/dist/assets/AssetLoader.js +12 -0
  140. package/dist/assets/AssetLoader.js.map +1 -0
  141. package/dist/index.d.ts +153 -0
  142. package/dist/index.d.ts.map +1 -0
  143. package/dist/index.js +107 -0
  144. package/dist/index.js.map +1 -0
  145. package/dist/media/IDBFile.d.ts +18 -0
  146. package/dist/media/IDBFile.d.ts.map +1 -0
  147. package/dist/media/IDBFile.js +2 -0
  148. package/dist/media/IDBFile.js.map +1 -0
  149. package/dist/media/PFile.d.ts +13 -0
  150. package/dist/media/PFile.d.ts.map +1 -0
  151. package/dist/media/PFile.js +34 -0
  152. package/dist/media/PFile.js.map +1 -0
  153. package/dist/pcomponents/BaseMaterial.d.ts +49 -0
  154. package/dist/pcomponents/BaseMaterial.d.ts.map +1 -0
  155. package/dist/pcomponents/BaseMaterial.js +59 -0
  156. package/dist/pcomponents/BaseMaterial.js.map +1 -0
  157. package/dist/pcomponents/PAnimator.d.ts +42 -0
  158. package/dist/pcomponents/PAnimator.d.ts.map +1 -0
  159. package/dist/pcomponents/PAnimator.js +51 -0
  160. package/dist/pcomponents/PAnimator.js.map +1 -0
  161. package/dist/pcomponents/PBackground.d.ts +37 -0
  162. package/dist/pcomponents/PBackground.d.ts.map +1 -0
  163. package/dist/pcomponents/PBackground.js +45 -0
  164. package/dist/pcomponents/PBackground.js.map +1 -0
  165. package/dist/pcomponents/PBasicMaterial.d.ts +22 -0
  166. package/dist/pcomponents/PBasicMaterial.d.ts.map +1 -0
  167. package/dist/pcomponents/PBasicMaterial.js +30 -0
  168. package/dist/pcomponents/PBasicMaterial.js.map +1 -0
  169. package/dist/pcomponents/PCallAction.d.ts +24 -0
  170. package/dist/pcomponents/PCallAction.d.ts.map +1 -0
  171. package/dist/pcomponents/PCallAction.js +35 -0
  172. package/dist/pcomponents/PCallAction.js.map +1 -0
  173. package/dist/pcomponents/PCameraPosition.d.ts +33 -0
  174. package/dist/pcomponents/PCameraPosition.d.ts.map +1 -0
  175. package/dist/pcomponents/PCameraPosition.js +83 -0
  176. package/dist/pcomponents/PCameraPosition.js.map +1 -0
  177. package/dist/pcomponents/PCameraTarget.d.ts +33 -0
  178. package/dist/pcomponents/PCameraTarget.d.ts.map +1 -0
  179. package/dist/pcomponents/PCameraTarget.js +84 -0
  180. package/dist/pcomponents/PCameraTarget.js.map +1 -0
  181. package/dist/pcomponents/PCollider.d.ts +40 -0
  182. package/dist/pcomponents/PCollider.d.ts.map +1 -0
  183. package/dist/pcomponents/PCollider.js +57 -0
  184. package/dist/pcomponents/PCollider.js.map +1 -0
  185. package/dist/pcomponents/PCompare.d.ts +32 -0
  186. package/dist/pcomponents/PCompare.d.ts.map +1 -0
  187. package/dist/pcomponents/PCompare.js +73 -0
  188. package/dist/pcomponents/PCompare.js.map +1 -0
  189. package/dist/pcomponents/PControllerInput.d.ts +30 -0
  190. package/dist/pcomponents/PControllerInput.d.ts.map +1 -0
  191. package/dist/pcomponents/PControllerInput.js +38 -0
  192. package/dist/pcomponents/PControllerInput.js.map +1 -0
  193. package/dist/pcomponents/PCubeGeometry.d.ts +18 -0
  194. package/dist/pcomponents/PCubeGeometry.d.ts.map +1 -0
  195. package/dist/pcomponents/PCubeGeometry.js +23 -0
  196. package/dist/pcomponents/PCubeGeometry.js.map +1 -0
  197. package/dist/pcomponents/PDebug.d.ts +21 -0
  198. package/dist/pcomponents/PDebug.d.ts.map +1 -0
  199. package/dist/pcomponents/PDebug.js +30 -0
  200. package/dist/pcomponents/PDebug.js.map +1 -0
  201. package/dist/pcomponents/PEnvironment.d.ts +27 -0
  202. package/dist/pcomponents/PEnvironment.d.ts.map +1 -0
  203. package/dist/pcomponents/PEnvironment.js +43 -0
  204. package/dist/pcomponents/PEnvironment.js.map +1 -0
  205. package/dist/pcomponents/PFadeAnimation.d.ts +31 -0
  206. package/dist/pcomponents/PFadeAnimation.d.ts.map +1 -0
  207. package/dist/pcomponents/PFadeAnimation.js +112 -0
  208. package/dist/pcomponents/PFadeAnimation.js.map +1 -0
  209. package/dist/pcomponents/PHud.d.ts +12 -0
  210. package/dist/pcomponents/PHud.d.ts.map +1 -0
  211. package/dist/pcomponents/PHud.js +12 -0
  212. package/dist/pcomponents/PHud.js.map +1 -0
  213. package/dist/pcomponents/PImageCache.d.ts +16 -0
  214. package/dist/pcomponents/PImageCache.d.ts.map +1 -0
  215. package/dist/pcomponents/PImageCache.js +30 -0
  216. package/dist/pcomponents/PImageCache.js.map +1 -0
  217. package/dist/pcomponents/PImageDetector.d.ts +26 -0
  218. package/dist/pcomponents/PImageDetector.d.ts.map +1 -0
  219. package/dist/pcomponents/PImageDetector.js +32 -0
  220. package/dist/pcomponents/PImageDetector.js.map +1 -0
  221. package/dist/pcomponents/PInteger.d.ts +41 -0
  222. package/dist/pcomponents/PInteger.d.ts.map +1 -0
  223. package/dist/pcomponents/PInteger.js +73 -0
  224. package/dist/pcomponents/PInteger.js.map +1 -0
  225. package/dist/pcomponents/PIntegerAnimator.d.ts +37 -0
  226. package/dist/pcomponents/PIntegerAnimator.d.ts.map +1 -0
  227. package/dist/pcomponents/PIntegerAnimator.js +104 -0
  228. package/dist/pcomponents/PIntegerAnimator.js.map +1 -0
  229. package/dist/pcomponents/PLight.d.ts +15 -0
  230. package/dist/pcomponents/PLight.d.ts.map +1 -0
  231. package/dist/pcomponents/PLight.js +19 -0
  232. package/dist/pcomponents/PLight.js.map +1 -0
  233. package/dist/pcomponents/PLightDirectional.d.ts +19 -0
  234. package/dist/pcomponents/PLightDirectional.d.ts.map +1 -0
  235. package/dist/pcomponents/PLightDirectional.js +25 -0
  236. package/dist/pcomponents/PLightDirectional.js.map +1 -0
  237. package/dist/pcomponents/PMaskedMaterial.d.ts +19 -0
  238. package/dist/pcomponents/PMaskedMaterial.d.ts.map +1 -0
  239. package/dist/pcomponents/PMaskedMaterial.js +28 -0
  240. package/dist/pcomponents/PMaskedMaterial.js.map +1 -0
  241. package/dist/pcomponents/PMaterialModifier.d.ts +38 -0
  242. package/dist/pcomponents/PMaterialModifier.d.ts.map +1 -0
  243. package/dist/pcomponents/PMaterialModifier.js +67 -0
  244. package/dist/pcomponents/PMaterialModifier.js.map +1 -0
  245. package/dist/pcomponents/PModelAnnotation.d.ts +47 -0
  246. package/dist/pcomponents/PModelAnnotation.d.ts.map +1 -0
  247. package/dist/pcomponents/PModelAnnotation.js +118 -0
  248. package/dist/pcomponents/PModelAnnotation.js.map +1 -0
  249. package/dist/pcomponents/PModelAnnotations.d.ts +46 -0
  250. package/dist/pcomponents/PModelAnnotations.d.ts.map +1 -0
  251. package/dist/pcomponents/PModelAnnotations.js +127 -0
  252. package/dist/pcomponents/PModelAnnotations.js.map +1 -0
  253. package/dist/pcomponents/PModelGLTF.d.ts +34 -0
  254. package/dist/pcomponents/PModelGLTF.d.ts.map +1 -0
  255. package/dist/pcomponents/PModelGLTF.js +55 -0
  256. package/dist/pcomponents/PModelGLTF.js.map +1 -0
  257. package/dist/pcomponents/PModelNode.d.ts +16 -0
  258. package/dist/pcomponents/PModelNode.d.ts.map +1 -0
  259. package/dist/pcomponents/PModelNode.js +18 -0
  260. package/dist/pcomponents/PModelNode.js.map +1 -0
  261. package/dist/pcomponents/PMoveAnimation.d.ts +27 -0
  262. package/dist/pcomponents/PMoveAnimation.d.ts.map +1 -0
  263. package/dist/pcomponents/PMoveAnimation.js +64 -0
  264. package/dist/pcomponents/PMoveAnimation.js.map +1 -0
  265. package/dist/pcomponents/PMoveToAnimation.d.ts +26 -0
  266. package/dist/pcomponents/PMoveToAnimation.d.ts.map +1 -0
  267. package/dist/pcomponents/PMoveToAnimation.js +80 -0
  268. package/dist/pcomponents/PMoveToAnimation.js.map +1 -0
  269. package/dist/pcomponents/PNumberAnimator.d.ts +41 -0
  270. package/dist/pcomponents/PNumberAnimator.d.ts.map +1 -0
  271. package/dist/pcomponents/PNumberAnimator.js +102 -0
  272. package/dist/pcomponents/PNumberAnimator.js.map +1 -0
  273. package/dist/pcomponents/PPhysicalMaterial.d.ts +28 -0
  274. package/dist/pcomponents/PPhysicalMaterial.d.ts.map +1 -0
  275. package/dist/pcomponents/PPhysicalMaterial.js +34 -0
  276. package/dist/pcomponents/PPhysicalMaterial.js.map +1 -0
  277. package/dist/pcomponents/PPlaneDetector.d.ts +20 -0
  278. package/dist/pcomponents/PPlaneDetector.d.ts.map +1 -0
  279. package/dist/pcomponents/PPlaneDetector.js +24 -0
  280. package/dist/pcomponents/PPlaneDetector.js.map +1 -0
  281. package/dist/pcomponents/PPlaneGeometry.d.ts +20 -0
  282. package/dist/pcomponents/PPlaneGeometry.d.ts.map +1 -0
  283. package/dist/pcomponents/PPlaneGeometry.js +26 -0
  284. package/dist/pcomponents/PPlaneGeometry.js.map +1 -0
  285. package/dist/pcomponents/PProjectRoot.d.ts +42 -0
  286. package/dist/pcomponents/PProjectRoot.d.ts.map +1 -0
  287. package/dist/pcomponents/PProjectRoot.js +93 -0
  288. package/dist/pcomponents/PProjectRoot.js.map +1 -0
  289. package/dist/pcomponents/PRotateAnimation.d.ts +33 -0
  290. package/dist/pcomponents/PRotateAnimation.d.ts.map +1 -0
  291. package/dist/pcomponents/PRotateAnimation.js +80 -0
  292. package/dist/pcomponents/PRotateAnimation.js.map +1 -0
  293. package/dist/pcomponents/PScaleAnimation.d.ts +28 -0
  294. package/dist/pcomponents/PScaleAnimation.d.ts.map +1 -0
  295. package/dist/pcomponents/PScaleAnimation.js +81 -0
  296. package/dist/pcomponents/PScaleAnimation.js.map +1 -0
  297. package/dist/pcomponents/PSceneContainer.d.ts +23 -0
  298. package/dist/pcomponents/PSceneContainer.d.ts.map +1 -0
  299. package/dist/pcomponents/PSceneContainer.js +46 -0
  300. package/dist/pcomponents/PSceneContainer.js.map +1 -0
  301. package/dist/pcomponents/PSceneRoot.d.ts +16 -0
  302. package/dist/pcomponents/PSceneRoot.d.ts.map +1 -0
  303. package/dist/pcomponents/PSceneRoot.js +20 -0
  304. package/dist/pcomponents/PSceneRoot.js.map +1 -0
  305. package/dist/pcomponents/PSlider.d.ts +34 -0
  306. package/dist/pcomponents/PSlider.d.ts.map +1 -0
  307. package/dist/pcomponents/PSlider.js +38 -0
  308. package/dist/pcomponents/PSlider.js.map +1 -0
  309. package/dist/pcomponents/PSound.d.ts +33 -0
  310. package/dist/pcomponents/PSound.d.ts.map +1 -0
  311. package/dist/pcomponents/PSound.js +39 -0
  312. package/dist/pcomponents/PSound.js.map +1 -0
  313. package/dist/pcomponents/PSphereGeometry.d.ts +19 -0
  314. package/dist/pcomponents/PSphereGeometry.d.ts.map +1 -0
  315. package/dist/pcomponents/PSphereGeometry.js +25 -0
  316. package/dist/pcomponents/PSphereGeometry.js.map +1 -0
  317. package/dist/pcomponents/PSprite.d.ts +17 -0
  318. package/dist/pcomponents/PSprite.d.ts.map +1 -0
  319. package/dist/pcomponents/PSprite.js +21 -0
  320. package/dist/pcomponents/PSprite.js.map +1 -0
  321. package/dist/pcomponents/PSpriteSheet.d.ts +28 -0
  322. package/dist/pcomponents/PSpriteSheet.d.ts.map +1 -0
  323. package/dist/pcomponents/PSpriteSheet.js +41 -0
  324. package/dist/pcomponents/PSpriteSheet.js.map +1 -0
  325. package/dist/pcomponents/PText.d.ts +34 -0
  326. package/dist/pcomponents/PText.d.ts.map +1 -0
  327. package/dist/pcomponents/PText.js +43 -0
  328. package/dist/pcomponents/PText.js.map +1 -0
  329. package/dist/pcomponents/PTransform.d.ts +23 -0
  330. package/dist/pcomponents/PTransform.d.ts.map +1 -0
  331. package/dist/pcomponents/PTransform.js +67 -0
  332. package/dist/pcomponents/PTransform.js.map +1 -0
  333. package/dist/pcomponents/PVarList.d.ts +43 -0
  334. package/dist/pcomponents/PVarList.d.ts.map +1 -0
  335. package/dist/pcomponents/PVarList.js +87 -0
  336. package/dist/pcomponents/PVarList.js.map +1 -0
  337. package/dist/pcomponents/PVideoPlayer.d.ts +36 -0
  338. package/dist/pcomponents/PVideoPlayer.d.ts.map +1 -0
  339. package/dist/pcomponents/PVideoPlayer.js +93 -0
  340. package/dist/pcomponents/PVideoPlayer.js.map +1 -0
  341. package/dist/pcomponents/PVisibility.d.ts +38 -0
  342. package/dist/pcomponents/PVisibility.d.ts.map +1 -0
  343. package/dist/pcomponents/PVisibility.js +68 -0
  344. package/dist/pcomponents/PVisibility.js.map +1 -0
  345. package/dist/pcomponents/PXRTools.d.ts +32 -0
  346. package/dist/pcomponents/PXRTools.d.ts.map +1 -0
  347. package/dist/pcomponents/PXRTools.js +43 -0
  348. package/dist/pcomponents/PXRTools.js.map +1 -0
  349. package/dist/ports/IDBInValue.d.ts +6 -0
  350. package/dist/ports/IDBInValue.d.ts.map +1 -0
  351. package/dist/ports/IDBInValue.js +2 -0
  352. package/dist/ports/IDBInValue.js.map +1 -0
  353. package/dist/ports/IDBLink.d.ts +17 -0
  354. package/dist/ports/IDBLink.d.ts.map +1 -0
  355. package/dist/ports/IDBLink.js +2 -0
  356. package/dist/ports/IDBLink.js.map +1 -0
  357. package/dist/ports/IDBPayloadValue.d.ts +5 -0
  358. package/dist/ports/IDBPayloadValue.d.ts.map +1 -0
  359. package/dist/ports/IDBPayloadValue.js +2 -0
  360. package/dist/ports/IDBPayloadValue.js.map +1 -0
  361. package/dist/ports/IValue.d.ts +10 -0
  362. package/dist/ports/IValue.d.ts.map +1 -0
  363. package/dist/ports/IValue.js +2 -0
  364. package/dist/ports/IValue.js.map +1 -0
  365. package/dist/ports/PInEventPort.d.ts +16 -0
  366. package/dist/ports/PInEventPort.d.ts.map +1 -0
  367. package/dist/ports/PInEventPort.js +22 -0
  368. package/dist/ports/PInEventPort.js.map +1 -0
  369. package/dist/ports/PInValue.d.ts +17 -0
  370. package/dist/ports/PInValue.d.ts.map +1 -0
  371. package/dist/ports/PInValue.js +31 -0
  372. package/dist/ports/PInValue.js.map +1 -0
  373. package/dist/ports/PInValuePort.d.ts +18 -0
  374. package/dist/ports/PInValuePort.d.ts.map +1 -0
  375. package/dist/ports/PInValuePort.js +49 -0
  376. package/dist/ports/PInValuePort.js.map +1 -0
  377. package/dist/ports/PLink.d.ts +23 -0
  378. package/dist/ports/PLink.d.ts.map +1 -0
  379. package/dist/ports/PLink.js +50 -0
  380. package/dist/ports/PLink.js.map +1 -0
  381. package/dist/ports/POutEventPort.d.ts +20 -0
  382. package/dist/ports/POutEventPort.d.ts.map +1 -0
  383. package/dist/ports/POutEventPort.js +65 -0
  384. package/dist/ports/POutEventPort.js.map +1 -0
  385. package/dist/ports/POutValuePort.d.ts +13 -0
  386. package/dist/ports/POutValuePort.d.ts.map +1 -0
  387. package/dist/ports/POutValuePort.js +21 -0
  388. package/dist/ports/POutValuePort.js.map +1 -0
  389. package/dist/ports/PPayloadValue.d.ts +16 -0
  390. package/dist/ports/PPayloadValue.d.ts.map +1 -0
  391. package/dist/ports/PPayloadValue.js +28 -0
  392. package/dist/ports/PPayloadValue.js.map +1 -0
  393. package/dist/ports/PPort.d.ts +21 -0
  394. package/dist/ports/PPort.d.ts.map +1 -0
  395. package/dist/ports/PPort.js +25 -0
  396. package/dist/ports/PPort.js.map +1 -0
  397. package/dist/settings/ICameraSettings.d.ts +16 -0
  398. package/dist/settings/ICameraSettings.d.ts.map +1 -0
  399. package/dist/settings/ICameraSettings.js +2 -0
  400. package/dist/settings/ICameraSettings.js.map +1 -0
  401. package/dist/settings/IQualitySettings.d.ts +14 -0
  402. package/dist/settings/IQualitySettings.d.ts.map +1 -0
  403. package/dist/settings/IQualitySettings.js +2 -0
  404. package/dist/settings/IQualitySettings.js.map +1 -0
  405. package/dist/settings/IRenderSetting.d.ts +7 -0
  406. package/dist/settings/IRenderSetting.d.ts.map +1 -0
  407. package/dist/settings/IRenderSetting.js +2 -0
  408. package/dist/settings/IRenderSetting.js.map +1 -0
  409. package/dist/settings/ISetting.d.ts +4 -0
  410. package/dist/settings/ISetting.d.ts.map +1 -0
  411. package/dist/settings/ISetting.js +2 -0
  412. package/dist/settings/ISetting.js.map +1 -0
  413. package/dist/settings/IWebSettings.d.ts +6 -0
  414. package/dist/settings/IWebSettings.d.ts.map +1 -0
  415. package/dist/settings/IWebSettings.js +2 -0
  416. package/dist/settings/IWebSettings.js.map +1 -0
  417. package/dist/settings/Settings_Babylonjs.d.ts +101 -0
  418. package/dist/settings/Settings_Babylonjs.d.ts.map +1 -0
  419. package/dist/settings/Settings_Babylonjs.js +85 -0
  420. package/dist/settings/Settings_Babylonjs.js.map +1 -0
  421. package/dist/settings/Settings_Base.d.ts +11 -0
  422. package/dist/settings/Settings_Base.d.ts.map +1 -0
  423. package/dist/settings/Settings_Base.js +45 -0
  424. package/dist/settings/Settings_Base.js.map +1 -0
  425. package/dist/settings/Settings_Threejs.d.ts +106 -0
  426. package/dist/settings/Settings_Threejs.d.ts.map +1 -0
  427. package/dist/settings/Settings_Threejs.js +165 -0
  428. package/dist/settings/Settings_Threejs.js.map +1 -0
  429. package/package.json +1 -1
@@ -0,0 +1,694 @@
1
+ import PFile from "./media/PFile";
2
+ import { Platform, Language, Coordinates, PortTypes } from "./PEnums";
3
+ import PEvent from "./PEvent";
4
+ import PNode from "./PNode";
5
+ import { PVariable } from "./PVariable";
6
+ import PFileUsage from "./PFileUsage";
7
+ import PScene from "./PScene";
8
+ var Workers;
9
+ (function (Workers) {
10
+ Workers[Workers["None"] = 0] = "None";
11
+ Workers[Workers["System"] = 1] = "System";
12
+ Workers[Workers["CameraControls"] = 2] = "CameraControls";
13
+ Workers[Workers["Animating"] = 4] = "Animating";
14
+ Workers[Workers["Updators"] = 8] = "Updators";
15
+ Workers[Workers["Admin"] = 16] = "Admin";
16
+ Workers[Workers["SceneLoader"] = 32] = "SceneLoader";
17
+ Workers[Workers["AdaptivePerformance"] = 64] = "AdaptivePerformance";
18
+ })(Workers || (Workers = {}));
19
+ export { Workers };
20
+ export default class GameContext {
21
+ _owner;
22
+ _root = null;
23
+ _pcanvas = null;
24
+ _running = false;
25
+ _pnodeRenderer = null;
26
+ _engine = null;
27
+ _audioListener = null;
28
+ _componentFactory = null;
29
+ _assetLoader = null;
30
+ editor = false;
31
+ debug_fastVideo = false;
32
+ isAdmin() {
33
+ return false;
34
+ }
35
+ s3Url = "https://p100-pw.s3.eu-north-1.amazonaws.com/";
36
+ constructor(owner, platform) {
37
+ this._owner = owner;
38
+ this._platform = platform;
39
+ }
40
+ setEngine(engine) {
41
+ this._engine = engine;
42
+ if (engine) {
43
+ this._pnodeRenderer = engine.setupNodeRenderer(this);
44
+ this._componentFactory = engine.getComponentFactory();
45
+ }
46
+ else {
47
+ this._pnodeRenderer = null;
48
+ this._componentFactory = null;
49
+ }
50
+ }
51
+ getOwner() {
52
+ return this._owner;
53
+ }
54
+ //
55
+ // PID
56
+ //
57
+ pid() {
58
+ console.error("MISSING PID");
59
+ return 0;
60
+ }
61
+ //
62
+ // PRENDERER
63
+ //
64
+ getIEngine() {
65
+ return this._engine;
66
+ }
67
+ getEngine() {
68
+ return this._engine;
69
+ }
70
+ getNodeRenderer() {
71
+ return this._pnodeRenderer;
72
+ }
73
+ //
74
+ // PCANVAS
75
+ //
76
+ getEngineScene() {
77
+ return this._pcanvas.getScene();
78
+ }
79
+ getCanvas() {
80
+ return this._pcanvas;
81
+ }
82
+ getPCanvas() {
83
+ return this._pcanvas;
84
+ }
85
+ getCanvasElement() {
86
+ return this._pcanvas?.getCanvasElement() || null;
87
+ }
88
+ setPCanvas(canvas) {
89
+ if (this._pcanvas !== null && canvas !== null) {
90
+ this.error("GameContext already had a canvas");
91
+ return;
92
+ }
93
+ this._pcanvas = canvas;
94
+ }
95
+ //
96
+ // ASSETS
97
+ //
98
+ assetLoader() {
99
+ if (this._assetLoader === null) {
100
+ this._assetLoader = this._engine.setupAssetLoader(this);
101
+ }
102
+ return this._assetLoader;
103
+ }
104
+ async loadAssetsAsync() {
105
+ return this._assetLoader?.loadAsync();
106
+ }
107
+ //
108
+ // MEDIA LOADERS
109
+ //
110
+ hasMediaQueue() {
111
+ return this._assetLoader?.hasQueue() || false;
112
+ }
113
+ //
114
+ // IEmitter
115
+ //
116
+ getContext() {
117
+ return this;
118
+ }
119
+ //
120
+ // LIFE CYCLE
121
+ //
122
+ /**
123
+ * Init and render scene
124
+ */
125
+ enable() {
126
+ this._sceneLoaderCounter = 0;
127
+ if (this._root) {
128
+ if (this._root.hasValidPlatform()) {
129
+ this._root.enable();
130
+ this._root.update();
131
+ this.setWorkFlag(Workers.System);
132
+ // pcanvas.enable();
133
+ this.clearWorkFlag(Workers.System);
134
+ }
135
+ else {
136
+ this.error("Root is not enabled or valid platform");
137
+ }
138
+ }
139
+ }
140
+ disable() {
141
+ this.disableInput();
142
+ this._root?.disable();
143
+ }
144
+ /**
145
+ * Destroy everything
146
+ */
147
+ dispose() {
148
+ this._assetLoader?.dispose();
149
+ this._assetLoader = null;
150
+ // Dispose ALL nodes, not just mounted ones
151
+ for (const node of this._nodes) {
152
+ node.dispose(false);
153
+ }
154
+ this._root = null;
155
+ this._nodes.length = 0;
156
+ this._events.length = 0;
157
+ this._fileUsages.length = 0;
158
+ this._pfiles.length = 0;
159
+ this._variables.length = 0;
160
+ if (this._audioListener !== null) {
161
+ const audioListener = this._audioListener;
162
+ if (audioListener.dispose) {
163
+ audioListener.dispose();
164
+ }
165
+ }
166
+ this.disposeCanvas();
167
+ }
168
+ /**
169
+ * Call when we need to dispose the old PCanvas and canvas element
170
+ */
171
+ disposeCanvas() {
172
+ this._pcanvas?.dispose();
173
+ this._assetLoader?.dispose();
174
+ this._assetLoader = null;
175
+ this._pcanvas = null;
176
+ this._engine = null;
177
+ }
178
+ /**
179
+ * use hard = true if we want to tear down and free all resources. Not
180
+ * to use while restarting.
181
+ */
182
+ soft_dispose() {
183
+ // Dispose ALL nodes, not just mounted ones
184
+ for (const node of this._nodes) {
185
+ node.dispose(false);
186
+ }
187
+ this._root = null;
188
+ this._nodes = [];
189
+ }
190
+ isLoading() {
191
+ return this.hasMediaQueue();
192
+ }
193
+ _sceneLoaderCounter = 0;
194
+ increaseSceneLoader() {
195
+ this._sceneLoaderCounter++;
196
+ if (this._sceneLoaderCounter === 1) {
197
+ this.setWorkFlag(Workers.SceneLoader);
198
+ }
199
+ }
200
+ decreaseSceneLoader() {
201
+ this._sceneLoaderCounter--;
202
+ if (this._sceneLoaderCounter === 0) {
203
+ this.clearWorkFlag(Workers.SceneLoader);
204
+ }
205
+ }
206
+ async play() {
207
+ if (this._root === null)
208
+ return;
209
+ if (this._running === true) {
210
+ console.error("play() GameContext was already running.");
211
+ return;
212
+ }
213
+ const pRootComponent = this._root.findComponent("PProjectRoot");
214
+ if (pRootComponent === null) {
215
+ this.error("play() PProjectRoot not found");
216
+ return;
217
+ }
218
+ this.increaseSceneLoader();
219
+ for (const variable of Object.values(this._variables)) {
220
+ variable.reset();
221
+ }
222
+ this._running = true;
223
+ await this.setupAudioListener();
224
+ this._root.play();
225
+ pRootComponent.native_OnPlay();
226
+ await this._assetLoader?.loadAsync();
227
+ pRootComponent.native_OnPlaying();
228
+ this._pcanvas?.updateEditorMode(false);
229
+ this._pcanvas.onSceneRunning();
230
+ this.decreaseSceneLoader();
231
+ }
232
+ stop() {
233
+ if (this._root === null)
234
+ return;
235
+ if (this._running === false)
236
+ return;
237
+ this._running = false;
238
+ for (const variable of Object.values(this._variables)) {
239
+ variable.reset();
240
+ }
241
+ this._root.stop();
242
+ this._pcanvas?.updateEditorMode(true);
243
+ }
244
+ //
245
+ // WORKER
246
+ //
247
+ _workFlags = 0;
248
+ isWorking() {
249
+ return this._workFlags > 0;
250
+ }
251
+ setWorkFlag(worker) {
252
+ const wasWorking = this._workFlags > 0;
253
+ this._workFlags = this._workFlags | worker;
254
+ // console.log(
255
+ // "setWorkState (" + Workers[worker] + ") _workFlags: ",
256
+ // this._workFlags
257
+ // );
258
+ if (!wasWorking && this._workFlags > 0 && this._pcanvas !== null) {
259
+ this._pcanvas.onWorkStarted(this._workFlags);
260
+ this.getOwner().setWorkState(true);
261
+ }
262
+ }
263
+ clearWorkFlag(flag) {
264
+ const wasWorking = this._workFlags > 0;
265
+ this._workFlags = this._workFlags & ~flag;
266
+ // console.log(
267
+ // "clearWorkState (" + Workers[flag] + ") _workState: ",
268
+ // this._workFlags
269
+ // );
270
+ if (wasWorking && this._workFlags === 0 && this._pcanvas !== null) {
271
+ this._pcanvas.onWorkStopped(flag);
272
+ this.getOwner().setWorkState(false);
273
+ }
274
+ }
275
+ /**
276
+ * Render a single frame if sleeping
277
+ */
278
+ snooze() {
279
+ this._pcanvas.snooze();
280
+ }
281
+ //
282
+ // NATIVE EVENTS
283
+ //
284
+ onClick = (node, ctrl, shift) => {
285
+ this._owner?.onClick(node, ctrl, shift);
286
+ };
287
+ onHoverEnter = (node) => {
288
+ this._owner?.onHoverEnter(node);
289
+ };
290
+ onHoverExit = (node) => {
291
+ this._owner?.onHoverExit(node);
292
+ };
293
+ //
294
+ // PEVENTS
295
+ //
296
+ _events = [];
297
+ registerEvent(dbEvent) {
298
+ const pevent = new PEvent(dbEvent);
299
+ this._events.push(pevent);
300
+ return pevent;
301
+ }
302
+ getEvents() {
303
+ return this._events;
304
+ }
305
+ getEvent(id) {
306
+ console.log("dont use getEvent(id: string)");
307
+ return this._events.find((e) => e._id == id) || null;
308
+ }
309
+ getEventByPid(pid) {
310
+ return this._events.find((e) => e.pid === pid) || null;
311
+ }
312
+ getExternalEvent(name) {
313
+ return this._events.find((e) => e.external && e.name === name) || null;
314
+ }
315
+ //
316
+ // PVARIABLES
317
+ //
318
+ _variables = [];
319
+ registerVariable(dbVariable) {
320
+ const pvariable = new PVariable(dbVariable);
321
+ this._variables.push(pvariable);
322
+ return pvariable;
323
+ }
324
+ getVariables() {
325
+ return this._variables;
326
+ }
327
+ getVariableByPid(pid) {
328
+ return this._variables.find((v) => v.pid === pid) || null;
329
+ }
330
+ getVariable(id) {
331
+ console.error("do not use getVariable(id: string)");
332
+ return this._variables.find((v) => v._id === id) || null;
333
+ }
334
+ //
335
+ // FILES
336
+ //
337
+ // This is overriden by EGameContext
338
+ _pfiles = [];
339
+ // This is overriden by EGameContext
340
+ registerFile(dbItem) {
341
+ const item = new PFile(dbItem);
342
+ this._pfiles.push(item);
343
+ return item;
344
+ }
345
+ //
346
+ // FILE USAGES
347
+ //
348
+ _fileUsages = [];
349
+ registerFileUsage(dbItem) {
350
+ const item = new PFileUsage(dbItem);
351
+ this._fileUsages.push(item);
352
+ return item;
353
+ }
354
+ findFileUsage(nodePid, componentPid, slot) {
355
+ return (this._fileUsages.find((f) => f.node === nodePid && f.component === componentPid && f.slot === slot) || null);
356
+ }
357
+ findFile(id) {
358
+ return this._pfiles.find((f) => f._id === id) || null;
359
+ }
360
+ /**
361
+ * Called when a component slot changes value. Used in admin.
362
+ */
363
+ setFileSlot(_fileSlot, _id) {
364
+ return null;
365
+ }
366
+ //
367
+ // PLINKS
368
+ //
369
+ linkPorts(links) {
370
+ // Link nodes to their ports
371
+ for (const link of links) {
372
+ const outPort = this.findOutEventPort(link.outPortType, link.outPid, link.outComponentPid, link.outPortId);
373
+ const inPort = this.findInEventPort(link.inPortType, link.inPid, link.inComponentPid, link.inPortId);
374
+ if (!outPort) {
375
+ this.error("[Link Ports] out port not found");
376
+ continue;
377
+ }
378
+ if (!inPort) {
379
+ this.error("[Link Ports] in port not found");
380
+ continue;
381
+ }
382
+ // Link
383
+ outPort.link(this, inPort, link);
384
+ }
385
+ }
386
+ //
387
+ // PCOMPONENTS
388
+ //
389
+ createComponents(pnode, components) {
390
+ return components
391
+ .map((c) => this._componentFactory.component(c, pnode, this))
392
+ .filter((c) => c !== null);
393
+ }
394
+ //
395
+ // NODES
396
+ //
397
+ _nodes = [];
398
+ createPNodeTree(dbItem, dbNodes, parent) {
399
+ const pnode = new PNode(dbItem, this, this._pnodeRenderer);
400
+ pnode.updateByComponent();
401
+ this._nodes.push(pnode);
402
+ if (parent) {
403
+ parent.add(pnode);
404
+ }
405
+ const res = dbNodes.filter((n) => n.parent === dbItem.pid);
406
+ for (const childNode of res) {
407
+ this.createPNodeTree(childNode, dbNodes, pnode);
408
+ }
409
+ return pnode;
410
+ }
411
+ /**
412
+ * [CREATE NODES]
413
+ * Create root node. For project or new nodes
414
+ */
415
+ createRootNode(dbRoot, dbNodes) {
416
+ // Create root PNode
417
+ const root = this.createPNodeTree(dbRoot, dbNodes);
418
+ root.traverse((n) => n.linkPorts());
419
+ return root;
420
+ }
421
+ findNode(id) {
422
+ return this._nodes.find((n) => n._id === id) || null;
423
+ }
424
+ findNodeByPid(pid) {
425
+ return this._nodes.find((n) => n.pid === pid) || null;
426
+ }
427
+ rerenderNode(_node) {
428
+ // Editor
429
+ }
430
+ editor_render() { }
431
+ getRoot() {
432
+ return this._root;
433
+ }
434
+ setRoot(root) {
435
+ this._root = root;
436
+ }
437
+ //
438
+ // PORTS & LINKS
439
+ //
440
+ findInEventPort(portType, pid, component, portId) {
441
+ // Supports only
442
+ if (portType === PortTypes.Event) {
443
+ const pevent = this.getEventByPid(pid);
444
+ if (pevent)
445
+ return pevent.inPort;
446
+ }
447
+ else if (portType === PortTypes.Variable) {
448
+ const pvariable = this.getVariableByPid(pid);
449
+ if (pvariable)
450
+ return pvariable.inPort;
451
+ }
452
+ else if (portType === PortTypes.PNode) {
453
+ const pnode = this.findNodeByPid(pid);
454
+ if (pnode) {
455
+ const pcomponent = pnode.findComponentByPid(component);
456
+ if (pcomponent)
457
+ return (pcomponent.inEventPorts.find((p) => p.portId === portId) || null);
458
+ }
459
+ }
460
+ return null;
461
+ }
462
+ findOutEventPort(portType, pid, component, portId) {
463
+ // Supports only
464
+ if (portType === PortTypes.Event) {
465
+ const pevent = this.getEventByPid(pid);
466
+ if (pevent)
467
+ return pevent.outPort;
468
+ }
469
+ else if (portType === PortTypes.Variable) {
470
+ const pvariable = this.getVariableByPid(pid);
471
+ if (pvariable)
472
+ return pvariable.outPort;
473
+ }
474
+ else if (portType === PortTypes.PNode) {
475
+ const pnode = this.findNodeByPid(pid);
476
+ if (pnode) {
477
+ const pcomponent = pnode.findComponentByPid(component);
478
+ if (pcomponent)
479
+ return (pcomponent.outEventPorts.find((p) => p.portId === portId) || null);
480
+ }
481
+ }
482
+ return null;
483
+ }
484
+ findOutValuePort(link) {
485
+ // Supports only
486
+ if (link.portType === PortTypes.PNode) {
487
+ const pnode = this.findNodeByPid(link.pid);
488
+ if (pnode) {
489
+ const pcomponent = pnode.findComponentByPid(link.componentPid);
490
+ if (pcomponent) {
491
+ return (pcomponent.outValuePorts.find((v) => v.portId === link.portId) ||
492
+ null);
493
+ }
494
+ }
495
+ }
496
+ else if (link.portType === PortTypes.Variable) {
497
+ const pvariable = this.getVariableByPid(link.pid);
498
+ if (pvariable)
499
+ return pvariable.outValue;
500
+ }
501
+ else {
502
+ console.error("Unsupported valuePortType", link);
503
+ }
504
+ return null;
505
+ }
506
+ //
507
+ // SCENES
508
+ //
509
+ _loadedScenePids = [];
510
+ _scenes = [];
511
+ registerScene = (dbScene) => {
512
+ const pscene = new PScene(dbScene);
513
+ this._scenes.push(pscene);
514
+ return pscene;
515
+ };
516
+ getScene(pid) {
517
+ return this._scenes.find((s) => s.pid === pid) || null;
518
+ }
519
+ isSceneLoaded(scenePid) {
520
+ return this._loadedScenePids.includes(scenePid);
521
+ }
522
+ getSceneRoot(pid) {
523
+ return (this._nodes.find((s) => s.parentPid === 0 && s.scenePid === pid) || null);
524
+ }
525
+ async loadScene(scenePid, loader, loadAssets, onLoadedEvent = null) {
526
+ const root = this.getSceneRoot(scenePid);
527
+ const pscene = this.getScene(scenePid);
528
+ if (!pscene || !root || !root.scenePid)
529
+ throw new Error("Scene not found");
530
+ if (pscene.isLoaded)
531
+ throw new Error("Scene was already loaded");
532
+ pscene.isLoaded = true;
533
+ this.increaseSceneLoader();
534
+ this._loadedScenePids.push(root.scenePid);
535
+ loader.add(root);
536
+ root.enable();
537
+ root.update();
538
+ this._owner.onLoadScene(root);
539
+ if (this.isRunning()) {
540
+ root.play();
541
+ }
542
+ if (loadAssets) {
543
+ await this._assetLoader?.loadAsync();
544
+ }
545
+ if (onLoadedEvent !== null)
546
+ onLoadedEvent.emit(root._id);
547
+ if (this.isRunning()) {
548
+ const pscene = root.findComponent("PSceneRoot");
549
+ pscene.outport_onSceneLoaded?.emit(root._id);
550
+ }
551
+ this.decreaseSceneLoader();
552
+ }
553
+ __unloadScene(pscene, root) {
554
+ if (!pscene.isLoaded)
555
+ throw new Error("Scene was not loaded");
556
+ pscene.isLoaded = false;
557
+ if (this.isRunning()) {
558
+ root.stop();
559
+ }
560
+ this._loadedScenePids = this._loadedScenePids.filter((id) => id !== root.scenePid);
561
+ this._owner.onUnloadScene(root);
562
+ root.disable();
563
+ root.removeFromParent();
564
+ }
565
+ unloadScene(pscene) {
566
+ const root = this.getSceneRoot(pscene.pid);
567
+ this.__unloadScene(pscene, root);
568
+ }
569
+ unloadSceneNode(root) {
570
+ const pscene = this.getScene(root.scenePid);
571
+ this.__unloadScene(pscene, root);
572
+ }
573
+ //
574
+ // LAYERS
575
+ //
576
+ _mask = 1;
577
+ mask = () => {
578
+ return this._mask;
579
+ };
580
+ /**
581
+ * Camera layer changed
582
+ */
583
+ setLayers(mask) {
584
+ this._mask = mask;
585
+ // Loop through nodes and update visiblity
586
+ if (this._root) {
587
+ this._root.update();
588
+ }
589
+ }
590
+ //
591
+ // COORDINATE SYSTEM
592
+ //
593
+ _coordinates = Coordinates.LeftHanded;
594
+ setCoordinates(coordinates) {
595
+ this._coordinates = coordinates;
596
+ }
597
+ /**
598
+ * Return coordinats of the selected engine
599
+ */
600
+ getEngineCoordinates() {
601
+ return this._engine.getCoordinates();
602
+ }
603
+ getCoordinates() {
604
+ return this._coordinates;
605
+ }
606
+ isInverted() {
607
+ return this._engine.getCoordinates() !== this._coordinates;
608
+ }
609
+ //
610
+ // PLATFORM
611
+ //
612
+ _platform = Platform.Threejs;
613
+ setPlatform(platform) {
614
+ this._platform = platform;
615
+ }
616
+ platform() {
617
+ return this._platform;
618
+ }
619
+ //
620
+ // LANGUAGES
621
+ //
622
+ _language = Language.English;
623
+ setLanguage(language) {
624
+ this._language = language;
625
+ }
626
+ language() {
627
+ return this._language;
628
+ }
629
+ //
630
+ // RUNNING
631
+ //
632
+ isRunning() {
633
+ return this._running;
634
+ }
635
+ //
636
+ // CAMERA
637
+ //
638
+ setCameraControlSettings(cameraSettings) {
639
+ const cameraControls = this._engine.setupCameraControls(this, cameraSettings);
640
+ this._pcanvas.setCameraControls(cameraControls);
641
+ return cameraControls;
642
+ }
643
+ getCameraControls() {
644
+ return this._pcanvas?.getCameraControls() || null;
645
+ }
646
+ //
647
+ // AUDIO
648
+ //
649
+ async setupAudioListener() {
650
+ if (this._audioListener === null) {
651
+ this._audioListener = await this._engine.setupAudioListener();
652
+ }
653
+ }
654
+ getAudioListener() {
655
+ return this._audioListener;
656
+ }
657
+ //
658
+ // INTERACTION
659
+ //
660
+ _inputEnabled = false;
661
+ enableInput() {
662
+ if (this._inputEnabled || !this._pcanvas)
663
+ return;
664
+ this._inputEnabled = true;
665
+ this._pcanvas.getCameraControls()?.enable();
666
+ this._pcanvas.enableRaycaster();
667
+ }
668
+ disableInput() {
669
+ if (!this._inputEnabled || !this._pcanvas)
670
+ return;
671
+ this._inputEnabled = false;
672
+ this._pcanvas.getCameraControls()?.disable();
673
+ this._pcanvas.disableRaycaster();
674
+ }
675
+ isInputEnabled() {
676
+ return this._inputEnabled;
677
+ }
678
+ //
679
+ // TWEENS
680
+ //
681
+ addTween(tween) {
682
+ this._pcanvas?.addTween(tween);
683
+ }
684
+ //
685
+ // NOTIFICATIONS
686
+ //
687
+ error(msg, details) {
688
+ this._owner.error(msg, details);
689
+ }
690
+ catch(error) {
691
+ this._owner.catch(error);
692
+ }
693
+ }
694
+ //# sourceMappingURL=GameContext.js.map