@playcanvas/web-components 0.14.0 → 0.15.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/dist/components/joint-component.d.cts +521 -0
- package/dist/components/joint-component.d.ts +521 -0
- package/dist/custom-elements.json +916 -0
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/pwc.cjs +917 -14
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +917 -14
- 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 +917 -15
- package/dist/pwc.mjs.map +1 -1
- package/dist/vscode.html-custom-data.json +192 -0
- package/dist/web-types.json +348 -1
- package/package.json +3 -2
- package/src/app.ts +18 -0
- package/src/components/joint-component.ts +984 -0
- package/src/entity.ts +28 -7
- package/src/index.ts +4 -0
- package/src/node.ts +2 -7
|
@@ -1329,6 +1329,198 @@
|
|
|
1329
1329
|
],
|
|
1330
1330
|
"references": []
|
|
1331
1331
|
},
|
|
1332
|
+
{
|
|
1333
|
+
"name": "pc-joint",
|
|
1334
|
+
"description": "The JointComponentElement interface provides properties and methods for manipulating\n[`<pc-joint>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-joint/) elements.\nThe JointComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe entity holding the joint is not itself constrained. Its world transform defines the joint\nframe — the anchor point and axes the constraint operates about — with the local X axis as the\nprimary axis: a hinge rotates about it, a slider translates along it and a ball joint twists\nabout it. The constrained bodies are referenced by `entity-a` and `entity-b`, both of which need\na rigid body component; leaving `entity-b` empty constrains `entity-a` to a fixed point in world\nspace. The underlying engine component is in alpha, so its API may change.\n\n---\n\n\n### **Events:**\n - **break** - Fired when the impulse on the joint exceeds `break-impulse` and the constraint breaks. A broken joint no longer constrains its bodies; calling `refreshFrames()` on the underlying component re-attaches it. Bubbles and is composed.\n- **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
1335
|
+
"attributes": [
|
|
1336
|
+
{
|
|
1337
|
+
"name": "angular-damping",
|
|
1338
|
+
"description": "The spring damping of the joint per angular axis. Accepts 3 space-separated numbers.",
|
|
1339
|
+
"values": []
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
"name": "angular-equilibrium",
|
|
1343
|
+
"description": "The rest angle of the joint's angular springs. Accepts 3 space-separated numbers.",
|
|
1344
|
+
"values": []
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
"name": "angular-limits-x",
|
|
1348
|
+
"description": "The rotation limits of the joint about its X axis. Accepts 2 space-separated numbers.",
|
|
1349
|
+
"values": []
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
"name": "angular-limits-y",
|
|
1353
|
+
"description": "The rotation limits of the joint about its Y axis. Accepts 2 space-separated numbers.",
|
|
1354
|
+
"values": []
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
"name": "angular-limits-z",
|
|
1358
|
+
"description": "The rotation limits of the joint about its Z axis. Accepts 2 space-separated numbers.",
|
|
1359
|
+
"values": []
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
"name": "angular-motion-x",
|
|
1363
|
+
"description": "How the joint constrains rotation about its X axis.",
|
|
1364
|
+
"values": [
|
|
1365
|
+
{ "name": "locked" },
|
|
1366
|
+
{ "name": "limited" },
|
|
1367
|
+
{ "name": "free" }
|
|
1368
|
+
]
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
"name": "angular-motion-y",
|
|
1372
|
+
"description": "How the joint constrains rotation about its Y axis.",
|
|
1373
|
+
"values": [
|
|
1374
|
+
{ "name": "locked" },
|
|
1375
|
+
{ "name": "limited" },
|
|
1376
|
+
{ "name": "free" }
|
|
1377
|
+
]
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
"name": "angular-motion-z",
|
|
1381
|
+
"description": "How the joint constrains rotation about its Z axis.",
|
|
1382
|
+
"values": [
|
|
1383
|
+
{ "name": "locked" },
|
|
1384
|
+
{ "name": "limited" },
|
|
1385
|
+
{ "name": "free" }
|
|
1386
|
+
]
|
|
1387
|
+
},
|
|
1388
|
+
{
|
|
1389
|
+
"name": "angular-stiffness",
|
|
1390
|
+
"description": "The spring stiffness of the joint per angular axis. Accepts 3 space-separated numbers.",
|
|
1391
|
+
"values": []
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
"name": "break-impulse",
|
|
1395
|
+
"description": "The impulse above which the joint breaks.",
|
|
1396
|
+
"values": []
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
"name": "enable-collision",
|
|
1400
|
+
"description": "Whether collision is enabled between the two constrained bodies.",
|
|
1401
|
+
"values": []
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
"name": "enable-limits",
|
|
1405
|
+
"description": "Whether the limits of the joint are enforced.",
|
|
1406
|
+
"values": []
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"name": "enabled",
|
|
1410
|
+
"description": "The enabled state of the component.",
|
|
1411
|
+
"values": []
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
"name": "entity-a",
|
|
1415
|
+
"description": "The reference to the `<pc-entity>` providing the first constrained body.",
|
|
1416
|
+
"values": []
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
"name": "entity-b",
|
|
1420
|
+
"description": "The reference to the `<pc-entity>` providing the second constrained body.",
|
|
1421
|
+
"values": []
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
"name": "limits",
|
|
1425
|
+
"description": "The rotation or travel limits of the joint. Accepts 2 space-separated numbers.",
|
|
1426
|
+
"values": []
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
"name": "linear-damping",
|
|
1430
|
+
"description": "The spring damping of the joint per linear axis. Accepts 3 space-separated numbers.",
|
|
1431
|
+
"values": []
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
"name": "linear-equilibrium",
|
|
1435
|
+
"description": "The rest point of the joint's linear springs. Accepts 3 space-separated numbers.",
|
|
1436
|
+
"values": []
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
"name": "linear-limits-x",
|
|
1440
|
+
"description": "The translation limits of the joint along its X axis. Accepts 2 space-separated numbers.",
|
|
1441
|
+
"values": []
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
"name": "linear-limits-y",
|
|
1445
|
+
"description": "The translation limits of the joint along its Y axis. Accepts 2 space-separated numbers.",
|
|
1446
|
+
"values": []
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
"name": "linear-limits-z",
|
|
1450
|
+
"description": "The translation limits of the joint along its Z axis. Accepts 2 space-separated numbers.",
|
|
1451
|
+
"values": []
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
"name": "linear-motion-x",
|
|
1455
|
+
"description": "How the joint constrains translation along its X axis.",
|
|
1456
|
+
"values": [
|
|
1457
|
+
{ "name": "locked" },
|
|
1458
|
+
{ "name": "limited" },
|
|
1459
|
+
{ "name": "free" }
|
|
1460
|
+
]
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"name": "linear-motion-y",
|
|
1464
|
+
"description": "How the joint constrains translation along its Y axis.",
|
|
1465
|
+
"values": [
|
|
1466
|
+
{ "name": "locked" },
|
|
1467
|
+
{ "name": "limited" },
|
|
1468
|
+
{ "name": "free" }
|
|
1469
|
+
]
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
"name": "linear-motion-z",
|
|
1473
|
+
"description": "How the joint constrains translation along its Z axis.",
|
|
1474
|
+
"values": [
|
|
1475
|
+
{ "name": "locked" },
|
|
1476
|
+
{ "name": "limited" },
|
|
1477
|
+
{ "name": "free" }
|
|
1478
|
+
]
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
"name": "linear-stiffness",
|
|
1482
|
+
"description": "The spring stiffness of the joint per linear axis. Accepts 3 space-separated numbers.",
|
|
1483
|
+
"values": []
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
"name": "max-motor-force",
|
|
1487
|
+
"description": "The maximum torque or force of the joint's motor.",
|
|
1488
|
+
"values": []
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
"name": "motor-speed",
|
|
1492
|
+
"description": "The target speed of the joint's motor.",
|
|
1493
|
+
"values": []
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
"name": "swing-limit-y",
|
|
1497
|
+
"description": "The maximum swing of the joint around the joint frame's Y axis.",
|
|
1498
|
+
"values": []
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
"name": "swing-limit-z",
|
|
1502
|
+
"description": "The maximum swing of the joint around the joint frame's Z axis.",
|
|
1503
|
+
"values": []
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
"name": "twist-limit",
|
|
1507
|
+
"description": "The maximum twist of the joint about its primary axis.",
|
|
1508
|
+
"values": []
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
"name": "type",
|
|
1512
|
+
"description": "The type of the joint.",
|
|
1513
|
+
"values": [
|
|
1514
|
+
{ "name": "fixed" },
|
|
1515
|
+
{ "name": "ball" },
|
|
1516
|
+
{ "name": "hinge" },
|
|
1517
|
+
{ "name": "slider" },
|
|
1518
|
+
{ "name": "6dof" }
|
|
1519
|
+
]
|
|
1520
|
+
}
|
|
1521
|
+
],
|
|
1522
|
+
"references": []
|
|
1523
|
+
},
|
|
1332
1524
|
{
|
|
1333
1525
|
"name": "pc-layoutchild",
|
|
1334
1526
|
"description": "The LayoutChildComponentElement interface provides properties and methods for manipulating\n[`<pc-layoutchild>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-layoutchild/) elements.\nThe LayoutChildComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\n---\n\n\n### **Events:**\n - **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@playcanvas/web-components",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -2713,6 +2713,353 @@
|
|
|
2713
2713
|
]
|
|
2714
2714
|
}
|
|
2715
2715
|
},
|
|
2716
|
+
{
|
|
2717
|
+
"name": "pc-joint",
|
|
2718
|
+
"description": "The JointComponentElement interface provides properties and methods for manipulating\n[`<pc-joint>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-joint/) elements.\nThe JointComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe entity holding the joint is not itself constrained. Its world transform defines the joint\nframe — the anchor point and axes the constraint operates about — with the local X axis as the\nprimary axis: a hinge rotates about it, a slider translates along it and a ball joint twists\nabout it. The constrained bodies are referenced by `entity-a` and `entity-b`, both of which need\na rigid body component; leaving `entity-b` empty constrains `entity-a` to a fixed point in world\nspace. The underlying engine component is in alpha, so its API may change.\n\n---\n\n\n### **Events:**\n - **break** - Fired when the impulse on the joint exceeds `break-impulse` and the constraint breaks. A broken joint no longer constrains its bodies; calling `refreshFrames()` on the underlying component re-attaches it. Bubbles and is composed.\n- **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
2719
|
+
"doc-url": "",
|
|
2720
|
+
"attributes": [
|
|
2721
|
+
{
|
|
2722
|
+
"name": "angular-damping",
|
|
2723
|
+
"description": "The spring damping of the joint per angular axis. Accepts 3 space-separated numbers.",
|
|
2724
|
+
"value": { "type": "string", "default": "1 1 1" }
|
|
2725
|
+
},
|
|
2726
|
+
{
|
|
2727
|
+
"name": "angular-equilibrium",
|
|
2728
|
+
"description": "The rest angle of the joint's angular springs. Accepts 3 space-separated numbers.",
|
|
2729
|
+
"value": { "type": "string", "default": "0 0 0" }
|
|
2730
|
+
},
|
|
2731
|
+
{
|
|
2732
|
+
"name": "angular-limits-x",
|
|
2733
|
+
"description": "The rotation limits of the joint about its X axis. Accepts 2 space-separated numbers.",
|
|
2734
|
+
"value": { "type": "string", "default": "0 0" }
|
|
2735
|
+
},
|
|
2736
|
+
{
|
|
2737
|
+
"name": "angular-limits-y",
|
|
2738
|
+
"description": "The rotation limits of the joint about its Y axis. Accepts 2 space-separated numbers.",
|
|
2739
|
+
"value": { "type": "string", "default": "0 0" }
|
|
2740
|
+
},
|
|
2741
|
+
{
|
|
2742
|
+
"name": "angular-limits-z",
|
|
2743
|
+
"description": "The rotation limits of the joint about its Z axis. Accepts 2 space-separated numbers.",
|
|
2744
|
+
"value": { "type": "string", "default": "0 0" }
|
|
2745
|
+
},
|
|
2746
|
+
{
|
|
2747
|
+
"name": "angular-motion-x",
|
|
2748
|
+
"description": "How the joint constrains rotation about its X axis.",
|
|
2749
|
+
"value": {
|
|
2750
|
+
"type": "'locked' | 'limited' | 'free'",
|
|
2751
|
+
"default": "locked"
|
|
2752
|
+
}
|
|
2753
|
+
},
|
|
2754
|
+
{
|
|
2755
|
+
"name": "angular-motion-y",
|
|
2756
|
+
"description": "How the joint constrains rotation about its Y axis.",
|
|
2757
|
+
"value": {
|
|
2758
|
+
"type": "'locked' | 'limited' | 'free'",
|
|
2759
|
+
"default": "locked"
|
|
2760
|
+
}
|
|
2761
|
+
},
|
|
2762
|
+
{
|
|
2763
|
+
"name": "angular-motion-z",
|
|
2764
|
+
"description": "How the joint constrains rotation about its Z axis.",
|
|
2765
|
+
"value": {
|
|
2766
|
+
"type": "'locked' | 'limited' | 'free'",
|
|
2767
|
+
"default": "locked"
|
|
2768
|
+
}
|
|
2769
|
+
},
|
|
2770
|
+
{
|
|
2771
|
+
"name": "angular-stiffness",
|
|
2772
|
+
"description": "The spring stiffness of the joint per angular axis. Accepts 3 space-separated numbers.",
|
|
2773
|
+
"value": { "type": "string", "default": "0 0 0" }
|
|
2774
|
+
},
|
|
2775
|
+
{
|
|
2776
|
+
"name": "break-impulse",
|
|
2777
|
+
"description": "The impulse above which the joint breaks.",
|
|
2778
|
+
"value": { "type": "number", "default": "Infinity" }
|
|
2779
|
+
},
|
|
2780
|
+
{
|
|
2781
|
+
"name": "enable-collision",
|
|
2782
|
+
"description": "Whether collision is enabled between the two constrained bodies.",
|
|
2783
|
+
"value": { "type": "boolean", "default": "false" }
|
|
2784
|
+
},
|
|
2785
|
+
{
|
|
2786
|
+
"name": "enable-limits",
|
|
2787
|
+
"description": "Whether the limits of the joint are enforced.",
|
|
2788
|
+
"value": { "type": "boolean", "default": "false" }
|
|
2789
|
+
},
|
|
2790
|
+
{
|
|
2791
|
+
"name": "enabled",
|
|
2792
|
+
"description": "The enabled state of the component.",
|
|
2793
|
+
"value": { "type": "boolean", "default": "true" }
|
|
2794
|
+
},
|
|
2795
|
+
{
|
|
2796
|
+
"name": "entity-a",
|
|
2797
|
+
"description": "The reference to the `<pc-entity>` providing the first constrained body.",
|
|
2798
|
+
"value": { "type": "string" }
|
|
2799
|
+
},
|
|
2800
|
+
{
|
|
2801
|
+
"name": "entity-b",
|
|
2802
|
+
"description": "The reference to the `<pc-entity>` providing the second constrained body.",
|
|
2803
|
+
"value": { "type": "string" }
|
|
2804
|
+
},
|
|
2805
|
+
{
|
|
2806
|
+
"name": "limits",
|
|
2807
|
+
"description": "The rotation or travel limits of the joint. Accepts 2 space-separated numbers.",
|
|
2808
|
+
"value": { "type": "string", "default": "-45 45" }
|
|
2809
|
+
},
|
|
2810
|
+
{
|
|
2811
|
+
"name": "linear-damping",
|
|
2812
|
+
"description": "The spring damping of the joint per linear axis. Accepts 3 space-separated numbers.",
|
|
2813
|
+
"value": { "type": "string", "default": "1 1 1" }
|
|
2814
|
+
},
|
|
2815
|
+
{
|
|
2816
|
+
"name": "linear-equilibrium",
|
|
2817
|
+
"description": "The rest point of the joint's linear springs. Accepts 3 space-separated numbers.",
|
|
2818
|
+
"value": { "type": "string", "default": "0 0 0" }
|
|
2819
|
+
},
|
|
2820
|
+
{
|
|
2821
|
+
"name": "linear-limits-x",
|
|
2822
|
+
"description": "The translation limits of the joint along its X axis. Accepts 2 space-separated numbers.",
|
|
2823
|
+
"value": { "type": "string", "default": "0 0" }
|
|
2824
|
+
},
|
|
2825
|
+
{
|
|
2826
|
+
"name": "linear-limits-y",
|
|
2827
|
+
"description": "The translation limits of the joint along its Y axis. Accepts 2 space-separated numbers.",
|
|
2828
|
+
"value": { "type": "string", "default": "0 0" }
|
|
2829
|
+
},
|
|
2830
|
+
{
|
|
2831
|
+
"name": "linear-limits-z",
|
|
2832
|
+
"description": "The translation limits of the joint along its Z axis. Accepts 2 space-separated numbers.",
|
|
2833
|
+
"value": { "type": "string", "default": "0 0" }
|
|
2834
|
+
},
|
|
2835
|
+
{
|
|
2836
|
+
"name": "linear-motion-x",
|
|
2837
|
+
"description": "How the joint constrains translation along its X axis.",
|
|
2838
|
+
"value": {
|
|
2839
|
+
"type": "'locked' | 'limited' | 'free'",
|
|
2840
|
+
"default": "locked"
|
|
2841
|
+
}
|
|
2842
|
+
},
|
|
2843
|
+
{
|
|
2844
|
+
"name": "linear-motion-y",
|
|
2845
|
+
"description": "How the joint constrains translation along its Y axis.",
|
|
2846
|
+
"value": {
|
|
2847
|
+
"type": "'locked' | 'limited' | 'free'",
|
|
2848
|
+
"default": "locked"
|
|
2849
|
+
}
|
|
2850
|
+
},
|
|
2851
|
+
{
|
|
2852
|
+
"name": "linear-motion-z",
|
|
2853
|
+
"description": "How the joint constrains translation along its Z axis.",
|
|
2854
|
+
"value": {
|
|
2855
|
+
"type": "'locked' | 'limited' | 'free'",
|
|
2856
|
+
"default": "locked"
|
|
2857
|
+
}
|
|
2858
|
+
},
|
|
2859
|
+
{
|
|
2860
|
+
"name": "linear-stiffness",
|
|
2861
|
+
"description": "The spring stiffness of the joint per linear axis. Accepts 3 space-separated numbers.",
|
|
2862
|
+
"value": { "type": "string", "default": "0 0 0" }
|
|
2863
|
+
},
|
|
2864
|
+
{
|
|
2865
|
+
"name": "max-motor-force",
|
|
2866
|
+
"description": "The maximum torque or force of the joint's motor.",
|
|
2867
|
+
"value": { "type": "number", "default": "0" }
|
|
2868
|
+
},
|
|
2869
|
+
{
|
|
2870
|
+
"name": "motor-speed",
|
|
2871
|
+
"description": "The target speed of the joint's motor.",
|
|
2872
|
+
"value": { "type": "number", "default": "0" }
|
|
2873
|
+
},
|
|
2874
|
+
{
|
|
2875
|
+
"name": "swing-limit-y",
|
|
2876
|
+
"description": "The maximum swing of the joint around the joint frame's Y axis.",
|
|
2877
|
+
"value": { "type": "number", "default": "45" }
|
|
2878
|
+
},
|
|
2879
|
+
{
|
|
2880
|
+
"name": "swing-limit-z",
|
|
2881
|
+
"description": "The maximum swing of the joint around the joint frame's Z axis.",
|
|
2882
|
+
"value": { "type": "number", "default": "45" }
|
|
2883
|
+
},
|
|
2884
|
+
{
|
|
2885
|
+
"name": "twist-limit",
|
|
2886
|
+
"description": "The maximum twist of the joint about its primary axis.",
|
|
2887
|
+
"value": { "type": "number", "default": "20" }
|
|
2888
|
+
},
|
|
2889
|
+
{
|
|
2890
|
+
"name": "type",
|
|
2891
|
+
"description": "The type of the joint.",
|
|
2892
|
+
"value": {
|
|
2893
|
+
"type": "'fixed' | 'ball' | 'hinge' | 'slider' | '6dof'",
|
|
2894
|
+
"default": "fixed"
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
],
|
|
2898
|
+
"events": [
|
|
2899
|
+
{
|
|
2900
|
+
"name": "break",
|
|
2901
|
+
"type": "CustomEvent",
|
|
2902
|
+
"description": "Fired when the impulse on the joint exceeds `break-impulse` and the constraint breaks. A broken joint no longer constrains its bodies; calling `refreshFrames()` on the underlying component re-attaches it. Bubbles and is composed."
|
|
2903
|
+
},
|
|
2904
|
+
{
|
|
2905
|
+
"name": "ready",
|
|
2906
|
+
"type": "CustomEvent",
|
|
2907
|
+
"description": "Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed."
|
|
2908
|
+
}
|
|
2909
|
+
],
|
|
2910
|
+
"js": {
|
|
2911
|
+
"properties": [
|
|
2912
|
+
{
|
|
2913
|
+
"name": "angularDamping",
|
|
2914
|
+
"description": "Gets the spring damping of the joint per angular axis."
|
|
2915
|
+
},
|
|
2916
|
+
{
|
|
2917
|
+
"name": "angularEquilibrium",
|
|
2918
|
+
"description": "Gets the rest angle of the joint's angular springs."
|
|
2919
|
+
},
|
|
2920
|
+
{
|
|
2921
|
+
"name": "angularLimitsX",
|
|
2922
|
+
"description": "Gets the rotation limits of the joint about its X axis."
|
|
2923
|
+
},
|
|
2924
|
+
{
|
|
2925
|
+
"name": "angularLimitsY",
|
|
2926
|
+
"description": "Gets the rotation limits of the joint about its Y axis."
|
|
2927
|
+
},
|
|
2928
|
+
{
|
|
2929
|
+
"name": "angularLimitsZ",
|
|
2930
|
+
"description": "Gets the rotation limits of the joint about its Z axis."
|
|
2931
|
+
},
|
|
2932
|
+
{
|
|
2933
|
+
"name": "angularMotionX",
|
|
2934
|
+
"description": "Gets how the joint constrains rotation about its X axis."
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
"name": "angularMotionY",
|
|
2938
|
+
"description": "Gets how the joint constrains rotation about its Y axis."
|
|
2939
|
+
},
|
|
2940
|
+
{
|
|
2941
|
+
"name": "angularMotionZ",
|
|
2942
|
+
"description": "Gets how the joint constrains rotation about its Z axis."
|
|
2943
|
+
},
|
|
2944
|
+
{
|
|
2945
|
+
"name": "angularStiffness",
|
|
2946
|
+
"description": "Gets the spring stiffness of the joint per angular axis."
|
|
2947
|
+
},
|
|
2948
|
+
{
|
|
2949
|
+
"name": "breakImpulse",
|
|
2950
|
+
"description": "Gets the impulse above which the joint breaks."
|
|
2951
|
+
},
|
|
2952
|
+
{
|
|
2953
|
+
"name": "closestApp",
|
|
2954
|
+
"description": "The nearest ancestor `<pc-app>` element, or `null` if this element has no `<pc-app>`\nancestor. The search starts at the parent, so an element never resolves to itself.",
|
|
2955
|
+
"type": "AppElement | null"
|
|
2956
|
+
},
|
|
2957
|
+
{
|
|
2958
|
+
"name": "closestEntity",
|
|
2959
|
+
"description": "The nearest ancestor element that fronts an entity — `<pc-entity>` or `<pc-node>` — or\n`null` if this element has no such ancestor. The search starts at the parent, so an element\nnever resolves to itself.",
|
|
2960
|
+
"type": "EntityBaseElement | null"
|
|
2961
|
+
},
|
|
2962
|
+
{
|
|
2963
|
+
"name": "component",
|
|
2964
|
+
"description": "Gets the underlying PlayCanvas joint component.",
|
|
2965
|
+
"type": "Component | null"
|
|
2966
|
+
},
|
|
2967
|
+
{
|
|
2968
|
+
"name": "enableCollision",
|
|
2969
|
+
"description": "Gets whether collision is enabled between the two constrained bodies."
|
|
2970
|
+
},
|
|
2971
|
+
{
|
|
2972
|
+
"name": "enabled",
|
|
2973
|
+
"description": "Gets the enabled state of the component."
|
|
2974
|
+
},
|
|
2975
|
+
{
|
|
2976
|
+
"name": "enableLimits",
|
|
2977
|
+
"description": "Gets whether the limits of the joint are enforced."
|
|
2978
|
+
},
|
|
2979
|
+
{
|
|
2980
|
+
"name": "entityA",
|
|
2981
|
+
"description": "Gets the reference to the `<pc-entity>` providing the first constrained body."
|
|
2982
|
+
},
|
|
2983
|
+
{
|
|
2984
|
+
"name": "entityB",
|
|
2985
|
+
"description": "Gets the reference to the `<pc-entity>` providing the second constrained body."
|
|
2986
|
+
},
|
|
2987
|
+
{
|
|
2988
|
+
"name": "limits",
|
|
2989
|
+
"description": "Gets the rotation or travel limits of the joint."
|
|
2990
|
+
},
|
|
2991
|
+
{
|
|
2992
|
+
"name": "linearDamping",
|
|
2993
|
+
"description": "Gets the spring damping of the joint per linear axis."
|
|
2994
|
+
},
|
|
2995
|
+
{
|
|
2996
|
+
"name": "linearEquilibrium",
|
|
2997
|
+
"description": "Gets the rest point of the joint's linear springs."
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
"name": "linearLimitsX",
|
|
3001
|
+
"description": "Gets the translation limits of the joint along its X axis."
|
|
3002
|
+
},
|
|
3003
|
+
{
|
|
3004
|
+
"name": "linearLimitsY",
|
|
3005
|
+
"description": "Gets the translation limits of the joint along its Y axis."
|
|
3006
|
+
},
|
|
3007
|
+
{
|
|
3008
|
+
"name": "linearLimitsZ",
|
|
3009
|
+
"description": "Gets the translation limits of the joint along its Z axis."
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
"name": "linearMotionX",
|
|
3013
|
+
"description": "Gets how the joint constrains translation along its X axis."
|
|
3014
|
+
},
|
|
3015
|
+
{
|
|
3016
|
+
"name": "linearMotionY",
|
|
3017
|
+
"description": "Gets how the joint constrains translation along its Y axis."
|
|
3018
|
+
},
|
|
3019
|
+
{
|
|
3020
|
+
"name": "linearMotionZ",
|
|
3021
|
+
"description": "Gets how the joint constrains translation along its Z axis."
|
|
3022
|
+
},
|
|
3023
|
+
{
|
|
3024
|
+
"name": "linearStiffness",
|
|
3025
|
+
"description": "Gets the spring stiffness of the joint per linear axis."
|
|
3026
|
+
},
|
|
3027
|
+
{
|
|
3028
|
+
"name": "maxMotorForce",
|
|
3029
|
+
"description": "Gets the maximum torque or force of the joint's motor."
|
|
3030
|
+
},
|
|
3031
|
+
{
|
|
3032
|
+
"name": "motorSpeed",
|
|
3033
|
+
"description": "Gets the target speed of the joint's motor."
|
|
3034
|
+
},
|
|
3035
|
+
{
|
|
3036
|
+
"name": "swingLimitY",
|
|
3037
|
+
"description": "Gets the maximum swing of the joint around the joint frame's Y axis."
|
|
3038
|
+
},
|
|
3039
|
+
{
|
|
3040
|
+
"name": "swingLimitZ",
|
|
3041
|
+
"description": "Gets the maximum swing of the joint around the joint frame's Z axis."
|
|
3042
|
+
},
|
|
3043
|
+
{
|
|
3044
|
+
"name": "twistLimit",
|
|
3045
|
+
"description": "Gets the maximum twist of the joint about its primary axis."
|
|
3046
|
+
},
|
|
3047
|
+
{ "name": "type", "description": "Gets the type of the joint." }
|
|
3048
|
+
],
|
|
3049
|
+
"events": [
|
|
3050
|
+
{
|
|
3051
|
+
"name": "break",
|
|
3052
|
+
"type": "CustomEvent",
|
|
3053
|
+
"description": "Fired when the impulse on the joint exceeds `break-impulse` and the constraint breaks. A broken joint no longer constrains its bodies; calling `refreshFrames()` on the underlying component re-attaches it. Bubbles and is composed."
|
|
3054
|
+
},
|
|
3055
|
+
{
|
|
3056
|
+
"name": "ready",
|
|
3057
|
+
"type": "CustomEvent",
|
|
3058
|
+
"description": "Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed."
|
|
3059
|
+
}
|
|
3060
|
+
]
|
|
3061
|
+
}
|
|
3062
|
+
},
|
|
2716
3063
|
{
|
|
2717
3064
|
"name": "pc-layoutchild",
|
|
2718
3065
|
"description": "The LayoutChildComponentElement interface provides properties and methods for manipulating\n[`<pc-layoutchild>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-layoutchild/) elements.\nThe LayoutChildComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\n---\n\n\n### **Events:**\n - **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcanvas/web-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"author": "PlayCanvas <support@playcanvas.com>",
|
|
5
5
|
"homepage": "https://playcanvas.com",
|
|
6
6
|
"description": "Web Components for the PlayCanvas Engine",
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
"test:unit": "vitest run --project unit",
|
|
72
72
|
"test:elements": "vitest run --project elements",
|
|
73
73
|
"test:integration": "vitest run --project integration",
|
|
74
|
+
"test:examples": "vitest run --project examples",
|
|
74
75
|
"publint": "publint",
|
|
75
76
|
"type-check": "npm run type-check:src && npm run type-check:test",
|
|
76
77
|
"type-check:src": "tsc --noEmit -p tsconfig.json",
|
|
@@ -100,7 +101,7 @@
|
|
|
100
101
|
"jsdom": "30.0.1",
|
|
101
102
|
"mediabunny": "1.53.1",
|
|
102
103
|
"opentype.js": "2.0.0",
|
|
103
|
-
"playcanvas": "2.
|
|
104
|
+
"playcanvas": "2.21.4",
|
|
104
105
|
"prettier": "3.9.6",
|
|
105
106
|
"publint": "0.3.23",
|
|
106
107
|
"rollup": "4.62.4",
|
package/src/app.ts
CHANGED
|
@@ -252,6 +252,24 @@ class AppElement extends AsyncElement {
|
|
|
252
252
|
this._bar = new LoadingBar(this);
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
// Upgrade the subtree before reading anything out of it. A subtree cloned from a
|
|
256
|
+
// <template> arrives entirely unupgraded - template content lives in an inert document,
|
|
257
|
+
// where custom element definitions are never looked up - and appending the clone upgrades
|
|
258
|
+
// its elements in tree order, this one before its descendants. The module query below would
|
|
259
|
+
// otherwise find plain HTMLElements with no _getLoadPromise to call, and the boot would die
|
|
260
|
+
// there, leaving the element permanently unready: no canvas, no entities, no application.
|
|
261
|
+
//
|
|
262
|
+
// Upgrading is the fix here rather than skipping whatever has not upgraded, because a
|
|
263
|
+
// <pc-module> is the one child that nothing else ever builds on its own behalf - skipping
|
|
264
|
+
// it would drop the wasm module the app asked for, silently and only for cloned apps.
|
|
265
|
+
// Upgrading runs each descendant's connectedCallback synchronously, a few lines earlier
|
|
266
|
+
// than the parser's path runs them but into the same state they see there: no application
|
|
267
|
+
// yet and _hierarchyReady false, so they defer to the sweeps below. A descendant that
|
|
268
|
+
// disconnects this element from there is caught by the generation check after the await,
|
|
269
|
+
// as any other disconnect is. An already-upgraded subtree - every other insertion path -
|
|
270
|
+
// is left completely untouched.
|
|
271
|
+
customElements.upgrade(this);
|
|
272
|
+
|
|
255
273
|
// Get all pc-module elements that are direct children of the pc-app element
|
|
256
274
|
const moduleElements = this.querySelectorAll<ModuleElement>(':scope > pc-module');
|
|
257
275
|
|