@p100-web/core 100.2.15 → 100.2.16

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