@playcanvas/web-components 0.1.11 → 0.1.12
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 +31 -303
- package/dist/app.d.ts +4 -1
- package/dist/asset.d.ts +3 -2
- package/dist/components/camera-component.d.ts +4 -3
- package/dist/components/collision-component.d.ts +4 -3
- package/dist/components/element-component.d.ts +84 -3
- package/dist/components/light-component.d.ts +4 -3
- package/dist/components/listener-component.d.ts +4 -3
- package/dist/components/render-component.d.ts +4 -3
- package/dist/components/rigidbody-component.d.ts +5 -4
- package/dist/components/screen-component.d.ts +4 -3
- package/dist/components/script-component.d.ts +4 -3
- package/dist/components/sound-component.d.ts +4 -3
- package/dist/components/sound-slot.d.ts +2 -2
- package/dist/components/splat-component.d.ts +36 -0
- package/dist/entity.d.ts +3 -2
- package/dist/index.d.ts +2 -2
- package/dist/material.d.ts +3 -2
- package/dist/model.d.ts +6 -5
- package/dist/module.d.ts +3 -2
- package/dist/pwc.cjs +238 -65
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +238 -65
- 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.mjs +238 -65
- package/dist/pwc.mjs.map +1 -1
- package/dist/scene.d.ts +3 -2
- package/dist/sky.d.ts +64 -0
- package/package.json +23 -23
- package/src/app.ts +14 -10
- package/src/asset.ts +3 -2
- package/src/components/camera-component.ts +4 -3
- package/src/components/collision-component.ts +4 -3
- package/src/components/element-component.ts +84 -3
- package/src/components/light-component.ts +4 -3
- package/src/components/listener-component.ts +4 -3
- package/src/components/render-component.ts +4 -3
- package/src/components/rigidbody-component.ts +5 -4
- package/src/components/screen-component.ts +4 -3
- package/src/components/script-component.ts +4 -3
- package/src/components/sound-component.ts +4 -3
- package/src/components/sound-slot.ts +2 -2
- package/src/components/{gsplat-component.ts → splat-component.ts} +17 -8
- package/src/entity.ts +3 -2
- package/src/index.ts +2 -2
- package/src/material.ts +6 -5
- package/src/model.ts +8 -7
- package/src/module.ts +3 -2
- package/src/scene.ts +3 -2
- package/src/sky.ts +64 -0
- package/dist/components/gsplat-component.d.ts +0 -27
- package/dist/fog.d.ts +0 -28
- package/src/fog.ts +0 -121
package/dist/pwc.mjs
CHANGED
|
@@ -38,8 +38,9 @@ class AsyncElement extends HTMLElement {
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* The ModuleElement interface provides properties and methods for manipulating
|
|
41
|
-
* `<pc-module>` elements.
|
|
42
|
-
*
|
|
41
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-module/ | `<pc-module>`} elements.
|
|
42
|
+
* The ModuleElement interface also inherits the properties and methods of the
|
|
43
|
+
* {@link HTMLElement} interface.
|
|
43
44
|
*/
|
|
44
45
|
class ModuleElement extends HTMLElement {
|
|
45
46
|
/** @ignore */
|
|
@@ -77,7 +78,10 @@ class ModuleElement extends HTMLElement {
|
|
|
77
78
|
customElements.define('pc-module', ModuleElement);
|
|
78
79
|
|
|
79
80
|
/**
|
|
80
|
-
* The
|
|
81
|
+
* The AppElement interface provides properties and methods for manipulating
|
|
82
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-app/ | `<pc-app>`} elements.
|
|
83
|
+
* The AppElement interface also inherits the properties and methods of the
|
|
84
|
+
* {@link HTMLElement} interface.
|
|
81
85
|
*/
|
|
82
86
|
class AppElement extends AsyncElement {
|
|
83
87
|
/**
|
|
@@ -236,13 +240,14 @@ class AppElement extends AsyncElement {
|
|
|
236
240
|
// Get the currently hovered entity by walking up the hierarchy
|
|
237
241
|
let newHoverEntity = null;
|
|
238
242
|
if (selection.length > 0) {
|
|
239
|
-
let
|
|
240
|
-
while (
|
|
241
|
-
const entityElement = this.querySelector(`pc-entity[name="${
|
|
243
|
+
let currentNode = selection[0].node;
|
|
244
|
+
while (currentNode !== null) {
|
|
245
|
+
const entityElement = this.querySelector(`pc-entity[name="${currentNode.name}"]`);
|
|
242
246
|
if (entityElement) {
|
|
243
247
|
newHoverEntity = entityElement;
|
|
248
|
+
break;
|
|
244
249
|
}
|
|
245
|
-
|
|
250
|
+
currentNode = currentNode.parent;
|
|
246
251
|
}
|
|
247
252
|
}
|
|
248
253
|
// Handle enter/leave events
|
|
@@ -273,14 +278,14 @@ class AppElement extends AsyncElement {
|
|
|
273
278
|
this._picker.prepare(camera, this.app.scene);
|
|
274
279
|
const selection = this._picker.getSelection(x, y);
|
|
275
280
|
if (selection.length > 0) {
|
|
276
|
-
let
|
|
277
|
-
while (
|
|
278
|
-
const entityElement = this.querySelector(`pc-entity[name="${
|
|
281
|
+
let currentNode = selection[0].node;
|
|
282
|
+
while (currentNode !== null) {
|
|
283
|
+
const entityElement = this.querySelector(`pc-entity[name="${currentNode.name}"]`);
|
|
279
284
|
if (entityElement && entityElement.hasListeners('pointerdown')) {
|
|
280
285
|
entityElement.dispatchEvent(new PointerEvent('pointerdown', event));
|
|
281
286
|
break;
|
|
282
287
|
}
|
|
283
|
-
|
|
288
|
+
currentNode = currentNode.parent;
|
|
284
289
|
}
|
|
285
290
|
}
|
|
286
291
|
}
|
|
@@ -649,8 +654,9 @@ const parseVec4 = (value) => {
|
|
|
649
654
|
|
|
650
655
|
/**
|
|
651
656
|
* The EntityElement interface provides properties and methods for manipulating
|
|
652
|
-
* `<pc-entity>` elements.
|
|
653
|
-
*
|
|
657
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-entity/ | `<pc-entity>`} elements.
|
|
658
|
+
* The EntityElement interface also inherits the properties and methods of the
|
|
659
|
+
* {@link HTMLElement} interface.
|
|
654
660
|
*/
|
|
655
661
|
class EntityElement extends AsyncElement {
|
|
656
662
|
constructor() {
|
|
@@ -988,8 +994,9 @@ const extToType = new Map([
|
|
|
988
994
|
]);
|
|
989
995
|
/**
|
|
990
996
|
* The AssetElement interface provides properties and methods for manipulating
|
|
991
|
-
* `<pc-asset>` elements.
|
|
992
|
-
*
|
|
997
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-asset/ | `<pc-asset>`} elements.
|
|
998
|
+
* The AssetElement interface also inherits the properties and methods of the
|
|
999
|
+
* {@link HTMLElement} interface.
|
|
993
1000
|
*/
|
|
994
1001
|
class AssetElement extends HTMLElement {
|
|
995
1002
|
constructor() {
|
|
@@ -1138,8 +1145,9 @@ class ComponentElement extends AsyncElement {
|
|
|
1138
1145
|
|
|
1139
1146
|
/**
|
|
1140
1147
|
* The ListenerComponentElement interface provides properties and methods for manipulating
|
|
1141
|
-
* `<pc-listener>` elements.
|
|
1142
|
-
* and methods of the
|
|
1148
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-listener/ | `<pc-listener>`} elements.
|
|
1149
|
+
* The ListenerComponentElement interface also inherits the properties and methods of the
|
|
1150
|
+
* {@link HTMLElement} interface.
|
|
1143
1151
|
*
|
|
1144
1152
|
* @category Components
|
|
1145
1153
|
*/
|
|
@@ -1149,7 +1157,7 @@ class ListenerComponentElement extends ComponentElement {
|
|
|
1149
1157
|
super('audiolistener');
|
|
1150
1158
|
}
|
|
1151
1159
|
/**
|
|
1152
|
-
* Gets the audio listener component.
|
|
1160
|
+
* Gets the underlying PlayCanvas audio listener component.
|
|
1153
1161
|
* @returns The audio listener component.
|
|
1154
1162
|
*/
|
|
1155
1163
|
get component() {
|
|
@@ -1169,8 +1177,9 @@ const tonemaps = new Map([
|
|
|
1169
1177
|
]);
|
|
1170
1178
|
/**
|
|
1171
1179
|
* The CameraComponentElement interface provides properties and methods for manipulating
|
|
1172
|
-
* `<pc-camera>` elements.
|
|
1173
|
-
*
|
|
1180
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-camera/ | `<pc-camera>`} elements.
|
|
1181
|
+
* The CameraComponentElement interface also inherits the properties and methods of the
|
|
1182
|
+
* {@link HTMLElement} interface.
|
|
1174
1183
|
*
|
|
1175
1184
|
* @category Components
|
|
1176
1185
|
*/
|
|
@@ -1240,7 +1249,7 @@ class CameraComponentElement extends ComponentElement {
|
|
|
1240
1249
|
}
|
|
1241
1250
|
}
|
|
1242
1251
|
/**
|
|
1243
|
-
* Gets the camera component.
|
|
1252
|
+
* Gets the underlying PlayCanvas camera component.
|
|
1244
1253
|
* @returns The camera component.
|
|
1245
1254
|
*/
|
|
1246
1255
|
get component() {
|
|
@@ -1641,8 +1650,9 @@ customElements.define('pc-camera', CameraComponentElement);
|
|
|
1641
1650
|
|
|
1642
1651
|
/**
|
|
1643
1652
|
* The CollisionComponentElement interface provides properties and methods for manipulating
|
|
1644
|
-
* `<pc-collision>` elements.
|
|
1645
|
-
* and methods of the
|
|
1653
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-collision/ | `<pc-collision>`} elements.
|
|
1654
|
+
* The CollisionComponentElement interface also inherits the properties and methods of the
|
|
1655
|
+
* {@link HTMLElement} interface.
|
|
1646
1656
|
*
|
|
1647
1657
|
* @category Components
|
|
1648
1658
|
*/
|
|
@@ -1672,7 +1682,7 @@ class CollisionComponentElement extends ComponentElement {
|
|
|
1672
1682
|
};
|
|
1673
1683
|
}
|
|
1674
1684
|
/**
|
|
1675
|
-
* Gets the collision component.
|
|
1685
|
+
* Gets the underlying PlayCanvas collision component.
|
|
1676
1686
|
* @returns The collision component.
|
|
1677
1687
|
*/
|
|
1678
1688
|
get component() {
|
|
@@ -1787,8 +1797,9 @@ customElements.define('pc-collision', CollisionComponentElement);
|
|
|
1787
1797
|
|
|
1788
1798
|
/**
|
|
1789
1799
|
* The ElementComponentElement interface provides properties and methods for manipulating
|
|
1790
|
-
* `<pc-element>` elements.
|
|
1791
|
-
*
|
|
1800
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-element/ | `<pc-element>`} elements.
|
|
1801
|
+
* The ElementComponentElement interface also inherits the properties and methods of the
|
|
1802
|
+
* {@link HTMLElement} interface.
|
|
1792
1803
|
*
|
|
1793
1804
|
* @category Components
|
|
1794
1805
|
*/
|
|
@@ -1827,21 +1838,33 @@ class ElementComponentElement extends ComponentElement {
|
|
|
1827
1838
|
};
|
|
1828
1839
|
}
|
|
1829
1840
|
/**
|
|
1830
|
-
* Gets the element component.
|
|
1841
|
+
* Gets the underlying PlayCanvas element component.
|
|
1831
1842
|
* @returns The element component.
|
|
1832
1843
|
*/
|
|
1833
1844
|
get component() {
|
|
1834
1845
|
return super.component;
|
|
1835
1846
|
}
|
|
1847
|
+
/**
|
|
1848
|
+
* Sets the anchor of the element component.
|
|
1849
|
+
* @param value - The anchor.
|
|
1850
|
+
*/
|
|
1836
1851
|
set anchor(value) {
|
|
1837
1852
|
this._anchor = value;
|
|
1838
1853
|
if (this.component) {
|
|
1839
1854
|
this.component.anchor = value;
|
|
1840
1855
|
}
|
|
1841
1856
|
}
|
|
1857
|
+
/**
|
|
1858
|
+
* Gets the anchor of the element component.
|
|
1859
|
+
* @returns The anchor.
|
|
1860
|
+
*/
|
|
1842
1861
|
get anchor() {
|
|
1843
1862
|
return this._anchor;
|
|
1844
1863
|
}
|
|
1864
|
+
/**
|
|
1865
|
+
* Sets the id of the `pc-asset` to use for the font.
|
|
1866
|
+
* @param value - The asset ID.
|
|
1867
|
+
*/
|
|
1845
1868
|
set asset(value) {
|
|
1846
1869
|
this._asset = value;
|
|
1847
1870
|
const asset = AssetElement.get(value);
|
|
@@ -1849,60 +1872,112 @@ class ElementComponentElement extends ComponentElement {
|
|
|
1849
1872
|
this.component.fontAsset = asset.id;
|
|
1850
1873
|
}
|
|
1851
1874
|
}
|
|
1875
|
+
/**
|
|
1876
|
+
* Gets the id of the `pc-asset` to use for the font.
|
|
1877
|
+
* @returns The asset ID.
|
|
1878
|
+
*/
|
|
1852
1879
|
get asset() {
|
|
1853
1880
|
return this._asset;
|
|
1854
1881
|
}
|
|
1882
|
+
/**
|
|
1883
|
+
* Sets whether the element component should automatically adjust its width.
|
|
1884
|
+
* @param value - Whether to automatically adjust the width.
|
|
1885
|
+
*/
|
|
1855
1886
|
set autoWidth(value) {
|
|
1856
1887
|
this._autoWidth = value;
|
|
1857
1888
|
if (this.component) {
|
|
1858
1889
|
this.component.autoWidth = value;
|
|
1859
1890
|
}
|
|
1860
1891
|
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Gets whether the element component should automatically adjust its width.
|
|
1894
|
+
* @returns Whether to automatically adjust the width.
|
|
1895
|
+
*/
|
|
1861
1896
|
get autoWidth() {
|
|
1862
1897
|
return this._autoWidth;
|
|
1863
1898
|
}
|
|
1899
|
+
/**
|
|
1900
|
+
* Sets the color of the element component.
|
|
1901
|
+
* @param value - The color.
|
|
1902
|
+
*/
|
|
1864
1903
|
set color(value) {
|
|
1865
1904
|
this._color = value;
|
|
1866
1905
|
if (this.component) {
|
|
1867
1906
|
this.component.color = value;
|
|
1868
1907
|
}
|
|
1869
1908
|
}
|
|
1909
|
+
/**
|
|
1910
|
+
* Gets the color of the element component.
|
|
1911
|
+
* @returns The color.
|
|
1912
|
+
*/
|
|
1870
1913
|
get color() {
|
|
1871
1914
|
return this._color;
|
|
1872
1915
|
}
|
|
1916
|
+
/**
|
|
1917
|
+
* Sets the font size of the element component.
|
|
1918
|
+
* @param value - The font size.
|
|
1919
|
+
*/
|
|
1873
1920
|
set fontSize(value) {
|
|
1874
1921
|
this._fontSize = value;
|
|
1875
1922
|
if (this.component) {
|
|
1876
1923
|
this.component.fontSize = value;
|
|
1877
1924
|
}
|
|
1878
1925
|
}
|
|
1926
|
+
/**
|
|
1927
|
+
* Gets the font size of the element component.
|
|
1928
|
+
* @returns The font size.
|
|
1929
|
+
*/
|
|
1879
1930
|
get fontSize() {
|
|
1880
1931
|
return this._fontSize;
|
|
1881
1932
|
}
|
|
1933
|
+
/**
|
|
1934
|
+
* Sets the line height of the element component.
|
|
1935
|
+
* @param value - The line height.
|
|
1936
|
+
*/
|
|
1882
1937
|
set lineHeight(value) {
|
|
1883
1938
|
this._lineHeight = value;
|
|
1884
1939
|
if (this.component) {
|
|
1885
1940
|
this.component.lineHeight = value;
|
|
1886
1941
|
}
|
|
1887
1942
|
}
|
|
1943
|
+
/**
|
|
1944
|
+
* Gets the line height of the element component.
|
|
1945
|
+
* @returns The line height.
|
|
1946
|
+
*/
|
|
1888
1947
|
get lineHeight() {
|
|
1889
1948
|
return this._lineHeight;
|
|
1890
1949
|
}
|
|
1950
|
+
/**
|
|
1951
|
+
* Sets the pivot of the element component.
|
|
1952
|
+
* @param value - The pivot.
|
|
1953
|
+
*/
|
|
1891
1954
|
set pivot(value) {
|
|
1892
1955
|
this._pivot = value;
|
|
1893
1956
|
if (this.component) {
|
|
1894
1957
|
this.component.pivot = value;
|
|
1895
1958
|
}
|
|
1896
1959
|
}
|
|
1960
|
+
/**
|
|
1961
|
+
* Gets the pivot of the element component.
|
|
1962
|
+
* @returns The pivot.
|
|
1963
|
+
*/
|
|
1897
1964
|
get pivot() {
|
|
1898
1965
|
return this._pivot;
|
|
1899
1966
|
}
|
|
1967
|
+
/**
|
|
1968
|
+
* Sets the text of the element component.
|
|
1969
|
+
* @param value - The text.
|
|
1970
|
+
*/
|
|
1900
1971
|
set text(value) {
|
|
1901
1972
|
this._text = value;
|
|
1902
1973
|
if (this.component) {
|
|
1903
1974
|
this.component.text = value;
|
|
1904
1975
|
}
|
|
1905
1976
|
}
|
|
1977
|
+
/**
|
|
1978
|
+
* Gets the text of the element component.
|
|
1979
|
+
* @returns The text.
|
|
1980
|
+
*/
|
|
1906
1981
|
get text() {
|
|
1907
1982
|
return this._text;
|
|
1908
1983
|
}
|
|
@@ -1923,21 +1998,37 @@ class ElementComponentElement extends ComponentElement {
|
|
|
1923
1998
|
get type() {
|
|
1924
1999
|
return this._type;
|
|
1925
2000
|
}
|
|
2001
|
+
/**
|
|
2002
|
+
* Sets the width of the element component.
|
|
2003
|
+
* @param value - The width.
|
|
2004
|
+
*/
|
|
1926
2005
|
set width(value) {
|
|
1927
2006
|
this._width = value;
|
|
1928
2007
|
if (this.component) {
|
|
1929
2008
|
this.component.width = value;
|
|
1930
2009
|
}
|
|
1931
2010
|
}
|
|
2011
|
+
/**
|
|
2012
|
+
* Gets the width of the element component.
|
|
2013
|
+
* @returns The width.
|
|
2014
|
+
*/
|
|
1932
2015
|
get width() {
|
|
1933
2016
|
return this._width;
|
|
1934
2017
|
}
|
|
2018
|
+
/**
|
|
2019
|
+
* Sets whether the element component should wrap lines.
|
|
2020
|
+
* @param value - Whether to wrap lines.
|
|
2021
|
+
*/
|
|
1935
2022
|
set wrapLines(value) {
|
|
1936
2023
|
this._wrapLines = value;
|
|
1937
2024
|
if (this.component) {
|
|
1938
2025
|
this.component.wrapLines = value;
|
|
1939
2026
|
}
|
|
1940
2027
|
}
|
|
2028
|
+
/**
|
|
2029
|
+
* Gets whether the element component should wrap lines.
|
|
2030
|
+
* @returns Whether to wrap lines.
|
|
2031
|
+
*/
|
|
1941
2032
|
get wrapLines() {
|
|
1942
2033
|
return this._wrapLines;
|
|
1943
2034
|
}
|
|
@@ -1999,13 +2090,14 @@ class ElementComponentElement extends ComponentElement {
|
|
|
1999
2090
|
customElements.define('pc-element', ElementComponentElement);
|
|
2000
2091
|
|
|
2001
2092
|
/**
|
|
2002
|
-
* The
|
|
2003
|
-
* `<pc-splat>` elements.
|
|
2004
|
-
*
|
|
2093
|
+
* The SplatComponentElement interface provides properties and methods for manipulating
|
|
2094
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-splat/ | `<pc-splat>`} elements.
|
|
2095
|
+
* The SplatComponentElement interface also inherits the properties and methods of the
|
|
2096
|
+
* {@link HTMLElement} interface.
|
|
2005
2097
|
*
|
|
2006
2098
|
* @category Components
|
|
2007
2099
|
*/
|
|
2008
|
-
class
|
|
2100
|
+
class SplatComponentElement extends ComponentElement {
|
|
2009
2101
|
/** @ignore */
|
|
2010
2102
|
constructor() {
|
|
2011
2103
|
super('gsplat');
|
|
@@ -2017,12 +2109,16 @@ class GSplatComponentElement extends ComponentElement {
|
|
|
2017
2109
|
};
|
|
2018
2110
|
}
|
|
2019
2111
|
/**
|
|
2020
|
-
* Gets the
|
|
2021
|
-
* @returns The
|
|
2112
|
+
* Gets the underlying PlayCanvas splat component.
|
|
2113
|
+
* @returns The splat component.
|
|
2022
2114
|
*/
|
|
2023
2115
|
get component() {
|
|
2024
2116
|
return super.component;
|
|
2025
2117
|
}
|
|
2118
|
+
/**
|
|
2119
|
+
* Sets id of the `pc-asset` to use for the splat.
|
|
2120
|
+
* @param value - The asset ID.
|
|
2121
|
+
*/
|
|
2026
2122
|
set asset(value) {
|
|
2027
2123
|
this._asset = value;
|
|
2028
2124
|
const asset = AssetElement.get(value);
|
|
@@ -2030,6 +2126,10 @@ class GSplatComponentElement extends ComponentElement {
|
|
|
2030
2126
|
this.component.asset = asset;
|
|
2031
2127
|
}
|
|
2032
2128
|
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Gets the id of the `pc-asset` to use for the splat.
|
|
2131
|
+
* @returns The asset ID.
|
|
2132
|
+
*/
|
|
2033
2133
|
get asset() {
|
|
2034
2134
|
return this._asset;
|
|
2035
2135
|
}
|
|
@@ -2045,7 +2145,7 @@ class GSplatComponentElement extends ComponentElement {
|
|
|
2045
2145
|
}
|
|
2046
2146
|
}
|
|
2047
2147
|
}
|
|
2048
|
-
customElements.define('pc-splat',
|
|
2148
|
+
customElements.define('pc-splat', SplatComponentElement);
|
|
2049
2149
|
|
|
2050
2150
|
const shadowTypes = new Map([
|
|
2051
2151
|
['pcf1-16f', SHADOW_PCF1_16F],
|
|
@@ -2060,8 +2160,9 @@ const shadowTypes = new Map([
|
|
|
2060
2160
|
]);
|
|
2061
2161
|
/**
|
|
2062
2162
|
* The LightComponentElement interface provides properties and methods for manipulating
|
|
2063
|
-
* `<pc-light>` elements.
|
|
2064
|
-
*
|
|
2163
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-light/ | `<pc-light>`} elements.
|
|
2164
|
+
* The LightComponentElement interface also inherits the properties and methods of the
|
|
2165
|
+
* {@link HTMLElement} interface.
|
|
2065
2166
|
*
|
|
2066
2167
|
* @category Components
|
|
2067
2168
|
*/
|
|
@@ -2103,7 +2204,7 @@ class LightComponentElement extends ComponentElement {
|
|
|
2103
2204
|
};
|
|
2104
2205
|
}
|
|
2105
2206
|
/**
|
|
2106
|
-
* Gets the light component.
|
|
2207
|
+
* Gets the underlying PlayCanvas light component.
|
|
2107
2208
|
* @returns The light component.
|
|
2108
2209
|
*/
|
|
2109
2210
|
get component() {
|
|
@@ -2433,8 +2534,9 @@ customElements.define('pc-light', LightComponentElement);
|
|
|
2433
2534
|
|
|
2434
2535
|
/**
|
|
2435
2536
|
* The MaterialElement interface provides properties and methods for manipulating
|
|
2436
|
-
* `<pc-material>` elements.
|
|
2437
|
-
*
|
|
2537
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-material/ | `<pc-material>`} elements.
|
|
2538
|
+
* The MaterialElement interface also inherits the properties and methods of the
|
|
2539
|
+
* {@link HTMLElement} interface.
|
|
2438
2540
|
*/
|
|
2439
2541
|
class MaterialElement extends HTMLElement {
|
|
2440
2542
|
constructor() {
|
|
@@ -2549,8 +2651,9 @@ customElements.define('pc-material', MaterialElement);
|
|
|
2549
2651
|
|
|
2550
2652
|
/**
|
|
2551
2653
|
* The RenderComponentElement interface provides properties and methods for manipulating
|
|
2552
|
-
* `<pc-render>` elements.
|
|
2553
|
-
*
|
|
2654
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-render/ | `<pc-render>`} elements.
|
|
2655
|
+
* The RenderComponentElement interface also inherits the properties and methods of the
|
|
2656
|
+
* {@link HTMLElement} interface.
|
|
2554
2657
|
*
|
|
2555
2658
|
* @category Components
|
|
2556
2659
|
*/
|
|
@@ -2572,7 +2675,7 @@ class RenderComponentElement extends ComponentElement {
|
|
|
2572
2675
|
};
|
|
2573
2676
|
}
|
|
2574
2677
|
/**
|
|
2575
|
-
* Gets the render component.
|
|
2678
|
+
* Gets the underlying PlayCanvas render component.
|
|
2576
2679
|
* @returns The render component.
|
|
2577
2680
|
*/
|
|
2578
2681
|
get component() {
|
|
@@ -2671,8 +2774,9 @@ customElements.define('pc-render', RenderComponentElement);
|
|
|
2671
2774
|
|
|
2672
2775
|
/**
|
|
2673
2776
|
* The RigidBodyComponentElement interface provides properties and methods for manipulating
|
|
2674
|
-
* `<pc-rigidbody>` elements.
|
|
2675
|
-
* and methods of the
|
|
2777
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-rigidbody/ | `<pc-rigidbody>`} elements.
|
|
2778
|
+
* The RigidBodyComponentElement interface also inherits the properties and methods of the
|
|
2779
|
+
* {@link HTMLElement} interface.
|
|
2676
2780
|
*
|
|
2677
2781
|
* @category Components
|
|
2678
2782
|
*/
|
|
@@ -2731,8 +2835,8 @@ class RigidBodyComponentElement extends ComponentElement {
|
|
|
2731
2835
|
};
|
|
2732
2836
|
}
|
|
2733
2837
|
/**
|
|
2734
|
-
* Gets the
|
|
2735
|
-
* @returns The
|
|
2838
|
+
* Gets the underlying PlayCanvas rigidbody component.
|
|
2839
|
+
* @returns The rigidbody component.
|
|
2736
2840
|
*/
|
|
2737
2841
|
get component() {
|
|
2738
2842
|
return super.component;
|
|
@@ -2858,8 +2962,9 @@ customElements.define('pc-rigidbody', RigidBodyComponentElement);
|
|
|
2858
2962
|
|
|
2859
2963
|
/**
|
|
2860
2964
|
* The ScreenComponentElement interface provides properties and methods for manipulating
|
|
2861
|
-
* `<pc-screen>` elements.
|
|
2862
|
-
*
|
|
2965
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-screen/ | `<pc-screen>`} elements.
|
|
2966
|
+
* The ScreenComponentElement interface also inherits the properties and methods of the
|
|
2967
|
+
* {@link HTMLElement} interface.
|
|
2863
2968
|
*
|
|
2864
2969
|
* @category Components
|
|
2865
2970
|
*/
|
|
@@ -2885,7 +2990,7 @@ class ScreenComponentElement extends ComponentElement {
|
|
|
2885
2990
|
};
|
|
2886
2991
|
}
|
|
2887
2992
|
/**
|
|
2888
|
-
* Gets the screen component.
|
|
2993
|
+
* Gets the underlying PlayCanvas screen component.
|
|
2889
2994
|
* @returns The screen component.
|
|
2890
2995
|
*/
|
|
2891
2996
|
get component() {
|
|
@@ -2984,8 +3089,9 @@ customElements.define('pc-screen', ScreenComponentElement);
|
|
|
2984
3089
|
|
|
2985
3090
|
/**
|
|
2986
3091
|
* The ScriptComponentElement interface provides properties and methods for manipulating
|
|
2987
|
-
* `<pc-scripts>` elements.
|
|
2988
|
-
*
|
|
3092
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-scripts/ | `<pc-scripts>`} elements.
|
|
3093
|
+
* The ScriptComponentElement interface also inherits the properties and methods of the
|
|
3094
|
+
* {@link HTMLElement} interface.
|
|
2989
3095
|
*
|
|
2990
3096
|
* @category Components
|
|
2991
3097
|
*/
|
|
@@ -3135,7 +3241,7 @@ class ScriptComponentElement extends ComponentElement {
|
|
|
3135
3241
|
(_a = super.disconnectedCallback) === null || _a === undefined ? undefined : _a.call(this);
|
|
3136
3242
|
}
|
|
3137
3243
|
/**
|
|
3138
|
-
* Gets the script component.
|
|
3244
|
+
* Gets the underlying PlayCanvas script component.
|
|
3139
3245
|
* @returns The script component.
|
|
3140
3246
|
*/
|
|
3141
3247
|
get component() {
|
|
@@ -3227,8 +3333,9 @@ customElements.define('pc-script', ScriptElement);
|
|
|
3227
3333
|
|
|
3228
3334
|
/**
|
|
3229
3335
|
* The SoundComponentElement interface provides properties and methods for manipulating
|
|
3230
|
-
* `<pc-sounds>` elements.
|
|
3231
|
-
*
|
|
3336
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-sounds/ | `<pc-sounds>`} elements.
|
|
3337
|
+
* The SoundComponentElement interface also inherits the properties and methods of the
|
|
3338
|
+
* {@link HTMLElement} interface.
|
|
3232
3339
|
*
|
|
3233
3340
|
* @category Components
|
|
3234
3341
|
*/
|
|
@@ -3256,7 +3363,7 @@ class SoundComponentElement extends ComponentElement {
|
|
|
3256
3363
|
};
|
|
3257
3364
|
}
|
|
3258
3365
|
/**
|
|
3259
|
-
* Gets the sound component.
|
|
3366
|
+
* Gets the underlying PlayCanvas sound component.
|
|
3260
3367
|
* @returns The sound component.
|
|
3261
3368
|
*/
|
|
3262
3369
|
get component() {
|
|
@@ -3475,7 +3582,7 @@ class SoundSlotElement extends AsyncElement {
|
|
|
3475
3582
|
return soundElement;
|
|
3476
3583
|
}
|
|
3477
3584
|
/**
|
|
3478
|
-
* Sets the
|
|
3585
|
+
* Sets the id of the `pc-asset` to use for the sound slot.
|
|
3479
3586
|
* @param value - The asset.
|
|
3480
3587
|
*/
|
|
3481
3588
|
set asset(value) {
|
|
@@ -3489,7 +3596,7 @@ class SoundSlotElement extends AsyncElement {
|
|
|
3489
3596
|
}
|
|
3490
3597
|
}
|
|
3491
3598
|
/**
|
|
3492
|
-
* Gets the
|
|
3599
|
+
* Gets the id of the `pc-asset` to use for the sound slot.
|
|
3493
3600
|
* @returns The asset.
|
|
3494
3601
|
*/
|
|
3495
3602
|
get asset() {
|
|
@@ -3667,8 +3774,9 @@ customElements.define('pc-sound', SoundSlotElement);
|
|
|
3667
3774
|
|
|
3668
3775
|
/**
|
|
3669
3776
|
* The ModelElement interface provides properties and methods for manipulating
|
|
3670
|
-
* `<pc-model>` elements.
|
|
3671
|
-
*
|
|
3777
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-model/ | `<pc-model>`} elements.
|
|
3778
|
+
* The ModelElement interface also inherits the properties and methods of the
|
|
3779
|
+
* {@link HTMLElement} interface.
|
|
3672
3780
|
*/
|
|
3673
3781
|
class ModelElement extends AsyncElement {
|
|
3674
3782
|
constructor() {
|
|
@@ -3731,7 +3839,7 @@ class ModelElement extends AsyncElement {
|
|
|
3731
3839
|
this._entity = null;
|
|
3732
3840
|
}
|
|
3733
3841
|
/**
|
|
3734
|
-
* Sets the asset
|
|
3842
|
+
* Sets the id of the `pc-asset` to use for the model.
|
|
3735
3843
|
* @param value - The asset ID.
|
|
3736
3844
|
*/
|
|
3737
3845
|
set asset(value) {
|
|
@@ -3741,8 +3849,8 @@ class ModelElement extends AsyncElement {
|
|
|
3741
3849
|
}
|
|
3742
3850
|
}
|
|
3743
3851
|
/**
|
|
3744
|
-
* Gets the
|
|
3745
|
-
* @returns The
|
|
3852
|
+
* Gets the id of the `pc-asset` to use for the model.
|
|
3853
|
+
* @returns The asset ID.
|
|
3746
3854
|
*/
|
|
3747
3855
|
get asset() {
|
|
3748
3856
|
return this._asset;
|
|
@@ -3762,8 +3870,9 @@ customElements.define('pc-model', ModelElement);
|
|
|
3762
3870
|
|
|
3763
3871
|
/**
|
|
3764
3872
|
* The SceneElement interface provides properties and methods for manipulating
|
|
3765
|
-
* `<pc-scene>` elements.
|
|
3766
|
-
*
|
|
3873
|
+
* {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-scene/ | `<pc-scene>`} elements.
|
|
3874
|
+
* The SceneElement interface also inherits the properties and methods of the
|
|
3875
|
+
* {@link HTMLElement} interface.
|
|
3767
3876
|
*/
|
|
3768
3877
|
class SceneElement extends AsyncElement {
|
|
3769
3878
|
constructor() {
|
|
@@ -4001,66 +4110,126 @@ class SkyElement extends AsyncElement {
|
|
|
4001
4110
|
this._scene.envAtlas = null;
|
|
4002
4111
|
this._scene = null;
|
|
4003
4112
|
}
|
|
4113
|
+
/**
|
|
4114
|
+
* Sets the id of the `pc-asset` to use for the skybox.
|
|
4115
|
+
* @param value - The asset ID.
|
|
4116
|
+
*/
|
|
4004
4117
|
set asset(value) {
|
|
4005
4118
|
this._asset = value;
|
|
4006
4119
|
if (this.isConnected) {
|
|
4007
4120
|
this._loadSkybox();
|
|
4008
4121
|
}
|
|
4009
4122
|
}
|
|
4123
|
+
/**
|
|
4124
|
+
* Gets the id of the `pc-asset` to use for the skybox.
|
|
4125
|
+
* @returns The asset ID.
|
|
4126
|
+
*/
|
|
4010
4127
|
get asset() {
|
|
4011
4128
|
return this._asset;
|
|
4012
4129
|
}
|
|
4130
|
+
/**
|
|
4131
|
+
* Sets the center of the skybox.
|
|
4132
|
+
* @param value - The center.
|
|
4133
|
+
*/
|
|
4013
4134
|
set center(value) {
|
|
4014
4135
|
this._center = value;
|
|
4015
4136
|
if (this._scene) {
|
|
4016
4137
|
this._scene.sky.center = this._center;
|
|
4017
4138
|
}
|
|
4018
4139
|
}
|
|
4140
|
+
/**
|
|
4141
|
+
* Gets the center of the skybox.
|
|
4142
|
+
* @returns The center.
|
|
4143
|
+
*/
|
|
4019
4144
|
get center() {
|
|
4020
4145
|
return this._center;
|
|
4021
4146
|
}
|
|
4147
|
+
/**
|
|
4148
|
+
* Sets the intensity of the skybox.
|
|
4149
|
+
* @param value - The intensity.
|
|
4150
|
+
*/
|
|
4022
4151
|
set intensity(value) {
|
|
4023
4152
|
this._intensity = value;
|
|
4024
4153
|
if (this._scene) {
|
|
4025
4154
|
this._scene.skyboxIntensity = this._intensity;
|
|
4026
4155
|
}
|
|
4027
4156
|
}
|
|
4157
|
+
/**
|
|
4158
|
+
* Gets the intensity of the skybox.
|
|
4159
|
+
* @returns The intensity.
|
|
4160
|
+
*/
|
|
4028
4161
|
get intensity() {
|
|
4029
4162
|
return this._intensity;
|
|
4030
4163
|
}
|
|
4164
|
+
/**
|
|
4165
|
+
* Sets the mip level of the skybox.
|
|
4166
|
+
* @param value - The mip level.
|
|
4167
|
+
*/
|
|
4031
4168
|
set level(value) {
|
|
4032
4169
|
this._level = value;
|
|
4033
4170
|
if (this._scene) {
|
|
4034
4171
|
this._scene.skyboxMip = this._level;
|
|
4035
4172
|
}
|
|
4036
4173
|
}
|
|
4174
|
+
/**
|
|
4175
|
+
* Gets the mip level of the skybox.
|
|
4176
|
+
* @returns The mip level.
|
|
4177
|
+
*/
|
|
4037
4178
|
get level() {
|
|
4038
4179
|
return this._level;
|
|
4039
4180
|
}
|
|
4181
|
+
/**
|
|
4182
|
+
* Sets whether the skybox is used as a light source.
|
|
4183
|
+
* @param value - Whether to use lighting.
|
|
4184
|
+
*/
|
|
4040
4185
|
set lighting(value) {
|
|
4041
4186
|
this._lighting = value;
|
|
4042
4187
|
}
|
|
4188
|
+
/**
|
|
4189
|
+
* Gets whether the skybox is used as a light source.
|
|
4190
|
+
* @returns Whether to use lighting.
|
|
4191
|
+
*/
|
|
4043
4192
|
get lighting() {
|
|
4044
4193
|
return this._lighting;
|
|
4045
4194
|
}
|
|
4195
|
+
/**
|
|
4196
|
+
* Sets the Euler rotation of the skybox.
|
|
4197
|
+
* @param value - The rotation.
|
|
4198
|
+
*/
|
|
4046
4199
|
set rotation(value) {
|
|
4047
4200
|
this._rotation = value;
|
|
4048
4201
|
if (this._scene) {
|
|
4049
4202
|
this._scene.skyboxRotation = new Quat().setFromEulerAngles(value);
|
|
4050
4203
|
}
|
|
4051
4204
|
}
|
|
4205
|
+
/**
|
|
4206
|
+
* Gets the Euler rotation of the skybox.
|
|
4207
|
+
* @returns The rotation.
|
|
4208
|
+
*/
|
|
4052
4209
|
get rotation() {
|
|
4053
4210
|
return this._rotation;
|
|
4054
4211
|
}
|
|
4212
|
+
/**
|
|
4213
|
+
* Sets the scale of the skybox.
|
|
4214
|
+
* @param value - The scale.
|
|
4215
|
+
*/
|
|
4055
4216
|
set scale(value) {
|
|
4056
4217
|
this._scale = value;
|
|
4057
4218
|
if (this._scene) {
|
|
4058
4219
|
this._scene.sky.node.setLocalScale(this._scale);
|
|
4059
4220
|
}
|
|
4060
4221
|
}
|
|
4222
|
+
/**
|
|
4223
|
+
* Gets the scale of the skybox.
|
|
4224
|
+
* @returns The scale.
|
|
4225
|
+
*/
|
|
4061
4226
|
get scale() {
|
|
4062
4227
|
return this._scale;
|
|
4063
4228
|
}
|
|
4229
|
+
/**
|
|
4230
|
+
* Sets the type of the skybox.
|
|
4231
|
+
* @param value - The type.
|
|
4232
|
+
*/
|
|
4064
4233
|
set type(value) {
|
|
4065
4234
|
this._type = value;
|
|
4066
4235
|
if (this._scene) {
|
|
@@ -4071,6 +4240,10 @@ class SkyElement extends AsyncElement {
|
|
|
4071
4240
|
}
|
|
4072
4241
|
}
|
|
4073
4242
|
}
|
|
4243
|
+
/**
|
|
4244
|
+
* Gets the type of the skybox.
|
|
4245
|
+
* @returns The type.
|
|
4246
|
+
*/
|
|
4074
4247
|
get type() {
|
|
4075
4248
|
return this._type;
|
|
4076
4249
|
}
|
|
@@ -4108,5 +4281,5 @@ class SkyElement extends AsyncElement {
|
|
|
4108
4281
|
}
|
|
4109
4282
|
customElements.define('pc-sky', SkyElement);
|
|
4110
4283
|
|
|
4111
|
-
export { AppElement, AssetElement, AsyncElement, CameraComponentElement, CollisionComponentElement, ComponentElement, ElementComponentElement, EntityElement,
|
|
4284
|
+
export { AppElement, AssetElement, AsyncElement, CameraComponentElement, CollisionComponentElement, ComponentElement, ElementComponentElement, EntityElement, LightComponentElement, ListenerComponentElement, MaterialElement, ModelElement, ModuleElement, RenderComponentElement, RigidBodyComponentElement, SceneElement, ScreenComponentElement, ScriptComponentElement, ScriptElement, SkyElement, SoundComponentElement, SoundSlotElement, SplatComponentElement };
|
|
4112
4285
|
//# sourceMappingURL=pwc.mjs.map
|