@p100-web/core-three 100.2.1 → 100.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/App.d.ts +41 -0
  2. package/dist/App.d.ts.map +1 -0
  3. package/dist/App.js +178 -0
  4. package/dist/App.js.map +1 -0
  5. package/dist/ComponentFactory.d.ts +5 -0
  6. package/dist/ComponentFactory.d.ts.map +1 -0
  7. package/dist/ComponentFactory.js +13 -0
  8. package/dist/ComponentFactory.js.map +1 -0
  9. package/dist/ThreeCanvas.d.ts +56 -0
  10. package/dist/ThreeCanvas.d.ts.map +1 -0
  11. package/dist/ThreeCanvas.js +410 -0
  12. package/dist/ThreeCanvas.js.map +1 -0
  13. package/dist/ThreeEngine.d.ts +24 -0
  14. package/dist/ThreeEngine.d.ts.map +1 -0
  15. package/dist/ThreeEngine.js +102 -0
  16. package/dist/ThreeEngine.js.map +1 -0
  17. package/dist/ThreeNodeRenderer.d.ts +41 -0
  18. package/dist/ThreeNodeRenderer.d.ts.map +1 -0
  19. package/dist/ThreeNodeRenderer.js +116 -0
  20. package/dist/ThreeNodeRenderer.js.map +1 -0
  21. package/dist/animations/ModelAnimation.d.ts +21 -0
  22. package/dist/animations/ModelAnimation.d.ts.map +1 -0
  23. package/dist/animations/ModelAnimation.js +45 -0
  24. package/dist/animations/ModelAnimation.js.map +1 -0
  25. package/dist/assets/ThreeAssetLoader.d.ts +98 -0
  26. package/dist/assets/ThreeAssetLoader.d.ts.map +1 -0
  27. package/dist/assets/ThreeAssetLoader.js +495 -0
  28. package/dist/assets/ThreeAssetLoader.js.map +1 -0
  29. package/dist/index.d.ts +7 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +8 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/pcomponents/PAnimator.d.ts +24 -0
  34. package/dist/pcomponents/PAnimator.d.ts.map +1 -0
  35. package/dist/pcomponents/PAnimator.js +134 -0
  36. package/dist/pcomponents/PAnimator.js.map +1 -0
  37. package/dist/pcomponents/PBackground.d.ts +17 -0
  38. package/dist/pcomponents/PBackground.d.ts.map +1 -0
  39. package/dist/pcomponents/PBackground.js +114 -0
  40. package/dist/pcomponents/PBackground.js.map +1 -0
  41. package/dist/pcomponents/PBasicMaterial.d.ts +22 -0
  42. package/dist/pcomponents/PBasicMaterial.d.ts.map +1 -0
  43. package/dist/pcomponents/PBasicMaterial.js +171 -0
  44. package/dist/pcomponents/PBasicMaterial.js.map +1 -0
  45. package/dist/pcomponents/PCollider.d.ts +18 -0
  46. package/dist/pcomponents/PCollider.d.ts.map +1 -0
  47. package/dist/pcomponents/PCollider.js +59 -0
  48. package/dist/pcomponents/PCollider.js.map +1 -0
  49. package/dist/pcomponents/PCubeGeometry.d.ts +8 -0
  50. package/dist/pcomponents/PCubeGeometry.d.ts.map +1 -0
  51. package/dist/pcomponents/PCubeGeometry.js +23 -0
  52. package/dist/pcomponents/PCubeGeometry.js.map +1 -0
  53. package/dist/pcomponents/PEnvironment.d.ts +12 -0
  54. package/dist/pcomponents/PEnvironment.d.ts.map +1 -0
  55. package/dist/pcomponents/PEnvironment.js +39 -0
  56. package/dist/pcomponents/PEnvironment.js.map +1 -0
  57. package/dist/pcomponents/PImageCache.d.ts +11 -0
  58. package/dist/pcomponents/PImageCache.d.ts.map +1 -0
  59. package/dist/pcomponents/PImageCache.js +38 -0
  60. package/dist/pcomponents/PImageCache.js.map +1 -0
  61. package/dist/pcomponents/PLight.d.ts +8 -0
  62. package/dist/pcomponents/PLight.d.ts.map +1 -0
  63. package/dist/pcomponents/PLight.js +45 -0
  64. package/dist/pcomponents/PLight.js.map +1 -0
  65. package/dist/pcomponents/PLightDirectional.d.ts +8 -0
  66. package/dist/pcomponents/PLightDirectional.d.ts.map +1 -0
  67. package/dist/pcomponents/PLightDirectional.js +36 -0
  68. package/dist/pcomponents/PLightDirectional.js.map +1 -0
  69. package/dist/pcomponents/PMaskedMaterial.d.ts +18 -0
  70. package/dist/pcomponents/PMaskedMaterial.d.ts.map +1 -0
  71. package/dist/pcomponents/PMaskedMaterial.js +200 -0
  72. package/dist/pcomponents/PMaskedMaterial.js.map +1 -0
  73. package/dist/pcomponents/PMaterialModifier.d.ts +12 -0
  74. package/dist/pcomponents/PMaterialModifier.d.ts.map +1 -0
  75. package/dist/pcomponents/PMaterialModifier.js +78 -0
  76. package/dist/pcomponents/PMaterialModifier.js.map +1 -0
  77. package/dist/pcomponents/PModelAnnotation.d.ts +11 -0
  78. package/dist/pcomponents/PModelAnnotation.d.ts.map +1 -0
  79. package/dist/pcomponents/PModelAnnotation.js +21 -0
  80. package/dist/pcomponents/PModelAnnotation.js.map +1 -0
  81. package/dist/pcomponents/PModelAnnotations.d.ts +10 -0
  82. package/dist/pcomponents/PModelAnnotations.d.ts.map +1 -0
  83. package/dist/pcomponents/PModelAnnotations.js +25 -0
  84. package/dist/pcomponents/PModelAnnotations.js.map +1 -0
  85. package/dist/pcomponents/PModelGLTF.d.ts +15 -0
  86. package/dist/pcomponents/PModelGLTF.d.ts.map +1 -0
  87. package/dist/pcomponents/PModelGLTF.js +111 -0
  88. package/dist/pcomponents/PModelGLTF.js.map +1 -0
  89. package/dist/pcomponents/PModelNode.d.ts +14 -0
  90. package/dist/pcomponents/PModelNode.d.ts.map +1 -0
  91. package/dist/pcomponents/PModelNode.js +82 -0
  92. package/dist/pcomponents/PModelNode.js.map +1 -0
  93. package/dist/pcomponents/PPhysicalMaterial.d.ts +15 -0
  94. package/dist/pcomponents/PPhysicalMaterial.d.ts.map +1 -0
  95. package/dist/pcomponents/PPhysicalMaterial.js +110 -0
  96. package/dist/pcomponents/PPhysicalMaterial.js.map +1 -0
  97. package/dist/pcomponents/PPlaneGeometry.d.ts +8 -0
  98. package/dist/pcomponents/PPlaneGeometry.d.ts.map +1 -0
  99. package/dist/pcomponents/PPlaneGeometry.js +23 -0
  100. package/dist/pcomponents/PPlaneGeometry.js.map +1 -0
  101. package/dist/pcomponents/PProjectRoot.d.ts +8 -0
  102. package/dist/pcomponents/PProjectRoot.d.ts.map +1 -0
  103. package/dist/pcomponents/PProjectRoot.js +24 -0
  104. package/dist/pcomponents/PProjectRoot.js.map +1 -0
  105. package/dist/pcomponents/PSlider.d.ts +18 -0
  106. package/dist/pcomponents/PSlider.d.ts.map +1 -0
  107. package/dist/pcomponents/PSlider.js +62 -0
  108. package/dist/pcomponents/PSlider.js.map +1 -0
  109. package/dist/pcomponents/PSound.d.ts +17 -0
  110. package/dist/pcomponents/PSound.d.ts.map +1 -0
  111. package/dist/pcomponents/PSound.js +119 -0
  112. package/dist/pcomponents/PSound.js.map +1 -0
  113. package/dist/pcomponents/PSphereGeometry.d.ts +9 -0
  114. package/dist/pcomponents/PSphereGeometry.d.ts.map +1 -0
  115. package/dist/pcomponents/PSphereGeometry.js +24 -0
  116. package/dist/pcomponents/PSphereGeometry.js.map +1 -0
  117. package/dist/pcomponents/PSprite.d.ts +13 -0
  118. package/dist/pcomponents/PSprite.d.ts.map +1 -0
  119. package/dist/pcomponents/PSprite.js +73 -0
  120. package/dist/pcomponents/PSprite.js.map +1 -0
  121. package/dist/pcomponents/PSpriteSheet.d.ts +13 -0
  122. package/dist/pcomponents/PSpriteSheet.d.ts.map +1 -0
  123. package/dist/pcomponents/PSpriteSheet.js +49 -0
  124. package/dist/pcomponents/PSpriteSheet.js.map +1 -0
  125. package/dist/pcomponents/PText.d.ts +9 -0
  126. package/dist/pcomponents/PText.d.ts.map +1 -0
  127. package/dist/pcomponents/PText.js +42 -0
  128. package/dist/pcomponents/PText.js.map +1 -0
  129. package/dist/pcomponents/PVideoPlayer.d.ts +5 -0
  130. package/dist/pcomponents/PVideoPlayer.d.ts.map +1 -0
  131. package/dist/pcomponents/PVideoPlayer.js +12 -0
  132. package/dist/pcomponents/PVideoPlayer.js.map +1 -0
  133. package/dist/pcomponents.d.ts +27 -0
  134. package/dist/pcomponents.d.ts.map +1 -0
  135. package/dist/pcomponents.js +33 -0
  136. package/dist/pcomponents.js.map +1 -0
  137. package/dist/postprocessing/PSSRPass.d.ts +19 -0
  138. package/dist/postprocessing/PSSRPass.d.ts.map +1 -0
  139. package/dist/postprocessing/PSSRPass.js +69 -0
  140. package/dist/postprocessing/PSSRPass.js.map +1 -0
  141. package/dist/postprocessing/ThreeJsPostProcessor.d.ts +32 -0
  142. package/dist/postprocessing/ThreeJsPostProcessor.d.ts.map +1 -0
  143. package/dist/postprocessing/ThreeJsPostProcessor.js +264 -0
  144. package/dist/postprocessing/ThreeJsPostProcessor.js.map +1 -0
  145. package/dist/three/ColliderObject3D.d.ts +19 -0
  146. package/dist/three/ColliderObject3D.d.ts.map +1 -0
  147. package/dist/three/ColliderObject3D.js +96 -0
  148. package/dist/three/ColliderObject3D.js.map +1 -0
  149. package/dist/three/FreeCameraControls.d.ts +32 -0
  150. package/dist/three/FreeCameraControls.d.ts.map +1 -0
  151. package/dist/three/FreeCameraControls.js +173 -0
  152. package/dist/three/FreeCameraControls.js.map +1 -0
  153. package/dist/three/OrbitCameraControls.d.ts +36 -0
  154. package/dist/three/OrbitCameraControls.d.ts.map +1 -0
  155. package/dist/three/OrbitCameraControls.js +306 -0
  156. package/dist/three/OrbitCameraControls.js.map +1 -0
  157. package/dist/three/VrCameraControls.d.ts +30 -0
  158. package/dist/three/VrCameraControls.d.ts.map +1 -0
  159. package/dist/three/VrCameraControls.js +142 -0
  160. package/dist/three/VrCameraControls.js.map +1 -0
  161. package/package.json +2 -2
