@p100-web/core-three 100.0.65 → 100.0.66
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.
- package/package.json +2 -2
- package/dist/src/App.d.ts +0 -40
- package/dist/src/App.d.ts.map +0 -1
- package/dist/src/App.js +0 -171
- package/dist/src/App.js.map +0 -1
- package/dist/src/ComponentFactory.d.ts +0 -5
- package/dist/src/ComponentFactory.d.ts.map +0 -1
- package/dist/src/ComponentFactory.js +0 -17
- package/dist/src/ComponentFactory.js.map +0 -1
- package/dist/src/PCanvas.d.ts +0 -171
- package/dist/src/PCanvas.d.ts.map +0 -1
- package/dist/src/PCanvas.js +0 -992
- package/dist/src/PCanvas.js.map +0 -1
- package/dist/src/ThreeEngine.d.ts +0 -25
- package/dist/src/ThreeEngine.d.ts.map +0 -1
- package/dist/src/ThreeEngine.js +0 -102
- package/dist/src/ThreeEngine.js.map +0 -1
- package/dist/src/ThreeNodeRenderer.d.ts +0 -32
- package/dist/src/ThreeNodeRenderer.d.ts.map +0 -1
- package/dist/src/ThreeNodeRenderer.js +0 -87
- package/dist/src/ThreeNodeRenderer.js.map +0 -1
- package/dist/src/media/AudioLoader.d.ts +0 -32
- package/dist/src/media/AudioLoader.d.ts.map +0 -1
- package/dist/src/media/AudioLoader.js +0 -110
- package/dist/src/media/AudioLoader.js.map +0 -1
- package/dist/src/media/EnvironmentLoader.d.ts +0 -40
- package/dist/src/media/EnvironmentLoader.d.ts.map +0 -1
- package/dist/src/media/EnvironmentLoader.js +0 -120
- package/dist/src/media/EnvironmentLoader.js.map +0 -1
- package/dist/src/media/ImageLoader.d.ts +0 -36
- package/dist/src/media/ImageLoader.d.ts.map +0 -1
- package/dist/src/media/ImageLoader.js +0 -160
- package/dist/src/media/ImageLoader.js.map +0 -1
- package/dist/src/media/MediaLoader.d.ts +0 -14
- package/dist/src/media/MediaLoader.d.ts.map +0 -1
- package/dist/src/media/MediaLoader.js +0 -70
- package/dist/src/media/MediaLoader.js.map +0 -1
- package/dist/src/media/ModelLoader.d.ts +0 -49
- package/dist/src/media/ModelLoader.d.ts.map +0 -1
- package/dist/src/media/ModelLoader.js +0 -223
- package/dist/src/media/ModelLoader.js.map +0 -1
- package/dist/src/media/VideoLoader.d.ts +0 -35
- package/dist/src/media/VideoLoader.d.ts.map +0 -1
- package/dist/src/media/VideoLoader.js +0 -105
- package/dist/src/media/VideoLoader.js.map +0 -1
- package/dist/src/pcomponents/PAnimator.d.ts +0 -24
- package/dist/src/pcomponents/PAnimator.d.ts.map +0 -1
- package/dist/src/pcomponents/PAnimator.js +0 -129
- package/dist/src/pcomponents/PAnimator.js.map +0 -1
- package/dist/src/pcomponents/PBasicMaterial.d.ts +0 -17
- package/dist/src/pcomponents/PBasicMaterial.d.ts.map +0 -1
- package/dist/src/pcomponents/PBasicMaterial.js +0 -142
- package/dist/src/pcomponents/PBasicMaterial.js.map +0 -1
- package/dist/src/pcomponents/PCollider.d.ts +0 -11
- package/dist/src/pcomponents/PCollider.d.ts.map +0 -1
- package/dist/src/pcomponents/PCollider.js +0 -61
- package/dist/src/pcomponents/PCollider.js.map +0 -1
- package/dist/src/pcomponents/PCubeGeometry.d.ts +0 -8
- package/dist/src/pcomponents/PCubeGeometry.d.ts.map +0 -1
- package/dist/src/pcomponents/PCubeGeometry.js +0 -23
- package/dist/src/pcomponents/PCubeGeometry.js.map +0 -1
- package/dist/src/pcomponents/PEnvironment.d.ts +0 -14
- package/dist/src/pcomponents/PEnvironment.d.ts.map +0 -1
- package/dist/src/pcomponents/PEnvironment.js +0 -86
- package/dist/src/pcomponents/PEnvironment.js.map +0 -1
- package/dist/src/pcomponents/PImageBackground.d.ts +0 -14
- package/dist/src/pcomponents/PImageBackground.d.ts.map +0 -1
- package/dist/src/pcomponents/PImageBackground.js +0 -85
- package/dist/src/pcomponents/PImageBackground.js.map +0 -1
- package/dist/src/pcomponents/PLight.d.ts +0 -8
- package/dist/src/pcomponents/PLight.d.ts.map +0 -1
- package/dist/src/pcomponents/PLight.js +0 -22
- package/dist/src/pcomponents/PLight.js.map +0 -1
- package/dist/src/pcomponents/PLightDirectional.d.ts +0 -8
- package/dist/src/pcomponents/PLightDirectional.d.ts.map +0 -1
- package/dist/src/pcomponents/PLightDirectional.js +0 -36
- package/dist/src/pcomponents/PLightDirectional.js.map +0 -1
- package/dist/src/pcomponents/PMaskedMaterial.d.ts +0 -17
- package/dist/src/pcomponents/PMaskedMaterial.d.ts.map +0 -1
- package/dist/src/pcomponents/PMaskedMaterial.js +0 -214
- package/dist/src/pcomponents/PMaskedMaterial.js.map +0 -1
- package/dist/src/pcomponents/PModelGLTF.d.ts +0 -18
- package/dist/src/pcomponents/PModelGLTF.d.ts.map +0 -1
- package/dist/src/pcomponents/PModelGLTF.js +0 -98
- package/dist/src/pcomponents/PModelGLTF.js.map +0 -1
- package/dist/src/pcomponents/PPhysicalMaterial.d.ts +0 -13
- package/dist/src/pcomponents/PPhysicalMaterial.d.ts.map +0 -1
- package/dist/src/pcomponents/PPhysicalMaterial.js +0 -106
- package/dist/src/pcomponents/PPhysicalMaterial.js.map +0 -1
- package/dist/src/pcomponents/PPlaneGeometry.d.ts +0 -8
- package/dist/src/pcomponents/PPlaneGeometry.d.ts.map +0 -1
- package/dist/src/pcomponents/PPlaneGeometry.js +0 -23
- package/dist/src/pcomponents/PPlaneGeometry.js.map +0 -1
- package/dist/src/pcomponents/PProjectRoot.d.ts +0 -8
- package/dist/src/pcomponents/PProjectRoot.d.ts.map +0 -1
- package/dist/src/pcomponents/PProjectRoot.js +0 -24
- package/dist/src/pcomponents/PProjectRoot.js.map +0 -1
- package/dist/src/pcomponents/PSlider.d.ts +0 -16
- package/dist/src/pcomponents/PSlider.d.ts.map +0 -1
- package/dist/src/pcomponents/PSlider.js +0 -69
- package/dist/src/pcomponents/PSlider.js.map +0 -1
- package/dist/src/pcomponents/PSound.d.ts +0 -17
- package/dist/src/pcomponents/PSound.d.ts.map +0 -1
- package/dist/src/pcomponents/PSound.js +0 -110
- package/dist/src/pcomponents/PSound.js.map +0 -1
- package/dist/src/pcomponents/PSphereGeometry.d.ts +0 -9
- package/dist/src/pcomponents/PSphereGeometry.d.ts.map +0 -1
- package/dist/src/pcomponents/PSphereGeometry.js +0 -24
- package/dist/src/pcomponents/PSphereGeometry.js.map +0 -1
- package/dist/src/pcomponents/PSprite.d.ts +0 -14
- package/dist/src/pcomponents/PSprite.d.ts.map +0 -1
- package/dist/src/pcomponents/PSprite.js +0 -79
- package/dist/src/pcomponents/PSprite.js.map +0 -1
- package/dist/src/pcomponents/PSpriteAnimation.d.ts +0 -15
- package/dist/src/pcomponents/PSpriteAnimation.d.ts.map +0 -1
- package/dist/src/pcomponents/PSpriteAnimation.js +0 -80
- package/dist/src/pcomponents/PSpriteAnimation.js.map +0 -1
- package/dist/src/pcomponents/PText.d.ts +0 -10
- package/dist/src/pcomponents/PText.d.ts.map +0 -1
- package/dist/src/pcomponents/PText.js +0 -44
- package/dist/src/pcomponents/PText.js.map +0 -1
- package/dist/src/pcomponents/PVideoBackground.d.ts +0 -13
- package/dist/src/pcomponents/PVideoBackground.d.ts.map +0 -1
- package/dist/src/pcomponents/PVideoBackground.js +0 -85
- package/dist/src/pcomponents/PVideoBackground.js.map +0 -1
- package/dist/src/pcomponents/PVideoPlayer.d.ts +0 -5
- package/dist/src/pcomponents/PVideoPlayer.d.ts.map +0 -1
- package/dist/src/pcomponents/PVideoPlayer.js +0 -12
- package/dist/src/pcomponents/PVideoPlayer.js.map +0 -1
- package/dist/src/postprocessing/PSSRPass.d.ts +0 -19
- package/dist/src/postprocessing/PSSRPass.d.ts.map +0 -1
- package/dist/src/postprocessing/PSSRPass.js +0 -69
- package/dist/src/postprocessing/PSSRPass.js.map +0 -1
- package/dist/src/postprocessing/ThreeJsPostProcessor.d.ts +0 -32
- package/dist/src/postprocessing/ThreeJsPostProcessor.d.ts.map +0 -1
- package/dist/src/postprocessing/ThreeJsPostProcessor.js +0 -264
- package/dist/src/postprocessing/ThreeJsPostProcessor.js.map +0 -1
- package/dist/src/three/ColliderObject3D.d.ts +0 -19
- package/dist/src/three/ColliderObject3D.d.ts.map +0 -1
- package/dist/src/three/ColliderObject3D.js +0 -146
- package/dist/src/three/ColliderObject3D.js.map +0 -1
- package/dist/src/three/FreeCameraControls.d.ts +0 -30
- package/dist/src/three/FreeCameraControls.d.ts.map +0 -1
- package/dist/src/three/FreeCameraControls.js +0 -158
- package/dist/src/three/FreeCameraControls.js.map +0 -1
- package/dist/src/three/OrbitCameraControls.d.ts +0 -24
- package/dist/src/three/OrbitCameraControls.d.ts.map +0 -1
- package/dist/src/three/OrbitCameraControls.js +0 -81
- package/dist/src/three/OrbitCameraControls.js.map +0 -1
- package/dist/src/three/VrCameraControls.d.ts +0 -28
- package/dist/src/three/VrCameraControls.d.ts.map +0 -1
- package/dist/src/three/VrCameraControls.js +0 -124
- package/dist/src/three/VrCameraControls.js.map +0 -1
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { BackSide, ClampToEdgeWrapping, FrontSide, MeshBasicMaterial, RepeatWrapping, Texture, Vector2, SRGBColorSpace, VideoTexture, } from "three";
|
|
2
|
-
import { 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._cacheKey = 0;
|
|
9
|
-
}
|
|
10
|
-
//
|
|
11
|
-
// PComponent
|
|
12
|
-
//
|
|
13
|
-
_dispose(unrender) {
|
|
14
|
-
if (this.file_texture) {
|
|
15
|
-
if (this.file_texture.type === FileType.Image) {
|
|
16
|
-
this.context
|
|
17
|
-
.imageLoader()
|
|
18
|
-
.disposeImage(this, this.file_texture, this._cacheKey);
|
|
19
|
-
}
|
|
20
|
-
else if (this.file_texture.type === FileType.Video) {
|
|
21
|
-
// Notify any video player
|
|
22
|
-
const videoPlayer = this.node.findComponent("PVideoPlayer");
|
|
23
|
-
videoPlayer?.onDisposeMaterial();
|
|
24
|
-
this.context.videoLoader().disposeVideo(this, this.file_texture);
|
|
25
|
-
}
|
|
26
|
-
this._cacheKey = 0;
|
|
27
|
-
}
|
|
28
|
-
// Check if we should dispose Material
|
|
29
|
-
if (this._material) {
|
|
30
|
-
// Do we have a texture as well?
|
|
31
|
-
if (this._material.map) {
|
|
32
|
-
this._material.map.dispose();
|
|
33
|
-
this._material.map.source.data = null;
|
|
34
|
-
this._material.map = null;
|
|
35
|
-
}
|
|
36
|
-
this._material.needsUpdate = true;
|
|
37
|
-
// Dispose material
|
|
38
|
-
if (unrender) {
|
|
39
|
-
this._material.dispose();
|
|
40
|
-
this._material = null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
render() {
|
|
45
|
-
// Register as material for PNode
|
|
46
|
-
this.node.material = this;
|
|
47
|
-
if (!this.node.hasEl()) {
|
|
48
|
-
this.context.error("Material is missing Mesh");
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const material = new MeshBasicMaterial({
|
|
52
|
-
color: this.color,
|
|
53
|
-
map: null,
|
|
54
|
-
side: this.inverted ? BackSide : FrontSide,
|
|
55
|
-
opacity: this.opacity,
|
|
56
|
-
transparent: this.transparent,
|
|
57
|
-
fog: false,
|
|
58
|
-
// shadowSide: DoubleSide,
|
|
59
|
-
wireframe: false,
|
|
60
|
-
alphaTest: this.alphaTest,
|
|
61
|
-
depthWrite: this.depthWrite,
|
|
62
|
-
});
|
|
63
|
-
this._material = material;
|
|
64
|
-
const mesh = this.node.getEl();
|
|
65
|
-
mesh.material = material;
|
|
66
|
-
mesh.renderOrder = this.renderOrder;
|
|
67
|
-
if (this.file_texture !== null) {
|
|
68
|
-
// Check which loader to use
|
|
69
|
-
if (this.file_texture.type === FileType.Image)
|
|
70
|
-
this.context.imageLoader().load(this, this.file_texture);
|
|
71
|
-
else if (this.file_texture.type === FileType.Video)
|
|
72
|
-
this.context.videoLoader().load(this, this.file_texture);
|
|
73
|
-
else
|
|
74
|
-
this.context.error("Unsuppotred material texture");
|
|
75
|
-
}
|
|
76
|
-
material.needsUpdate = true;
|
|
77
|
-
}
|
|
78
|
-
//
|
|
79
|
-
// Event Callbacks
|
|
80
|
-
//
|
|
81
|
-
callback_setOpacity(payloadValue) {
|
|
82
|
-
if (this._material && payloadValue) {
|
|
83
|
-
const opacity = parseFloat(payloadValue);
|
|
84
|
-
this._material.opacity = opacity;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
//
|
|
88
|
-
// IVideoLoader
|
|
89
|
-
//
|
|
90
|
-
onVideoLoaded(file, value) {
|
|
91
|
-
if (this._material === null) {
|
|
92
|
-
this.context.error("onVideoLoaded and material was null");
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const texture = new VideoTexture(value);
|
|
96
|
-
texture.colorSpace = SRGBColorSpace;
|
|
97
|
-
if (file.subType === FileSubType.Stereo)
|
|
98
|
-
texture.repeat = new Vector2(1, 0.5);
|
|
99
|
-
this._material.map = texture;
|
|
100
|
-
this.setTextureRepeat();
|
|
101
|
-
this._material.needsUpdate = true;
|
|
102
|
-
}
|
|
103
|
-
//
|
|
104
|
-
// IImageLoader
|
|
105
|
-
//
|
|
106
|
-
onImageLoaded(file, data, cacheKey) {
|
|
107
|
-
this._cacheKey = cacheKey;
|
|
108
|
-
if (this._material === null) {
|
|
109
|
-
this.context.error("onImageLoaded and material was null");
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const texture = new Texture();
|
|
113
|
-
texture.userData.id = file._id;
|
|
114
|
-
texture.colorSpace = SRGBColorSpace;
|
|
115
|
-
texture.image = data;
|
|
116
|
-
if (file.subType === FileSubType.Stereo)
|
|
117
|
-
texture.repeat = new Vector2(1, 0.5);
|
|
118
|
-
this._material.map = texture;
|
|
119
|
-
this.setTextureRepeat();
|
|
120
|
-
this._material.needsUpdate = true;
|
|
121
|
-
}
|
|
122
|
-
//
|
|
123
|
-
// Tools
|
|
124
|
-
//
|
|
125
|
-
/**
|
|
126
|
-
* Called by this component and eg PSpriteAnimation.
|
|
127
|
-
*/
|
|
128
|
-
setTextureRepeat() {
|
|
129
|
-
const texture = this.getTexture();
|
|
130
|
-
if (texture !== null) {
|
|
131
|
-
texture.wrapS = this.repeat.x > 1 ? RepeatWrapping : ClampToEdgeWrapping;
|
|
132
|
-
texture.wrapT = this.repeat.y > 1 ? RepeatWrapping : ClampToEdgeWrapping;
|
|
133
|
-
const repeatY = this.file_texture.subType === FileSubType.Stereo ? 0.5 : 1;
|
|
134
|
-
texture.repeat = new Vector2(this.repeat.x, this.repeat.y * repeatY);
|
|
135
|
-
texture.offset = new Vector2(this.offset.x, this.offset.y);
|
|
136
|
-
if (this._material)
|
|
137
|
-
this._material.needsUpdate = true;
|
|
138
|
-
texture.needsUpdate = true;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
//# sourceMappingURL=PBasicMaterial.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EACd,OAAO,EACP,OAAO,EACP,cAAc,EACd,YAAY,GACb,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EACL,WAAW,EACX,QAAQ,GAIT,MAAM,gBAAgB,CAAC;AAExB,MAAM,CAAC,OAAO,OAAO,cACnB,SAAQ,kBAAkB;IAD5B;;QAIY,cAAS,GAA6B,IAAI,CAAC;QACrD,cAAS,GAAG,CAAC,CAAC;IA6JhB,CAAC;IA3JC,EAAE;IACF,cAAc;IACd,EAAE;IAEF,QAAQ,CAAC,QAAiB;Q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ACrE,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"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import ColliderObject3D from "../three/ColliderObject3D";
|
|
2
|
-
import { PCollider as PColliderBase, type IColliderObject } from "@p100-web/core";
|
|
3
|
-
export default class PCollider extends PColliderBase {
|
|
4
|
-
protected _el: ColliderObject3D | null;
|
|
5
|
-
getColliderObject(): IColliderObject | null;
|
|
6
|
-
render(): void;
|
|
7
|
-
addColliderNode(): void;
|
|
8
|
-
unrender(): void;
|
|
9
|
-
computeBounds(): void;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=PCollider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PCollider.d.ts","sourceRoot":"","sources":["../../../src/pcomponents/PCollider.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,aAAa;IAClD,SAAS,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAE9C,iBAAiB,IAAI,eAAe,GAAG,IAAI;IAI3C,MAAM;IAaN,eAAe;IAsBf,QAAQ;IAiBR,aAAa;CAKd"}
|
|
@@ -1,61 +0,0 @@
|
|
|
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
|
-
getColliderObject() {
|
|
9
|
-
return this._el;
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
this.node.collider = this;
|
|
13
|
-
if (this.box || this.sphere) {
|
|
14
|
-
this._el = new ColliderObject3D(this);
|
|
15
|
-
}
|
|
16
|
-
// If we have a parent, add us directly
|
|
17
|
-
if (this.node.hasEl()) {
|
|
18
|
-
this.addColliderNode();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
addColliderNode() {
|
|
22
|
-
if (!this.node.hasEl()) {
|
|
23
|
-
this.context.error("PCollider had no el");
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const nodeEl = this.node.getEl();
|
|
27
|
-
if (this._el) {
|
|
28
|
-
nodeEl.add(this._el);
|
|
29
|
-
this.computeBounds();
|
|
30
|
-
// Add me to the raycaster
|
|
31
|
-
this.context.getPCanvas().addCollider(this._el);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
// Add me to the raycaster
|
|
35
|
-
nodeEl.layers.mask = 3;
|
|
36
|
-
nodeEl.userData.collider = this;
|
|
37
|
-
this.context.getPCanvas().addCollider(nodeEl);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
unrender() {
|
|
41
|
-
if (this._el !== null) {
|
|
42
|
-
// Add me to the raycaster
|
|
43
|
-
this.context.getPCanvas().removeCollider(this._el);
|
|
44
|
-
this._el.removeFromParent();
|
|
45
|
-
this._el.dispose();
|
|
46
|
-
this._el = null;
|
|
47
|
-
}
|
|
48
|
-
else if (this.node.hasEl()) {
|
|
49
|
-
const nodeEl = this.node.getEl();
|
|
50
|
-
nodeEl.layers.mask = 1;
|
|
51
|
-
nodeEl.userData.collider = null;
|
|
52
|
-
this.context.getPCanvas().removeCollider(nodeEl);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
computeBounds() {
|
|
56
|
-
if (this._el !== null) {
|
|
57
|
-
this._el.computeBounds();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=PCollider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PCollider.js","sourceRoot":"","sources":["../../../src/pcomponents/PCollider.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,SAAS,IAAI,aAAa,GAE3B,MAAM,gBAAgB,CAAC;AAIxB,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,aAAa;IAApD;;QACY,QAAG,GAA4B,IAAI,CAAC;IA+DhD,CAAC;IA7DC,iBAAiB;QACf,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAE1B,IAAI,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,CAAC,GAAG,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC;QAED,uCAAuC;QACvC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;YACtB,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;IAED,eAAe;QACb,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,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAY,CAAC;QAE3C,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAI,CAAC,CAAC;YACtB,IAAI,CAAC,aAAa,EAAE,CAAC;YAErB,0BAA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ometry 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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,23 +0,0 @@
|
|
|
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, false);
|
|
20
|
-
this._mesh = mesh;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=PCubeGeometry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,KAAK,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Texture } from "three";
|
|
2
|
-
import { PEnvironment as PEnvironmentBase } from "@p100-web/core";
|
|
3
|
-
import { IImageLoader, PFile } from "@p100-web/core";
|
|
4
|
-
export default class PEnvironment extends PEnvironmentBase implements IImageLoader {
|
|
5
|
-
_texture: Texture | null;
|
|
6
|
-
_cacheKey: number;
|
|
7
|
-
getTexture(): Texture | null;
|
|
8
|
-
_dispose(): void;
|
|
9
|
-
unrender(): void;
|
|
10
|
-
render(): void;
|
|
11
|
-
onEnvironmentLoaded(_file: PFile, texture: Texture): void;
|
|
12
|
-
onImageLoaded(file: PFile, data: any, cacheKey: number): void;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=PEnvironment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PEnvironment.d.ts","sourceRoot":"","sources":["../../../src/pcomponents/PEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,EACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAY,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAG/D,MAAM,CAAC,OAAO,OAAO,YACnB,SAAQ,gBACR,YAAW,YAAY;IAEvB,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAQ;IAChC,SAAS,SAAK;IAEd,UAAU,IAAI,OAAO,GAAG,IAAI;IAQ5B,QAAQ;IAsBR,QAAQ;IAIR,MAAM;IAeN,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAgBzD,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CA0B9D"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { EquirectangularReflectionMapping, SRGBColorSpace, Texture, } from "three";
|
|
2
|
-
import { PEnvironment as PEnvironmentBase } from "@p100-web/core";
|
|
3
|
-
import { FileType } from "@p100-web/core";
|
|
4
|
-
export default class PEnvironment extends PEnvironmentBase {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this._texture = null;
|
|
8
|
-
this._cacheKey = 0;
|
|
9
|
-
}
|
|
10
|
-
getTexture() {
|
|
11
|
-
return this._texture;
|
|
12
|
-
}
|
|
13
|
-
//
|
|
14
|
-
// PComponent
|
|
15
|
-
//
|
|
16
|
-
_dispose() {
|
|
17
|
-
const pcanvas = this.context.getPCanvas();
|
|
18
|
-
if (this._texture) {
|
|
19
|
-
pcanvas.clearEnvironment(this);
|
|
20
|
-
}
|
|
21
|
-
if (this.file_texture) {
|
|
22
|
-
if (this.file_texture.type & FileType.Environment) {
|
|
23
|
-
this.context
|
|
24
|
-
.environmentLoader()
|
|
25
|
-
.disposeEnvironment(this, this.file_texture);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
this.context
|
|
29
|
-
.imageLoader()
|
|
30
|
-
.disposeImage(this, this.file_texture, this._cacheKey);
|
|
31
|
-
this._cacheKey = 0;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
this._texture?.dispose();
|
|
35
|
-
this._texture = null;
|
|
36
|
-
}
|
|
37
|
-
unrender() {
|
|
38
|
-
this._dispose();
|
|
39
|
-
}
|
|
40
|
-
render() {
|
|
41
|
-
if (this.file_texture !== null) {
|
|
42
|
-
// Check image type
|
|
43
|
-
if (this.file_texture.type & FileType.Environment) {
|
|
44
|
-
this.context.environmentLoader().load(this, this.file_texture);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
this.context.imageLoader().load(this, this.file_texture);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
//
|
|
52
|
-
// IEnvironmentLoader
|
|
53
|
-
//
|
|
54
|
-
onEnvironmentLoaded(_file, texture) {
|
|
55
|
-
this._texture = texture;
|
|
56
|
-
const pcanvas = this.context.getPCanvas();
|
|
57
|
-
pcanvas.setEnvironment(this);
|
|
58
|
-
// if (this.background)
|
|
59
|
-
// pcanvas.setBackground(this._texture, this.rotation, this.intensity);
|
|
60
|
-
// if (this.environment)
|
|
61
|
-
// pcanvas.setEnvironment(this._texture, this.rotation, this.intensity);
|
|
62
|
-
}
|
|
63
|
-
//
|
|
64
|
-
// IImageLoader
|
|
65
|
-
//
|
|
66
|
-
onImageLoaded(file, data, cacheKey) {
|
|
67
|
-
this._cacheKey = cacheKey;
|
|
68
|
-
const texture = new Texture();
|
|
69
|
-
this._texture = texture;
|
|
70
|
-
if (this.equirectangular) {
|
|
71
|
-
texture.mapping = EquirectangularReflectionMapping;
|
|
72
|
-
}
|
|
73
|
-
texture.colorSpace = SRGBColorSpace;
|
|
74
|
-
texture.userData.id = file._id;
|
|
75
|
-
texture.colorSpace = SRGBColorSpace;
|
|
76
|
-
texture.image = data;
|
|
77
|
-
texture.needsUpdate = true;
|
|
78
|
-
const pcanvas = this.context.getPCanvas();
|
|
79
|
-
pcanvas.setEnvironment(this);
|
|
80
|
-
// if (this.background)
|
|
81
|
-
// pcanvas.setBackground(this._texture, this.rotation, this.intensity);
|
|
82
|
-
// if (this.environment)
|
|
83
|
-
// pcanvas.setEnvironment(this._texture, this.rotation, this.intensity);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=PEnvironment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PEnvironment.js","sourceRoot":"","sources":["../../../src/pcomponents/PEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,cAAc,EACd,OAAO,GACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAgB,QAAQ,EAAS,MAAM,gBAAgB,CAAC;AAG/D,MAAM,CAAC,OAAO,OAAO,YACnB,SAAQ,gBAAgB;IAD1B;;QAIE,aAAQ,GAAmB,IAAI,CAAC;QAChC,cAAS,GAAG,CAAC,CAAC;IA6FhB,CAAC;IA3FC,UAAU;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,EAAE;IACF,cAAc;IACd,EAAE;IAEF,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,sBAAsB;IACtB,EAAE;IAEF,mBAAmB,CAAC,KAAY,EAAE,OAAgB;QAChD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAExB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAW,CAAC;QACnD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE7B,uBAAuB;QACvB,yEAAyE;QACzE,wBAAwB;QACxB,0EAA0E;IAC5E,CAAC;IAED,EAAE;IACF,gBAAgB;IAChB,EAAE;IAEF,aAAa,CAAC,IAAW,EAAE,IAAS,EAAE,QAAgB;QACpD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAExB,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,OAAO,CAAC,OAAO,GAAG,gCAAgC,CAAC;QACrD,CAAC;QACD,OAAO,CAAC,UAAU,GAAG,cAAc,CAAC;QAEpC,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAC/B,OAAO,CAAC,UAAU,GAAG,cAAc,CAAC;QACpC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;QAErB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAW,CAAC;QACnD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE7B,uBAAuB;QACvB,yEAAyE;QAEzE,wBAAwB;QACxB,0EAA0E;IAC5E,CAAC;CACF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { MeshBasicMaterial, SphereGeometry, Texture } from "three";
|
|
2
|
-
import { PImageBackground as PImageBackgroundBase } from "@p100-web/core";
|
|
3
|
-
import { IImageLoader, PFile } from "@p100-web/core";
|
|
4
|
-
export default class PImageBackground extends PImageBackgroundBase implements IImageLoader {
|
|
5
|
-
material: MeshBasicMaterial | null;
|
|
6
|
-
geometry: SphereGeometry | null;
|
|
7
|
-
_texture: Texture | null;
|
|
8
|
-
_cacheKey: number;
|
|
9
|
-
_dispose(unrender: boolean): void;
|
|
10
|
-
unrender(): void;
|
|
11
|
-
render(): void;
|
|
12
|
-
onImageLoaded(file: PFile, data: any, cacheKey: number): void;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=PImageBackground.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PImageBackground.d.ts","sourceRoot":"","sources":["../../../src/pcomponents/PImageBackground.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EACjB,cAAc,EAEd,OAAO,EAER,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAe,YAAY,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,oBAAqB,YAAW,YAAY;IACxF,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAC1C,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAQ;IACvC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAQ;IAChC,SAAS,SAAK;IAEd,QAAQ,CAAC,QAAQ,EAAE,OAAO;IA6B1B,QAAQ;IAIR,MAAM;IAqCN,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CAsB9D"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { BackSide, DoubleSide, MathUtils, Mesh, MeshBasicMaterial, SphereGeometry, SRGBColorSpace, Texture, Vector2, } from "three";
|
|
2
|
-
import { PImageBackground as PImageBackgroundBase } from "@p100-web/core";
|
|
3
|
-
import { FileSubType } from "@p100-web/core";
|
|
4
|
-
export default class PImageBackground extends PImageBackgroundBase {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.material = null;
|
|
8
|
-
this.geometry = null;
|
|
9
|
-
this._texture = null;
|
|
10
|
-
this._cacheKey = 0;
|
|
11
|
-
}
|
|
12
|
-
_dispose(unrender) {
|
|
13
|
-
if (this.file_texture) {
|
|
14
|
-
this.context
|
|
15
|
-
.imageLoader()
|
|
16
|
-
.disposeImage(this, this.file_texture, this._cacheKey);
|
|
17
|
-
this._cacheKey = 0;
|
|
18
|
-
}
|
|
19
|
-
this._texture?.dispose();
|
|
20
|
-
this._texture = null;
|
|
21
|
-
// Check if we should dispose Material
|
|
22
|
-
if (this.material) {
|
|
23
|
-
this.material.map = null;
|
|
24
|
-
this.material.needsUpdate = true;
|
|
25
|
-
// Dispose material
|
|
26
|
-
if (unrender) {
|
|
27
|
-
this.material.dispose();
|
|
28
|
-
this.material = null;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (unrender && this.geometry !== null) {
|
|
32
|
-
this.geometry.dispose();
|
|
33
|
-
this.geometry = null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
unrender() {
|
|
37
|
-
this._dispose(true);
|
|
38
|
-
}
|
|
39
|
-
render() {
|
|
40
|
-
const geometry = new SphereGeometry(this.radius, 32, 32);
|
|
41
|
-
this.geometry = geometry;
|
|
42
|
-
const mesh = new Mesh(geometry);
|
|
43
|
-
mesh.castShadow = false;
|
|
44
|
-
mesh.receiveShadow = false;
|
|
45
|
-
this.node.set_el(mesh, false);
|
|
46
|
-
mesh.rotation.y = MathUtils.degToRad(this.rotation);
|
|
47
|
-
const material = new MeshBasicMaterial({
|
|
48
|
-
color: 0xffffff,
|
|
49
|
-
map: null,
|
|
50
|
-
side: BackSide,
|
|
51
|
-
transparent: false,
|
|
52
|
-
fog: false,
|
|
53
|
-
shadowSide: DoubleSide,
|
|
54
|
-
});
|
|
55
|
-
this.material = material;
|
|
56
|
-
mesh.material = material;
|
|
57
|
-
mesh.scale.x = mesh.scale.x * -1;
|
|
58
|
-
if (this.file_texture !== null) {
|
|
59
|
-
this.context
|
|
60
|
-
.imageLoader()
|
|
61
|
-
.load(this, this.file_texture);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
//
|
|
65
|
-
// IImageLoader
|
|
66
|
-
//
|
|
67
|
-
onImageLoaded(file, data, cacheKey) {
|
|
68
|
-
this._cacheKey = cacheKey;
|
|
69
|
-
if (this.material === null) {
|
|
70
|
-
this.context.error("onImageLoaded and material was null");
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const texture = new Texture();
|
|
74
|
-
this._texture = texture;
|
|
75
|
-
texture.userData.id = file._id;
|
|
76
|
-
texture.colorSpace = SRGBColorSpace;
|
|
77
|
-
texture.image = data;
|
|
78
|
-
if (file.subType === FileSubType.Stereo)
|
|
79
|
-
texture.repeat = new Vector2(1, 0.5);
|
|
80
|
-
texture.needsUpdate = true;
|
|
81
|
-
this.material.map = texture;
|
|
82
|
-
this.material.needsUpdate = true;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=PImageBackground.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PImageBackground.js","sourceRoot":"","sources":["../../../src/pcomponents/PImageBackground.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,UAAU,EACV,SAAS,EACT,IAAI,EACJ,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,OAAO,EACP,OAAO,GACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAuB,MAAM,gBAAgB,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,oBAAoB;IAAlE;;QACE,aAAQ,GAA6B,IAAI,CAAC;QAC1C,aAAQ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,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAC/B,OAAO,CAAC,UAAU,GAAG,cAAc,CAAC;QACpC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;QAErB,IAAI,IAAI,CAAC,OAAO,KAAK,WAAW,CAAC,MAAM;YACrC,OAAO,CAAC,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAEvC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PLight.d.ts","sourceRoot":"","sources":["../../../src/pcomponents/PLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,UAAU;IAC5C,KAAK,EAAE,YAAY,GAAG,IAAI,CAAQ;IAElC,QAAQ;IAOR,MAAM;CAOP"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AmbientLight } from "three";
|
|
2
|
-
import { PLight as PLightBase } from "@p100-web/core";
|
|
3
|
-
export default class PLight extends PLightBase {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.light = null;
|
|
7
|
-
}
|
|
8
|
-
unrender() {
|
|
9
|
-
if (this.light !== null) {
|
|
10
|
-
this.light.dispose();
|
|
11
|
-
this.light = null;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
render() {
|
|
15
|
-
const light = new AmbientLight(this.color, this.intensity);
|
|
16
|
-
this.light = light;
|
|
17
|
-
light.intensity = this.intensity;
|
|
18
|
-
light.position.set(0, 200, 0);
|
|
19
|
-
this.node.set_el(light, false);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=PLight.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PLight.js","sourceRoot":"","sources":["../../../src/pcomponents/PLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,UAAU;IAA9C;;QACE,UAAK,GAAwB,IAAI,CAAC;IAgBpC,CAAC;IAdC,QAAQ;QACN,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DirectionalLight } from "three";
|
|
2
|
-
import { PLightDirectional as PLightDirectionalBase } from "@p100-web/core";
|
|
3
|
-
export default class PLightDirectional extends PLightDirectionalBase {
|
|
4
|
-
light: DirectionalLight | null;
|
|
5
|
-
unrender(): void;
|
|
6
|
-
render(): void;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=PLightDirectional.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PLightDirectional.d.ts","sourceRoot":"","sources":["../../../src/pcomponents/PLightDirectional.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,gBAAgB,EAAW,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAClE,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAEtC,QAAQ;IAaR,MAAM;CAiBP"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Color, DirectionalLight, Vector2 } from "three";
|
|
2
|
-
import { PLightDirectional as PLightDirectionalBase } from "@p100-web/core";
|
|
3
|
-
export default class PLightDirectional extends PLightDirectionalBase {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.light = null;
|
|
7
|
-
}
|
|
8
|
-
unrender() {
|
|
9
|
-
if (this.light !== null) {
|
|
10
|
-
if (this.light.shadow.map) {
|
|
11
|
-
this.light.shadow.map.dispose();
|
|
12
|
-
}
|
|
13
|
-
if (this.light.shadow) {
|
|
14
|
-
this.light.shadow.dispose();
|
|
15
|
-
}
|
|
16
|
-
this.light.dispose();
|
|
17
|
-
this.light = null;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
render() {
|
|
21
|
-
const light = new DirectionalLight(new Color(this.color), 5);
|
|
22
|
-
this.light = light;
|
|
23
|
-
light.castShadow = this.castShadow;
|
|
24
|
-
light.intensity = this.intensity;
|
|
25
|
-
if (this.castShadow) {
|
|
26
|
-
this.light.shadow.camera.top = -this.shadowSize;
|
|
27
|
-
this.light.shadow.camera.bottom = this.shadowSize;
|
|
28
|
-
this.light.shadow.camera.left = -this.shadowSize;
|
|
29
|
-
this.light.shadow.camera.right = this.shadowSize;
|
|
30
|
-
this.light.shadow.mapSize = new Vector2(2048, 2048);
|
|
31
|
-
this.light.shadow.bias = 0.0001;
|
|
32
|
-
}
|
|
33
|
-
this.node.set_el(light, false);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=PLightDirectional.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PLightDirectional.js","sourceRoot":"","sources":["../../../src/pcomponents/PLightDirectional.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAApE;;QACE,UAAK,GAA4B,IAAI,CAAC;IAgCxC,CAAC;IA9BC,QAAQ;QACN,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;gBAC1B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YAClC,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;gBACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAC9B,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,gBAAgB,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACnC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAEjC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;YAChD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;YAClD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;YACjD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC;YACjD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;QAClC,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Texture, ShaderMaterial } from "three";
|
|
2
|
-
import { PMaskedMaterial as PMaskedMaterialBase } from "@p100-web/core";
|
|
3
|
-
import { type IImageLoader, type IVideoLoader, PFile } from "@p100-web/core";
|
|
4
|
-
export default class PMaskedMaterial extends PMaskedMaterialBase implements IImageLoader, IVideoLoader {
|
|
5
|
-
private _material;
|
|
6
|
-
private _cacheKey;
|
|
7
|
-
getTexture<T>(): T | null;
|
|
8
|
-
getMaterial(): ShaderMaterial | null;
|
|
9
|
-
dispose(): void;
|
|
10
|
-
_dispose(unrender: boolean): void;
|
|
11
|
-
unrender(): void;
|
|
12
|
-
render(): void;
|
|
13
|
-
protected setTextureRepeat(file: PFile, texture: Texture): void;
|
|
14
|
-
onVideoLoaded(file: PFile, value: any): void;
|
|
15
|
-
onImageLoaded(file: PFile, data: any, cacheKey: number): void;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=PMaskedMaterial.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PMaskedMaterial.d.ts","sourceRoot":"","sources":["../../../src/pcomponents/PMaskedMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,OAAO,EAGP,cAAc,EAGf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,YAAY,EAEjB,KAAK,EAEN,MAAM,gBAAgB,CAAC;AAExB,MAAM,CAAC,OAAO,OAAO,eACnB,SAAQ,mBACR,YAAW,YAAY,EAAE,YAAY;IAErC,OAAO,CAAC,SAAS,CAA+B;IAChD,OAAO,CAAC,SAAS,CAAK;IAEtB,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI;IAIzB,WAAW;IAQX,OAAO;IAKP,QAAQ,CAAC,QAAQ,EAAE,OAAO;IAsC1B,QAAQ;IAMR,MAAM;IAgDN,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO;IAexD,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG;IAoBrC,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CAmB9D"}
|