hytopia 0.1.78 → 0.1.80
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/docs/server.entity.despawn.md +1 -1
- package/docs/server.entity.md +44 -2
- package/docs/server.entity.parent.md +13 -0
- package/docs/server.entity.parentnodename.md +13 -0
- package/docs/server.entity.spawn.md +19 -3
- package/docs/server.entitymanager.getentitychildren.md +55 -0
- package/docs/server.entitymanager.md +14 -0
- package/docs/server.entityoptions.md +38 -0
- package/docs/server.entityoptions.parent.md +13 -0
- package/docs/server.entityoptions.parentnodename.md +13 -0
- package/docs/server.modelregistry.getnodenames.md +55 -0
- package/docs/server.modelregistry.md +28 -0
- package/docs/server.modelregistry.modelhasnode.md +71 -0
- package/examples/child-entity/README.md +3 -0
- package/examples/child-entity/assets/map.json +2623 -0
- package/examples/child-entity/assets/models/sword.gltf +1 -0
- package/examples/child-entity/index.ts +42 -0
- package/examples/child-entity/package.json +16 -0
- package/examples/entity-controller/MyEntityController.ts +12 -9
- package/package.json +1 -1
- package/server.api.json +309 -6
- package/server.d.ts +36 -3
- package/server.js +83 -83
@@ -0,0 +1 @@
|
|
1
|
+
{"asset":{"version":"2.0","generator":"Blockbench 4.11.2 glTF exporter"},"scenes":[{"nodes":[6],"name":"blockbench_export"}],"scene":0,"nodes":[{"translation":[0.015625,-0.0859375,0.03125],"name":"cube","mesh":0},{"translation":[-2.7755575615628914e-17,-0.8125,0],"name":"cube","mesh":1},{"translation":[0.031249999999999972,-0.34218749999999987,0],"name":"cube","mesh":2},{"translation":[-2.7755575610105143e-17,1.71875,-3.4694469961437686e-18],"name":"cube","mesh":3},{"translation":[-0.17187500001243847,0.45468750000000013,0.046875],"name":"cube","mesh":4},{"rotation":[0,7.960590520106338e-10,0,1],"translation":[2.7755575615628914e-17,0.4375,0],"name":"sword","children":[0,1,2,3,4]},{"children":[5]}],"bufferViews":[{"buffer":0,"byteOffset":0,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":288,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":576,"byteLength":192,"target":34962,"byteStride":8},{"buffer":0,"byteOffset":768,"byteLength":72,"target":34963},{"buffer":0,"byteOffset":840,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":1128,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":1416,"byteLength":192,"target":34962,"byteStride":8},{"buffer":0,"byteOffset":1608,"byteLength":72,"target":34963},{"buffer":0,"byteOffset":1680,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":1968,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":2256,"byteLength":192,"target":34962,"byteStride":8},{"buffer":0,"byteOffset":2448,"byteLength":72,"target":34963},{"buffer":0,"byteOffset":2520,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":2808,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":3096,"byteLength":192,"target":34962,"byteStride":8},{"buffer":0,"byteOffset":3288,"byteLength":72,"target":34963},{"buffer":0,"byteOffset":3360,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":3648,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":3936,"byteLength":192,"target":34962,"byteStride":8},{"buffer":0,"byteOffset":4128,"byteLength":72,"target":34963}],"buffers":[{"byteLength":4200,"uri":"data:application/octet-stream;base64,AAAQPgAA2z8AAAA9AAAQPgAA2z8AAMC9AAAQPgAABj8AAAA9AAAQPgAABj8AAMC9AAAwvgAA2z8AAMC9AAAwvgAA2z8AAAA9AAAwvgAABj8AAMC9AAAwvgAABj8AAAA9AAAwvgAA2z8AAMC9AAAQPgAA2z8AAMC9AAAwvgAA2z8AAAA9AAAQPgAA2z8AAAA9AAAwvgAABj8AAAA9AAAQPgAABj8AAAA9AAAwvgAABj8AAMC9AAAQPgAABj8AAMC9AAAwvgAA2z8AAAA9AAAQPgAA2z8A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ors":[{"bufferView":0,"componentType":5126,"count":24,"max":[0.140625,1.7109375,0.03125],"min":[-0.171875,0.5234375,-0.09375],"type":"VEC3"},{"bufferView":1,"componentType":5126,"count":24,"max":[1,1,1],"min":[-1,-1,-1],"type":"VEC3"},{"bufferView":2,"componentType":5126,"count":24,"max":[0.43701171875,0.65576171875],"min":[0.00048828125,0.00048828125],"type":"VEC2"},{"bufferView":3,"componentType":5123,"count":36,"max":[23],"min":[0],"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":24,"max":[0.0625,1.0625,0.0625],"min":[-0.0625,0.625,-0.0625],"type":"VEC3"},{"bufferView":5,"componentType":5126,"count":24,"max":[1,1,1],"min":[-1,-1,-1],"type":"VEC3"},{"bufferView":6,"componentType":5126,"count":24,"max":[0.71826171875,0.65576171875],"min":[0.46923828125,0.37548828125],"type":"VEC2"},{"bufferView":7,"componentType":5123,"count":36,"max":[23],"min":[0],"type":"SCALAR"},{"bufferView":8,"componentType":5126,"count":24,"max":[0.09375,0.15625,0.09375],"min":[-0.15625,-0.09375,-0.09375],"type":"VEC3"},{"bufferView":9,"componentType":5126,"count":24,"max":[1,1,1],"min":[-1,-1,-1],"type":"VEC3"},{"bufferView":10,"componentType":5126,"count":24,"max":[0.87451171875,0.21826171875],"min":[0.43798828125,0.00048828125],"type":"VEC2"},{"bufferView":11,"componentType":5123,"count":36,"max":[23],"min":[0],"type":"SCALAR"},{"bufferView":12,"componentType":5126,"count":24,"max":[0.15625,0.09375,0.0000625000029685907],"min":[-0.15625,-0.09375,3.469446951953614e-18],"type":"VEC3"},{"bufferView":13,"componentType":5126,"count":24,"max":[1,1,1],"min":[-1,-1,-1],"type":"VEC3"},{"bufferView":14,"componentType":5126,"count":24,"max":[0.74951171875,0.31201171875],"min":[0.43701171875,0.21826171875],"type":"VEC2"},{"bufferView":15,"componentType":5123,"count":36,"max":[23],"min":[0],"type":"SCALAR"},{"bufferView":16,"componentType":5126,"count":24,"max":[0.515625,-0.01718750037252903,0.046875],"min":[-0.171875,-0.20468750596046448,-0.140625],"type":"VEC3"},{"bufferView":17,"componentType":5126,"count":24,"max":[1,1,1],"min":[-1,-1,-1],"type":"VEC3"},{"bufferView":18,"componentType":5126,"count":24,"max":[0.87451171875,0.84326171875],"min":[0.00048828125,0.65673828125],"type":"VEC2"},{"bufferView":19,"componentType":5123,"count":36,"max":[23],"min":[0],"type":"SCALAR"}],"materials":[{"pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":1,"baseColorTexture":{"index":0}},"alphaMode":"MASK","alphaCutoff":0.05,"doubleSided":true}],"textures":[{"sampler":0,"source":0,"name":"sword.png"}],"samplers":[{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33071}],"images":[{"mimeType":"image/png","uri":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAUtJREFUWEdjZICCc5dW/QcxVaRVGRZs3AkTxqDzkioY0QU/vT0P1gsDd57eRlFipBeGoQemAC4xYA6AWQxzEb4QSPB3Z4D5DtlXFIUAuQ4AOZQcwCdsiBIdjOQ6AN3yI2fugYVsTJQw3IUsh54eho8DiI0OqoUAzCBQFOLLZoQcRnYUgCwFWQ5KjKCcQa4jyHYAerYFJT5yHEG2A8ixDFt0DA8HpFoZodQFs4+dw1n2o4cCVUJgwByAbjG674gJCYpCYG9mMErQozvAefpaglExtB2AHAVaAtwoAXDtw1eG0SggKg1MmteBkpBARSqs/kZPVMhyoLYhVaIA2RJsjRNcDU10RyI3RNDlsDVkMRqlIIGR6QB0XyNHCXLDE72tj6+hgU8fRosIPREiGwxrhhPqrKA7Bp8+9PTAOOAOINRmo7U8wcpi1AHDPgQAgqx2MAXdOiQAAAAASUVORK5CYII="}],"meshes":[{"primitives":[{"mode":4,"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"primitives":[{"mode":4,"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]},{"primitives":[{"mode":4,"attributes":{"POSITION":8,"NORMAL":9,"TEXCOORD_0":10},"indices":11,"material":0}]},{"primitives":[{"mode":4,"attributes":{"POSITION":12,"NORMAL":13,"TEXCOORD_0":14},"indices":15,"material":0}]},{"primitives":[{"mode":4,"attributes":{"POSITION":16,"NORMAL":17,"TEXCOORD_0":18},"indices":19,"material":0}]}]}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import {
|
2
|
+
startServer,
|
3
|
+
Entity,
|
4
|
+
PlayerEntity,
|
5
|
+
} from 'hytopia';
|
6
|
+
|
7
|
+
import worldMap from './assets/map.json';
|
8
|
+
|
9
|
+
startServer(world => {
|
10
|
+
world.loadMap(worldMap);
|
11
|
+
|
12
|
+
// Spawn a player entity when a player joins the game.
|
13
|
+
world.onPlayerJoin = player => {
|
14
|
+
const playerEntity = new PlayerEntity({
|
15
|
+
player,
|
16
|
+
name: 'Player',
|
17
|
+
modelUri: 'models/player.gltf',
|
18
|
+
modelLoopedAnimations: [ 'idle' ],
|
19
|
+
modelScale: 0.5,
|
20
|
+
});
|
21
|
+
|
22
|
+
playerEntity.spawn(world, { x: 0, y: 10, z: 0 });
|
23
|
+
|
24
|
+
// Spawn a sword entity as a child of the player entity.
|
25
|
+
const swordChildEntity = new Entity({
|
26
|
+
name: 'sword',
|
27
|
+
modelUri: 'models/sword.gltf',
|
28
|
+
parent: playerEntity,
|
29
|
+
parentNodeName: 'hand_right_anchor',
|
30
|
+
});
|
31
|
+
|
32
|
+
swordChildEntity.spawn(
|
33
|
+
world,
|
34
|
+
{ x: 0, y: 0.3, z: 0.5 }, // spawn with a position relative to the parent node
|
35
|
+
{ x: -Math.PI / 3, y: 0, z: 0, w: 1 } // spawn with a rotation so it looks correct in the hand
|
36
|
+
);
|
37
|
+
};
|
38
|
+
|
39
|
+
world.onPlayerLeave = player => {
|
40
|
+
world.entityManager.getPlayerEntitiesByPlayer(player).forEach(entity => entity.despawn());
|
41
|
+
};
|
42
|
+
});
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"name": "child-entity",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"keywords": [],
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC",
|
12
|
+
"dependencies": {
|
13
|
+
"hytopia": "latest",
|
14
|
+
"@hytopia.com/assets": "latest"
|
15
|
+
}
|
16
|
+
}
|
@@ -144,7 +144,7 @@ export default class MyEntityController extends BaseEntityController {
|
|
144
144
|
collidesWith: [ CollisionGroup.BLOCK, CollisionGroup.ENTITY ],
|
145
145
|
},
|
146
146
|
isSensor: true,
|
147
|
-
|
147
|
+
relativePosition: { x: 0, y: -0.75, z: 0 },
|
148
148
|
tag: 'groundSensor',
|
149
149
|
onCollision: (_other: BlockType | Entity, started: boolean) => {
|
150
150
|
// Ground contact
|
@@ -206,20 +206,23 @@ export default class MyEntityController extends BaseEntityController {
|
|
206
206
|
// Temporary, animations
|
207
207
|
if (this.isGrounded && (w || a || s || d)) {
|
208
208
|
if (isRunning) {
|
209
|
-
|
210
|
-
entity.
|
211
|
-
|
209
|
+
const runAnimations = [ 'run_upper', 'run_lower' ];
|
210
|
+
entity.stopModelAnimations(Array.from(entity.modelLoopedAnimations).filter(v => !runAnimations.includes(v)));
|
211
|
+
entity.startModelLoopedAnimations(runAnimations);
|
212
|
+
this._stepAudio?.setPlaybackRate(0.81);
|
212
213
|
} else {
|
213
|
-
|
214
|
-
entity.
|
215
|
-
|
214
|
+
const walkAnimations = [ 'walk_upper', 'walk_lower' ];
|
215
|
+
entity.stopModelAnimations(Array.from(entity.modelLoopedAnimations).filter(v => !walkAnimations.includes(v)));
|
216
|
+
entity.startModelLoopedAnimations(walkAnimations);
|
217
|
+
this._stepAudio?.setPlaybackRate(0.55);
|
216
218
|
}
|
217
219
|
|
218
220
|
this._stepAudio?.play(entity.world, !this._stepAudio?.isPlaying);
|
219
221
|
} else {
|
220
222
|
this._stepAudio?.pause();
|
221
|
-
|
222
|
-
entity.
|
223
|
+
const idleAnimations = [ 'idle_upper', 'idle_lower' ];
|
224
|
+
entity.stopModelAnimations(Array.from(entity.modelLoopedAnimations).filter(v => !idleAnimations.includes(v)));
|
225
|
+
entity.startModelLoopedAnimations(idleAnimations);
|
223
226
|
}
|
224
227
|
|
225
228
|
if (ml) {
|
package/package.json
CHANGED
package/server.api.json
CHANGED
@@ -9692,7 +9692,7 @@
|
|
9692
9692
|
{
|
9693
9693
|
"kind": "Method",
|
9694
9694
|
"canonicalReference": "server!Entity#despawn:member(1)",
|
9695
|
-
"docComment": "/**\n * Despawns the entity from the world.\n */\n",
|
9695
|
+
"docComment": "/**\n * Despawns the entity and all children from the world.\n */\n",
|
9696
9696
|
"excerptTokens": [
|
9697
9697
|
{
|
9698
9698
|
"kind": "Content",
|
@@ -10423,6 +10423,71 @@
|
|
10423
10423
|
"isProtected": false,
|
10424
10424
|
"isAbstract": false
|
10425
10425
|
},
|
10426
|
+
{
|
10427
|
+
"kind": "Property",
|
10428
|
+
"canonicalReference": "server!Entity#parent:member",
|
10429
|
+
"docComment": "/**\n * The parent entity of the entity.\n */\n",
|
10430
|
+
"excerptTokens": [
|
10431
|
+
{
|
10432
|
+
"kind": "Content",
|
10433
|
+
"text": "get parent(): "
|
10434
|
+
},
|
10435
|
+
{
|
10436
|
+
"kind": "Reference",
|
10437
|
+
"text": "Entity",
|
10438
|
+
"canonicalReference": "server!Entity:class"
|
10439
|
+
},
|
10440
|
+
{
|
10441
|
+
"kind": "Content",
|
10442
|
+
"text": " | undefined"
|
10443
|
+
},
|
10444
|
+
{
|
10445
|
+
"kind": "Content",
|
10446
|
+
"text": ";"
|
10447
|
+
}
|
10448
|
+
],
|
10449
|
+
"isReadonly": true,
|
10450
|
+
"isOptional": false,
|
10451
|
+
"releaseTag": "Public",
|
10452
|
+
"name": "parent",
|
10453
|
+
"propertyTypeTokenRange": {
|
10454
|
+
"startIndex": 1,
|
10455
|
+
"endIndex": 3
|
10456
|
+
},
|
10457
|
+
"isStatic": false,
|
10458
|
+
"isProtected": false,
|
10459
|
+
"isAbstract": false
|
10460
|
+
},
|
10461
|
+
{
|
10462
|
+
"kind": "Property",
|
10463
|
+
"canonicalReference": "server!Entity#parentNodeName:member",
|
10464
|
+
"docComment": "/**\n * The name of the parent's node (if parent is a model entity) this entity is attached to when spawned.\n */\n",
|
10465
|
+
"excerptTokens": [
|
10466
|
+
{
|
10467
|
+
"kind": "Content",
|
10468
|
+
"text": "get parentNodeName(): "
|
10469
|
+
},
|
10470
|
+
{
|
10471
|
+
"kind": "Content",
|
10472
|
+
"text": "string | undefined"
|
10473
|
+
},
|
10474
|
+
{
|
10475
|
+
"kind": "Content",
|
10476
|
+
"text": ";"
|
10477
|
+
}
|
10478
|
+
],
|
10479
|
+
"isReadonly": true,
|
10480
|
+
"isOptional": false,
|
10481
|
+
"releaseTag": "Public",
|
10482
|
+
"name": "parentNodeName",
|
10483
|
+
"propertyTypeTokenRange": {
|
10484
|
+
"startIndex": 1,
|
10485
|
+
"endIndex": 2
|
10486
|
+
},
|
10487
|
+
"isStatic": false,
|
10488
|
+
"isProtected": false,
|
10489
|
+
"isAbstract": false
|
10490
|
+
},
|
10426
10491
|
{
|
10427
10492
|
"kind": "Method",
|
10428
10493
|
"canonicalReference": "server!Entity#setController:member(1)",
|
@@ -10676,7 +10741,7 @@
|
|
10676
10741
|
{
|
10677
10742
|
"kind": "Method",
|
10678
10743
|
"canonicalReference": "server!Entity#spawn:member(1)",
|
10679
|
-
"docComment": "/**\n * Spawns the entity in the world.\n *\n * @param world - The world to spawn the entity in.\n *\n * @param
|
10744
|
+
"docComment": "/**\n * Spawns the entity in the world.\n *\n * @param world - The world to spawn the entity in.\n *\n * @param position - The position to spawn the entity at.\n *\n * @param rotation - The optional rotation to spawn the entity with.\n */\n",
|
10680
10745
|
"excerptTokens": [
|
10681
10746
|
{
|
10682
10747
|
"kind": "Content",
|
@@ -10689,13 +10754,22 @@
|
|
10689
10754
|
},
|
10690
10755
|
{
|
10691
10756
|
"kind": "Content",
|
10692
|
-
"text": ",
|
10757
|
+
"text": ", position: "
|
10693
10758
|
},
|
10694
10759
|
{
|
10695
10760
|
"kind": "Reference",
|
10696
10761
|
"text": "Vector3Like",
|
10697
10762
|
"canonicalReference": "server!Vector3Like:interface"
|
10698
10763
|
},
|
10764
|
+
{
|
10765
|
+
"kind": "Content",
|
10766
|
+
"text": ", rotation?: "
|
10767
|
+
},
|
10768
|
+
{
|
10769
|
+
"kind": "Reference",
|
10770
|
+
"text": "QuaternionLike",
|
10771
|
+
"canonicalReference": "server!QuaternionLike:interface"
|
10772
|
+
},
|
10699
10773
|
{
|
10700
10774
|
"kind": "Content",
|
10701
10775
|
"text": "): "
|
@@ -10711,8 +10785,8 @@
|
|
10711
10785
|
],
|
10712
10786
|
"isStatic": false,
|
10713
10787
|
"returnTypeTokenRange": {
|
10714
|
-
"startIndex":
|
10715
|
-
"endIndex":
|
10788
|
+
"startIndex": 7,
|
10789
|
+
"endIndex": 8
|
10716
10790
|
},
|
10717
10791
|
"releaseTag": "Public",
|
10718
10792
|
"isProtected": false,
|
@@ -10727,12 +10801,20 @@
|
|
10727
10801
|
"isOptional": false
|
10728
10802
|
},
|
10729
10803
|
{
|
10730
|
-
"parameterName": "
|
10804
|
+
"parameterName": "position",
|
10731
10805
|
"parameterTypeTokenRange": {
|
10732
10806
|
"startIndex": 3,
|
10733
10807
|
"endIndex": 4
|
10734
10808
|
},
|
10735
10809
|
"isOptional": false
|
10810
|
+
},
|
10811
|
+
{
|
10812
|
+
"parameterName": "rotation",
|
10813
|
+
"parameterTypeTokenRange": {
|
10814
|
+
"startIndex": 5,
|
10815
|
+
"endIndex": 6
|
10816
|
+
},
|
10817
|
+
"isOptional": true
|
10736
10818
|
}
|
10737
10819
|
],
|
10738
10820
|
"isOptional": false,
|
@@ -12289,6 +12371,60 @@
|
|
12289
12371
|
"isAbstract": false,
|
12290
12372
|
"name": "getEntity"
|
12291
12373
|
},
|
12374
|
+
{
|
12375
|
+
"kind": "Method",
|
12376
|
+
"canonicalReference": "server!EntityManager#getEntityChildren:member(1)",
|
12377
|
+
"docComment": "/**\n * Gets all child entities of an entity.\n *\n * @param entity - The entity to get the children for.\n *\n * @returns All child entities of the entity.\n */\n",
|
12378
|
+
"excerptTokens": [
|
12379
|
+
{
|
12380
|
+
"kind": "Content",
|
12381
|
+
"text": "getEntityChildren(entity: "
|
12382
|
+
},
|
12383
|
+
{
|
12384
|
+
"kind": "Reference",
|
12385
|
+
"text": "Entity",
|
12386
|
+
"canonicalReference": "server!Entity:class"
|
12387
|
+
},
|
12388
|
+
{
|
12389
|
+
"kind": "Content",
|
12390
|
+
"text": "): "
|
12391
|
+
},
|
12392
|
+
{
|
12393
|
+
"kind": "Reference",
|
12394
|
+
"text": "Entity",
|
12395
|
+
"canonicalReference": "server!Entity:class"
|
12396
|
+
},
|
12397
|
+
{
|
12398
|
+
"kind": "Content",
|
12399
|
+
"text": "[]"
|
12400
|
+
},
|
12401
|
+
{
|
12402
|
+
"kind": "Content",
|
12403
|
+
"text": ";"
|
12404
|
+
}
|
12405
|
+
],
|
12406
|
+
"isStatic": false,
|
12407
|
+
"returnTypeTokenRange": {
|
12408
|
+
"startIndex": 3,
|
12409
|
+
"endIndex": 5
|
12410
|
+
},
|
12411
|
+
"releaseTag": "Public",
|
12412
|
+
"isProtected": false,
|
12413
|
+
"overloadIndex": 1,
|
12414
|
+
"parameters": [
|
12415
|
+
{
|
12416
|
+
"parameterName": "entity",
|
12417
|
+
"parameterTypeTokenRange": {
|
12418
|
+
"startIndex": 1,
|
12419
|
+
"endIndex": 2
|
12420
|
+
},
|
12421
|
+
"isOptional": false
|
12422
|
+
}
|
12423
|
+
],
|
12424
|
+
"isOptional": false,
|
12425
|
+
"isAbstract": false,
|
12426
|
+
"name": "getEntityChildren"
|
12427
|
+
},
|
12292
12428
|
{
|
12293
12429
|
"kind": "Method",
|
12294
12430
|
"canonicalReference": "server!EntityManager#getPlayerEntitiesByPlayer:member(1)",
|
@@ -12664,6 +12800,61 @@
|
|
12664
12800
|
"endIndex": 2
|
12665
12801
|
}
|
12666
12802
|
},
|
12803
|
+
{
|
12804
|
+
"kind": "PropertySignature",
|
12805
|
+
"canonicalReference": "server!EntityOptions#parent:member",
|
12806
|
+
"docComment": "/**\n * The parent entity of the entity, entities with a parent will ignore creating their own colliders.\n */\n",
|
12807
|
+
"excerptTokens": [
|
12808
|
+
{
|
12809
|
+
"kind": "Content",
|
12810
|
+
"text": "parent?: "
|
12811
|
+
},
|
12812
|
+
{
|
12813
|
+
"kind": "Reference",
|
12814
|
+
"text": "Entity",
|
12815
|
+
"canonicalReference": "server!Entity:class"
|
12816
|
+
},
|
12817
|
+
{
|
12818
|
+
"kind": "Content",
|
12819
|
+
"text": ";"
|
12820
|
+
}
|
12821
|
+
],
|
12822
|
+
"isReadonly": false,
|
12823
|
+
"isOptional": true,
|
12824
|
+
"releaseTag": "Public",
|
12825
|
+
"name": "parent",
|
12826
|
+
"propertyTypeTokenRange": {
|
12827
|
+
"startIndex": 1,
|
12828
|
+
"endIndex": 2
|
12829
|
+
}
|
12830
|
+
},
|
12831
|
+
{
|
12832
|
+
"kind": "PropertySignature",
|
12833
|
+
"canonicalReference": "server!EntityOptions#parentNodeName:member",
|
12834
|
+
"docComment": "/**\n * The name of the parent's node (if parent is a model entity) to attach the entity to.\n */\n",
|
12835
|
+
"excerptTokens": [
|
12836
|
+
{
|
12837
|
+
"kind": "Content",
|
12838
|
+
"text": "parentNodeName?: "
|
12839
|
+
},
|
12840
|
+
{
|
12841
|
+
"kind": "Content",
|
12842
|
+
"text": "string"
|
12843
|
+
},
|
12844
|
+
{
|
12845
|
+
"kind": "Content",
|
12846
|
+
"text": ";"
|
12847
|
+
}
|
12848
|
+
],
|
12849
|
+
"isReadonly": false,
|
12850
|
+
"isOptional": true,
|
12851
|
+
"releaseTag": "Public",
|
12852
|
+
"name": "parentNodeName",
|
12853
|
+
"propertyTypeTokenRange": {
|
12854
|
+
"startIndex": 1,
|
12855
|
+
"endIndex": 2
|
12856
|
+
}
|
12857
|
+
},
|
12667
12858
|
{
|
12668
12859
|
"kind": "PropertySignature",
|
12669
12860
|
"canonicalReference": "server!EntityOptions#rigidBodyOptions:member",
|
@@ -16754,6 +16945,54 @@
|
|
16754
16945
|
"isAbstract": false,
|
16755
16946
|
"name": "getBoundingBox"
|
16756
16947
|
},
|
16948
|
+
{
|
16949
|
+
"kind": "Method",
|
16950
|
+
"canonicalReference": "server!ModelRegistry#getNodeNames:member(1)",
|
16951
|
+
"docComment": "/**\n * Retrieves the names of all nodes in a model.\n *\n * @param modelUri - The URI of the model to retrieve the node names for.\n *\n * @returns The names of all nodes in the model.\n */\n",
|
16952
|
+
"excerptTokens": [
|
16953
|
+
{
|
16954
|
+
"kind": "Content",
|
16955
|
+
"text": "getNodeNames(modelUri: "
|
16956
|
+
},
|
16957
|
+
{
|
16958
|
+
"kind": "Content",
|
16959
|
+
"text": "string"
|
16960
|
+
},
|
16961
|
+
{
|
16962
|
+
"kind": "Content",
|
16963
|
+
"text": "): "
|
16964
|
+
},
|
16965
|
+
{
|
16966
|
+
"kind": "Content",
|
16967
|
+
"text": "string[]"
|
16968
|
+
},
|
16969
|
+
{
|
16970
|
+
"kind": "Content",
|
16971
|
+
"text": ";"
|
16972
|
+
}
|
16973
|
+
],
|
16974
|
+
"isStatic": false,
|
16975
|
+
"returnTypeTokenRange": {
|
16976
|
+
"startIndex": 3,
|
16977
|
+
"endIndex": 4
|
16978
|
+
},
|
16979
|
+
"releaseTag": "Public",
|
16980
|
+
"isProtected": false,
|
16981
|
+
"overloadIndex": 1,
|
16982
|
+
"parameters": [
|
16983
|
+
{
|
16984
|
+
"parameterName": "modelUri",
|
16985
|
+
"parameterTypeTokenRange": {
|
16986
|
+
"startIndex": 1,
|
16987
|
+
"endIndex": 2
|
16988
|
+
},
|
16989
|
+
"isOptional": false
|
16990
|
+
}
|
16991
|
+
],
|
16992
|
+
"isOptional": false,
|
16993
|
+
"isAbstract": false,
|
16994
|
+
"name": "getNodeNames"
|
16995
|
+
},
|
16757
16996
|
{
|
16758
16997
|
"kind": "Property",
|
16759
16998
|
"canonicalReference": "server!ModelRegistry.instance:member",
|
@@ -16784,6 +17023,70 @@
|
|
16784
17023
|
"isStatic": true,
|
16785
17024
|
"isProtected": false,
|
16786
17025
|
"isAbstract": false
|
17026
|
+
},
|
17027
|
+
{
|
17028
|
+
"kind": "Method",
|
17029
|
+
"canonicalReference": "server!ModelRegistry#modelHasNode:member(1)",
|
17030
|
+
"docComment": "/**\n * Checks if a model has a node with the given name.\n *\n * @param modelUri - The URI of the model to check.\n *\n * @param nodeName - The name of the node to check for.\n *\n * @returns Whether the model has a node with the given name.\n */\n",
|
17031
|
+
"excerptTokens": [
|
17032
|
+
{
|
17033
|
+
"kind": "Content",
|
17034
|
+
"text": "modelHasNode(modelUri: "
|
17035
|
+
},
|
17036
|
+
{
|
17037
|
+
"kind": "Content",
|
17038
|
+
"text": "string"
|
17039
|
+
},
|
17040
|
+
{
|
17041
|
+
"kind": "Content",
|
17042
|
+
"text": ", nodeName: "
|
17043
|
+
},
|
17044
|
+
{
|
17045
|
+
"kind": "Content",
|
17046
|
+
"text": "string"
|
17047
|
+
},
|
17048
|
+
{
|
17049
|
+
"kind": "Content",
|
17050
|
+
"text": "): "
|
17051
|
+
},
|
17052
|
+
{
|
17053
|
+
"kind": "Content",
|
17054
|
+
"text": "boolean"
|
17055
|
+
},
|
17056
|
+
{
|
17057
|
+
"kind": "Content",
|
17058
|
+
"text": ";"
|
17059
|
+
}
|
17060
|
+
],
|
17061
|
+
"isStatic": false,
|
17062
|
+
"returnTypeTokenRange": {
|
17063
|
+
"startIndex": 5,
|
17064
|
+
"endIndex": 6
|
17065
|
+
},
|
17066
|
+
"releaseTag": "Public",
|
17067
|
+
"isProtected": false,
|
17068
|
+
"overloadIndex": 1,
|
17069
|
+
"parameters": [
|
17070
|
+
{
|
17071
|
+
"parameterName": "modelUri",
|
17072
|
+
"parameterTypeTokenRange": {
|
17073
|
+
"startIndex": 1,
|
17074
|
+
"endIndex": 2
|
17075
|
+
},
|
17076
|
+
"isOptional": false
|
17077
|
+
},
|
17078
|
+
{
|
17079
|
+
"parameterName": "nodeName",
|
17080
|
+
"parameterTypeTokenRange": {
|
17081
|
+
"startIndex": 3,
|
17082
|
+
"endIndex": 4
|
17083
|
+
},
|
17084
|
+
"isOptional": false
|
17085
|
+
}
|
17086
|
+
],
|
17087
|
+
"isOptional": false,
|
17088
|
+
"isAbstract": false,
|
17089
|
+
"name": "modelHasNode"
|
16787
17090
|
}
|
16788
17091
|
],
|
16789
17092
|
"implementsTokenRanges": []
|
package/server.d.ts
CHANGED
@@ -1359,6 +1359,8 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1359
1359
|
|
1360
1360
|
|
1361
1361
|
|
1362
|
+
|
1363
|
+
|
1362
1364
|
/**
|
1363
1365
|
* @param options - The options for the entity.
|
1364
1366
|
*/
|
@@ -1385,6 +1387,10 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1385
1387
|
get name(): string;
|
1386
1388
|
/** The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque. */
|
1387
1389
|
get opacity(): number | undefined;
|
1390
|
+
/** The parent entity of the entity. */
|
1391
|
+
get parent(): Entity | undefined;
|
1392
|
+
/** The name of the parent's node (if parent is a model entity) this entity is attached to when spawned. */
|
1393
|
+
get parentNodeName(): string | undefined;
|
1388
1394
|
/** An arbitrary identifier tag of the entity. Useful for your own logic. */
|
1389
1395
|
get tag(): string | undefined;
|
1390
1396
|
/** The tint color of the entity. */
|
@@ -1400,11 +1406,12 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1400
1406
|
/**
|
1401
1407
|
* Spawns the entity in the world.
|
1402
1408
|
* @param world - The world to spawn the entity in.
|
1403
|
-
* @param
|
1409
|
+
* @param position - The position to spawn the entity at.
|
1410
|
+
* @param rotation - The optional rotation to spawn the entity with.
|
1404
1411
|
*/
|
1405
|
-
spawn(world: World,
|
1412
|
+
spawn(world: World, position: Vector3Like, rotation?: QuaternionLike): void;
|
1406
1413
|
/**
|
1407
|
-
* Despawns the entity from the world.
|
1414
|
+
* Despawns the entity and all children from the world.
|
1408
1415
|
*/
|
1409
1416
|
despawn(): void;
|
1410
1417
|
/**
|
@@ -1602,6 +1609,12 @@ export declare class EntityManager {
|
|
1602
1609
|
* @returns All spawned entities in the world with a tag that includes the provided substring.
|
1603
1610
|
*/
|
1604
1611
|
getEntitiesByTagSubstring(tagSubstring: string): Entity[];
|
1612
|
+
/**
|
1613
|
+
* Gets all child entities of an entity.
|
1614
|
+
* @param entity - The entity to get the children for.
|
1615
|
+
* @returns All child entities of the entity.
|
1616
|
+
*/
|
1617
|
+
getEntityChildren(entity: Entity): Entity[];
|
1605
1618
|
|
1606
1619
|
|
1607
1620
|
}
|
@@ -1628,6 +1641,10 @@ export declare interface EntityOptions {
|
|
1628
1641
|
name?: string;
|
1629
1642
|
/** The opacity of the entity between 0 and 1. 0 is fully transparent, 1 is fully opaque. */
|
1630
1643
|
opacity?: number;
|
1644
|
+
/** The parent entity of the entity, entities with a parent will ignore creating their own colliders. */
|
1645
|
+
parent?: Entity;
|
1646
|
+
/** The name of the parent's node (if parent is a model entity) to attach the entity to. */
|
1647
|
+
parentNodeName?: string;
|
1631
1648
|
/** The rigid body options for the entity. */
|
1632
1649
|
rigidBodyOptions?: RigidBodyOptions;
|
1633
1650
|
/** An arbitrary identifier tag of the entity. Useful for your own logic. */
|
@@ -2106,6 +2123,7 @@ export declare class ModelRegistry {
|
|
2106
2123
|
|
2107
2124
|
|
2108
2125
|
|
2126
|
+
|
2109
2127
|
/**
|
2110
2128
|
* Retrieves the bounding box of a model.
|
2111
2129
|
*
|
@@ -2113,6 +2131,21 @@ export declare class ModelRegistry {
|
|
2113
2131
|
* @returns The bounding box of the model.
|
2114
2132
|
*/
|
2115
2133
|
getBoundingBox(modelUri: string): ModelBoundingBox;
|
2134
|
+
/**
|
2135
|
+
* Retrieves the names of all nodes in a model.
|
2136
|
+
*
|
2137
|
+
* @param modelUri - The URI of the model to retrieve the node names for.
|
2138
|
+
* @returns The names of all nodes in the model.
|
2139
|
+
*/
|
2140
|
+
getNodeNames(modelUri: string): string[];
|
2141
|
+
/**
|
2142
|
+
* Checks if a model has a node with the given name.
|
2143
|
+
*
|
2144
|
+
* @param modelUri - The URI of the model to check.
|
2145
|
+
* @param nodeName - The name of the node to check for.
|
2146
|
+
* @returns Whether the model has a node with the given name.
|
2147
|
+
*/
|
2148
|
+
modelHasNode(modelUri: string, nodeName: string): boolean;
|
2116
2149
|
|
2117
2150
|
|
2118
2151
|
}
|