hytopia 0.3.9 → 0.3.11
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.ballcollideroptions.md +75 -0
- package/docs/server.ballcollideroptions.radius.md +13 -0
- package/docs/server.ballcollideroptions.shape.md +11 -0
- package/docs/server.basecollideroptions.bounciness.md +13 -0
- package/docs/server.basecollideroptions.bouncinesscombinerule.md +13 -0
- package/docs/server.basecollideroptions.collisiongroups.md +13 -0
- package/docs/server.basecollideroptions.enabled.md +13 -0
- package/docs/server.basecollideroptions.flags.md +13 -0
- package/docs/server.basecollideroptions.friction.md +13 -0
- package/docs/server.basecollideroptions.frictioncombinerule.md +13 -0
- package/docs/server.basecollideroptions.issensor.md +13 -0
- package/docs/server.basecollideroptions.mass.md +13 -0
- package/docs/server.basecollideroptions.md +342 -0
- package/docs/server.basecollideroptions.oncollision.md +13 -0
- package/docs/server.basecollideroptions.parentrigidbody.md +13 -0
- package/docs/server.basecollideroptions.relativeposition.md +13 -0
- package/docs/server.basecollideroptions.relativerotation.md +13 -0
- package/docs/server.basecollideroptions.shape.md +13 -0
- package/docs/{server.collideroptions.simulation.md → server.basecollideroptions.simulation.md} +2 -2
- package/docs/{server.collideroptions.tag.md → server.basecollideroptions.tag.md} +2 -2
- package/docs/{server.rigidbodyoptions.colliders.md → server.baserigidbodyoptions.colliders.md} +2 -2
- package/docs/server.baserigidbodyoptions.enabled.md +13 -0
- package/docs/server.baserigidbodyoptions.md +152 -0
- package/docs/server.baserigidbodyoptions.position.md +13 -0
- package/docs/server.baserigidbodyoptions.rotation.md +13 -0
- package/docs/{server.rigidbodyoptions.simulation.md → server.baserigidbodyoptions.simulation.md} +2 -2
- package/docs/server.baserigidbodyoptions.type.md +13 -0
- package/docs/server.blockcollideroptions.halfextents.md +13 -0
- package/docs/server.blockcollideroptions.md +75 -0
- package/docs/server.blockcollideroptions.shape.md +11 -0
- package/docs/server.blocktype.collideroptions.md +1 -1
- package/docs/server.blocktype.md +1 -1
- package/docs/server.blocktypeoptions.customcollideroptions.md +1 -1
- package/docs/server.blocktypeoptions.md +1 -1
- package/docs/server.capsulecollideroptions.halfheight.md +13 -0
- package/docs/server.capsulecollideroptions.md +94 -0
- package/docs/server.capsulecollideroptions.radius.md +13 -0
- package/docs/server.capsulecollideroptions.shape.md +11 -0
- package/docs/server.collideroptions.md +4 -445
- package/docs/server.collidershape.md +14 -0
- package/docs/server.conecollideroptions.halfheight.md +13 -0
- package/docs/server.conecollideroptions.md +94 -0
- package/docs/server.conecollideroptions.radius.md +13 -0
- package/docs/server.conecollideroptions.shape.md +11 -0
- package/docs/server.cylindercollideroptions.halfheight.md +13 -0
- package/docs/server.cylindercollideroptions.md +94 -0
- package/docs/server.cylindercollideroptions.radius.md +13 -0
- package/docs/server.cylindercollideroptions.shape.md +11 -0
- package/docs/server.dynamicrigidbodyoptions.additionalmass.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.additionalmassproperties.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.additionalsolveriterations.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.angulardamping.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.angularvelocity.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.ccdenabled.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.dominancegroup.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.enabledpositions.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.enabledrotations.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.gravityscale.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.lineardamping.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.linearvelocity.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.md +324 -0
- package/docs/server.dynamicrigidbodyoptions.sleeping.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.softccdprediction.md +13 -0
- package/docs/server.dynamicrigidbodyoptions.type.md +11 -0
- package/docs/server.errorhandler.error.md +69 -0
- package/docs/server.errorhandler.fatalerror.md +73 -0
- package/docs/server.errorhandler.md +81 -0
- package/docs/server.errorhandler.warning.md +69 -0
- package/docs/server.fixedrigidbodyoptions.md +56 -0
- package/docs/server.fixedrigidbodyoptions.type.md +11 -0
- package/docs/server.kinematicpositionrigidbodyoptions.md +56 -0
- package/docs/server.kinematicpositionrigidbodyoptions.type.md +11 -0
- package/docs/server.kinematicvelocityrigidbodyoptions.angularvelocity.md +13 -0
- package/docs/server.kinematicvelocityrigidbodyoptions.linearvelocity.md +13 -0
- package/docs/server.kinematicvelocityrigidbodyoptions.md +94 -0
- package/docs/server.kinematicvelocityrigidbodyoptions.type.md +11 -0
- package/docs/server.md +169 -4
- package/docs/server.nonecollideroptions.md +56 -0
- package/docs/server.nonecollideroptions.shape.md +11 -0
- package/docs/server.rigidbody.createandaddchildcollider.md +3 -3
- package/docs/server.rigidbodyoptions.md +4 -407
- package/docs/server.roundcylindercollideroptions.borderradius.md +13 -0
- package/docs/server.roundcylindercollideroptions.halfheight.md +13 -0
- package/docs/server.roundcylindercollideroptions.md +113 -0
- package/docs/server.roundcylindercollideroptions.radius.md +13 -0
- package/docs/server.roundcylindercollideroptions.shape.md +11 -0
- package/docs/server.trimeshcollideroptions.indices.md +13 -0
- package/docs/server.trimeshcollideroptions.md +94 -0
- package/docs/server.trimeshcollideroptions.shape.md +11 -0
- package/docs/server.trimeshcollideroptions.vertices.md +13 -0
- package/examples/hygrounds/assets/icons/mobile-jump.png +0 -0
- package/examples/hygrounds/assets/icons/mobile-place-block.png +0 -0
- package/examples/hygrounds/assets/icons/mobile-reload.png +0 -0
- package/examples/hygrounds/assets/icons/mobile-shoot.png +0 -0
- package/examples/hygrounds/assets/ui/index.html +219 -3
- package/examples/hygrounds/classes/ChestEntity.ts +2 -1
- package/examples/hygrounds/classes/GamePlayerEntity.ts +10 -0
- package/examples/hygrounds/classes/GunEntity.ts +4 -0
- package/examples/hygrounds/classes/ItemEntity.ts +4 -1
- package/examples/hygrounds/classes/weapons/PistolEntity.ts +2 -2
- package/examples/hygrounds/classes/weapons/RevolverEntity.ts +1 -1
- package/examples/hygrounds/classes/weapons/RocketLauncherEntity.ts +1 -1
- package/examples/hygrounds/classes/weapons/ShotgunEntity.ts +2 -2
- package/examples/hygrounds/gameConfig.ts +11 -11
- package/examples/hygrounds/hygrounds-10.zip +0 -0
- package/examples/zombies-fps/classes/PurchaseBarrierEntity.ts +2 -2
- package/examples/zombies-fps/classes/WeaponCrateEntity.ts +2 -1
- package/package.json +1 -1
- package/server.api.json +5787 -4442
- package/server.d.ts +211 -96
- package/server.js +118 -113
- package/docs/server.collideroptions.borderradius.md +0 -13
- package/docs/server.collideroptions.bounciness.md +0 -13
- package/docs/server.collideroptions.bouncinesscombinerule.md +0 -13
- package/docs/server.collideroptions.collisiongroups.md +0 -13
- package/docs/server.collideroptions.enabled.md +0 -13
- package/docs/server.collideroptions.flags.md +0 -13
- package/docs/server.collideroptions.friction.md +0 -13
- package/docs/server.collideroptions.frictioncombinerule.md +0 -13
- package/docs/server.collideroptions.halfextents.md +0 -13
- package/docs/server.collideroptions.halfheight.md +0 -13
- package/docs/server.collideroptions.indices.md +0 -13
- package/docs/server.collideroptions.issensor.md +0 -13
- package/docs/server.collideroptions.mass.md +0 -13
- package/docs/server.collideroptions.oncollision.md +0 -13
- package/docs/server.collideroptions.parentrigidbody.md +0 -13
- package/docs/server.collideroptions.radius.md +0 -13
- package/docs/server.collideroptions.relativeposition.md +0 -13
- package/docs/server.collideroptions.relativerotation.md +0 -13
- package/docs/server.collideroptions.shape.md +0 -13
- package/docs/server.collideroptions.vertices.md +0 -13
- package/docs/server.rigidbodyoptions.additionalmass.md +0 -13
- package/docs/server.rigidbodyoptions.additionalmassproperties.md +0 -13
- package/docs/server.rigidbodyoptions.additionalsolveriterations.md +0 -13
- package/docs/server.rigidbodyoptions.angulardamping.md +0 -13
- package/docs/server.rigidbodyoptions.angularvelocity.md +0 -13
- package/docs/server.rigidbodyoptions.ccdenabled.md +0 -13
- package/docs/server.rigidbodyoptions.dominancegroup.md +0 -13
- package/docs/server.rigidbodyoptions.enabled.md +0 -13
- package/docs/server.rigidbodyoptions.enabledpositions.md +0 -13
- package/docs/server.rigidbodyoptions.enabledrotations.md +0 -13
- package/docs/server.rigidbodyoptions.gravityscale.md +0 -13
- package/docs/server.rigidbodyoptions.lineardamping.md +0 -13
- package/docs/server.rigidbodyoptions.linearvelocity.md +0 -13
- package/docs/server.rigidbodyoptions.position.md +0 -13
- package/docs/server.rigidbodyoptions.rotation.md +0 -13
- package/docs/server.rigidbodyoptions.sleeping.md +0 -13
- package/docs/server.rigidbodyoptions.softccdprediction.md +0 -13
- package/docs/server.rigidbodyoptions.type.md +0 -13
package/server.d.ts
CHANGED
@@ -305,6 +305,49 @@ export declare interface AudioOptions {
|
|
305
305
|
volume?: number;
|
306
306
|
}
|
307
307
|
|
308
|
+
/** The options for a ball collider. @public */
|
309
|
+
export declare interface BallColliderOptions extends BaseColliderOptions {
|
310
|
+
shape: ColliderShape.BALL;
|
311
|
+
/** The radius of the ball collider. */
|
312
|
+
radius?: number;
|
313
|
+
}
|
314
|
+
|
315
|
+
/** The base options for a collider. @public */
|
316
|
+
export declare interface BaseColliderOptions {
|
317
|
+
/** The shape of the collider. */
|
318
|
+
shape: ColliderShape;
|
319
|
+
/** The bounciness of the collider. */
|
320
|
+
bounciness?: number;
|
321
|
+
/** The bounciness combine rule of the collider. */
|
322
|
+
bouncinessCombineRule?: CoefficientCombineRule;
|
323
|
+
/** The collision groups the collider belongs to. */
|
324
|
+
collisionGroups?: CollisionGroups;
|
325
|
+
/** Whether the collider is enabled. */
|
326
|
+
enabled?: boolean;
|
327
|
+
/** The flags of the collider if the shape is a trimesh */
|
328
|
+
flags?: number;
|
329
|
+
/** The friction of the collider. */
|
330
|
+
friction?: number;
|
331
|
+
/** The friction combine rule of the collider. */
|
332
|
+
frictionCombineRule?: CoefficientCombineRule;
|
333
|
+
/** Whether the collider is a sensor. */
|
334
|
+
isSensor?: boolean;
|
335
|
+
/** The mass of the collider. */
|
336
|
+
mass?: number;
|
337
|
+
/** The on collision callback for the collider. */
|
338
|
+
onCollision?: CollisionCallback;
|
339
|
+
/** The parent rigid body of the collider. */
|
340
|
+
parentRigidBody?: RigidBody;
|
341
|
+
/** The relative position of the collider. Relative to parent rigid body. */
|
342
|
+
relativePosition?: Vector3Like;
|
343
|
+
/** The relative rotation of the collider. Relative to parent rigid body. */
|
344
|
+
relativeRotation?: QuaternionLike;
|
345
|
+
/** The simulation the collider is in, if provided the collider will automatically be added to the simulation. */
|
346
|
+
simulation?: Simulation;
|
347
|
+
/** An arbitrary identifier tag of the collider. Useful for your own logic. */
|
348
|
+
tag?: string;
|
349
|
+
}
|
350
|
+
|
308
351
|
/**
|
309
352
|
* A base class for entity controller implementations.
|
310
353
|
*
|
@@ -410,6 +453,22 @@ export declare interface BaseEntityControllerEventPayloads {
|
|
410
453
|
};
|
411
454
|
}
|
412
455
|
|
456
|
+
/** The base options for a rigid body. @public */
|
457
|
+
export declare interface BaseRigidBodyOptions {
|
458
|
+
/** The type of the rigid body, defaults to {@link RigidBodyType.DYNAMIC}. */
|
459
|
+
type?: RigidBodyType;
|
460
|
+
/** The colliders of the rigid body, provided as {@link ColliderOptions}. */
|
461
|
+
colliders?: ColliderOptions[];
|
462
|
+
/** Whether the rigid body is enabled. */
|
463
|
+
enabled?: boolean;
|
464
|
+
/** The position of the rigid body. */
|
465
|
+
position?: Vector3Like;
|
466
|
+
/** The rotation of the rigid body. */
|
467
|
+
rotation?: QuaternionLike;
|
468
|
+
/** The simulation the rigid body is in. If provided, the rigid body will be automatically added to the simulation. */
|
469
|
+
simulation?: Simulation;
|
470
|
+
}
|
471
|
+
|
413
472
|
/**
|
414
473
|
* Represents a block in a world.
|
415
474
|
*
|
@@ -437,6 +496,13 @@ export declare class Block {
|
|
437
496
|
getNeighborGlobalCoordinateFromHitPoint(hitPoint: Vector3Like): Vector3Like;
|
438
497
|
}
|
439
498
|
|
499
|
+
/** The options for a block collider. @public */
|
500
|
+
export declare interface BlockColliderOptions extends BaseColliderOptions {
|
501
|
+
shape: ColliderShape.BLOCK;
|
502
|
+
/** The half extents of the block collider. */
|
503
|
+
halfExtents?: Vector3Like;
|
504
|
+
}
|
505
|
+
|
440
506
|
/**
|
441
507
|
* Represents a block type.
|
442
508
|
*
|
@@ -483,7 +549,7 @@ export declare class BlockType extends EventRouter implements protocol.Serializa
|
|
483
549
|
/** The unique identifier for the block type. */
|
484
550
|
get id(): number;
|
485
551
|
/** The collider options for the block type. */
|
486
|
-
get colliderOptions():
|
552
|
+
get colliderOptions(): TrimeshColliderOptions;
|
487
553
|
/** Whether the block type is a liquid. */
|
488
554
|
get isLiquid(): boolean;
|
489
555
|
/** Whether the block type is meshable. */
|
@@ -525,7 +591,7 @@ export declare interface BlockTypeOptions {
|
|
525
591
|
/** The unique numeric identifier for the block type. */
|
526
592
|
id: number;
|
527
593
|
/** The custom collider options for the block type. */
|
528
|
-
customColliderOptions?:
|
594
|
+
customColliderOptions?: TrimeshColliderOptions;
|
529
595
|
/** Whether the block type is a liquid. */
|
530
596
|
isLiquid?: boolean;
|
531
597
|
/** The name of the block type. */
|
@@ -605,6 +671,15 @@ export declare interface BlockTypeRegistryEventPayloads {
|
|
605
671
|
};
|
606
672
|
}
|
607
673
|
|
674
|
+
/** The options for a capsule collider. @public */
|
675
|
+
export declare interface CapsuleColliderOptions extends BaseColliderOptions {
|
676
|
+
shape: ColliderShape.CAPSULE;
|
677
|
+
/** The half height of the capsule collider. */
|
678
|
+
halfHeight?: number;
|
679
|
+
/** The radius of the capsule collider. */
|
680
|
+
radius?: number;
|
681
|
+
}
|
682
|
+
|
608
683
|
/** Event types a ChatManager instance can emit. See {@link ChatEventPayloads} for the payloads. @public */
|
609
684
|
export declare enum ChatEvent {
|
610
685
|
BROADCAST_MESSAGE = "CHAT.BROADCAST_MESSAGE",
|
@@ -1084,59 +1159,17 @@ export declare class Collider extends EventRouter {
|
|
1084
1159
|
|
1085
1160
|
|
1086
1161
|
|
1162
|
+
private _requireUnsimulated;
|
1163
|
+
private _requireNotRemoved;
|
1087
1164
|
|
1088
1165
|
}
|
1089
1166
|
|
1090
|
-
/**
|
1091
|
-
export declare
|
1092
|
-
/** The shape of the collider. */
|
1093
|
-
shape: ColliderShape;
|
1094
|
-
/** The border radius of the collider if the shape is a round cylinder. */
|
1095
|
-
borderRadius?: number;
|
1096
|
-
/** The bounciness of the collider. */
|
1097
|
-
bounciness?: number;
|
1098
|
-
/** The bounciness combine rule of the collider. */
|
1099
|
-
bouncinessCombineRule?: CoefficientCombineRule;
|
1100
|
-
/** The collision groups the collider belongs to. */
|
1101
|
-
collisionGroups?: CollisionGroups;
|
1102
|
-
/** Whether the collider is enabled. */
|
1103
|
-
enabled?: boolean;
|
1104
|
-
/** The flags of the collider if the shape is a trimesh */
|
1105
|
-
flags?: number;
|
1106
|
-
/** The friction of the collider. */
|
1107
|
-
friction?: number;
|
1108
|
-
/** The friction combine rule of the collider. */
|
1109
|
-
frictionCombineRule?: CoefficientCombineRule;
|
1110
|
-
/** The half extents of the collider if the shape is a block. */
|
1111
|
-
halfExtents?: Vector3Like;
|
1112
|
-
/** The half height of the collider if the shape is a capsule, cone, cylinder, or round cylinder. */
|
1113
|
-
halfHeight?: number;
|
1114
|
-
/** The indices of the collider if the shape is a trimesh. */
|
1115
|
-
indices?: Uint32Array;
|
1116
|
-
/** Whether the collider is a sensor. */
|
1117
|
-
isSensor?: boolean;
|
1118
|
-
/** The mass of the collider. */
|
1119
|
-
mass?: number;
|
1120
|
-
/** The on collision callback for the collider. */
|
1121
|
-
onCollision?: CollisionCallback;
|
1122
|
-
/** The parent rigid body of the collider. */
|
1123
|
-
parentRigidBody?: RigidBody;
|
1124
|
-
/** The radius of the collider if the shape is a ball, capsule, cone, cylinder, or round cylinder. */
|
1125
|
-
radius?: number;
|
1126
|
-
/** The relative position of the collider. Relative to parent rigid body. */
|
1127
|
-
relativePosition?: Vector3Like;
|
1128
|
-
/** The relative rotation of the collider. Relative to parent rigid body. */
|
1129
|
-
relativeRotation?: QuaternionLike;
|
1130
|
-
/** The simulation the collider is in, if provided the collider will automatically be added to the simulation. */
|
1131
|
-
simulation?: Simulation;
|
1132
|
-
/** An arbitrary identifier tag of the collider. Useful for your own logic. */
|
1133
|
-
tag?: string;
|
1134
|
-
/** The vertices of the collider if the shape is a trimesh. */
|
1135
|
-
vertices?: Float32Array;
|
1136
|
-
}
|
1167
|
+
/** The options for a collider. @public */
|
1168
|
+
export declare type ColliderOptions = BallColliderOptions | BlockColliderOptions | CapsuleColliderOptions | ConeColliderOptions | CylinderColliderOptions | RoundCylinderColliderOptions | TrimeshColliderOptions | NoneColliderOptions;
|
1137
1169
|
|
1138
1170
|
/** The shapes a collider can be. @public */
|
1139
1171
|
export declare enum ColliderShape {
|
1172
|
+
NONE = "none",
|
1140
1173
|
BALL = "ball",
|
1141
1174
|
BLOCK = "block",
|
1142
1175
|
CAPSULE = "capsule",
|
@@ -1263,6 +1296,15 @@ export declare class CollisionGroupsBuilder {
|
|
1263
1296
|
*/
|
1264
1297
|
export declare type CommandCallback = (player: Player, args: string[], message: string) => void;
|
1265
1298
|
|
1299
|
+
/** The options for a cone collider. @public */
|
1300
|
+
export declare interface ConeColliderOptions extends BaseColliderOptions {
|
1301
|
+
shape: ColliderShape.CONE;
|
1302
|
+
/** The half height of the cone collider. */
|
1303
|
+
halfHeight?: number;
|
1304
|
+
/** The radius of the cone collider. */
|
1305
|
+
radius?: number;
|
1306
|
+
}
|
1307
|
+
|
1266
1308
|
/** Data for contact forces. @public */
|
1267
1309
|
export declare type ContactForceData = {
|
1268
1310
|
/** The total force vector. */
|
@@ -1287,6 +1329,15 @@ export declare type ContactManifold = {
|
|
1287
1329
|
normal: Vector3Like;
|
1288
1330
|
};
|
1289
1331
|
|
1332
|
+
/** The options for a cylinder collider. @public */
|
1333
|
+
export declare interface CylinderColliderOptions extends BaseColliderOptions {
|
1334
|
+
shape: ColliderShape.CYLINDER;
|
1335
|
+
/** The half height of the cylinder collider. */
|
1336
|
+
halfHeight?: number;
|
1337
|
+
/** The radius of the cylinder collider. */
|
1338
|
+
radius?: number;
|
1339
|
+
}
|
1340
|
+
|
1290
1341
|
/** A decoded set of collision groups represented as their string equivalents. @public */
|
1291
1342
|
export declare type DecodedCollisionGroups = {
|
1292
1343
|
belongsTo: string[];
|
@@ -1296,6 +1347,39 @@ export declare type DecodedCollisionGroups = {
|
|
1296
1347
|
/** The default rigid body options for a model entity when EntityOptions.rigidBodyOptions is not provided. @public */
|
1297
1348
|
export declare const DEFAULT_ENTITY_RIGID_BODY_OPTIONS: RigidBodyOptions;
|
1298
1349
|
|
1350
|
+
/** The options for a dynamic rigid body, also the default type. @public */
|
1351
|
+
export declare interface DynamicRigidBodyOptions extends BaseRigidBodyOptions {
|
1352
|
+
type?: RigidBodyType.DYNAMIC;
|
1353
|
+
/** The additional mass of the rigid body. */
|
1354
|
+
additionalMass?: number;
|
1355
|
+
/** The additional mass properties of the rigid body. */
|
1356
|
+
additionalMassProperties?: RigidBodyAdditionalMassProperties;
|
1357
|
+
/** The additional solver iterations of the rigid body. */
|
1358
|
+
additionalSolverIterations?: number;
|
1359
|
+
/** The angular damping of the rigid body. */
|
1360
|
+
angularDamping?: number;
|
1361
|
+
/** The angular velocity of the rigid body. */
|
1362
|
+
angularVelocity?: Vector3Like;
|
1363
|
+
/** Whether the rigid body has continuous collision detection enabled. */
|
1364
|
+
ccdEnabled?: boolean;
|
1365
|
+
/** The dominance group of the rigid body. */
|
1366
|
+
dominanceGroup?: number;
|
1367
|
+
/** The enabled axes of positional movement of the rigid body. */
|
1368
|
+
enabledPositions?: Vector3Boolean;
|
1369
|
+
/** The enabled rotations of the rigid body. */
|
1370
|
+
enabledRotations?: Vector3Boolean;
|
1371
|
+
/** The gravity scale of the rigid body. */
|
1372
|
+
gravityScale?: number;
|
1373
|
+
/** The linear damping of the rigid body. */
|
1374
|
+
linearDamping?: number;
|
1375
|
+
/** The linear velocity of the rigid body. */
|
1376
|
+
linearVelocity?: Vector3Like;
|
1377
|
+
/** Whether the rigid body is sleeping. */
|
1378
|
+
sleeping?: boolean;
|
1379
|
+
/** The soft continuous collision detection prediction of the rigid body. */
|
1380
|
+
softCcdPrediction?: number;
|
1381
|
+
}
|
1382
|
+
|
1299
1383
|
/**
|
1300
1384
|
* Represents an entity in a world.
|
1301
1385
|
*
|
@@ -1724,6 +1808,36 @@ export declare interface EntityOptions {
|
|
1724
1808
|
tintColor?: RgbColor;
|
1725
1809
|
}
|
1726
1810
|
|
1811
|
+
/**
|
1812
|
+
* Manages error and warning logging.
|
1813
|
+
*
|
1814
|
+
* @public
|
1815
|
+
*/
|
1816
|
+
export declare class ErrorHandler {
|
1817
|
+
private static errorCount;
|
1818
|
+
private static warningCount;
|
1819
|
+
/**
|
1820
|
+
* Logs a formatted warning message to alert about potential issues
|
1821
|
+
* @param message - The warning message to display
|
1822
|
+
* @param context - Optional context information about the warning
|
1823
|
+
*/
|
1824
|
+
static warning(message: string, context?: string): void;
|
1825
|
+
/**
|
1826
|
+
* Logs a formatted error message with stack trace to help debug issues
|
1827
|
+
* @param message - The error message to display
|
1828
|
+
* @param context - Optional context information about the error
|
1829
|
+
*/
|
1830
|
+
static error(message: string, context?: string): void;
|
1831
|
+
/**
|
1832
|
+
* Logs a formatted fatal error message with stack trace and throws the error
|
1833
|
+
* @param message - The error message to display
|
1834
|
+
* @param context - Optional context information about the error
|
1835
|
+
* @throws The created Error object
|
1836
|
+
*/
|
1837
|
+
static fatalError(message: string, context?: string): never;
|
1838
|
+
|
1839
|
+
}
|
1840
|
+
|
1727
1841
|
/**
|
1728
1842
|
* The payloads for all events in the game server.
|
1729
1843
|
*
|
@@ -1856,6 +1970,11 @@ export declare type FaceOptions = {
|
|
1856
1970
|
faceCompleteCallback?: FaceCompleteCallback;
|
1857
1971
|
};
|
1858
1972
|
|
1973
|
+
/** The options for a fixed rigid body. @public */
|
1974
|
+
export declare interface FixedRigidBodyOptions extends BaseRigidBodyOptions {
|
1975
|
+
type: RigidBodyType.FIXED;
|
1976
|
+
}
|
1977
|
+
|
1859
1978
|
/**
|
1860
1979
|
* Manages the game and associated worlds and systems.
|
1861
1980
|
*
|
@@ -1908,6 +2027,20 @@ export declare interface GameServerEventPayloads {
|
|
1908
2027
|
};
|
1909
2028
|
}
|
1910
2029
|
|
2030
|
+
/** The options for a kinematic position rigid body. @public */
|
2031
|
+
export declare interface KinematicPositionRigidBodyOptions extends BaseRigidBodyOptions {
|
2032
|
+
type: RigidBodyType.KINEMATIC_POSITION;
|
2033
|
+
}
|
2034
|
+
|
2035
|
+
/** The options for a kinematic velocity rigid body. @public */
|
2036
|
+
export declare interface KinematicVelocityRigidBodyOptions extends BaseRigidBodyOptions {
|
2037
|
+
type: RigidBodyType.KINEMATIC_VELOCITY;
|
2038
|
+
/** The angular velocity of the rigid body. */
|
2039
|
+
angularVelocity?: Vector3Like;
|
2040
|
+
/** The linear velocity of the rigid body. */
|
2041
|
+
linearVelocity?: Vector3Like;
|
2042
|
+
}
|
2043
|
+
|
1911
2044
|
/**
|
1912
2045
|
* Represents a light in a world. Lights can be point lights
|
1913
2046
|
* or spotlights.
|
@@ -2895,6 +3028,11 @@ export declare type MoveOptions = {
|
|
2895
3028
|
};
|
2896
3029
|
};
|
2897
3030
|
|
3031
|
+
/** The options for an error type "none" collider. @public */
|
3032
|
+
export declare interface NoneColliderOptions extends BaseColliderOptions {
|
3033
|
+
shape: ColliderShape.NONE;
|
3034
|
+
}
|
3035
|
+
|
2898
3036
|
/**
|
2899
3037
|
* A callback function called when the pathfinding algorithm aborts.
|
2900
3038
|
* @public
|
@@ -4254,9 +4392,9 @@ export declare class RigidBody extends EventRouter {
|
|
4254
4392
|
* and also simulated when the rigid body is simulated.
|
4255
4393
|
*
|
4256
4394
|
* @param colliderOptions - The options for the child collider to add.
|
4257
|
-
* @returns The child collider that was added to the rigid body.
|
4395
|
+
* @returns The child collider that was added to the rigid body, or null if failed.
|
4258
4396
|
*/
|
4259
|
-
createAndAddChildCollider(colliderOptions: ColliderOptions): Collider;
|
4397
|
+
createAndAddChildCollider(colliderOptions: ColliderOptions): Collider | null;
|
4260
4398
|
/**
|
4261
4399
|
* Creates and adds multiple child colliders to the rigid body for the simulation it belongs to.
|
4262
4400
|
* @param colliderOptions - The options for the child colliders to add to the rigid body.
|
@@ -4319,8 +4457,6 @@ export declare class RigidBody extends EventRouter {
|
|
4319
4457
|
|
4320
4458
|
|
4321
4459
|
|
4322
|
-
|
4323
|
-
|
4324
4460
|
}
|
4325
4461
|
|
4326
4462
|
/** Additional mass properties for a RigidBody. @public */
|
@@ -4331,49 +4467,8 @@ export declare type RigidBodyAdditionalMassProperties = {
|
|
4331
4467
|
principalAngularInertiaLocalFrame: QuaternionLike;
|
4332
4468
|
};
|
4333
4469
|
|
4334
|
-
/**
|
4335
|
-
export declare
|
4336
|
-
/** The type of the rigid body. */
|
4337
|
-
type?: RigidBodyType;
|
4338
|
-
/** The additional mass of the rigid body. */
|
4339
|
-
additionalMass?: number;
|
4340
|
-
/** The additional mass properties of the rigid body. */
|
4341
|
-
additionalMassProperties?: RigidBodyAdditionalMassProperties;
|
4342
|
-
/** The additional solver iterations of the rigid body. */
|
4343
|
-
additionalSolverIterations?: number;
|
4344
|
-
/** The angular damping of the rigid body. */
|
4345
|
-
angularDamping?: number;
|
4346
|
-
/** The angular velocity of the rigid body. */
|
4347
|
-
angularVelocity?: Vector3Like;
|
4348
|
-
/** Whether the rigid body has continuous collision detection enabled. */
|
4349
|
-
ccdEnabled?: boolean;
|
4350
|
-
/** The colliders of the rigid body, provided as {@link ColliderOptions}. */
|
4351
|
-
colliders?: ColliderOptions[];
|
4352
|
-
/** The dominance group of the rigid body. */
|
4353
|
-
dominanceGroup?: number;
|
4354
|
-
/** Whether the rigid body is enabled. */
|
4355
|
-
enabled?: boolean;
|
4356
|
-
/** The enabled axes of positional movement of the rigid body. */
|
4357
|
-
enabledPositions?: Vector3Boolean;
|
4358
|
-
/** The enabled rotations of the rigid body. */
|
4359
|
-
enabledRotations?: Vector3Boolean;
|
4360
|
-
/** The gravity scale of the rigid body. */
|
4361
|
-
gravityScale?: number;
|
4362
|
-
/** The linear damping of the rigid body. */
|
4363
|
-
linearDamping?: number;
|
4364
|
-
/** The linear velocity of the rigid body. */
|
4365
|
-
linearVelocity?: Vector3Like;
|
4366
|
-
/** The position of the rigid body. */
|
4367
|
-
position?: Vector3Like;
|
4368
|
-
/** The rotation of the rigid body. */
|
4369
|
-
rotation?: QuaternionLike;
|
4370
|
-
/** The simulation the rigid body is in. If provided, the rigid body will be automatically added to the simulation. */
|
4371
|
-
simulation?: Simulation;
|
4372
|
-
/** Whether the rigid body is sleeping. */
|
4373
|
-
sleeping?: boolean;
|
4374
|
-
/** The soft continuous collision detection prediction of the rigid body. */
|
4375
|
-
softCcdPrediction?: number;
|
4376
|
-
}
|
4470
|
+
/** The options for a rigid body. @public */
|
4471
|
+
export declare type RigidBodyOptions = DynamicRigidBodyOptions | FixedRigidBodyOptions | KinematicPositionRigidBodyOptions | KinematicVelocityRigidBodyOptions;
|
4377
4472
|
|
4378
4473
|
/** The types a RigidBody can be. @public */
|
4379
4474
|
export declare enum RigidBodyType {
|
@@ -4383,6 +4478,17 @@ export declare enum RigidBodyType {
|
|
4383
4478
|
KINEMATIC_VELOCITY = "kinematic_velocity"
|
4384
4479
|
}
|
4385
4480
|
|
4481
|
+
/** The options for a round cylinder collider. @public */
|
4482
|
+
export declare interface RoundCylinderColliderOptions extends BaseColliderOptions {
|
4483
|
+
shape: ColliderShape.ROUND_CYLINDER;
|
4484
|
+
/** The border radius of the round cylinder collider. */
|
4485
|
+
borderRadius?: number;
|
4486
|
+
/** The half height of the round cylinder collider. */
|
4487
|
+
halfHeight?: number;
|
4488
|
+
/** The radius of the round cylinder collider. */
|
4489
|
+
radius?: number;
|
4490
|
+
}
|
4491
|
+
|
4386
4492
|
/**
|
4387
4493
|
* UI rendered within the 3D space of a world's
|
4388
4494
|
* game scene.
|
@@ -4821,6 +4927,15 @@ export declare function startServer(init: (world: World) => void): void;
|
|
4821
4927
|
/** The input keys that are included in the PlayerInput. @public */
|
4822
4928
|
export declare const SUPPORTED_INPUT_KEYS: readonly ["w", "a", "s", "d", "sp", "sh", "tb", "ml", "mr", "q", "e", "r", "f", "z", "x", "c", "v", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
|
4823
4929
|
|
4930
|
+
/** The options for a trimesh collider. @public */
|
4931
|
+
export declare interface TrimeshColliderOptions extends BaseColliderOptions {
|
4932
|
+
shape: ColliderShape.TRIMESH;
|
4933
|
+
/** The indices of the trimesh collider. */
|
4934
|
+
indices?: Uint32Array;
|
4935
|
+
/** The vertices of the trimesh collider. */
|
4936
|
+
vertices?: Float32Array;
|
4937
|
+
}
|
4938
|
+
|
4824
4939
|
/**
|
4825
4940
|
* Represents a 2D vector.
|
4826
4941
|
*
|