@@ -0,0 +1,134 @@
1
+ import { NodeEvents, PAnimator as PAnimatorBase, } from "@p100-web/core";
2
+ export default class PAnimator extends PAnimatorBase {
3
+ constructor() {
4
+ super(...arguments);
5
+ this._animation = null;
6
+ this._playedDuration = 0;
7
+ this._segmentDuration = 0;
8
+ this._playing = false;
9
+ //
10
+ // INodeEventListener
11
+ //
12
+ this.onNodeEvent = (component, type, model) => {
13
+ if (!(type & NodeEvents.ModelLoaded))
14
+ return;
15
+ this._animation = null;
16
+ this.loaded = false;
17
+ this.validAnimation = false;
18
+ // We are updating the model
19
+ if (component !== null && model !== null) {
20
+ this._animation = component.getAnimation(this.clip);
21
+ this.validAnimation = this._animation !== null;
22
+ this.loaded = true;
23
+ }
24
+ };
25
+ this.onFinished = () => {
26
+ this._playedDuration = 0;
27
+ this._stop();
28
+ this.outport_onFinished?.emit(null);
29
+ };
30
+ this.updateSegment = (dt) => {
31
+ this._playedDuration += dt;
32
+ if (this._playedDuration >= this._segmentDuration) {
33
+ if (this.loop) {
34
+ this._playedDuration = 0;
35
+ this._animation.setTime(this.from);
36
+ }
37
+ else {
38
+ this._animation.setTime(this.to);
39
+ this._animation?.setPaused(true);
40
+ this.onFinished();
41
+ return;
42
+ }
43
+ }
44
+ this._animation?.update(dt);
45
+ };
46
+ this.update = (dt) => {
47
+ this._animation.update(dt);
48
+ };
49
+ }
50
+ getModelComponent() {
51
+ return this.findComponent("PModelGLTF");
52
+ }
53
+ render() {
54
+ // Find model
55
+ const model = this.getModelComponent();
56
+ if (model === null) {
57
+ this.context.error("Animator did not find model");
58
+ return;
59
+ }
60
+ model.node.addNodeEventListener(this);
61
+ }
62
+ unrender() {
63
+ if (this._playing) {
64
+ this._stop();
65
+ }
66
+ this._animation = null;
67
+ const model = this.getModelComponent();
68
+ model?.node.removeNodeEventListener(this);
69
+ this.loaded = false;
70
+ this.validAnimation = false;
71
+ }
72
+ getAnimationClips() {
73
+ const model = this.getModelComponent();
74
+ return model?.getAnimationNames() || [];
75
+ }
76
+ /**
77
+ * Stop playback and remove event listeners
78
+ */
79
+ _stop() {
80
+ if (this.segment) {
81
+ this.context.getCanvas().unregisterUpdate(this.updateSegment);
82
+ }
83
+ else {
84
+ this.context.getCanvas().unregisterUpdate(this.update);
85
+ this._animation?.removeFinishedListener(this.onFinished);
86
+ }
87
+ this._playing = false;
88
+ // Always call on stop
89
+ this.outport_onStopped?.emit(null);
90
+ }
91
+ callback_onPlay() {
92
+ if (this.clip === "")
93
+ return;
94
+ if (this._playing) {
95
+ console.log("this._playing: ", this._playing);
96
+ //this._stop();
97
+ }
98
+ if (this._animation !== null) {
99
+ if (this._animation.isRunning()) {
100
+ this.context.error("Animation was already running");
101
+ return;
102
+ }
103
+ this._playedDuration = 0;
104
+ this._segmentDuration = this.to - this.from;
105
+ this._animation.setLoop(this.loop);
106
+ if (this.segment) {
107
+ this._animation.setPaused(false);
108
+ this._animation.setTime(this.from);
109
+ this.context.getCanvas().registerUpdate(this.updateSegment);
110
+ }
111
+ else {
112
+ this._animation.setTime(0);
113
+ this._animation.addFinishedListener(this.onFinished);
114
+ this.context.getCanvas().registerUpdate(this.update);
115
+ }
116
+ this._playing = true;
117
+ this._animation.play();
118
+ this.outport_onPlay?.emit("");
119
+ }
120
+ else {
121
+ this.context.error("Animation not found: " + this.clip);
122
+ }
123
+ }
124
+ callback_onStop() {
125
+ console.log("callback_onStop: ");
126
+ if (this.clip === "")
127
+ return;
128
+ this._playedDuration = 0;
129
+ // This will reset animation
130
+ this._animation?.stop();
131
+ this._stop();
132
+ }
133
+ }
134
+ //# sourceMappingURL=PAnimator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PAnimator.js","sourceRoot":"","sources":["../../src/pcomponents/PAnimator.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,UAAU,EACV,SAAS,IAAI,aAAa,GAC3B,MAAM,gBAAgB,CAAC;AAExB,MAAM,CAAC,OAAO,OAAO,SACnB,SAAQ,aAAa;IADvB;;QAIY,eAAU,GAA2B,IAAI,CAAC;QAE5C,oBAAe,GAAG,CAAC,CAAC;QACpB,qBAAgB,GAAG,CAAC,CAAC;QACrB,aAAQ,GAAG,KAAK,CAAC;QA2BzB,EAAE;QACF,sBAAsB;QACtB,EAAE;QAEF,gBAAW,GAAG,CACZ,SAA2B,EAC3B,IAAgB,EAChB,KAAY,EACN,EAAE;YACR,IAAI,CAAC,CAAC,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC;gBAAE,OAAO;YAE7C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;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mB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACrD,IAAI,CAAC,OAAO,CAAC,SAAS,EAAG,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACxD,CAAC;YACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAEvB,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAQD,eAAe;QACb,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACjC,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE;YAAE,OAAO;QAC7B,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,4BAA4B;QAC5B,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CAqBF"}
@@ -0,0 +1,17 @@
1
+ import { MeshBasicMaterial, SphereGeometry, Texture } from "three";
2
+ import { PBackground as PBackgroundBase } from "@p100-web/core";
3
+ import { TextureTask, VideoTextureTask, ITextureTaskLoader, IVideoTextureTaskLoader } from "../assets/ThreeAssetLoader";
4
+ export default class PBackground extends PBackgroundBase implements ITextureTaskLoader, IVideoTextureTaskLoader {
5
+ protected _material: MeshBasicMaterial | null;
6
+ protected _geometry: SphereGeometry | null;
7
+ protected _texture: Texture | null;
8
+ _dispose(unrender: boolean): void;
9
+ unrender(): void;
10
+ render(): void;
11
+ getOpacity(): number;
12
+ setOpacity(value: number): void;
13
+ getTexture<T>(): T | null;
14
+ onVideoTextureTaskLoaded: (task: VideoTextureTask) => void;
15
+ onTextureTaskLoaded: (task: TextureTask) => void;
16
+ }
17
+ //# sourceMappingURL=PBackground.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PBackground.d.ts","sourceRoot":"","sources":["../../src/pcomponents/PBackground.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EACjB,cAAc,EACd,OAAO,EACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAAY,WAAW,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE1E,OAAyB,EACvB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,WACnB,SAAQ,eACR,YAAW,kBAAkB,EAAE,uBAAuB;IAEtD,SAAS,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IACrD,SAAS,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,CAAQ;IAClD,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAQ;IAE1C,QAAQ,CAAC,QAAQ,EAAE,OAAO;IAuB1B,QAAQ;IAIR,MAAM;IA6CN,UAAU,IAAI,MAAM;IAIpB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/B,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI;IAQzB,wBAAwB,GAAI,MAAM,gBAAgB,KAAG,IAAI,CAcvD;IAMF,mBAAmB,GAAI,MAAM,WAAW,KAAG,IAAI,CAc7C;CACH"}
@@ -0,0 +1,114 @@
1
+ import { BackSide, MathUtils, Mesh, MeshBasicMaterial, SphereGeometry, } from "three";
2
+ import { FileType, PBackground as PBackgroundBase } from "@p100-web/core";
3
+ export default class PBackground extends PBackgroundBase {
4
+ constructor() {
5
+ super(...arguments);
6
+ this._material = null;
7
+ this._geometry = null;
8
+ this._texture = null;
9
+ //
10
+ // VideoTextureTask
11
+ //
12
+ this.onVideoTextureTaskLoaded = (task) => {
13
+ if (this._material === null) {
14
+ this.context.error("onVideoTextureLoaded and material was null");
15
+ return;
16
+ }
17
+ if (task.texture === null) {
18
+ this.context.error("onVideoTextureLoaded and texture was null");
19
+ return;
20
+ }
21
+ const texture = task.texture;
22
+ this._material.map = texture;
23
+ this._material.needsUpdate = true;
24
+ this._texture = texture;
25
+ };
26
+ //
27
+ // TextureTask
28
+ //
29
+ this.onTextureTaskLoaded = (task) => {
30
+ if (this._material === null) {
31
+ this.context.error("onTextureLoaded and material was null");
32
+ return;
33
+ }
34
+ if (task.texture === null) {
35
+ this.context.error("onTextureLoaded and texture was null");
36
+ return;
37
+ }
38
+ const texture = task.texture;
39
+ this._material.map = texture;
40
+ this._material.needsUpdate = true;
41
+ this._texture = texture;
42
+ };
43
+ }
44
+ _dispose(unrender) {
45
+ // AssetLoader will take care of cleaning up the html elements
46
+ this._texture?.dispose();
47
+ this._texture = null;
48
+ // Check if we should dispose Material
49
+ if (this._material) {
50
+ this._material.map = null;
51
+ this._material.needsUpdate = true;
52
+ // Dispose material
53
+ if (unrender) {
54
+ this._material.dispose();
55
+ this._material = null;
56
+ }
57
+ }
58
+ if (unrender && this._geometry !== null) {
59
+ this._geometry.dispose();
60
+ this._geometry = null;
61
+ }
62
+ }
63
+ unrender() {
64
+ this._dispose(true);
65
+ }
66
+ render() {
67
+ const geometry = new SphereGeometry(this.radius, 32, 32);
68
+ this._geometry = geometry;
69
+ const mesh = new Mesh(geometry);
70
+ mesh.castShadow = false;
71
+ mesh.receiveShadow = false;
72
+ this.node.set_el(mesh);
73
+ mesh.rotation.y = MathUtils.degToRad(this.rotation);
74
+ const material = new MeshBasicMaterial({
75
+ color: 0xffffff,
76
+ map: null,
77
+ side: BackSide,
78
+ transparent: false,
79
+ fog: false,
80
+ // shadowSide: DoubleSide,
81
+ depthTest: true, // ?? maybe
82
+ depthWrite: true,
83
+ });
84
+ this._material = material;
85
+ mesh.material = material;
86
+ mesh.scale.x = mesh.scale.x * -1;
87
+ if (this.file_texture.file !== null) {
88
+ if (this.file_texture.file.type === FileType.Image) {
89
+ this.context
90
+ .assetLoader()
91
+ .addTextureTask(this, this.file_texture.file);
92
+ }
93
+ else if (this.file_texture.file.type === FileType.Video) {
94
+ this.context
95
+ .assetLoader()
96
+ .addVideoTextureTask(this, this.file_texture.file);
97
+ }
98
+ }
99
+ }
100
+ //
101
+ // IPMaterial
102
+ //
103
+ getOpacity() {
104
+ return this._material?.opacity || 0;
105
+ }
106
+ setOpacity(value) {
107
+ if (this._material)
108
+ this._material.opacity = value;
109
+ }
110
+ getTexture() {
111
+ return this._texture;
112
+ }
113
+ }
114
+ //# sourceMappingURL=PBackground.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PBackground.js","sourceRoot":"","sources":["../../src/pcomponents/PBackground.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,iBAAiB,EACjB,cAAc,GAEf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,QAAQ,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAS1E,MAAM,CAAC,OAAO,OAAO,WACnB,SAAQ,eAAe;IADzB;;QAIY,cAAS,GAA6B,IAAI,CAAC;QAC3C,cAAS,GAA0B,IAAI,CAAC;QACxC,aAAQ,GAAmB,IAAI,CAAC;QAsF1C,EAAE;QACF,oBAAoB;QACpB,EAAE;QAEF,6BAAwB,GAAG,CAAC,IAAsB,EAAQ,EAAE;YAC1D,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;gBAC5B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;gBACjE,OAAO;YACT,CAAC;YACD,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;gBAC1B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;gBAChE,OAAO;YACT,CAAC;YAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAC7B,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,OA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AAI,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACnD,IAAI,CAAC,OAAO;qBACT,WAAW,EAAoB;qBAC/B,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAClD,CAAC;iBAAM,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;gBAC1D,IAAI,CAAC,OAAO;qBACT,WAAW,EAAoB;qBAC/B,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC;IAED,EAAE;IACF,cAAc;IACd,EAAE;IAEF,UAAU;QACR,OAAO,IAAI,CAAC,SAAS,EAAE,OAAO,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,UAAU,CAAC,KAAa;QACtB,IAAI,IAAI,CAAC,SAAS;YAAE,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;IACrD,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,QAAa,CAAC;IAC5B,CAAC;CAyCF"}
@@ -0,0 +1,22 @@
1
+ import { MeshBasicMaterial, Texture } from "three";
2
+ import { INodeEventListener, INodeEventSender, PBasicMaterial as PBasicMaterialBase } from "@p100-web/core";
3
+ import { TextureTask, VideoTextureTask, ITextureTaskLoader, IVideoTextureTaskLoader } from "../assets/ThreeAssetLoader";
4
+ export default class PBasicMaterial extends PBasicMaterialBase implements ITextureTaskLoader, IVideoTextureTaskLoader, INodeEventSender {
5
+ protected _material: MeshBasicMaterial | null;
6
+ protected _texture: Texture | null;
7
+ _dispose(unrender: boolean): void;
8
+ unrender(): void;
9
+ render(): void;
10
+ getOpacity(): number;
11
+ setOpacity(value: number): void;
12
+ getTexture<T>(): T | null;
13
+ onAddNodeEventListener: (listener: INodeEventListener) => void;
14
+ callback_setOpacity(payloadValue: string | null): void;
15
+ onVideoTextureTaskLoaded: (task: VideoTextureTask) => void;
16
+ onTextureTaskLoaded: (task: TextureTask) => void;
17
+ /**
18
+ * Called by this component.
19
+ */
20
+ setTextureRepeat(): void;
21
+ }
22
+ //# sourceMappingURL=PBasicMaterial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PBasicMaterial.d.ts","sourceRoot":"","sources":["../../src/pcomponents/PBasicMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EAEjB,OAAO,EAER,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAEhB,cAAc,IAAI,kBAAkB,EACrC,MAAM,gBAAgB,CAAC;AAIxB,OAAyB,EACvB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,cACnB,SAAQ,kBACR,YAAW,kBAAkB,EAAE,uBAAuB,EAAE,gBAAgB;IAExE,SAAS,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IACrD,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAQ;IAM1C,QAAQ,CAAC,QAAQ,EAAE,OAAO;IAqB1B,QAAQ;IAKR,MAAM;IAoDN,UAAU,IAAI,MAAM;IAIpB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/B,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI;IAQzB,sBAAsB,GAAI,UAAU,kBAAkB,UAgBpD;IAMF,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAWtD,wBAAwB,GAAI,MAAM,gBAAgB,KAAG,IAAI,CAmBvD;IAMF,mBAAmB,GAAI,MAAM,WAAW,KAAG,IAAI,CAmB7C;IAMF;;OAEG;IACH,gBAAgB;CAajB"}
@@ -0,0 +1,171 @@
1
+ import { BackSide, ClampToEdgeWrapping, FrontSide, MeshBasicMaterial, RepeatWrapping, Vector2, } from "three";
2
+ import { NodeEvents, PBasicMaterial as PBasicMaterialBase, } from "@p100-web/core";
3
+ import { FileSubType, FileType } from "@p100-web/core";
4
+ export default class PBasicMaterial extends PBasicMaterialBase {
5
+ constructor() {
6
+ super(...arguments);
7
+ this._material = null;
8
+ this._texture = null;
9
+ //
10
+ // INodeEventSender
11
+ //
12
+ this.onAddNodeEventListener = (listener) => {
13
+ if (this.file_texture.file !== null && this._texture) {
14
+ if (this.file_texture.file.type === FileType.Image) {
15
+ listener.onNodeEvent(this, NodeEvents.ImageTextureLoaded, this._texture);
16
+ }
17
+ else if (this.file_texture.file.type === FileType.Video) {
18
+ listener.onNodeEvent(this, NodeEvents.VideoTextureLoaded, this._texture);
19
+ }
20
+ }
21
+ };
22
+ //
23
+ // VideoTextureTask
24
+ //
25
+ this.onVideoTextureTaskLoaded = (task) => {
26
+ if (this._material === null) {
27
+ this.context.error("onVideoTextureLoaded and material was null");
28
+ return;
29
+ }
30
+ if (task.texture === null) {
31
+ this.context.error("onVideoTextureLoaded and texture was null");
32
+ return;
33
+ }
34
+ this._texture = task.texture;
35
+ const texture = task.texture;
36
+ this._material.map = texture;
37
+ this._material.needsUpdate = true;
38
+ this.setTextureRepeat();
39
+ // Notify other components
40
+ this.node.emitNodeEvent(this, NodeEvents.VideoTextureLoaded, texture);
41
+ };
42
+ //
43
+ // TextureTask
44
+ //
45
+ this.onTextureTaskLoaded = (task) => {
46
+ if (this._material === null) {
47
+ this.context.error("onTextureLoaded and material was null");
48
+ return;
49
+ }
50
+ if (task.texture === null) {
51
+ this.context.error("onTextureLoaded and texture was null");
52
+ return;
53
+ }
54
+ this._texture = task.texture;
55
+ const texture = task.texture;
56
+ this._material.map = texture;
57
+ this._material.needsUpdate = true;
58
+ this.setTextureRepeat();
59
+ // Notify other components
60
+ this.node.emitNodeEvent(this, NodeEvents.ImageTextureLoaded, texture);
61
+ };
62
+ }
63
+ //
64
+ // PComponent
65
+ //
66
+ _dispose(unrender) {
67
+ if (this._texture !== null) {
68
+ // AssetLoader will take care of cleaning up the html elements
69
+ this._texture.dispose();
70
+ this._texture = null;
71
+ }
72
+ // Check if we should dispose Material
73
+ if (this._material) {
74
+ // Do we have a texture as well?
75
+ this._material.map = null;
76
+ this._material.needsUpdate = true;
77
+ // Dispose material
78
+ if (unrender) {
79
+ this._material.dispose();
80
+ this._material = null;
81
+ }
82
+ }
83
+ }
84
+ unrender() {
85
+ this.node.unregisterNodeEventSender(this);
86
+ this._dispose(true);
87
+ }
88
+ render() {
89
+ this.node.registerNodeEventSender(this);
90
+ if (!this.node.hasEl()) {
91
+ this.context.error("Material is missing Mesh");
92
+ return;
93
+ }
94
+ let inverted = this.inverted;
95
+ if (this.context.isInverted()) {
96
+ inverted = !inverted;
97
+ }
98
+ const material = new MeshBasicMaterial({
99
+ color: this.color,
100
+ map: null,
101
+ side: inverted ? BackSide : FrontSide,
102
+ opacity: this.opacity,
103
+ transparent: this.transparent,
104
+ fog: false,
105
+ // shadowSide: DoubleSide,
106
+ wireframe: false,
107
+ alphaTest: this.alphaTest,
108
+ depthWrite: this.depthWrite,
109
+ });
110
+ this._material = material;
111
+ const mesh = this.node.getEl();
112
+ mesh.material = material;
113
+ mesh.renderOrder = this.renderOrder;
114
+ if (this.file_texture.file !== null) {
115
+ // Check which loader to use
116
+ if (this.file_texture.file.type === FileType.Image) {
117
+ this.context
118
+ .assetLoader()
119
+ .addTextureTask(this, this.file_texture.file);
120
+ }
121
+ else if (this.file_texture.file.type === FileType.Video) {
122
+ this.context
123
+ .assetLoader()
124
+ .addVideoTextureTask(this, this.file_texture.file);
125
+ }
126
+ }
127
+ material.needsUpdate = true;
128
+ }
129
+ //
130
+ // IPMaterial
131
+ //
132
+ getOpacity() {
133
+ return this._material?.opacity || 0;
134
+ }
135
+ setOpacity(value) {
136
+ if (this._material)
137
+ this._material.opacity = value;
138
+ }
139
+ getTexture() {
140
+ return this._texture;
141
+ }
142
+ //
143
+ // Event Callbacks
144
+ //
145
+ callback_setOpacity(payloadValue) {
146
+ if (this._material && payloadValue) {
147
+ const opacity = parseFloat(payloadValue);
148
+ this._material.opacity = opacity;
149
+ }
150
+ }
151
+ //
152
+ // Tools
153
+ //
154
+ /**
155
+ * Called by this component.
156
+ */
157
+ setTextureRepeat() {
158
+ const texture = this._texture;
159
+ if (texture !== null) {
160
+ texture.wrapS = this.repeat.x > 1 ? RepeatWrapping : ClampToEdgeWrapping;
161
+ texture.wrapT = this.repeat.y > 1 ? RepeatWrapping : ClampToEdgeWrapping;
162
+ const repeatY = this.file_texture.file.subType === FileSubType.Stereo ? 0.5 : 1;
163
+ texture.repeat = new Vector2(this.repeat.x, this.repeat.y * repeatY);
164
+ texture.offset = new Vector2(this.offset.x, this.offset.y);
165
+ if (this._material)
166
+ this._material.needsUpdate = true;
167
+ texture.needsUpdate = true;
168
+ }
169
+ }
170
+ }
171
+ //# sourceMappingURL=PBasicMaterial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PBasicMaterial.js","sourceRoot":"","sources":["../../src/pcomponents/PBasicMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,SAAS,EAET,iBAAiB,EACjB,cAAc,EAEd,OAAO,GACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAGL,UAAU,EACV,cAAc,IAAI,kBAAkB,GACrC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AASvD,MAAM,CAAC,OAAO,OAAO,cACnB,SAAQ,kBAAkB;IAD5B;;QAIY,cAAS,GAA6B,IAAI,CAAC;QAC3C,aAAQ,GAAmB,IAAI,CAAC;QAgG1C,EAAE;QACF,oBAAoB;QACpB,EAAE;QAEF,2BAAsB,GAAG,CAAC,QAA4B,EAAE,EAAE;YACxD,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CA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G,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,mBAAmB,CAAC;YACzE,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,mBAAmB,CAAC;YACzE,MAAM,OAAO,GACX,IAAI,CAAC,YAAY,CAAC,IAAK,CAAC,OAAO,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACnE,OAAO,CAAC,MAAM,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;YACrE,OAAO,CAAC,MAAM,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC3D,IAAI,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;YACtD,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ import ColliderObject3D from "../three/ColliderObject3D";
2
+ import { PCollider as PColliderBase } from "@p100-web/core";
3
+ export default class PCollider extends PColliderBase {
4
+ protected _el: ColliderObject3D | null;
5
+ protected _unrender(): void;
6
+ dispose(): void;
7
+ render(): void;
8
+ unrender(): void;
9
+ protected computeBounds(): void;
10
+ show(): void;
11
+ hide(): void;
12
+ /**
13
+ * This is called by PNode->set_el
14
+ */
15
+ addColliderObject(): void;
16
+ removeColliderObject(): void;
17
+ }
18
+ //# sourceMappingURL=PCollider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PCollider.d.ts","sourceRoot":"","sources":["../../src/pcomponents/PCollider.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI5D,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,aAAa;IAClD,SAAS,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAE9C,SAAS,CAAC,SAAS;IAUnB,OAAO,IAAI,IAAI;IAMf,MAAM;IAGN,QAAQ;IAIR,SAAS,CAAC,aAAa;IAIvB,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;IAIZ;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAqBzB,oBAAoB,IAAI,IAAI;CAG7B"}
@@ -0,0 +1,59 @@
1
+ import ColliderObject3D from "../three/ColliderObject3D";
2
+ import { PCollider as PColliderBase } from "@p100-web/core";
3
+ export default class PCollider extends PColliderBase {
4
+ constructor() {
5
+ super(...arguments);
6
+ this._el = null;
7
+ }
8
+ _unrender() {
9
+ if (this._el !== null) {
10
+ // Add me to the raycaster
11
+ this.context.getPCanvas().removeCollider(this._el);
12
+ this._el.dispose();
13
+ this._el.removeFromParent();
14
+ this._el = null;
15
+ }
16
+ }
17
+ dispose() {
18
+ if (this.node.collider === this) {
19
+ this.node.collider = null;
20
+ }
21
+ }
22
+ render() {
23
+ }
24
+ unrender() {
25
+ this._unrender();
26
+ }
27
+ computeBounds() {
28
+ this._el?.computeBounds(this);
29
+ }
30
+ show() {
31
+ this._el?.show(this);
32
+ }
33
+ hide() {
34
+ this._el?.hide();
35
+ }
36
+ /**
37
+ * This is called by PNode->set_el
38
+ */
39
+ addColliderObject() {
40
+ if (!this.node.hasEl()) {
41
+ this.context.error("PCollider had no el");
42
+ return;
43
+ }
44
+ if (this._el) {
45
+ this.context.error("PCollider already had ColliderObject3D");
46
+ return;
47
+ }
48
+ this._el = new ColliderObject3D(this);
49
+ const nodeEl = this.node.getEl();
50
+ nodeEl.add(this._el);
51
+ this.computeBounds();
52
+ // Add me to the raycaster
53
+ this.context.getPCanvas().addCollider(this._el);
54
+ }
55
+ removeColliderObject() {
56
+ this._unrender();
57
+ }
58
+ }
59
+ //# sourceMappingURL=PCollider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PCollider.js","sourceRoot":"","sources":["../../src/pcomponents/PCollider.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI5D,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,aAAa;IAApD;;QACY,QAAG,GAA4B,IAAI,CAAC;IAgEhD,CAAC;IA9DW,SAAS;QACjB,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;YACtB,0BAA0B;YAC1B,IAAI,CAAC,OAAO,CAAC,UAAU,EAAe,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAChE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;YAC5B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,MAAM;IACN,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAES,aAAa;QACrB,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,IAAI;QACF,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,IAAI;QACF,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;YACvB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;YAC1C,OAAO;QACT,CAAC;QAED,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;YAC7D,OAAO;QACT,CAAC;QAED,IAAI,CAAC,GAAG,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAEtC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAY,CAAC;QAE3C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,0BAA0B;QAC1B,IAAI,CAAC,OAAO,CAAC,UAAU,EAAe,CAAC,WAAW,CAAC,IAAI,CAAC,GAAI,CAAC,CAAC;IAChE,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ import { Mesh } from "three";
2
+ import { PCubeGeometry as PCubeGeometryBase } from "@p100-web/core";
3
+ export default class PCubeGeometry extends PCubeGeometryBase {
4
+ protected _mesh: Mesh | null;
5
+ unrender(): void;
6
+ render(): void;
7
+ }
8
+ //# sourceMappingURL=PCubeGeometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PCubeGeometry.d.ts","sourceRoot":"","sources":["../../src/pcomponents/PCubeGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,iBAAiB;IAC1D,SAAS,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEpC,QAAQ;IAOR,MAAM;CAQP"}
@@ -0,0 +1,23 @@
1
+ import { Mesh, BoxGeometry } from "three";
2
+ import { PCubeGeometry as PCubeGeometryBase } from "@p100-web/core";
3
+ export default class PCubeGeometry extends PCubeGeometryBase {
4
+ constructor() {
5
+ super(...arguments);
6
+ this._mesh = null;
7
+ }
8
+ unrender() {
9
+ if (this._mesh) {
10
+ this._mesh.geometry.dispose();
11
+ this._mesh = null;
12
+ }
13
+ }
14
+ render() {
15
+ const geometry = new BoxGeometry(this.size.x, this.size.y, this.size.z);
16
+ const mesh = new Mesh(geometry);
17
+ mesh.castShadow = this.castShadow;
18
+ mesh.receiveShadow = this.receiveShadow;
19
+ this.node.set_el(mesh);
20
+ this._mesh = mesh;
21
+ }
22
+ }
23
+ //# sourceMappingURL=PCubeGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PCubeGeometry.js","sourceRoot":"","sources":["../../src/pcomponents/PCubeGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,iBAAiB;IAA5D;;QACY,UAAK,GAAgB,IAAI,CAAC;IAiBtC,CAAC;IAfC,QAAQ;QACN,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxE,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QACxC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { Texture } from "three";
2
+ import { PEnvironment as PEnvironmentBase } from "@p100-web/core";
3
+ import { HDRTextureTask, type IHDRTextureTaskLoader } from "../assets/ThreeAssetLoader";
4
+ export default class PEnvironment extends PEnvironmentBase implements IHDRTextureTaskLoader {
5
+ _texture: Texture | null;
6
+ getTexture<T>(): T | null;
7
+ _dispose(): void;
8
+ unrender(): void;
9
+ render(): void;
10
+ onHDRTextureTaskLoaded: (task: HDRTextureTask) => void;
11
+ }
12
+ //# sourceMappingURL=PEnvironment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PEnvironment.d.ts","sourceRoot":"","sources":["../../src/pcomponents/PEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlE,OAAyB,EACvB,cAAc,EACd,KAAK,qBAAqB,EAC3B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,YACnB,SAAQ,gBACR,YAAW,qBAAqB;IAEhC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAQ;IAEhC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI;IAQzB,QAAQ;IASR,QAAQ;IAIR,MAAM;IAWN,sBAAsB,GAAI,MAAM,cAAc,KAAG,IAAI,CAInD;CACH"}