@playcanvas/web-components 0.16.0 → 0.18.0
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/README.md +5 -3
- package/dist/app.d.cts +18 -13
- package/dist/app.d.ts +18 -13
- package/dist/asset.d.cts +13 -3
- package/dist/asset.d.ts +13 -3
- package/dist/async-element.d.cts +13 -13
- package/dist/async-element.d.ts +13 -13
- package/dist/components/anim-clip.d.cts +4 -0
- package/dist/components/anim-clip.d.ts +4 -0
- package/dist/components/anim-component.d.cts +38 -5
- package/dist/components/anim-component.d.ts +38 -5
- package/dist/components/audio-listener-component.d.cts +26 -0
- package/dist/components/audio-listener-component.d.ts +26 -0
- package/dist/components/button-component.d.cts +10 -1
- package/dist/components/button-component.d.ts +10 -1
- package/dist/components/camera-component.d.cts +37 -1
- package/dist/components/camera-component.d.ts +37 -1
- package/dist/components/collision-component.d.cts +9 -1
- package/dist/components/collision-component.d.ts +9 -1
- package/dist/components/component.d.cts +3 -2
- package/dist/components/component.d.ts +3 -2
- package/dist/components/element-component.d.cts +11 -0
- package/dist/components/element-component.d.ts +11 -0
- package/dist/components/gsplat-component.d.cts +6 -0
- package/dist/components/gsplat-component.d.ts +6 -0
- package/dist/components/joint-component.d.cts +14 -2
- package/dist/components/joint-component.d.ts +14 -2
- package/dist/components/{layoutchild-component.d.cts → layout-child-component.d.cts} +7 -1
- package/dist/components/{layoutchild-component.d.ts → layout-child-component.d.ts} +7 -1
- package/dist/components/{layoutgroup-component.d.cts → layout-group-component.d.cts} +7 -1
- package/dist/components/{layoutgroup-component.d.ts → layout-group-component.d.ts} +7 -1
- package/dist/components/light-component.d.cts +52 -1
- package/dist/components/light-component.d.ts +52 -1
- package/dist/components/{particlesystem-component.d.cts → particle-system-component.d.cts} +7 -1
- package/dist/components/{particlesystem-component.d.ts → particle-system-component.d.ts} +7 -1
- package/dist/components/render-component.d.cts +7 -0
- package/dist/components/render-component.d.ts +7 -0
- package/dist/components/{rigidbody-component.d.cts → rigid-body-component.d.cts} +8 -1
- package/dist/components/{rigidbody-component.d.ts → rigid-body-component.d.ts} +8 -1
- package/dist/components/screen-component.d.cts +6 -0
- package/dist/components/screen-component.d.ts +6 -0
- package/dist/components/script-component.d.cts +26 -12
- package/dist/components/script-component.d.ts +26 -12
- package/dist/components/{script.d.cts → script-instance.d.cts} +11 -7
- package/dist/components/{script.d.ts → script-instance.d.ts} +11 -7
- package/dist/components/{scrollview-component.d.cts → scroll-view-component.d.cts} +7 -1
- package/dist/components/{scrollview-component.d.ts → scroll-view-component.d.ts} +7 -1
- package/dist/components/scrollbar-component.d.cts +6 -0
- package/dist/components/scrollbar-component.d.ts +6 -0
- package/dist/components/sound-component.d.cts +7 -1
- package/dist/components/sound-component.d.ts +7 -1
- package/dist/components/sound-slot.d.cts +5 -2
- package/dist/components/sound-slot.d.ts +5 -2
- package/dist/custom-elements.json +1852 -974
- package/dist/entity-base.d.cts +7 -6
- package/dist/entity-base.d.ts +7 -6
- package/dist/entity-owner.d.cts +118 -0
- package/dist/entity-owner.d.ts +118 -0
- package/dist/entity.d.cts +14 -102
- package/dist/entity.d.ts +14 -102
- package/dist/index.d.cts +26 -22
- package/dist/index.d.ts +26 -22
- package/dist/material.d.cts +18 -7
- package/dist/material.d.ts +18 -7
- package/dist/model.d.cts +72 -24
- package/dist/model.d.ts +72 -24
- package/dist/node.d.cts +6 -1
- package/dist/node.d.ts +6 -1
- package/dist/pwc.cjs +807 -293
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +807 -293
- package/dist/pwc.js.map +1 -1
- package/dist/pwc.min.js +1 -1
- package/dist/pwc.min.js.map +1 -1
- package/dist/pwc.min.mjs +1 -1
- package/dist/pwc.min.mjs.map +1 -1
- package/dist/pwc.mjs +805 -292
- package/dist/pwc.mjs.map +1 -1
- package/dist/scene.d.cts +3 -0
- package/dist/scene.d.ts +3 -0
- package/dist/sky.d.cts +4 -0
- package/dist/sky.d.ts +4 -0
- package/dist/vscode.html-custom-data.json +351 -121
- package/dist/{module.d.cts → wasm.d.cts} +10 -6
- package/dist/{module.d.ts → wasm.d.ts} +10 -6
- package/dist/web-types.json +465 -291
- package/package.json +7 -7
- package/src/app.ts +49 -35
- package/src/asset.ts +13 -4
- package/src/async-element.ts +14 -14
- package/src/components/anim-clip.ts +4 -0
- package/src/components/anim-component.ts +89 -14
- package/src/components/audio-listener-component.ts +36 -0
- package/src/components/button-component.ts +10 -1
- package/src/components/camera-component.ts +65 -6
- package/src/components/collision-component.ts +9 -1
- package/src/components/component.ts +4 -3
- package/src/components/element-component.ts +11 -0
- package/src/components/gsplat-component.ts +6 -0
- package/src/components/joint-component.ts +14 -2
- package/src/components/{layoutchild-component.ts → layout-child-component.ts} +8 -2
- package/src/components/{layoutgroup-component.ts → layout-group-component.ts} +8 -2
- package/src/components/light-component.ts +110 -17
- package/src/components/{particlesystem-component.ts → particle-system-component.ts} +8 -2
- package/src/components/render-component.ts +7 -0
- package/src/components/{rigidbody-component.ts → rigid-body-component.ts} +9 -2
- package/src/components/screen-component.ts +6 -0
- package/src/components/script-component.ts +66 -42
- package/src/components/{script.ts → script-instance.ts} +18 -14
- package/src/components/{scrollview-component.ts → scroll-view-component.ts} +8 -2
- package/src/components/scrollbar-component.ts +6 -0
- package/src/components/sound-component.ts +8 -2
- package/src/components/sound-slot.ts +7 -4
- package/src/entity-base.ts +8 -7
- package/src/entity-owner.ts +298 -0
- package/src/entity.ts +21 -271
- package/src/index.ts +38 -25
- package/src/material.ts +19 -8
- package/src/model.ts +164 -72
- package/src/node.ts +15 -6
- package/src/scene.ts +3 -0
- package/src/sky.ts +4 -0
- package/src/{module.ts → wasm.ts} +12 -8
- package/dist/components/listener-component.d.cts +0 -20
- package/dist/components/listener-component.d.ts +0 -20
- package/src/components/listener-component.ts +0 -30
|
@@ -7,11 +7,18 @@ import { ComponentElement } from './component.cjs';
|
|
|
7
7
|
* The CameraComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link CameraComponent} (`camera`).
|
|
11
|
+
*
|
|
12
|
+
* @elementSummary The `<pc-camera>` element renders the scene from its entity's transform, with
|
|
13
|
+
* attributes for the projection, field of view, clip planes, clear color and tonemapping. Must be a
|
|
14
|
+
* child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
15
|
+
*
|
|
10
16
|
* @category Components
|
|
11
17
|
*/
|
|
12
18
|
declare class CameraComponentElement extends ComponentElement {
|
|
13
19
|
private _clearColor;
|
|
14
20
|
private _clearColorBuffer;
|
|
21
|
+
private _clearDepth;
|
|
15
22
|
private _clearDepthBuffer;
|
|
16
23
|
private _clearStencilBuffer;
|
|
17
24
|
private _cullFaces;
|
|
@@ -33,6 +40,7 @@ declare class CameraComponentElement extends ComponentElement {
|
|
|
33
40
|
protected getInitialComponentData(): {
|
|
34
41
|
clearColor: Color;
|
|
35
42
|
clearColorBuffer: boolean;
|
|
43
|
+
clearDepth: number;
|
|
36
44
|
clearDepthBuffer: boolean;
|
|
37
45
|
clearStencilBuffer: boolean;
|
|
38
46
|
cullFaces: boolean;
|
|
@@ -50,7 +58,25 @@ declare class CameraComponentElement extends ComponentElement {
|
|
|
50
58
|
scissorRect: Vec4;
|
|
51
59
|
toneMapping: number;
|
|
52
60
|
};
|
|
53
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Whether immersive AR is available. Independent of {@link vrAvailable}: a device can offer
|
|
63
|
+
* either mode without the other.
|
|
64
|
+
* @returns Whether immersive AR is available.
|
|
65
|
+
*/
|
|
66
|
+
get arAvailable(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether immersive VR is available. Independent of {@link arAvailable}: a device can offer
|
|
69
|
+
* either mode without the other.
|
|
70
|
+
* @returns Whether immersive VR is available.
|
|
71
|
+
*/
|
|
72
|
+
get vrAvailable(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Whether one XR session type is available on this device.
|
|
75
|
+
*
|
|
76
|
+
* @param type - The XR session type to test.
|
|
77
|
+
* @returns Whether that type is available.
|
|
78
|
+
*/
|
|
79
|
+
private _available;
|
|
54
80
|
/**
|
|
55
81
|
* Starts the camera in XR mode.
|
|
56
82
|
* @param type - The type of XR mode to start.
|
|
@@ -86,6 +112,16 @@ declare class CameraComponentElement extends ComponentElement {
|
|
|
86
112
|
* @returns The clear color buffer.
|
|
87
113
|
*/
|
|
88
114
|
get clearColorBuffer(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Sets the depth value the depth buffer is cleared to. Defaults to 1.
|
|
117
|
+
* @param value - The clear depth value.
|
|
118
|
+
*/
|
|
119
|
+
set clearDepth(value: number);
|
|
120
|
+
/**
|
|
121
|
+
* Gets the depth value the depth buffer is cleared to.
|
|
122
|
+
* @returns The clear depth value.
|
|
123
|
+
*/
|
|
124
|
+
get clearDepth(): number;
|
|
89
125
|
/**
|
|
90
126
|
* Sets the clear depth buffer of the camera.
|
|
91
127
|
* @param value - The clear depth buffer.
|
|
@@ -7,11 +7,18 @@ import { ComponentElement } from './component.js';
|
|
|
7
7
|
* The CameraComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link CameraComponent} (`camera`).
|
|
11
|
+
*
|
|
12
|
+
* @elementSummary The `<pc-camera>` element renders the scene from its entity's transform, with
|
|
13
|
+
* attributes for the projection, field of view, clip planes, clear color and tonemapping. Must be a
|
|
14
|
+
* child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
15
|
+
*
|
|
10
16
|
* @category Components
|
|
11
17
|
*/
|
|
12
18
|
declare class CameraComponentElement extends ComponentElement {
|
|
13
19
|
private _clearColor;
|
|
14
20
|
private _clearColorBuffer;
|
|
21
|
+
private _clearDepth;
|
|
15
22
|
private _clearDepthBuffer;
|
|
16
23
|
private _clearStencilBuffer;
|
|
17
24
|
private _cullFaces;
|
|
@@ -33,6 +40,7 @@ declare class CameraComponentElement extends ComponentElement {
|
|
|
33
40
|
protected getInitialComponentData(): {
|
|
34
41
|
clearColor: Color;
|
|
35
42
|
clearColorBuffer: boolean;
|
|
43
|
+
clearDepth: number;
|
|
36
44
|
clearDepthBuffer: boolean;
|
|
37
45
|
clearStencilBuffer: boolean;
|
|
38
46
|
cullFaces: boolean;
|
|
@@ -50,7 +58,25 @@ declare class CameraComponentElement extends ComponentElement {
|
|
|
50
58
|
scissorRect: Vec4;
|
|
51
59
|
toneMapping: number;
|
|
52
60
|
};
|
|
53
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Whether immersive AR is available. Independent of {@link vrAvailable}: a device can offer
|
|
63
|
+
* either mode without the other.
|
|
64
|
+
* @returns Whether immersive AR is available.
|
|
65
|
+
*/
|
|
66
|
+
get arAvailable(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether immersive VR is available. Independent of {@link arAvailable}: a device can offer
|
|
69
|
+
* either mode without the other.
|
|
70
|
+
* @returns Whether immersive VR is available.
|
|
71
|
+
*/
|
|
72
|
+
get vrAvailable(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Whether one XR session type is available on this device.
|
|
75
|
+
*
|
|
76
|
+
* @param type - The XR session type to test.
|
|
77
|
+
* @returns Whether that type is available.
|
|
78
|
+
*/
|
|
79
|
+
private _available;
|
|
54
80
|
/**
|
|
55
81
|
* Starts the camera in XR mode.
|
|
56
82
|
* @param type - The type of XR mode to start.
|
|
@@ -86,6 +112,16 @@ declare class CameraComponentElement extends ComponentElement {
|
|
|
86
112
|
* @returns The clear color buffer.
|
|
87
113
|
*/
|
|
88
114
|
get clearColorBuffer(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Sets the depth value the depth buffer is cleared to. Defaults to 1.
|
|
117
|
+
* @param value - The clear depth value.
|
|
118
|
+
*/
|
|
119
|
+
set clearDepth(value: number);
|
|
120
|
+
/**
|
|
121
|
+
* Gets the depth value the depth buffer is cleared to.
|
|
122
|
+
* @returns The clear depth value.
|
|
123
|
+
*/
|
|
124
|
+
get clearDepth(): number;
|
|
89
125
|
/**
|
|
90
126
|
* Sets the clear depth buffer of the camera.
|
|
91
127
|
* @param value - The clear depth buffer.
|
|
@@ -13,6 +13,12 @@ import { ComponentElement } from './component.cjs';
|
|
|
13
13
|
* retargets or rebinds picks up the new node's geometry. An entity with no asset-backed render
|
|
14
14
|
* component warns, and the collider has no shape.
|
|
15
15
|
*
|
|
16
|
+
* Engine component: {@link CollisionComponent} (`collision`).
|
|
17
|
+
*
|
|
18
|
+
* @elementSummary The `<pc-collision>` element gives its entity a collision shape — a box, sphere,
|
|
19
|
+
* capsule, cone, cylinder or mesh — for the physics simulation to collide against. Pair it with a
|
|
20
|
+
* `<pc-rigid-body>`. Must be a child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
21
|
+
*
|
|
16
22
|
* @category Components
|
|
17
23
|
*/
|
|
18
24
|
declare class CollisionComponentElement extends ComponentElement {
|
|
@@ -43,7 +49,9 @@ declare class CollisionComponentElement extends ComponentElement {
|
|
|
43
49
|
* no attribute to supply it - so the host's visible geometry, the meaning a mesh collider
|
|
44
50
|
* on a glTF node carries, fills the gap. Runs on every application (so a rebound `pc-node`
|
|
45
51
|
* recomputes it) and on a runtime switch to `type="mesh"`; an explicitly assigned
|
|
46
|
-
* `renderAsset` is never overwritten.
|
|
52
|
+
* `renderAsset` is never overwritten. A `pc-model` host entity never carries a render
|
|
53
|
+
* component (the instantiated content beneath it does), so a mesh collider that should take
|
|
54
|
+
* an asset's geometry belongs on a bound `pc-node`.
|
|
47
55
|
*/
|
|
48
56
|
private _applyMeshGeometryDefault;
|
|
49
57
|
/**
|
|
@@ -13,6 +13,12 @@ import { ComponentElement } from './component.js';
|
|
|
13
13
|
* retargets or rebinds picks up the new node's geometry. An entity with no asset-backed render
|
|
14
14
|
* component warns, and the collider has no shape.
|
|
15
15
|
*
|
|
16
|
+
* Engine component: {@link CollisionComponent} (`collision`).
|
|
17
|
+
*
|
|
18
|
+
* @elementSummary The `<pc-collision>` element gives its entity a collision shape — a box, sphere,
|
|
19
|
+
* capsule, cone, cylinder or mesh — for the physics simulation to collide against. Pair it with a
|
|
20
|
+
* `<pc-rigid-body>`. Must be a child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
21
|
+
*
|
|
16
22
|
* @category Components
|
|
17
23
|
*/
|
|
18
24
|
declare class CollisionComponentElement extends ComponentElement {
|
|
@@ -43,7 +49,9 @@ declare class CollisionComponentElement extends ComponentElement {
|
|
|
43
49
|
* no attribute to supply it - so the host's visible geometry, the meaning a mesh collider
|
|
44
50
|
* on a glTF node carries, fills the gap. Runs on every application (so a rebound `pc-node`
|
|
45
51
|
* recomputes it) and on a runtime switch to `type="mesh"`; an explicitly assigned
|
|
46
|
-
* `renderAsset` is never overwritten.
|
|
52
|
+
* `renderAsset` is never overwritten. A `pc-model` host entity never carries a render
|
|
53
|
+
* component (the instantiated content beneath it does), so a mesh collider that should take
|
|
54
|
+
* an asset's geometry belongs on a bound `pc-node`.
|
|
47
55
|
*/
|
|
48
56
|
private _applyMeshGeometryDefault;
|
|
49
57
|
/**
|
|
@@ -61,8 +61,9 @@ declare class ComponentElement extends AsyncElement {
|
|
|
61
61
|
disconnectedCallback(): void;
|
|
62
62
|
/**
|
|
63
63
|
* The PlayCanvas component instance. `null` until the element is ready, and also for an
|
|
64
|
-
* element that is not a descendant of
|
|
65
|
-
* element's `ready()` promise
|
|
64
|
+
* element that is not a descendant of an entity-fronting element (`<pc-entity>`,
|
|
65
|
+
* `<pc-model>` or `<pc-node>`) — await {@link whenReady} or the element's `ready()` promise
|
|
66
|
+
* before accessing it.
|
|
66
67
|
* @returns The component instance, or `null`.
|
|
67
68
|
*/
|
|
68
69
|
get component(): Component | null;
|
|
@@ -61,8 +61,9 @@ declare class ComponentElement extends AsyncElement {
|
|
|
61
61
|
disconnectedCallback(): void;
|
|
62
62
|
/**
|
|
63
63
|
* The PlayCanvas component instance. `null` until the element is ready, and also for an
|
|
64
|
-
* element that is not a descendant of
|
|
65
|
-
* element's `ready()` promise
|
|
64
|
+
* element that is not a descendant of an entity-fronting element (`<pc-entity>`,
|
|
65
|
+
* `<pc-model>` or `<pc-node>`) — await {@link whenReady} or the element's `ready()` promise
|
|
66
|
+
* before accessing it.
|
|
66
67
|
* @returns The component instance, or `null`.
|
|
67
68
|
*/
|
|
68
69
|
get component(): Component | null;
|
|
@@ -7,6 +7,17 @@ import { ComponentElement } from './component.cjs';
|
|
|
7
7
|
* The ElementComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Despite the name, this is not a base class or a generic wrapper: it is the engine's 2D UI
|
|
11
|
+
* component, which gives its host entity a rectangle in a `<pc-screen>` hierarchy that draws
|
|
12
|
+
* either an image, a line of text or nothing (`type="image"`, `"text"` or `"group"`). The tag
|
|
13
|
+
* spells the engine component it adds, as every component element does.
|
|
14
|
+
*
|
|
15
|
+
* Engine component: {@link ElementComponent} (`element`).
|
|
16
|
+
*
|
|
17
|
+
* @elementSummary The `<pc-element>` element gives its entity a 2D UI rectangle inside a
|
|
18
|
+
* `<pc-screen>` hierarchy, drawing an image, a line of text or nothing (`type="image"`, `"text"` or
|
|
19
|
+
* `"group"`). Must be a child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
20
|
+
*
|
|
10
21
|
* @category Components
|
|
11
22
|
*/
|
|
12
23
|
declare class ElementComponentElement extends ComponentElement {
|
|
@@ -7,6 +7,17 @@ import { ComponentElement } from './component.js';
|
|
|
7
7
|
* The ElementComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Despite the name, this is not a base class or a generic wrapper: it is the engine's 2D UI
|
|
11
|
+
* component, which gives its host entity a rectangle in a `<pc-screen>` hierarchy that draws
|
|
12
|
+
* either an image, a line of text or nothing (`type="image"`, `"text"` or `"group"`). The tag
|
|
13
|
+
* spells the engine component it adds, as every component element does.
|
|
14
|
+
*
|
|
15
|
+
* Engine component: {@link ElementComponent} (`element`).
|
|
16
|
+
*
|
|
17
|
+
* @elementSummary The `<pc-element>` element gives its entity a 2D UI rectangle inside a
|
|
18
|
+
* `<pc-screen>` hierarchy, drawing an image, a line of text or nothing (`type="image"`, `"text"` or
|
|
19
|
+
* `"group"`). Must be a child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
20
|
+
*
|
|
10
21
|
* @category Components
|
|
11
22
|
*/
|
|
12
23
|
declare class ElementComponentElement extends ComponentElement {
|
|
@@ -6,6 +6,12 @@ import { ComponentElement } from './component.cjs';
|
|
|
6
6
|
* The GSplatComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link GSplatComponent} (`gsplat`).
|
|
10
|
+
*
|
|
11
|
+
* @elementSummary The `<pc-gsplat>` element renders the 3D Gaussian splats of a `gsplat` asset at
|
|
12
|
+
* its entity, with attributes for shadow casting and level of detail. Must be a child of a
|
|
13
|
+
* `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
14
|
+
*
|
|
9
15
|
* @category Components
|
|
10
16
|
*/
|
|
11
17
|
declare class GSplatComponentElement extends ComponentElement {
|
|
@@ -6,6 +6,12 @@ import { ComponentElement } from './component.js';
|
|
|
6
6
|
* The GSplatComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link GSplatComponent} (`gsplat`).
|
|
10
|
+
*
|
|
11
|
+
* @elementSummary The `<pc-gsplat>` element renders the 3D Gaussian splats of a `gsplat` asset at
|
|
12
|
+
* its entity, with attributes for shadow casting and level of detail. Must be a child of a
|
|
13
|
+
* `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
14
|
+
*
|
|
9
15
|
* @category Components
|
|
10
16
|
*/
|
|
11
17
|
declare class GSplatComponentElement extends ComponentElement {
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { JointComponent } from 'playcanvas';
|
|
2
2
|
import { Vec2, Vec3 } from 'playcanvas';
|
|
3
3
|
import { ComponentElement } from './component.cjs';
|
|
4
|
-
|
|
5
|
-
type
|
|
4
|
+
/** The constraint types supported by the `<pc-joint>` element. */
|
|
5
|
+
export type JointType = 'fixed' | 'ball' | 'hinge' | 'slider' | '6dof';
|
|
6
|
+
/**
|
|
7
|
+
* The motion modes for a single joint axis: fully constrained (`locked`), constrained within
|
|
8
|
+
* limits (`limited`) or unconstrained (`free`).
|
|
9
|
+
*/
|
|
10
|
+
export type MotionMode = 'locked' | 'limited' | 'free';
|
|
6
11
|
/**
|
|
7
12
|
* The JointComponentElement interface provides properties and methods for manipulating
|
|
8
13
|
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-joint/ | `<pc-joint>`} elements.
|
|
@@ -16,10 +21,17 @@ type MotionMode = 'locked' | 'limited' | 'free';
|
|
|
16
21
|
* a rigid body component; leaving `entity-b` empty constrains `entity-a` to a fixed point in world
|
|
17
22
|
* space. The underlying engine component is in alpha, so its API may change.
|
|
18
23
|
*
|
|
24
|
+
* @elementSummary The `<pc-joint>` element constrains two rigid bodies to each other — a hinged
|
|
25
|
+
* door, a swinging chain, a sliding drawer. Its entity's transform is the joint frame, and
|
|
26
|
+
* `entity-a` and `entity-b` name the bodies. Must be a child of a `<pc-entity>`, `<pc-model>` or
|
|
27
|
+
* `<pc-node>`.
|
|
28
|
+
*
|
|
19
29
|
* @fires {CustomEvent} break - Fired when the impulse on the joint exceeds `break-impulse` and the
|
|
20
30
|
* constraint breaks. A broken joint no longer constrains its bodies; calling `refreshFrames()` on
|
|
21
31
|
* the underlying component re-attaches it. Bubbles and is composed.
|
|
22
32
|
*
|
|
33
|
+
* Engine component: {@link JointComponent} (`joint`).
|
|
34
|
+
*
|
|
23
35
|
* @category Components
|
|
24
36
|
*/
|
|
25
37
|
declare class JointComponentElement extends ComponentElement {
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { JointComponent } from 'playcanvas';
|
|
2
2
|
import { Vec2, Vec3 } from 'playcanvas';
|
|
3
3
|
import { ComponentElement } from './component.js';
|
|
4
|
-
|
|
5
|
-
type
|
|
4
|
+
/** The constraint types supported by the `<pc-joint>` element. */
|
|
5
|
+
export type JointType = 'fixed' | 'ball' | 'hinge' | 'slider' | '6dof';
|
|
6
|
+
/**
|
|
7
|
+
* The motion modes for a single joint axis: fully constrained (`locked`), constrained within
|
|
8
|
+
* limits (`limited`) or unconstrained (`free`).
|
|
9
|
+
*/
|
|
10
|
+
export type MotionMode = 'locked' | 'limited' | 'free';
|
|
6
11
|
/**
|
|
7
12
|
* The JointComponentElement interface provides properties and methods for manipulating
|
|
8
13
|
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-joint/ | `<pc-joint>`} elements.
|
|
@@ -16,10 +21,17 @@ type MotionMode = 'locked' | 'limited' | 'free';
|
|
|
16
21
|
* a rigid body component; leaving `entity-b` empty constrains `entity-a` to a fixed point in world
|
|
17
22
|
* space. The underlying engine component is in alpha, so its API may change.
|
|
18
23
|
*
|
|
24
|
+
* @elementSummary The `<pc-joint>` element constrains two rigid bodies to each other — a hinged
|
|
25
|
+
* door, a swinging chain, a sliding drawer. Its entity's transform is the joint frame, and
|
|
26
|
+
* `entity-a` and `entity-b` name the bodies. Must be a child of a `<pc-entity>`, `<pc-model>` or
|
|
27
|
+
* `<pc-node>`.
|
|
28
|
+
*
|
|
19
29
|
* @fires {CustomEvent} break - Fired when the impulse on the joint exceeds `break-impulse` and the
|
|
20
30
|
* constraint breaks. A broken joint no longer constrains its bodies; calling `refreshFrames()` on
|
|
21
31
|
* the underlying component re-attaches it. Bubbles and is composed.
|
|
22
32
|
*
|
|
33
|
+
* Engine component: {@link JointComponent} (`joint`).
|
|
34
|
+
*
|
|
23
35
|
* @category Components
|
|
24
36
|
*/
|
|
25
37
|
declare class JointComponentElement extends ComponentElement {
|
|
@@ -2,10 +2,16 @@ import type { LayoutChildComponent } from 'playcanvas';
|
|
|
2
2
|
import { ComponentElement } from './component.cjs';
|
|
3
3
|
/**
|
|
4
4
|
* The LayoutChildComponentElement interface provides properties and methods for manipulating
|
|
5
|
-
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-
|
|
5
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-layout-child/ | `<pc-layout-child>`} elements.
|
|
6
6
|
* The LayoutChildComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link LayoutChildComponent} (`layoutchild`).
|
|
10
|
+
*
|
|
11
|
+
* @elementSummary The `<pc-layout-child>` element controls how its entity is sized by the
|
|
12
|
+
* `<pc-layout-group>` above it, through minimum and maximum sizes and fit proportions. Must be a
|
|
13
|
+
* child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
14
|
+
*
|
|
9
15
|
* @category Components
|
|
10
16
|
*/
|
|
11
17
|
declare class LayoutChildComponentElement extends ComponentElement {
|
|
@@ -2,10 +2,16 @@ import type { LayoutChildComponent } from 'playcanvas';
|
|
|
2
2
|
import { ComponentElement } from './component.js';
|
|
3
3
|
/**
|
|
4
4
|
* The LayoutChildComponentElement interface provides properties and methods for manipulating
|
|
5
|
-
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-
|
|
5
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-layout-child/ | `<pc-layout-child>`} elements.
|
|
6
6
|
* The LayoutChildComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link LayoutChildComponent} (`layoutchild`).
|
|
10
|
+
*
|
|
11
|
+
* @elementSummary The `<pc-layout-child>` element controls how its entity is sized by the
|
|
12
|
+
* `<pc-layout-group>` above it, through minimum and maximum sizes and fit proportions. Must be a
|
|
13
|
+
* child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
14
|
+
*
|
|
9
15
|
* @category Components
|
|
10
16
|
*/
|
|
11
17
|
declare class LayoutChildComponentElement extends ComponentElement {
|
|
@@ -3,10 +3,16 @@ import { Vec2, Vec4 } from 'playcanvas';
|
|
|
3
3
|
import { ComponentElement } from './component.cjs';
|
|
4
4
|
/**
|
|
5
5
|
* The LayoutGroupComponentElement interface provides properties and methods for manipulating
|
|
6
|
-
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-
|
|
6
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-layout-group/ | `<pc-layout-group>`} elements.
|
|
7
7
|
* The LayoutGroupComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link LayoutGroupComponent} (`layoutgroup`).
|
|
11
|
+
*
|
|
12
|
+
* @elementSummary The `<pc-layout-group>` element arranges its entity's children in a row or
|
|
13
|
+
* column, with spacing, padding, alignment and fitting. Must be a child of a `<pc-entity>`,
|
|
14
|
+
* `<pc-model>` or `<pc-node>`.
|
|
15
|
+
*
|
|
10
16
|
* @category Components
|
|
11
17
|
*/
|
|
12
18
|
declare class LayoutGroupComponentElement extends ComponentElement {
|
|
@@ -3,10 +3,16 @@ import { Vec2, Vec4 } from 'playcanvas';
|
|
|
3
3
|
import { ComponentElement } from './component.js';
|
|
4
4
|
/**
|
|
5
5
|
* The LayoutGroupComponentElement interface provides properties and methods for manipulating
|
|
6
|
-
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-
|
|
6
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-layout-group/ | `<pc-layout-group>`} elements.
|
|
7
7
|
* The LayoutGroupComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link LayoutGroupComponent} (`layoutgroup`).
|
|
11
|
+
*
|
|
12
|
+
* @elementSummary The `<pc-layout-group>` element arranges its entity's children in a row or
|
|
13
|
+
* column, with spacing, padding, alignment and fitting. Must be a child of a `<pc-entity>`,
|
|
14
|
+
* `<pc-model>` or `<pc-node>`.
|
|
15
|
+
*
|
|
10
16
|
* @category Components
|
|
11
17
|
*/
|
|
12
18
|
declare class LayoutGroupComponentElement extends ComponentElement {
|
|
@@ -7,14 +7,23 @@ import { ComponentElement } from './component.cjs';
|
|
|
7
7
|
* The LightComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link LightComponent} (`light`).
|
|
11
|
+
*
|
|
12
|
+
* @elementSummary The `<pc-light>` element lights the scene from its entity — as a directional,
|
|
13
|
+
* omni or spot light — with attributes for color, intensity, range and shadows. Must be a child of
|
|
14
|
+
* a `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
15
|
+
*
|
|
10
16
|
* @category Components
|
|
11
17
|
*/
|
|
12
18
|
declare class LightComponentElement extends ComponentElement {
|
|
19
|
+
private _cascadeBlend;
|
|
20
|
+
private _cascadeDistribution;
|
|
13
21
|
private _castShadows;
|
|
14
22
|
private _color;
|
|
15
23
|
private _innerConeAngle;
|
|
16
24
|
private _intensity;
|
|
17
25
|
private _normalOffsetBias;
|
|
26
|
+
private _numCascades;
|
|
18
27
|
private _outerConeAngle;
|
|
19
28
|
private _range;
|
|
20
29
|
private _shadowBias;
|
|
@@ -32,11 +41,14 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
32
41
|
/** @ignore */
|
|
33
42
|
constructor();
|
|
34
43
|
protected getInitialComponentData(): {
|
|
44
|
+
cascadeBlend: number;
|
|
45
|
+
cascadeDistribution: number;
|
|
35
46
|
castShadows: boolean;
|
|
36
47
|
color: Color;
|
|
37
48
|
innerConeAngle: number;
|
|
38
49
|
intensity: number;
|
|
39
50
|
normalOffsetBias: number;
|
|
51
|
+
numCascades: number;
|
|
40
52
|
outerConeAngle: number;
|
|
41
53
|
penumbraFalloff: number;
|
|
42
54
|
penumbraSize: number;
|
|
@@ -47,7 +59,7 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
47
59
|
shadowIntensity: number;
|
|
48
60
|
shadowResolution: number;
|
|
49
61
|
shadowSamples: number;
|
|
50
|
-
shadowType: number
|
|
62
|
+
shadowType: number;
|
|
51
63
|
type: "directional" | "omni" | "spot";
|
|
52
64
|
vsmBias: number;
|
|
53
65
|
vsmBlurSize: number;
|
|
@@ -57,6 +69,33 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
57
69
|
* @returns The light component.
|
|
58
70
|
*/
|
|
59
71
|
get component(): LightComponent;
|
|
72
|
+
/**
|
|
73
|
+
* Sets the fraction of each shadow cascade that is blended into the next one, from 0 (no
|
|
74
|
+
* blending) to 1, which applies only to `directional` lights with `num-cascades` greater than
|
|
75
|
+
* 1. Defaults to 0.
|
|
76
|
+
* @param value - The cascade blend factor.
|
|
77
|
+
*/
|
|
78
|
+
set cascadeBlend(value: number);
|
|
79
|
+
/**
|
|
80
|
+
* Gets the cascade blend factor of the light, from 0 (no blending) to 1, which applies only to
|
|
81
|
+
* `directional` lights with `num-cascades` greater than 1.
|
|
82
|
+
* @returns The cascade blend factor.
|
|
83
|
+
*/
|
|
84
|
+
get cascadeBlend(): number;
|
|
85
|
+
/**
|
|
86
|
+
* Sets the distribution of the camera frustum split between shadow cascades, from 0 (linear
|
|
87
|
+
* split) to 1 (logarithmic split, concentrating shadow resolution near the camera), which
|
|
88
|
+
* applies only to `directional` lights with `num-cascades` greater than 1. Defaults to 0.5.
|
|
89
|
+
* @param value - The cascade distribution.
|
|
90
|
+
*/
|
|
91
|
+
set cascadeDistribution(value: number);
|
|
92
|
+
/**
|
|
93
|
+
* Gets the cascade distribution of the light, from 0 (linear split) to 1 (logarithmic split,
|
|
94
|
+
* concentrating shadow resolution near the camera), which applies only to `directional` lights
|
|
95
|
+
* with `num-cascades` greater than 1.
|
|
96
|
+
* @returns The cascade distribution.
|
|
97
|
+
*/
|
|
98
|
+
get cascadeDistribution(): number;
|
|
60
99
|
/**
|
|
61
100
|
* Sets the cast shadows flag of the light.
|
|
62
101
|
* @param value - The cast shadows flag.
|
|
@@ -107,6 +146,18 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
107
146
|
* @returns The normal offset bias.
|
|
108
147
|
*/
|
|
109
148
|
get normalOffsetBias(): number;
|
|
149
|
+
/**
|
|
150
|
+
* Sets the number of shadow cascades of the light, an integer from 1 (no cascades) to 4, which
|
|
151
|
+
* applies only to `directional` lights. Defaults to 1.
|
|
152
|
+
* @param value - The number of shadow cascades.
|
|
153
|
+
*/
|
|
154
|
+
set numCascades(value: number);
|
|
155
|
+
/**
|
|
156
|
+
* Gets the number of shadow cascades of the light, an integer from 1 (no cascades) to 4, which
|
|
157
|
+
* applies only to `directional` lights.
|
|
158
|
+
* @returns The number of shadow cascades.
|
|
159
|
+
*/
|
|
160
|
+
get numCascades(): number;
|
|
110
161
|
/**
|
|
111
162
|
* Sets the outer cone angle of the light.
|
|
112
163
|
* @param value - The outer cone angle.
|
|
@@ -7,14 +7,23 @@ import { ComponentElement } from './component.js';
|
|
|
7
7
|
* The LightComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link LightComponent} (`light`).
|
|
11
|
+
*
|
|
12
|
+
* @elementSummary The `<pc-light>` element lights the scene from its entity — as a directional,
|
|
13
|
+
* omni or spot light — with attributes for color, intensity, range and shadows. Must be a child of
|
|
14
|
+
* a `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
15
|
+
*
|
|
10
16
|
* @category Components
|
|
11
17
|
*/
|
|
12
18
|
declare class LightComponentElement extends ComponentElement {
|
|
19
|
+
private _cascadeBlend;
|
|
20
|
+
private _cascadeDistribution;
|
|
13
21
|
private _castShadows;
|
|
14
22
|
private _color;
|
|
15
23
|
private _innerConeAngle;
|
|
16
24
|
private _intensity;
|
|
17
25
|
private _normalOffsetBias;
|
|
26
|
+
private _numCascades;
|
|
18
27
|
private _outerConeAngle;
|
|
19
28
|
private _range;
|
|
20
29
|
private _shadowBias;
|
|
@@ -32,11 +41,14 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
32
41
|
/** @ignore */
|
|
33
42
|
constructor();
|
|
34
43
|
protected getInitialComponentData(): {
|
|
44
|
+
cascadeBlend: number;
|
|
45
|
+
cascadeDistribution: number;
|
|
35
46
|
castShadows: boolean;
|
|
36
47
|
color: Color;
|
|
37
48
|
innerConeAngle: number;
|
|
38
49
|
intensity: number;
|
|
39
50
|
normalOffsetBias: number;
|
|
51
|
+
numCascades: number;
|
|
40
52
|
outerConeAngle: number;
|
|
41
53
|
penumbraFalloff: number;
|
|
42
54
|
penumbraSize: number;
|
|
@@ -47,7 +59,7 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
47
59
|
shadowIntensity: number;
|
|
48
60
|
shadowResolution: number;
|
|
49
61
|
shadowSamples: number;
|
|
50
|
-
shadowType: number
|
|
62
|
+
shadowType: number;
|
|
51
63
|
type: "directional" | "omni" | "spot";
|
|
52
64
|
vsmBias: number;
|
|
53
65
|
vsmBlurSize: number;
|
|
@@ -57,6 +69,33 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
57
69
|
* @returns The light component.
|
|
58
70
|
*/
|
|
59
71
|
get component(): LightComponent;
|
|
72
|
+
/**
|
|
73
|
+
* Sets the fraction of each shadow cascade that is blended into the next one, from 0 (no
|
|
74
|
+
* blending) to 1, which applies only to `directional` lights with `num-cascades` greater than
|
|
75
|
+
* 1. Defaults to 0.
|
|
76
|
+
* @param value - The cascade blend factor.
|
|
77
|
+
*/
|
|
78
|
+
set cascadeBlend(value: number);
|
|
79
|
+
/**
|
|
80
|
+
* Gets the cascade blend factor of the light, from 0 (no blending) to 1, which applies only to
|
|
81
|
+
* `directional` lights with `num-cascades` greater than 1.
|
|
82
|
+
* @returns The cascade blend factor.
|
|
83
|
+
*/
|
|
84
|
+
get cascadeBlend(): number;
|
|
85
|
+
/**
|
|
86
|
+
* Sets the distribution of the camera frustum split between shadow cascades, from 0 (linear
|
|
87
|
+
* split) to 1 (logarithmic split, concentrating shadow resolution near the camera), which
|
|
88
|
+
* applies only to `directional` lights with `num-cascades` greater than 1. Defaults to 0.5.
|
|
89
|
+
* @param value - The cascade distribution.
|
|
90
|
+
*/
|
|
91
|
+
set cascadeDistribution(value: number);
|
|
92
|
+
/**
|
|
93
|
+
* Gets the cascade distribution of the light, from 0 (linear split) to 1 (logarithmic split,
|
|
94
|
+
* concentrating shadow resolution near the camera), which applies only to `directional` lights
|
|
95
|
+
* with `num-cascades` greater than 1.
|
|
96
|
+
* @returns The cascade distribution.
|
|
97
|
+
*/
|
|
98
|
+
get cascadeDistribution(): number;
|
|
60
99
|
/**
|
|
61
100
|
* Sets the cast shadows flag of the light.
|
|
62
101
|
* @param value - The cast shadows flag.
|
|
@@ -107,6 +146,18 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
107
146
|
* @returns The normal offset bias.
|
|
108
147
|
*/
|
|
109
148
|
get normalOffsetBias(): number;
|
|
149
|
+
/**
|
|
150
|
+
* Sets the number of shadow cascades of the light, an integer from 1 (no cascades) to 4, which
|
|
151
|
+
* applies only to `directional` lights. Defaults to 1.
|
|
152
|
+
* @param value - The number of shadow cascades.
|
|
153
|
+
*/
|
|
154
|
+
set numCascades(value: number);
|
|
155
|
+
/**
|
|
156
|
+
* Gets the number of shadow cascades of the light, an integer from 1 (no cascades) to 4, which
|
|
157
|
+
* applies only to `directional` lights.
|
|
158
|
+
* @returns The number of shadow cascades.
|
|
159
|
+
*/
|
|
160
|
+
get numCascades(): number;
|
|
110
161
|
/**
|
|
111
162
|
* Sets the outer cone angle of the light.
|
|
112
163
|
* @param value - The outer cone angle.
|
|
@@ -2,10 +2,16 @@ import type { ParticleSystemComponent } from 'playcanvas';
|
|
|
2
2
|
import { ComponentElement } from './component.cjs';
|
|
3
3
|
/**
|
|
4
4
|
* The ParticleSystemComponentElement interface provides properties and methods for manipulating
|
|
5
|
-
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-
|
|
5
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-particle-system/ | `<pc-particle-system>`} elements.
|
|
6
6
|
* The ParticleSystemComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link ParticleSystemComponent} (`particlesystem`).
|
|
10
|
+
*
|
|
11
|
+
* @elementSummary The `<pc-particle-system>` element emits particles from its entity, with
|
|
12
|
+
* attributes for the emitter's shape, rate, lifetime, textures and blending. Must be a child of a
|
|
13
|
+
* `<pc-entity>`, `<pc-model>` or `<pc-node>`.
|
|
14
|
+
*
|
|
9
15
|
* @category Components
|
|
10
16
|
*/
|
|
11
17
|
declare class ParticleSystemComponentElement extends ComponentElement {
|