hytopia 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +16 -12
- package/boilerplate/assets/audio/sfx/step.wav +0 -0
- package/boilerplate/assets/map.json +2623 -0
- package/boilerplate/index.ts +103 -0
- package/docs/index.md +29 -0
- package/docs/server.audio._constructor_.md +47 -0
- package/docs/server.audio.attachedtoentity.md +13 -0
- package/docs/server.audio.detune.md +13 -0
- package/docs/server.audio.distortion.md +13 -0
- package/docs/server.audio.duration.md +13 -0
- package/docs/server.audio.id.md +13 -0
- package/docs/server.audio.isloaded.md +13 -0
- package/docs/server.audio.isplaying.md +13 -0
- package/docs/server.audio.ispositional.md +13 -0
- package/docs/server.audio.loop.md +13 -0
- package/docs/server.audio.md +591 -0
- package/docs/server.audio.offset.md +13 -0
- package/docs/server.audio.pause.md +17 -0
- package/docs/server.audio.play.md +69 -0
- package/docs/server.audio.playbackrate.md +13 -0
- package/docs/server.audio.position.md +13 -0
- package/docs/server.audio.referencedistance.md +13 -0
- package/docs/server.audio.setattachedtoentity.md +53 -0
- package/docs/server.audio.setdetune.md +53 -0
- package/docs/server.audio.setdistortion.md +53 -0
- package/docs/server.audio.setplaybackrate.md +53 -0
- package/docs/server.audio.setposition.md +53 -0
- package/docs/server.audio.setreferencedistance.md +53 -0
- package/docs/server.audio.setvolume.md +53 -0
- package/docs/server.audio.starttick.md +13 -0
- package/docs/server.audio.uri.md +13 -0
- package/docs/server.audio.volume.md +13 -0
- package/docs/server.audio.world.md +13 -0
- package/docs/server.audioeventpayload.md +118 -0
- package/docs/server.audioeventpayload.pause.audio.md +11 -0
- package/docs/server.audioeventpayload.pause.md +53 -0
- package/docs/server.audioeventpayload.play.audio.md +11 -0
- package/docs/server.audioeventpayload.play.md +53 -0
- package/docs/server.audioeventpayload.playrestart.audio.md +11 -0
- package/docs/server.audioeventpayload.playrestart.md +53 -0
- package/docs/server.audioeventpayload.setattachedtoentity.audio.md +11 -0
- package/docs/server.audioeventpayload.setattachedtoentity.entity.md +11 -0
- package/docs/server.audioeventpayload.setattachedtoentity.md +70 -0
- package/docs/server.audioeventpayload.setdetune.audio.md +11 -0
- package/docs/server.audioeventpayload.setdetune.detune.md +11 -0
- package/docs/server.audioeventpayload.setdetune.md +70 -0
- package/docs/server.audioeventpayload.setdistortion.audio.md +11 -0
- package/docs/server.audioeventpayload.setdistortion.distortion.md +11 -0
- package/docs/server.audioeventpayload.setdistortion.md +70 -0
- package/docs/server.audioeventpayload.setplaybackrate.audio.md +11 -0
- package/docs/server.audioeventpayload.setplaybackrate.md +70 -0
- package/docs/server.audioeventpayload.setplaybackrate.playbackrate.md +11 -0
- package/docs/server.audioeventpayload.setposition.audio.md +11 -0
- package/docs/server.audioeventpayload.setposition.md +70 -0
- package/docs/server.audioeventpayload.setposition.position.md +11 -0
- package/docs/server.audioeventpayload.setreferencedistance.audio.md +11 -0
- package/docs/server.audioeventpayload.setreferencedistance.md +70 -0
- package/docs/server.audioeventpayload.setreferencedistance.referencedistance.md +11 -0
- package/docs/server.audioeventpayload.setvolume.audio.md +11 -0
- package/docs/server.audioeventpayload.setvolume.md +70 -0
- package/docs/server.audioeventpayload.setvolume.volume.md +11 -0
- package/docs/server.audioeventtype.md +173 -0
- package/docs/server.audiomanager.getallaudios.md +19 -0
- package/docs/server.audiomanager.getallentityattachedaudios.md +55 -0
- package/docs/server.audiomanager.getallloopedaudios.md +19 -0
- package/docs/server.audiomanager.getalloneshotaudios.md +19 -0
- package/docs/server.audiomanager.md +150 -0
- package/docs/server.audiomanager.world.md +13 -0
- package/docs/server.audiooptions.attachedtoentity.md +13 -0
- package/docs/server.audiooptions.detune.md +13 -0
- package/docs/server.audiooptions.distortion.md +13 -0
- package/docs/server.audiooptions.duration.md +13 -0
- package/docs/server.audiooptions.loop.md +13 -0
- package/docs/server.audiooptions.md +247 -0
- package/docs/server.audiooptions.offset.md +13 -0
- package/docs/server.audiooptions.playbackrate.md +13 -0
- package/docs/server.audiooptions.position.md +13 -0
- package/docs/server.audiooptions.referencedistance.md +13 -0
- package/docs/server.audiooptions.uri.md +13 -0
- package/docs/server.audiooptions.volume.md +13 -0
- package/docs/server.basecharactercontroller._constructor_.md +65 -0
- package/docs/server.basecharactercontroller.createsensorcolliders.md +19 -0
- package/docs/server.basecharactercontroller.entity.md +13 -0
- package/docs/server.basecharactercontroller.md +197 -0
- package/docs/server.basecharactercontroller.ontickpathfindingmovement.md +13 -0
- package/docs/server.basecharactercontroller.ontickplayermovement.md +13 -0
- package/docs/server.basecharactercontroller.tickpathfindingmovement.md +69 -0
- package/docs/server.basecharactercontroller.tickplayermovement.md +85 -0
- package/docs/server.block.blocktype.md +13 -0
- package/docs/server.block.globalcoordinate.md +13 -0
- package/docs/server.block.md +86 -0
- package/docs/server.blocktype._constructor_.md +49 -0
- package/docs/server.blocktype.collideroptions.md +13 -0
- package/docs/server.blocktype.id.md +13 -0
- package/docs/server.blocktype.ismeshable.md +13 -0
- package/docs/server.blocktype.md +235 -0
- package/docs/server.blocktype.name.md +13 -0
- package/docs/server.blocktype.onentitycollision.md +13 -0
- package/docs/server.blocktype.onentitycontactforce.md +13 -0
- package/docs/server.blocktype.textureuri.md +13 -0
- package/docs/server.blocktypeoptions.customcollideroptions.md +11 -0
- package/docs/server.blocktypeoptions.id.md +11 -0
- package/docs/server.blocktypeoptions.md +108 -0
- package/docs/server.blocktypeoptions.name.md +11 -0
- package/docs/server.blocktypeoptions.textureuri.md +11 -0
- package/docs/server.blocktyperegistry.getallblocktypes.md +19 -0
- package/docs/server.blocktyperegistry.getblocktype.md +55 -0
- package/docs/server.blocktyperegistry.md +153 -0
- package/docs/server.blocktyperegistry.registerblocktype.md +69 -0
- package/docs/server.blocktyperegistry.registergenericblocktype.md +55 -0
- package/docs/server.blocktyperegistry.world.md +13 -0
- package/docs/server.blocktyperegistryeventpayload.md +37 -0
- package/docs/server.blocktyperegistryeventpayload.registerblocktype.blocktype.md +11 -0
- package/docs/server.blocktyperegistryeventpayload.registerblocktype.blocktyperegistry.md +11 -0
- package/docs/server.blocktyperegistryeventpayload.registerblocktype.id.md +11 -0
- package/docs/server.blocktyperegistryeventpayload.registerblocktype.md +87 -0
- package/docs/server.blocktyperegistryeventtype.md +47 -0
- package/docs/server.chateventpayload.md +46 -0
- package/docs/server.chateventpayload.sendbroadcastmessage.color.md +11 -0
- package/docs/server.chateventpayload.sendbroadcastmessage.md +72 -0
- package/docs/server.chateventpayload.sendbroadcastmessage.message.md +11 -0
- package/docs/server.chateventpayload.sendplayermessage.color.md +11 -0
- package/docs/server.chateventpayload.sendplayermessage.md +89 -0
- package/docs/server.chateventpayload.sendplayermessage.message.md +11 -0
- package/docs/server.chateventpayload.sendplayermessage.player.md +11 -0
- package/docs/server.chateventtype.md +61 -0
- package/docs/server.chatmanager.md +112 -0
- package/docs/server.chatmanager.registercommand.md +69 -0
- package/docs/server.chatmanager.sendbroadcastmessage.md +76 -0
- package/docs/server.chatmanager.sendplayermessage.md +92 -0
- package/docs/server.chatmanager.unregistercommand.md +53 -0
- package/docs/server.chunk._constructor_.md +13 -0
- package/docs/server.chunk.blockindextolocalcoordinate.md +55 -0
- package/docs/server.chunk.blocks.md +13 -0
- package/docs/server.chunk.despawn.md +17 -0
- package/docs/server.chunk.globalcoordinatetolocalcoordinate.md +55 -0
- package/docs/server.chunk.globalcoordinatetoorigincoordinate.md +55 -0
- package/docs/server.chunk.issimulated.md +13 -0
- package/docs/server.chunk.isspawned.md +13 -0
- package/docs/server.chunk.isvalidorigincoordinate.md +55 -0
- package/docs/server.chunk.md +324 -0
- package/docs/server.chunk.origincoordinate.md +13 -0
- package/docs/server.chunk.setblock.md +69 -0
- package/docs/server.chunk.spawn.md +69 -0
- package/docs/server.chunk.world.md +13 -0
- package/docs/server.chunkeventpayload.despawn.chunk.md +11 -0
- package/docs/server.chunkeventpayload.despawn.md +53 -0
- package/docs/server.chunkeventpayload.md +55 -0
- package/docs/server.chunkeventpayload.setblock.blocktypeid.md +11 -0
- package/docs/server.chunkeventpayload.setblock.chunk.md +11 -0
- package/docs/server.chunkeventpayload.setblock.globalcoordinate.md +11 -0
- package/docs/server.chunkeventpayload.setblock.localcoordinate.md +11 -0
- package/docs/server.chunkeventpayload.setblock.md +104 -0
- package/docs/server.chunkeventpayload.spawn.chunk.md +11 -0
- package/docs/server.chunkeventpayload.spawn.md +53 -0
- package/docs/server.chunkeventtype.md +75 -0
- package/docs/server.chunklattice._constructor_.md +49 -0
- package/docs/server.chunklattice.getallchunks.md +19 -0
- package/docs/server.chunklattice.getchunk.md +55 -0
- package/docs/server.chunklattice.haschunk.md +55 -0
- package/docs/server.chunklattice.md +127 -0
- package/docs/server.chunklattice.setblock.md +69 -0
- package/docs/server.collider._constructor_.md +49 -0
- package/docs/server.collider.addtosimulation.md +69 -0
- package/docs/server.collider.enablecollisionevents.md +53 -0
- package/docs/server.collider.enablecontactforceevents.md +53 -0
- package/docs/server.collider.getbounciness.md +19 -0
- package/docs/server.collider.getcollisiongroups.md +19 -0
- package/docs/server.collider.getfriction.md +19 -0
- package/docs/server.collider.getrelativerotation.md +19 -0
- package/docs/server.collider.getrelativetranslation.md +19 -0
- package/docs/server.collider.isenabled.md +13 -0
- package/docs/server.collider.isremoved.md +13 -0
- package/docs/server.collider.issensor.md +13 -0
- package/docs/server.collider.issimulated.md +13 -0
- package/docs/server.collider.md +509 -0
- package/docs/server.collider.parentrigidbody.md +13 -0
- package/docs/server.collider.rawcollider.md +13 -0
- package/docs/server.collider.removefromsimulation.md +17 -0
- package/docs/server.collider.setbounciness.md +53 -0
- package/docs/server.collider.setcollisiongroups.md +53 -0
- package/docs/server.collider.setenabled.md +53 -0
- package/docs/server.collider.setfriction.md +53 -0
- package/docs/server.collider.setmass.md +53 -0
- package/docs/server.collider.setoncollision.md +53 -0
- package/docs/server.collider.setrelativerotation.md +53 -0
- package/docs/server.collider.setrelativetranslation.md +53 -0
- package/docs/server.collider.setsensor.md +53 -0
- package/docs/server.collider.settag.md +53 -0
- package/docs/server.collider.tag.md +13 -0
- package/docs/server.collideroptions.borderradius.md +13 -0
- package/docs/server.collideroptions.bounciness.md +13 -0
- package/docs/server.collideroptions.collisiongroups.md +13 -0
- package/docs/server.collideroptions.enabled.md +13 -0
- package/docs/server.collideroptions.friction.md +13 -0
- package/docs/server.collideroptions.halfextents.md +13 -0
- package/docs/server.collideroptions.halfheight.md +13 -0
- package/docs/server.collideroptions.issensor.md +13 -0
- package/docs/server.collideroptions.mass.md +13 -0
- package/docs/server.collideroptions.md +361 -0
- package/docs/server.collideroptions.oncollision.md +13 -0
- package/docs/server.collideroptions.parentrigidbody.md +13 -0
- package/docs/server.collideroptions.radius.md +13 -0
- package/docs/server.collideroptions.relativerotation.md +13 -0
- package/docs/server.collideroptions.relativetranslation.md +13 -0
- package/docs/server.collideroptions.shape.md +13 -0
- package/docs/server.collideroptions.simulation.md +13 -0
- package/docs/server.collideroptions.tag.md +13 -0
- package/docs/server.collidershape.md +117 -0
- package/docs/server.collisioncallback.md +15 -0
- package/docs/server.collisiongroup.md +116 -0
- package/docs/server.collisiongroups.md +18 -0
- package/docs/server.collisiongroupsbuilder.buildrawcollisiongroups.md +55 -0
- package/docs/server.collisiongroupsbuilder.decodecollisiongroups.md +55 -0
- package/docs/server.collisiongroupsbuilder.decoderawcollisiongroups.md +55 -0
- package/docs/server.collisiongroupsbuilder.isdefaultcollisiongroups.md +55 -0
- package/docs/server.collisiongroupsbuilder.md +101 -0
- package/docs/server.commandcallback.md +15 -0
- package/docs/server.decodedcollisiongroups.md +16 -0
- package/docs/server.default_entity_rigid_body_options.md +13 -0
- package/docs/server.defaultcharactercontroller._constructor_.md +65 -0
- package/docs/server.defaultcharactercontroller.canjump.md +13 -0
- package/docs/server.defaultcharactercontroller.canrun.md +13 -0
- package/docs/server.defaultcharactercontroller.canwalk.md +13 -0
- package/docs/server.defaultcharactercontroller.createsensorcolliders.md +19 -0
- package/docs/server.defaultcharactercontroller.isgrounded.md +13 -0
- package/docs/server.defaultcharactercontroller.isonplatform.md +13 -0
- package/docs/server.defaultcharactercontroller.jumpvelocity.md +13 -0
- package/docs/server.defaultcharactercontroller.md +333 -0
- package/docs/server.defaultcharactercontroller.platform.md +13 -0
- package/docs/server.defaultcharactercontroller.runvelocity.md +13 -0
- package/docs/server.defaultcharactercontroller.tickpathfindingmovement.md +69 -0
- package/docs/server.defaultcharactercontroller.tickplayermovement.md +85 -0
- package/docs/server.defaultcharactercontroller.walkvelocity.md +13 -0
- package/docs/server.defaultcharactercontrolleroptions.canjump.md +13 -0
- package/docs/server.defaultcharactercontrolleroptions.canrun.md +13 -0
- package/docs/server.defaultcharactercontrolleroptions.canwalk.md +13 -0
- package/docs/server.defaultcharactercontrolleroptions.jumpvelocity.md +13 -0
- package/docs/server.defaultcharactercontrolleroptions.md +152 -0
- package/docs/server.defaultcharactercontrolleroptions.runvelocity.md +13 -0
- package/docs/server.defaultcharactercontrolleroptions.walkvelocity.md +13 -0
- package/docs/server.entity._constructor_.md +49 -0
- package/docs/server.entity.charactercontroller.md +13 -0
- package/docs/server.entity.createcustomcharactercontroller.md +13 -0
- package/docs/server.entity.despawn.md +17 -0
- package/docs/server.entity.id.md +13 -0
- package/docs/server.entity.isspawned.md +13 -0
- package/docs/server.entity.md +529 -0
- package/docs/server.entity.modelloopedanimations.md +13 -0
- package/docs/server.entity.modelscale.md +13 -0
- package/docs/server.entity.modeluri.md +13 -0
- package/docs/server.entity.name.md +13 -0
- package/docs/server.entity.onblockcollision.md +13 -0
- package/docs/server.entity.onblockcontactforce.md +13 -0
- package/docs/server.entity.ondespawn.md +13 -0
- package/docs/server.entity.onentitycollision.md +13 -0
- package/docs/server.entity.onentitycontactforce.md +13 -0
- package/docs/server.entity.onspawn.md +13 -0
- package/docs/server.entity.ontick.md +13 -0
- package/docs/server.entity.setcharactercontroller.md +53 -0
- package/docs/server.entity.spawn.md +69 -0
- package/docs/server.entity.startmodelloopedanimations.md +53 -0
- package/docs/server.entity.startmodeloneshotanimations.md +53 -0
- package/docs/server.entity.stopmodelanimations.md +53 -0
- package/docs/server.entity.world.md +13 -0
- package/docs/server.entityeventpayload.despawn.entity.md +11 -0
- package/docs/server.entityeventpayload.despawn.md +53 -0
- package/docs/server.entityeventpayload.md +91 -0
- package/docs/server.entityeventpayload.spawn.entity.md +11 -0
- package/docs/server.entityeventpayload.spawn.md +53 -0
- package/docs/server.entityeventpayload.startmodelloopedanimations.animations.md +11 -0
- package/docs/server.entityeventpayload.startmodelloopedanimations.entity.md +11 -0
- package/docs/server.entityeventpayload.startmodelloopedanimations.md +70 -0
- package/docs/server.entityeventpayload.startmodeloneshotanimations.animations.md +11 -0
- package/docs/server.entityeventpayload.startmodeloneshotanimations.entity.md +11 -0
- package/docs/server.entityeventpayload.startmodeloneshotanimations.md +70 -0
- package/docs/server.entityeventpayload.stopmodelanimations.animations.md +11 -0
- package/docs/server.entityeventpayload.stopmodelanimations.entity.md +11 -0
- package/docs/server.entityeventpayload.stopmodelanimations.md +70 -0
- package/docs/server.entityeventpayload.updaterotation.entity.md +11 -0
- package/docs/server.entityeventpayload.updaterotation.md +70 -0
- package/docs/server.entityeventpayload.updaterotation.rotation.md +11 -0
- package/docs/server.entityeventpayload.updatetranslation.entity.md +11 -0
- package/docs/server.entityeventpayload.updatetranslation.md +70 -0
- package/docs/server.entityeventpayload.updatetranslation.translation.md +11 -0
- package/docs/server.entityeventtype.md +131 -0
- package/docs/server.entitymanager.getallentities.md +19 -0
- package/docs/server.entitymanager.getallplayerentities.md +55 -0
- package/docs/server.entitymanager.getentity.md +55 -0
- package/docs/server.entitymanager.md +136 -0
- package/docs/server.entitymanager.world.md +13 -0
- package/docs/server.entityoptions.md +133 -0
- package/docs/server.entityoptions.modelloopedanimations.md +13 -0
- package/docs/server.entityoptions.modelscale.md +13 -0
- package/docs/server.entityoptions.modeluri.md +13 -0
- package/docs/server.entityoptions.name.md +13 -0
- package/docs/server.entityoptions.rigidbodyoptions.md +13 -0
- package/docs/server.event_2.md +76 -0
- package/docs/server.event_2.payload.md +13 -0
- package/docs/server.event_2.type.md +13 -0
- package/docs/server.eventrouter._constructor_.md +49 -0
- package/docs/server.eventrouter.emit.md +55 -0
- package/docs/server.eventrouter.logallevents.md +13 -0
- package/docs/server.eventrouter.logeventspayloads.md +13 -0
- package/docs/server.eventrouter.logignoreeventprefixes.md +13 -0
- package/docs/server.eventrouter.logignoreevents.md +13 -0
- package/docs/server.eventrouter.logunlistenedevents.md +13 -0
- package/docs/server.eventrouter.md +270 -0
- package/docs/server.eventrouter.off.md +69 -0
- package/docs/server.eventrouter.offall.md +53 -0
- package/docs/server.eventrouter.on.md +73 -0
- package/docs/server.eventrouter.serverinstance.md +13 -0
- package/docs/server.gameserver.instance.md +13 -0
- package/docs/server.gameserver.md +109 -0
- package/docs/server.gameserver.playermanager.md +13 -0
- package/docs/server.gameserver.worlds.md +15 -0
- package/docs/server.gameservereventpayload.md +46 -0
- package/docs/server.gameservereventpayload.start.md +53 -0
- package/docs/server.gameservereventpayload.start.startedatms.md +11 -0
- package/docs/server.gameservereventpayload.stop.md +53 -0
- package/docs/server.gameservereventpayload.stop.stoppedatms.md +11 -0
- package/docs/server.gameservereventtype.md +61 -0
- package/docs/server.hytopia.audio._constructor_.md +47 -0
- package/docs/server.hytopia.audio.attachedtoentity.md +13 -0
- package/docs/server.hytopia.audio.detune.md +13 -0
- package/docs/server.hytopia.audio.distortion.md +13 -0
- package/docs/server.hytopia.audio.duration.md +13 -0
- package/docs/server.hytopia.audio.id.md +13 -0
- package/docs/server.hytopia.audio.isloaded.md +13 -0
- package/docs/server.hytopia.audio.isplaying.md +13 -0
- package/docs/server.hytopia.audio.ispositional.md +13 -0
- package/docs/server.hytopia.audio.loop.md +13 -0
- package/docs/server.hytopia.audio.md +591 -0
- package/docs/server.hytopia.audio.offset.md +13 -0
- package/docs/server.hytopia.audio.pause.md +17 -0
- package/docs/server.hytopia.audio.play.md +69 -0
- package/docs/server.hytopia.audio.playbackrate.md +13 -0
- package/docs/server.hytopia.audio.position.md +13 -0
- package/docs/server.hytopia.audio.referencedistance.md +13 -0
- package/docs/server.hytopia.audio.setattachedtoentity.md +53 -0
- package/docs/server.hytopia.audio.setdetune.md +53 -0
- package/docs/server.hytopia.audio.setdistortion.md +53 -0
- package/docs/server.hytopia.audio.setplaybackrate.md +53 -0
- package/docs/server.hytopia.audio.setposition.md +53 -0
- package/docs/server.hytopia.audio.setreferencedistance.md +53 -0
- package/docs/server.hytopia.audio.setvolume.md +53 -0
- package/docs/server.hytopia.audio.starttick.md +13 -0
- package/docs/server.hytopia.audio.uri.md +13 -0
- package/docs/server.hytopia.audio.volume.md +13 -0
- package/docs/server.hytopia.audio.world.md +13 -0
- package/docs/server.hytopia.audioeventpayload.md +118 -0
- package/docs/server.hytopia.audioeventpayload.pause.audio.md +11 -0
- package/docs/server.hytopia.audioeventpayload.pause.md +53 -0
- package/docs/server.hytopia.audioeventpayload.play.audio.md +11 -0
- package/docs/server.hytopia.audioeventpayload.play.md +53 -0
- package/docs/server.hytopia.audioeventpayload.playrestart.audio.md +11 -0
- package/docs/server.hytopia.audioeventpayload.playrestart.md +53 -0
- package/docs/server.hytopia.audioeventpayload.setattachedtoentity.audio.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setattachedtoentity.entity.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setattachedtoentity.md +70 -0
- package/docs/server.hytopia.audioeventpayload.setdetune.audio.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setdetune.detune.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setdetune.md +70 -0
- package/docs/server.hytopia.audioeventpayload.setdistortion.audio.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setdistortion.distortion.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setdistortion.md +70 -0
- package/docs/server.hytopia.audioeventpayload.setplaybackrate.audio.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setplaybackrate.md +70 -0
- package/docs/server.hytopia.audioeventpayload.setplaybackrate.playbackrate.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setposition.audio.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setposition.md +70 -0
- package/docs/server.hytopia.audioeventpayload.setposition.position.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setreferencedistance.audio.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setreferencedistance.md +70 -0
- package/docs/server.hytopia.audioeventpayload.setreferencedistance.referencedistance.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setvolume.audio.md +11 -0
- package/docs/server.hytopia.audioeventpayload.setvolume.md +70 -0
- package/docs/server.hytopia.audioeventpayload.setvolume.volume.md +11 -0
- package/docs/server.hytopia.audioeventtype.md +173 -0
- package/docs/server.hytopia.audiomanager.getallaudios.md +19 -0
- package/docs/server.hytopia.audiomanager.getallentityattachedaudios.md +55 -0
- package/docs/server.hytopia.audiomanager.getallloopedaudios.md +19 -0
- package/docs/server.hytopia.audiomanager.getalloneshotaudios.md +19 -0
- package/docs/server.hytopia.audiomanager.md +150 -0
- package/docs/server.hytopia.audiomanager.world.md +13 -0
- package/docs/server.hytopia.audiooptions.attachedtoentity.md +13 -0
- package/docs/server.hytopia.audiooptions.detune.md +13 -0
- package/docs/server.hytopia.audiooptions.distortion.md +13 -0
- package/docs/server.hytopia.audiooptions.duration.md +13 -0
- package/docs/server.hytopia.audiooptions.loop.md +13 -0
- package/docs/server.hytopia.audiooptions.md +247 -0
- package/docs/server.hytopia.audiooptions.offset.md +13 -0
- package/docs/server.hytopia.audiooptions.playbackrate.md +13 -0
- package/docs/server.hytopia.audiooptions.position.md +13 -0
- package/docs/server.hytopia.audiooptions.referencedistance.md +13 -0
- package/docs/server.hytopia.audiooptions.uri.md +13 -0
- package/docs/server.hytopia.audiooptions.volume.md +13 -0
- package/docs/server.hytopia.basecharactercontroller._constructor_.md +65 -0
- package/docs/server.hytopia.basecharactercontroller.createsensorcolliders.md +19 -0
- package/docs/server.hytopia.basecharactercontroller.entity.md +13 -0
- package/docs/server.hytopia.basecharactercontroller.md +197 -0
- package/docs/server.hytopia.basecharactercontroller.ontickpathfindingmovement.md +13 -0
- package/docs/server.hytopia.basecharactercontroller.ontickplayermovement.md +13 -0
- package/docs/server.hytopia.basecharactercontroller.tickpathfindingmovement.md +69 -0
- package/docs/server.hytopia.basecharactercontroller.tickplayermovement.md +85 -0
- package/docs/server.hytopia.block.blocktype.md +13 -0
- package/docs/server.hytopia.block.globalcoordinate.md +13 -0
- package/docs/server.hytopia.block.md +86 -0
- package/docs/server.hytopia.blocktype._constructor_.md +49 -0
- package/docs/server.hytopia.blocktype.collideroptions.md +13 -0
- package/docs/server.hytopia.blocktype.id.md +13 -0
- package/docs/server.hytopia.blocktype.ismeshable.md +13 -0
- package/docs/server.hytopia.blocktype.md +235 -0
- package/docs/server.hytopia.blocktype.name.md +13 -0
- package/docs/server.hytopia.blocktype.onentitycollision.md +13 -0
- package/docs/server.hytopia.blocktype.onentitycontactforce.md +13 -0
- package/docs/server.hytopia.blocktype.textureuri.md +13 -0
- package/docs/server.hytopia.blocktypeoptions.customcollideroptions.md +11 -0
- package/docs/server.hytopia.blocktypeoptions.id.md +11 -0
- package/docs/server.hytopia.blocktypeoptions.md +108 -0
- package/docs/server.hytopia.blocktypeoptions.name.md +11 -0
- package/docs/server.hytopia.blocktypeoptions.textureuri.md +11 -0
- package/docs/server.hytopia.blocktyperegistry.getallblocktypes.md +19 -0
- package/docs/server.hytopia.blocktyperegistry.getblocktype.md +55 -0
- package/docs/server.hytopia.blocktyperegistry.md +153 -0
- package/docs/server.hytopia.blocktyperegistry.registerblocktype.md +69 -0
- package/docs/server.hytopia.blocktyperegistry.registergenericblocktype.md +55 -0
- package/docs/server.hytopia.blocktyperegistry.world.md +13 -0
- package/docs/server.hytopia.blocktyperegistryeventpayload.md +37 -0
- package/docs/server.hytopia.blocktyperegistryeventpayload.registerblocktype.blocktype.md +11 -0
- package/docs/server.hytopia.blocktyperegistryeventpayload.registerblocktype.blocktyperegistry.md +11 -0
- package/docs/server.hytopia.blocktyperegistryeventpayload.registerblocktype.id.md +11 -0
- package/docs/server.hytopia.blocktyperegistryeventpayload.registerblocktype.md +87 -0
- package/docs/server.hytopia.blocktyperegistryeventtype.md +47 -0
- package/docs/server.hytopia.chateventpayload.md +46 -0
- package/docs/server.hytopia.chateventpayload.sendbroadcastmessage.color.md +11 -0
- package/docs/server.hytopia.chateventpayload.sendbroadcastmessage.md +72 -0
- package/docs/server.hytopia.chateventpayload.sendbroadcastmessage.message.md +11 -0
- package/docs/server.hytopia.chateventpayload.sendplayermessage.color.md +11 -0
- package/docs/server.hytopia.chateventpayload.sendplayermessage.md +89 -0
- package/docs/server.hytopia.chateventpayload.sendplayermessage.message.md +11 -0
- package/docs/server.hytopia.chateventpayload.sendplayermessage.player.md +11 -0
- package/docs/server.hytopia.chateventtype.md +61 -0
- package/docs/server.hytopia.chatmanager.md +112 -0
- package/docs/server.hytopia.chatmanager.registercommand.md +69 -0
- package/docs/server.hytopia.chatmanager.sendbroadcastmessage.md +76 -0
- package/docs/server.hytopia.chatmanager.sendplayermessage.md +92 -0
- package/docs/server.hytopia.chatmanager.unregistercommand.md +53 -0
- package/docs/server.hytopia.chunk._constructor_.md +13 -0
- package/docs/server.hytopia.chunk.blockindextolocalcoordinate.md +55 -0
- package/docs/server.hytopia.chunk.blocks.md +13 -0
- package/docs/server.hytopia.chunk.despawn.md +17 -0
- package/docs/server.hytopia.chunk.globalcoordinatetolocalcoordinate.md +55 -0
- package/docs/server.hytopia.chunk.globalcoordinatetoorigincoordinate.md +55 -0
- package/docs/server.hytopia.chunk.issimulated.md +13 -0
- package/docs/server.hytopia.chunk.isspawned.md +13 -0
- package/docs/server.hytopia.chunk.isvalidorigincoordinate.md +55 -0
- package/docs/server.hytopia.chunk.md +324 -0
- package/docs/server.hytopia.chunk.origincoordinate.md +13 -0
- package/docs/server.hytopia.chunk.setblock.md +69 -0
- package/docs/server.hytopia.chunk.spawn.md +69 -0
- package/docs/server.hytopia.chunk.world.md +13 -0
- package/docs/server.hytopia.chunkeventpayload.despawn.chunk.md +11 -0
- package/docs/server.hytopia.chunkeventpayload.despawn.md +53 -0
- package/docs/server.hytopia.chunkeventpayload.md +55 -0
- package/docs/server.hytopia.chunkeventpayload.setblock.blocktypeid.md +11 -0
- package/docs/server.hytopia.chunkeventpayload.setblock.chunk.md +11 -0
- package/docs/server.hytopia.chunkeventpayload.setblock.globalcoordinate.md +11 -0
- package/docs/server.hytopia.chunkeventpayload.setblock.localcoordinate.md +11 -0
- package/docs/server.hytopia.chunkeventpayload.setblock.md +104 -0
- package/docs/server.hytopia.chunkeventpayload.spawn.chunk.md +11 -0
- package/docs/server.hytopia.chunkeventpayload.spawn.md +53 -0
- package/docs/server.hytopia.chunkeventtype.md +75 -0
- package/docs/server.hytopia.chunklattice._constructor_.md +49 -0
- package/docs/server.hytopia.chunklattice.getallchunks.md +19 -0
- package/docs/server.hytopia.chunklattice.getchunk.md +55 -0
- package/docs/server.hytopia.chunklattice.haschunk.md +55 -0
- package/docs/server.hytopia.chunklattice.md +127 -0
- package/docs/server.hytopia.chunklattice.setblock.md +69 -0
- package/docs/server.hytopia.collider._constructor_.md +49 -0
- package/docs/server.hytopia.collider.addtosimulation.md +69 -0
- package/docs/server.hytopia.collider.enablecollisionevents.md +53 -0
- package/docs/server.hytopia.collider.enablecontactforceevents.md +53 -0
- package/docs/server.hytopia.collider.getbounciness.md +19 -0
- package/docs/server.hytopia.collider.getcollisiongroups.md +19 -0
- package/docs/server.hytopia.collider.getfriction.md +19 -0
- package/docs/server.hytopia.collider.getrelativerotation.md +19 -0
- package/docs/server.hytopia.collider.getrelativetranslation.md +19 -0
- package/docs/server.hytopia.collider.isenabled.md +13 -0
- package/docs/server.hytopia.collider.isremoved.md +13 -0
- package/docs/server.hytopia.collider.issensor.md +13 -0
- package/docs/server.hytopia.collider.issimulated.md +13 -0
- package/docs/server.hytopia.collider.md +509 -0
- package/docs/server.hytopia.collider.parentrigidbody.md +13 -0
- package/docs/server.hytopia.collider.rawcollider.md +13 -0
- package/docs/server.hytopia.collider.removefromsimulation.md +17 -0
- package/docs/server.hytopia.collider.setbounciness.md +53 -0
- package/docs/server.hytopia.collider.setcollisiongroups.md +53 -0
- package/docs/server.hytopia.collider.setenabled.md +53 -0
- package/docs/server.hytopia.collider.setfriction.md +53 -0
- package/docs/server.hytopia.collider.setmass.md +53 -0
- package/docs/server.hytopia.collider.setoncollision.md +53 -0
- package/docs/server.hytopia.collider.setrelativerotation.md +53 -0
- package/docs/server.hytopia.collider.setrelativetranslation.md +53 -0
- package/docs/server.hytopia.collider.setsensor.md +53 -0
- package/docs/server.hytopia.collider.settag.md +53 -0
- package/docs/server.hytopia.collider.tag.md +13 -0
- package/docs/server.hytopia.collideroptions.borderradius.md +13 -0
- package/docs/server.hytopia.collideroptions.bounciness.md +13 -0
- package/docs/server.hytopia.collideroptions.collisiongroups.md +13 -0
- package/docs/server.hytopia.collideroptions.enabled.md +13 -0
- package/docs/server.hytopia.collideroptions.friction.md +13 -0
- package/docs/server.hytopia.collideroptions.halfextents.md +13 -0
- package/docs/server.hytopia.collideroptions.halfheight.md +13 -0
- package/docs/server.hytopia.collideroptions.issensor.md +13 -0
- package/docs/server.hytopia.collideroptions.mass.md +13 -0
- package/docs/server.hytopia.collideroptions.md +361 -0
- package/docs/server.hytopia.collideroptions.oncollision.md +13 -0
- package/docs/server.hytopia.collideroptions.parentrigidbody.md +13 -0
- package/docs/server.hytopia.collideroptions.radius.md +13 -0
- package/docs/server.hytopia.collideroptions.relativerotation.md +13 -0
- package/docs/server.hytopia.collideroptions.relativetranslation.md +13 -0
- package/docs/server.hytopia.collideroptions.shape.md +13 -0
- package/docs/server.hytopia.collideroptions.simulation.md +13 -0
- package/docs/server.hytopia.collideroptions.tag.md +13 -0
- package/docs/server.hytopia.collidershape.md +117 -0
- package/docs/server.hytopia.collisioncallback.md +15 -0
- package/docs/server.hytopia.collisiongroup.md +116 -0
- package/docs/server.hytopia.collisiongroups.md +18 -0
- package/docs/server.hytopia.collisiongroupsbuilder.buildrawcollisiongroups.md +55 -0
- package/docs/server.hytopia.collisiongroupsbuilder.decodecollisiongroups.md +55 -0
- package/docs/server.hytopia.collisiongroupsbuilder.decoderawcollisiongroups.md +55 -0
- package/docs/server.hytopia.collisiongroupsbuilder.isdefaultcollisiongroups.md +55 -0
- package/docs/server.hytopia.collisiongroupsbuilder.md +101 -0
- package/docs/server.hytopia.commandcallback.md +15 -0
- package/docs/server.hytopia.decodedcollisiongroups.md +16 -0
- package/docs/server.hytopia.default_entity_rigid_body_options.md +13 -0
- package/docs/server.hytopia.defaultcharactercontroller._constructor_.md +65 -0
- package/docs/server.hytopia.defaultcharactercontroller.canjump.md +13 -0
- package/docs/server.hytopia.defaultcharactercontroller.canrun.md +13 -0
- package/docs/server.hytopia.defaultcharactercontroller.canwalk.md +13 -0
- package/docs/server.hytopia.defaultcharactercontroller.createsensorcolliders.md +19 -0
- package/docs/server.hytopia.defaultcharactercontroller.isgrounded.md +13 -0
- package/docs/server.hytopia.defaultcharactercontroller.isonplatform.md +13 -0
- package/docs/server.hytopia.defaultcharactercontroller.jumpvelocity.md +13 -0
- package/docs/server.hytopia.defaultcharactercontroller.md +333 -0
- package/docs/server.hytopia.defaultcharactercontroller.platform.md +13 -0
- package/docs/server.hytopia.defaultcharactercontroller.runvelocity.md +13 -0
- package/docs/server.hytopia.defaultcharactercontroller.tickpathfindingmovement.md +69 -0
- package/docs/server.hytopia.defaultcharactercontroller.tickplayermovement.md +85 -0
- package/docs/server.hytopia.defaultcharactercontroller.walkvelocity.md +13 -0
- package/docs/server.hytopia.defaultcharactercontrolleroptions.canjump.md +13 -0
- package/docs/server.hytopia.defaultcharactercontrolleroptions.canrun.md +13 -0
- package/docs/server.hytopia.defaultcharactercontrolleroptions.canwalk.md +13 -0
- package/docs/server.hytopia.defaultcharactercontrolleroptions.jumpvelocity.md +13 -0
- package/docs/server.hytopia.defaultcharactercontrolleroptions.md +152 -0
- package/docs/server.hytopia.defaultcharactercontrolleroptions.runvelocity.md +13 -0
- package/docs/server.hytopia.defaultcharactercontrolleroptions.walkvelocity.md +13 -0
- package/docs/server.hytopia.entity._constructor_.md +49 -0
- package/docs/server.hytopia.entity.charactercontroller.md +13 -0
- package/docs/server.hytopia.entity.createcustomcharactercontroller.md +13 -0
- package/docs/server.hytopia.entity.despawn.md +17 -0
- package/docs/server.hytopia.entity.id.md +13 -0
- package/docs/server.hytopia.entity.isspawned.md +13 -0
- package/docs/server.hytopia.entity.md +529 -0
- package/docs/server.hytopia.entity.modelloopedanimations.md +13 -0
- package/docs/server.hytopia.entity.modelscale.md +13 -0
- package/docs/server.hytopia.entity.modeluri.md +13 -0
- package/docs/server.hytopia.entity.name.md +13 -0
- package/docs/server.hytopia.entity.onblockcollision.md +13 -0
- package/docs/server.hytopia.entity.onblockcontactforce.md +13 -0
- package/docs/server.hytopia.entity.ondespawn.md +13 -0
- package/docs/server.hytopia.entity.onentitycollision.md +13 -0
- package/docs/server.hytopia.entity.onentitycontactforce.md +13 -0
- package/docs/server.hytopia.entity.onspawn.md +13 -0
- package/docs/server.hytopia.entity.ontick.md +13 -0
- package/docs/server.hytopia.entity.setcharactercontroller.md +53 -0
- package/docs/server.hytopia.entity.spawn.md +69 -0
- package/docs/server.hytopia.entity.startmodelloopedanimations.md +53 -0
- package/docs/server.hytopia.entity.startmodeloneshotanimations.md +53 -0
- package/docs/server.hytopia.entity.stopmodelanimations.md +53 -0
- package/docs/server.hytopia.entity.world.md +13 -0
- package/docs/server.hytopia.entityeventpayload.despawn.entity.md +11 -0
- package/docs/server.hytopia.entityeventpayload.despawn.md +53 -0
- package/docs/server.hytopia.entityeventpayload.md +91 -0
- package/docs/server.hytopia.entityeventpayload.spawn.entity.md +11 -0
- package/docs/server.hytopia.entityeventpayload.spawn.md +53 -0
- package/docs/server.hytopia.entityeventpayload.startmodelloopedanimations.animations.md +11 -0
- package/docs/server.hytopia.entityeventpayload.startmodelloopedanimations.entity.md +11 -0
- package/docs/server.hytopia.entityeventpayload.startmodelloopedanimations.md +70 -0
- package/docs/server.hytopia.entityeventpayload.startmodeloneshotanimations.animations.md +11 -0
- package/docs/server.hytopia.entityeventpayload.startmodeloneshotanimations.entity.md +11 -0
- package/docs/server.hytopia.entityeventpayload.startmodeloneshotanimations.md +70 -0
- package/docs/server.hytopia.entityeventpayload.stopmodelanimations.animations.md +11 -0
- package/docs/server.hytopia.entityeventpayload.stopmodelanimations.entity.md +11 -0
- package/docs/server.hytopia.entityeventpayload.stopmodelanimations.md +70 -0
- package/docs/server.hytopia.entityeventpayload.updaterotation.entity.md +11 -0
- package/docs/server.hytopia.entityeventpayload.updaterotation.md +70 -0
- package/docs/server.hytopia.entityeventpayload.updaterotation.rotation.md +11 -0
- package/docs/server.hytopia.entityeventpayload.updatetranslation.entity.md +11 -0
- package/docs/server.hytopia.entityeventpayload.updatetranslation.md +70 -0
- package/docs/server.hytopia.entityeventpayload.updatetranslation.translation.md +11 -0
- package/docs/server.hytopia.entityeventtype.md +131 -0
- package/docs/server.hytopia.entitymanager.getallentities.md +19 -0
- package/docs/server.hytopia.entitymanager.getallplayerentities.md +55 -0
- package/docs/server.hytopia.entitymanager.getentity.md +55 -0
- package/docs/server.hytopia.entitymanager.md +136 -0
- package/docs/server.hytopia.entitymanager.world.md +13 -0
- package/docs/server.hytopia.entityoptions.md +133 -0
- package/docs/server.hytopia.entityoptions.modelloopedanimations.md +13 -0
- package/docs/server.hytopia.entityoptions.modelscale.md +13 -0
- package/docs/server.hytopia.entityoptions.modeluri.md +13 -0
- package/docs/server.hytopia.entityoptions.name.md +13 -0
- package/docs/server.hytopia.entityoptions.rigidbodyoptions.md +13 -0
- package/docs/server.hytopia.event.md +76 -0
- package/docs/server.hytopia.event.payload.md +13 -0
- package/docs/server.hytopia.event.type.md +13 -0
- package/docs/server.hytopia.eventrouter._constructor_.md +49 -0
- package/docs/server.hytopia.eventrouter.emit.md +55 -0
- package/docs/server.hytopia.eventrouter.logallevents.md +13 -0
- package/docs/server.hytopia.eventrouter.logeventspayloads.md +13 -0
- package/docs/server.hytopia.eventrouter.logignoreeventprefixes.md +13 -0
- package/docs/server.hytopia.eventrouter.logignoreevents.md +13 -0
- package/docs/server.hytopia.eventrouter.logunlistenedevents.md +13 -0
- package/docs/server.hytopia.eventrouter.md +270 -0
- package/docs/server.hytopia.eventrouter.off.md +69 -0
- package/docs/server.hytopia.eventrouter.offall.md +53 -0
- package/docs/server.hytopia.eventrouter.on.md +73 -0
- package/docs/server.hytopia.eventrouter.serverinstance.md +13 -0
- package/docs/server.hytopia.gameserver.instance.md +13 -0
- package/docs/server.hytopia.gameserver.md +109 -0
- package/docs/server.hytopia.gameserver.playermanager.md +13 -0
- package/docs/server.hytopia.gameserver.worlds.md +15 -0
- package/docs/server.hytopia.gameservereventpayload.md +46 -0
- package/docs/server.hytopia.gameservereventpayload.start.md +53 -0
- package/docs/server.hytopia.gameservereventpayload.start.startedatms.md +11 -0
- package/docs/server.hytopia.gameservereventpayload.stop.md +53 -0
- package/docs/server.hytopia.gameservereventpayload.stop.stoppedatms.md +11 -0
- package/docs/server.hytopia.gameservereventtype.md +61 -0
- package/docs/server.hytopia.md +840 -0
- package/docs/server.hytopia.player.disconnect.md +17 -0
- package/docs/server.hytopia.player.id.md +13 -0
- package/docs/server.hytopia.player.inputstate.md +13 -0
- package/docs/server.hytopia.player.joinworld.md +57 -0
- package/docs/server.hytopia.player.leaveworld.md +17 -0
- package/docs/server.hytopia.player.md +211 -0
- package/docs/server.hytopia.player.orientationstate.md +13 -0
- package/docs/server.hytopia.player.username.md +13 -0
- package/docs/server.hytopia.player.world.md +13 -0
- package/docs/server.hytopia.playerentity._constructor_.md +49 -0
- package/docs/server.hytopia.playerentity.md +115 -0
- package/docs/server.hytopia.playerentity.player.md +13 -0
- package/docs/server.hytopia.playerentityoptions.md +58 -0
- package/docs/server.hytopia.playerentityoptions.player.md +13 -0
- package/docs/server.hytopia.playereventpayload.chatmessagesend.md +70 -0
- package/docs/server.hytopia.playereventpayload.chatmessagesend.message.md +11 -0
- package/docs/server.hytopia.playereventpayload.chatmessagesend.player.md +11 -0
- package/docs/server.hytopia.playereventpayload.joinedworld.md +70 -0
- package/docs/server.hytopia.playereventpayload.joinedworld.player.md +11 -0
- package/docs/server.hytopia.playereventpayload.joinedworld.world.md +11 -0
- package/docs/server.hytopia.playereventpayload.leftworld.md +70 -0
- package/docs/server.hytopia.playereventpayload.leftworld.player.md +11 -0
- package/docs/server.hytopia.playereventpayload.leftworld.world.md +11 -0
- package/docs/server.hytopia.playereventpayload.md +64 -0
- package/docs/server.hytopia.playereventpayload.requestsync.md +87 -0
- package/docs/server.hytopia.playereventpayload.requestsync.player.md +11 -0
- package/docs/server.hytopia.playereventpayload.requestsync.receivedat.md +11 -0
- package/docs/server.hytopia.playereventpayload.requestsync.receivedatms.md +11 -0
- package/docs/server.hytopia.playereventtype.md +89 -0
- package/docs/server.hytopia.playerinputstate.md +13 -0
- package/docs/server.hytopia.playermanager.getconnectedplayerbyusername.md +55 -0
- package/docs/server.hytopia.playermanager.getconnectedplayers.md +19 -0
- package/docs/server.hytopia.playermanager.instance.md +13 -0
- package/docs/server.hytopia.playermanager.md +125 -0
- package/docs/server.hytopia.playerorientationstate.md +16 -0
- package/docs/server.hytopia.rawcollisiongroups.md +13 -0
- package/docs/server.hytopia.rigidbody._constructor_.md +49 -0
- package/docs/server.hytopia.rigidbody.addchildcollidertosimulation.md +53 -0
- package/docs/server.hytopia.rigidbody.addforce.md +53 -0
- package/docs/server.hytopia.rigidbody.addtorque.md +53 -0
- package/docs/server.hytopia.rigidbody.addtosimulation.md +53 -0
- package/docs/server.hytopia.rigidbody.applyimpulse.md +53 -0
- package/docs/server.hytopia.rigidbody.applyimpulseatpoint.md +69 -0
- package/docs/server.hytopia.rigidbody.applytorqueimpulse.md +53 -0
- package/docs/server.hytopia.rigidbody.colliders.md +13 -0
- package/docs/server.hytopia.rigidbody.createandaddchildcolliderstosimulation.md +55 -0
- package/docs/server.hytopia.rigidbody.createandaddchildcollidertosimulation.md +55 -0
- package/docs/server.hytopia.rigidbody.getadditionalmass.md +19 -0
- package/docs/server.hytopia.rigidbody.getadditionalsolveriterations.md +19 -0
- package/docs/server.hytopia.rigidbody.getangulardamping.md +19 -0
- package/docs/server.hytopia.rigidbody.getangularvelocity.md +19 -0
- package/docs/server.hytopia.rigidbody.getcollidersbytag.md +55 -0
- package/docs/server.hytopia.rigidbody.getdirectionfromrotation.md +19 -0
- package/docs/server.hytopia.rigidbody.getdominancegroup.md +19 -0
- package/docs/server.hytopia.rigidbody.geteffectiveangularinertia.md +19 -0
- package/docs/server.hytopia.rigidbody.geteffectiveinversemass.md +19 -0
- package/docs/server.hytopia.rigidbody.geteffectiveworldinverseprincipalangularinertiasqrt.md +19 -0
- package/docs/server.hytopia.rigidbody.getenabledrotations.md +19 -0
- package/docs/server.hytopia.rigidbody.getenabledtranslations.md +19 -0
- package/docs/server.hytopia.rigidbody.getgravityscale.md +19 -0
- package/docs/server.hytopia.rigidbody.getinversemass.md +19 -0
- package/docs/server.hytopia.rigidbody.getinverseprincipalangularinertiasqrt.md +19 -0
- package/docs/server.hytopia.rigidbody.getlineardamping.md +19 -0
- package/docs/server.hytopia.rigidbody.getlinearvelocity.md +19 -0
- package/docs/server.hytopia.rigidbody.getlocalcenterofmass.md +19 -0
- package/docs/server.hytopia.rigidbody.getmass.md +19 -0
- package/docs/server.hytopia.rigidbody.getnextkinematicrotation.md +19 -0
- package/docs/server.hytopia.rigidbody.getnextkinematictranslation.md +19 -0
- package/docs/server.hytopia.rigidbody.getprincipalangularinertia.md +19 -0
- package/docs/server.hytopia.rigidbody.getprincipalangularinertialocalframe.md +19 -0
- package/docs/server.hytopia.rigidbody.getrotation.md +19 -0
- package/docs/server.hytopia.rigidbody.getsoftccdprediction.md +19 -0
- package/docs/server.hytopia.rigidbody.gettranslation.md +19 -0
- package/docs/server.hytopia.rigidbody.gettype.md +19 -0
- package/docs/server.hytopia.rigidbody.getworldcenterofmass.md +19 -0
- package/docs/server.hytopia.rigidbody.isccdenabled.md +13 -0
- package/docs/server.hytopia.rigidbody.isdynamic.md +13 -0
- package/docs/server.hytopia.rigidbody.isenabled.md +13 -0
- package/docs/server.hytopia.rigidbody.isfixed.md +13 -0
- package/docs/server.hytopia.rigidbody.iskinematic.md +13 -0
- package/docs/server.hytopia.rigidbody.iskinematicpositionbased.md +13 -0
- package/docs/server.hytopia.rigidbody.iskinematicvelocitybased.md +13 -0
- package/docs/server.hytopia.rigidbody.ismoving.md +13 -0
- package/docs/server.hytopia.rigidbody.isremoved.md +13 -0
- package/docs/server.hytopia.rigidbody.issimulated.md +13 -0
- package/docs/server.hytopia.rigidbody.issleeping.md +13 -0
- package/docs/server.hytopia.rigidbody.lockallrotations.md +17 -0
- package/docs/server.hytopia.rigidbody.lockalltranslations.md +17 -0
- package/docs/server.hytopia.rigidbody.md +1307 -0
- package/docs/server.hytopia.rigidbody.numcolliders.md +13 -0
- package/docs/server.hytopia.rigidbody.rawrigidbody.md +13 -0
- package/docs/server.hytopia.rigidbody.removefromsimulation.md +17 -0
- package/docs/server.hytopia.rigidbody.setadditionalmass.md +53 -0
- package/docs/server.hytopia.rigidbody.setadditionalmassproperties.md +53 -0
- package/docs/server.hytopia.rigidbody.setadditionalsolveriterations.md +53 -0
- package/docs/server.hytopia.rigidbody.setangulardamping.md +53 -0
- package/docs/server.hytopia.rigidbody.setangularvelocity.md +53 -0
- package/docs/server.hytopia.rigidbody.setccdenabled.md +53 -0
- package/docs/server.hytopia.rigidbody.setcollisiongroupsforsolidcolliders.md +53 -0
- package/docs/server.hytopia.rigidbody.setdominancegroup.md +53 -0
- package/docs/server.hytopia.rigidbody.setenabled.md +53 -0
- package/docs/server.hytopia.rigidbody.setenabledrotations.md +53 -0
- package/docs/server.hytopia.rigidbody.setenabledtranslations.md +53 -0
- package/docs/server.hytopia.rigidbody.setgravityscale.md +53 -0
- package/docs/server.hytopia.rigidbody.setlineardamping.md +53 -0
- package/docs/server.hytopia.rigidbody.setlinearvelocity.md +53 -0
- package/docs/server.hytopia.rigidbody.setnextkinematicrotation.md +53 -0
- package/docs/server.hytopia.rigidbody.setnextkinematictranslation.md +53 -0
- package/docs/server.hytopia.rigidbody.setrotation.md +53 -0
- package/docs/server.hytopia.rigidbody.setsleeping.md +53 -0
- package/docs/server.hytopia.rigidbody.setsoftccdprediction.md +53 -0
- package/docs/server.hytopia.rigidbody.settag.md +53 -0
- package/docs/server.hytopia.rigidbody.settranslation.md +53 -0
- package/docs/server.hytopia.rigidbody.settype.md +53 -0
- package/docs/server.hytopia.rigidbody.sleep.md +17 -0
- package/docs/server.hytopia.rigidbody.tag.md +13 -0
- package/docs/server.hytopia.rigidbody.wakeup.md +17 -0
- package/docs/server.hytopia.rigidbodyadditionalmassproperties.md +20 -0
- package/docs/server.hytopia.rigidbodyoptions.additionalmass.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.additionalmassproperties.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.additionalsolveriterations.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.angulardamping.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.angularvelocity.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.ccdenabled.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.colliders.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.dominancegroup.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.enabled.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.enabledrotations.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.enabledtranslations.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.gravityscale.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.lineardamping.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.linearvelocity.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.md +437 -0
- package/docs/server.hytopia.rigidbodyoptions.rotation.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.simulation.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.sleeping.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.softccdprediction.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.tag.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.translation.md +13 -0
- package/docs/server.hytopia.rigidbodyoptions.type.md +13 -0
- package/docs/server.hytopia.rigidbodytype.md +89 -0
- package/docs/server.hytopia.rotation.md +106 -0
- package/docs/server.hytopia.rotation.w.md +11 -0
- package/docs/server.hytopia.rotation.x.md +11 -0
- package/docs/server.hytopia.rotation.y.md +11 -0
- package/docs/server.hytopia.rotation.z.md +11 -0
- package/docs/server.hytopia.simulation.castray.md +103 -0
- package/docs/server.hytopia.simulation.gravity.md +13 -0
- package/docs/server.hytopia.simulation.md +141 -0
- package/docs/server.hytopia.simulation.timesteps.md +13 -0
- package/docs/server.hytopia.simulation.world.md +13 -0
- package/docs/server.hytopia.spdmatrix3.md +15 -0
- package/docs/server.hytopia.startserver.md +57 -0
- package/docs/server.hytopia.supported_input_keys.md +13 -0
- package/docs/server.hytopia.vector3.md +89 -0
- package/docs/server.hytopia.vector3.x.md +11 -0
- package/docs/server.hytopia.vector3.y.md +11 -0
- package/docs/server.hytopia.vector3.z.md +11 -0
- package/docs/server.hytopia.vector3boolean.md +89 -0
- package/docs/server.hytopia.vector3boolean.x.md +11 -0
- package/docs/server.hytopia.vector3boolean.y.md +11 -0
- package/docs/server.hytopia.vector3boolean.z.md +11 -0
- package/docs/server.hytopia.world._constructor_.md +49 -0
- package/docs/server.hytopia.world.audiomanager.md +13 -0
- package/docs/server.hytopia.world.blocktyperegistry.md +13 -0
- package/docs/server.hytopia.world.chatmanager.md +13 -0
- package/docs/server.hytopia.world.chunklattice.md +13 -0
- package/docs/server.hytopia.world.entitymanager.md +13 -0
- package/docs/server.hytopia.world.eventrouter.md +13 -0
- package/docs/server.hytopia.world.id.md +13 -0
- package/docs/server.hytopia.world.loadmap.md +53 -0
- package/docs/server.hytopia.world.loop.md +13 -0
- package/docs/server.hytopia.world.md +419 -0
- package/docs/server.hytopia.world.name.md +13 -0
- package/docs/server.hytopia.world.onplayerjoin.md +13 -0
- package/docs/server.hytopia.world.onplayerleave.md +13 -0
- package/docs/server.hytopia.world.simulation.md +13 -0
- package/docs/server.hytopia.world.skyboxuri.md +13 -0
- package/docs/server.hytopia.world.start.md +17 -0
- package/docs/server.hytopia.world.stop.md +17 -0
- package/docs/server.hytopia.worldloop.currenttick.md +13 -0
- package/docs/server.hytopia.worldloop.md +140 -0
- package/docs/server.hytopia.worldloop.nexttickms.md +13 -0
- package/docs/server.hytopia.worldloop.timesteps.md +13 -0
- package/docs/server.hytopia.worldloop.world.md +13 -0
- package/docs/server.hytopia.worldmap.blocks.md +15 -0
- package/docs/server.hytopia.worldmap.blocktypes.md +17 -0
- package/docs/server.hytopia.worldmap.md +76 -0
- package/docs/server.hytopia.worldoptions.gravity.md +13 -0
- package/docs/server.hytopia.worldoptions.id.md +13 -0
- package/docs/server.hytopia.worldoptions.md +133 -0
- package/docs/server.hytopia.worldoptions.name.md +13 -0
- package/docs/server.hytopia.worldoptions.skyboxuri.md +13 -0
- package/docs/server.hytopia.worldoptions.tickrate.md +13 -0
- package/docs/server.md +849 -0
- package/docs/server.player.disconnect.md +17 -0
- package/docs/server.player.id.md +13 -0
- package/docs/server.player.inputstate.md +13 -0
- package/docs/server.player.joinworld.md +57 -0
- package/docs/server.player.leaveworld.md +17 -0
- package/docs/server.player.md +211 -0
- package/docs/server.player.orientationstate.md +13 -0
- package/docs/server.player.username.md +13 -0
- package/docs/server.player.world.md +13 -0
- package/docs/server.playerentity._constructor_.md +49 -0
- package/docs/server.playerentity.md +115 -0
- package/docs/server.playerentity.player.md +13 -0
- package/docs/server.playerentityoptions.md +58 -0
- package/docs/server.playerentityoptions.player.md +13 -0
- package/docs/server.playereventpayload.chatmessagesend.md +70 -0
- package/docs/server.playereventpayload.chatmessagesend.message.md +11 -0
- package/docs/server.playereventpayload.chatmessagesend.player.md +11 -0
- package/docs/server.playereventpayload.joinedworld.md +70 -0
- package/docs/server.playereventpayload.joinedworld.player.md +11 -0
- package/docs/server.playereventpayload.joinedworld.world.md +11 -0
- package/docs/server.playereventpayload.leftworld.md +70 -0
- package/docs/server.playereventpayload.leftworld.player.md +11 -0
- package/docs/server.playereventpayload.leftworld.world.md +11 -0
- package/docs/server.playereventpayload.md +64 -0
- package/docs/server.playereventpayload.requestsync.md +87 -0
- package/docs/server.playereventpayload.requestsync.player.md +11 -0
- package/docs/server.playereventpayload.requestsync.receivedat.md +11 -0
- package/docs/server.playereventpayload.requestsync.receivedatms.md +11 -0
- package/docs/server.playereventtype.md +89 -0
- package/docs/server.playerinputstate.md +13 -0
- package/docs/server.playermanager.getconnectedplayerbyusername.md +55 -0
- package/docs/server.playermanager.getconnectedplayers.md +19 -0
- package/docs/server.playermanager.instance.md +13 -0
- package/docs/server.playermanager.md +125 -0
- package/docs/server.playerorientationstate.md +16 -0
- package/docs/server.rawcollisiongroups.md +13 -0
- package/docs/server.rigidbody._constructor_.md +49 -0
- package/docs/server.rigidbody.addchildcollidertosimulation.md +53 -0
- package/docs/server.rigidbody.addforce.md +53 -0
- package/docs/server.rigidbody.addtorque.md +53 -0
- package/docs/server.rigidbody.addtosimulation.md +53 -0
- package/docs/server.rigidbody.applyimpulse.md +53 -0
- package/docs/server.rigidbody.applyimpulseatpoint.md +69 -0
- package/docs/server.rigidbody.applytorqueimpulse.md +53 -0
- package/docs/server.rigidbody.colliders.md +13 -0
- package/docs/server.rigidbody.createandaddchildcolliderstosimulation.md +55 -0
- package/docs/server.rigidbody.createandaddchildcollidertosimulation.md +55 -0
- package/docs/server.rigidbody.getadditionalmass.md +19 -0
- package/docs/server.rigidbody.getadditionalsolveriterations.md +19 -0
- package/docs/server.rigidbody.getangulardamping.md +19 -0
- package/docs/server.rigidbody.getangularvelocity.md +19 -0
- package/docs/server.rigidbody.getcollidersbytag.md +55 -0
- package/docs/server.rigidbody.getdirectionfromrotation.md +19 -0
- package/docs/server.rigidbody.getdominancegroup.md +19 -0
- package/docs/server.rigidbody.geteffectiveangularinertia.md +19 -0
- package/docs/server.rigidbody.geteffectiveinversemass.md +19 -0
- package/docs/server.rigidbody.geteffectiveworldinverseprincipalangularinertiasqrt.md +19 -0
- package/docs/server.rigidbody.getenabledrotations.md +19 -0
- package/docs/server.rigidbody.getenabledtranslations.md +19 -0
- package/docs/server.rigidbody.getgravityscale.md +19 -0
- package/docs/server.rigidbody.getinversemass.md +19 -0
- package/docs/server.rigidbody.getinverseprincipalangularinertiasqrt.md +19 -0
- package/docs/server.rigidbody.getlineardamping.md +19 -0
- package/docs/server.rigidbody.getlinearvelocity.md +19 -0
- package/docs/server.rigidbody.getlocalcenterofmass.md +19 -0
- package/docs/server.rigidbody.getmass.md +19 -0
- package/docs/server.rigidbody.getnextkinematicrotation.md +19 -0
- package/docs/server.rigidbody.getnextkinematictranslation.md +19 -0
- package/docs/server.rigidbody.getprincipalangularinertia.md +19 -0
- package/docs/server.rigidbody.getprincipalangularinertialocalframe.md +19 -0
- package/docs/server.rigidbody.getrotation.md +19 -0
- package/docs/server.rigidbody.getsoftccdprediction.md +19 -0
- package/docs/server.rigidbody.gettranslation.md +19 -0
- package/docs/server.rigidbody.gettype.md +19 -0
- package/docs/server.rigidbody.getworldcenterofmass.md +19 -0
- package/docs/server.rigidbody.isccdenabled.md +13 -0
- package/docs/server.rigidbody.isdynamic.md +13 -0
- package/docs/server.rigidbody.isenabled.md +13 -0
- package/docs/server.rigidbody.isfixed.md +13 -0
- package/docs/server.rigidbody.iskinematic.md +13 -0
- package/docs/server.rigidbody.iskinematicpositionbased.md +13 -0
- package/docs/server.rigidbody.iskinematicvelocitybased.md +13 -0
- package/docs/server.rigidbody.ismoving.md +13 -0
- package/docs/server.rigidbody.isremoved.md +13 -0
- package/docs/server.rigidbody.issimulated.md +13 -0
- package/docs/server.rigidbody.issleeping.md +13 -0
- package/docs/server.rigidbody.lockallrotations.md +17 -0
- package/docs/server.rigidbody.lockalltranslations.md +17 -0
- package/docs/server.rigidbody.md +1307 -0
- package/docs/server.rigidbody.numcolliders.md +13 -0
- package/docs/server.rigidbody.rawrigidbody.md +13 -0
- package/docs/server.rigidbody.removefromsimulation.md +17 -0
- package/docs/server.rigidbody.setadditionalmass.md +53 -0
- package/docs/server.rigidbody.setadditionalmassproperties.md +53 -0
- package/docs/server.rigidbody.setadditionalsolveriterations.md +53 -0
- package/docs/server.rigidbody.setangulardamping.md +53 -0
- package/docs/server.rigidbody.setangularvelocity.md +53 -0
- package/docs/server.rigidbody.setccdenabled.md +53 -0
- package/docs/server.rigidbody.setcollisiongroupsforsolidcolliders.md +53 -0
- package/docs/server.rigidbody.setdominancegroup.md +53 -0
- package/docs/server.rigidbody.setenabled.md +53 -0
- package/docs/server.rigidbody.setenabledrotations.md +53 -0
- package/docs/server.rigidbody.setenabledtranslations.md +53 -0
- package/docs/server.rigidbody.setgravityscale.md +53 -0
- package/docs/server.rigidbody.setlineardamping.md +53 -0
- package/docs/server.rigidbody.setlinearvelocity.md +53 -0
- package/docs/server.rigidbody.setnextkinematicrotation.md +53 -0
- package/docs/server.rigidbody.setnextkinematictranslation.md +53 -0
- package/docs/server.rigidbody.setrotation.md +53 -0
- package/docs/server.rigidbody.setsleeping.md +53 -0
- package/docs/server.rigidbody.setsoftccdprediction.md +53 -0
- package/docs/server.rigidbody.settag.md +53 -0
- package/docs/server.rigidbody.settranslation.md +53 -0
- package/docs/server.rigidbody.settype.md +53 -0
- package/docs/server.rigidbody.sleep.md +17 -0
- package/docs/server.rigidbody.tag.md +13 -0
- package/docs/server.rigidbody.wakeup.md +17 -0
- package/docs/server.rigidbodyadditionalmassproperties.md +20 -0
- package/docs/server.rigidbodyoptions.additionalmass.md +13 -0
- package/docs/server.rigidbodyoptions.additionalmassproperties.md +13 -0
- package/docs/server.rigidbodyoptions.additionalsolveriterations.md +13 -0
- package/docs/server.rigidbodyoptions.angulardamping.md +13 -0
- package/docs/server.rigidbodyoptions.angularvelocity.md +13 -0
- package/docs/server.rigidbodyoptions.ccdenabled.md +13 -0
- package/docs/server.rigidbodyoptions.colliders.md +13 -0
- package/docs/server.rigidbodyoptions.dominancegroup.md +13 -0
- package/docs/server.rigidbodyoptions.enabled.md +13 -0
- package/docs/server.rigidbodyoptions.enabledrotations.md +13 -0
- package/docs/server.rigidbodyoptions.enabledtranslations.md +13 -0
- package/docs/server.rigidbodyoptions.gravityscale.md +13 -0
- package/docs/server.rigidbodyoptions.lineardamping.md +13 -0
- package/docs/server.rigidbodyoptions.linearvelocity.md +13 -0
- package/docs/server.rigidbodyoptions.md +437 -0
- package/docs/server.rigidbodyoptions.rotation.md +13 -0
- package/docs/server.rigidbodyoptions.simulation.md +13 -0
- package/docs/server.rigidbodyoptions.sleeping.md +13 -0
- package/docs/server.rigidbodyoptions.softccdprediction.md +13 -0
- package/docs/server.rigidbodyoptions.tag.md +13 -0
- package/docs/server.rigidbodyoptions.translation.md +13 -0
- package/docs/server.rigidbodyoptions.type.md +13 -0
- package/docs/server.rigidbodytype.md +89 -0
- package/docs/server.rotation.md +106 -0
- package/docs/server.rotation.w.md +11 -0
- package/docs/server.rotation.x.md +11 -0
- package/docs/server.rotation.y.md +11 -0
- package/docs/server.rotation.z.md +11 -0
- package/docs/server.simulation.castray.md +103 -0
- package/docs/server.simulation.gravity.md +13 -0
- package/docs/server.simulation.md +141 -0
- package/docs/server.simulation.timesteps.md +13 -0
- package/docs/server.simulation.world.md +13 -0
- package/docs/server.spdmatrix3.md +15 -0
- package/docs/server.startserver.md +57 -0
- package/docs/server.supported_input_keys.md +13 -0
- package/docs/server.vector3.md +89 -0
- package/docs/server.vector3.x.md +11 -0
- package/docs/server.vector3.y.md +11 -0
- package/docs/server.vector3.z.md +11 -0
- package/docs/server.vector3boolean.md +89 -0
- package/docs/server.vector3boolean.x.md +11 -0
- package/docs/server.vector3boolean.y.md +11 -0
- package/docs/server.vector3boolean.z.md +11 -0
- package/docs/server.world._constructor_.md +49 -0
- package/docs/server.world.audiomanager.md +13 -0
- package/docs/server.world.blocktyperegistry.md +13 -0
- package/docs/server.world.chatmanager.md +13 -0
- package/docs/server.world.chunklattice.md +13 -0
- package/docs/server.world.entitymanager.md +13 -0
- package/docs/server.world.eventrouter.md +13 -0
- package/docs/server.world.id.md +13 -0
- package/docs/server.world.loadmap.md +53 -0
- package/docs/server.world.loop.md +13 -0
- package/docs/server.world.md +419 -0
- package/docs/server.world.name.md +13 -0
- package/docs/server.world.onplayerjoin.md +13 -0
- package/docs/server.world.onplayerleave.md +13 -0
- package/docs/server.world.simulation.md +13 -0
- package/docs/server.world.skyboxuri.md +13 -0
- package/docs/server.world.start.md +17 -0
- package/docs/server.world.stop.md +17 -0
- package/docs/server.worldloop.currenttick.md +13 -0
- package/docs/server.worldloop.md +140 -0
- package/docs/server.worldloop.nexttickms.md +13 -0
- package/docs/server.worldloop.timesteps.md +13 -0
- package/docs/server.worldloop.world.md +13 -0
- package/docs/server.worldmap.blocks.md +15 -0
- package/docs/server.worldmap.blocktypes.md +17 -0
- package/docs/server.worldmap.md +76 -0
- package/docs/server.worldoptions.gravity.md +13 -0
- package/docs/server.worldoptions.id.md +13 -0
- package/docs/server.worldoptions.md +133 -0
- package/docs/server.worldoptions.name.md +13 -0
- package/docs/server.worldoptions.skyboxuri.md +13 -0
- package/docs/server.worldoptions.tickrate.md +13 -0
- package/examples/payload-game/assets/audio/music/game.mp3 +0 -0
- package/examples/payload-game/assets/audio/sfx/damage.wav +0 -0
- package/examples/payload-game/assets/audio/sfx/payload-idle.mp3 +0 -0
- package/examples/payload-game/assets/audio/sfx/shoot.mp3 +0 -0
- package/examples/payload-game/assets/cubemaps/skybox/+x.png +0 -0
- package/examples/payload-game/assets/cubemaps/skybox/+y.png +0 -0
- package/examples/payload-game/assets/cubemaps/skybox/+z.png +0 -0
- package/examples/payload-game/assets/cubemaps/skybox/-x.png +0 -0
- package/examples/payload-game/assets/cubemaps/skybox/-y.png +0 -0
- package/examples/payload-game/assets/cubemaps/skybox/-z.png +0 -0
- package/examples/{payload/assets/world.json → payload-game/assets/map.json} +1 -1
- package/examples/payload-game/assets/models/bullet.gltf +1 -0
- package/examples/payload-game/assets/models/payload.gltf +1 -0
- package/examples/payload-game/assets/models/player-with-gun.gltf +1 -0
- package/examples/payload-game/assets/models/spider.gltf +1 -0
- package/examples/payload-game/assets/textures/dragons_stone.png +0 -0
- package/examples/payload-game/assets/textures/infected_shadowrock.png +0 -0
- package/examples/payload-game/assets/textures/shadowrock.png +0 -0
- package/examples/payload-game/assets/textures/stone.png +0 -0
- package/examples/payload-game/assets/textures/stone_bricks.png +0 -0
- package/examples/payload-game/assets/textures/void_sand.png +0 -0
- package/examples/payload-game/index.ts +579 -0
- package/package.json +1 -1
- package/server.api.json +36139 -0
- package/server.d.ts +1765 -360
- package/server.js +60 -60
- package/tsconfig.json +21 -0
- package/docs/assets/banner.png +0 -0
- package/examples/payload/index.ts +0 -0
- package/examples/zombies/index.ts +0 -0
- /package/{assets → boilerplate/assets}/audio/music/cave.mp3 +0 -0
- /package/{assets → boilerplate/assets}/audio/music/desert.mp3 +0 -0
- /package/{assets → boilerplate/assets}/audio/music/end.mp3 +0 -0
- /package/{assets → boilerplate/assets}/audio/music/jungle.mp3 +0 -0
- /package/{assets → boilerplate/assets}/audio/music/nether.mp3 +0 -0
- /package/{assets → boilerplate/assets}/audio/music/night.mp3 +0 -0
- /package/{assets → boilerplate/assets}/audio/music/night2.mp3 +0 -0
- /package/{assets → boilerplate/assets}/audio/music/overworld.mp3 +0 -0
- /package/{assets → boilerplate/assets}/audio/music/snow.mp3 +0 -0
- /package/{assets → boilerplate/assets}/audio/sfx/damage.wav +0 -0
- /package/{assets → boilerplate/assets}/cubemaps/skybox/+x.png +0 -0
- /package/{assets → boilerplate/assets}/cubemaps/skybox/+y.png +0 -0
- /package/{assets → boilerplate/assets}/cubemaps/skybox/+z.png +0 -0
- /package/{assets → boilerplate/assets}/cubemaps/skybox/-x.png +0 -0
- /package/{assets → boilerplate/assets}/cubemaps/skybox/-y.png +0 -0
- /package/{assets → boilerplate/assets}/cubemaps/skybox/-z.png +0 -0
- /package/{assets → boilerplate/assets}/models/player.gltf +0 -0
- /package/{assets → boilerplate/assets}/models/spider.gltf +0 -0
- /package/{assets → boilerplate/assets}/models/zombie.gltf +0 -0
- /package/{assets → boilerplate/assets}/textures/bricks.png +0 -0
- /package/{assets → boilerplate/assets}/textures/clay.png +0 -0
- /package/{assets → boilerplate/assets}/textures/diamond_ore.png +0 -0
- /package/{assets → boilerplate/assets}/textures/dirt.png +0 -0
- /package/{assets → boilerplate/assets}/textures/dragons_stone.png +0 -0
- /package/{assets → boilerplate/assets}/textures/glass.png +0 -0
- /package/{assets → boilerplate/assets}/textures/grass/+x.png +0 -0
- /package/{assets → boilerplate/assets}/textures/grass/+y.png +0 -0
- /package/{assets → boilerplate/assets}/textures/grass/+z.png +0 -0
- /package/{assets → boilerplate/assets}/textures/grass/-x.png +0 -0
- /package/{assets → boilerplate/assets}/textures/grass/-y.png +0 -0
- /package/{assets → boilerplate/assets}/textures/grass/-z.png +0 -0
- /package/{assets → boilerplate/assets}/textures/grass.png +0 -0
- /package/{assets → boilerplate/assets}/textures/gravel.png +0 -0
- /package/{assets → boilerplate/assets}/textures/ice.png +0 -0
- /package/{assets → boilerplate/assets}/textures/infected_shadowrock.png +0 -0
- /package/{assets → boilerplate/assets}/textures/log_side.png +0 -0
- /package/{assets → boilerplate/assets}/textures/log_top.png +0 -0
- /package/{assets → boilerplate/assets}/textures/mossy_coblestone.png +0 -0
- /package/{assets → boilerplate/assets}/textures/nuit.png +0 -0
- /package/{assets → boilerplate/assets}/textures/oak_leaves.png +0 -0
- /package/{assets → boilerplate/assets}/textures/oak_planks.png +0 -0
- /package/{assets → boilerplate/assets}/textures/sand.png +0 -0
- /package/{assets → boilerplate/assets}/textures/shadowrock.png +0 -0
- /package/{assets → boilerplate/assets}/textures/stone.png +0 -0
- /package/{assets → boilerplate/assets}/textures/stone_bricks.png +0 -0
- /package/{assets → boilerplate/assets}/textures/void_sand.png +0 -0
- /package/{assets → boilerplate/assets}/textures/water_still.png +0 -0
package/server.d.ts
CHANGED
@@ -1,76 +1,148 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
|
3
3
|
import type { AnyPacket } from '@hytopia.com/server-protocol';
|
4
|
+
import http from 'http';
|
4
5
|
import type { IncomingMessage } from 'http';
|
5
6
|
import type { InputSchema } from '@hytopia.com/server-protocol';
|
6
7
|
import type { IPacket } from '@hytopia.com/server-protocol';
|
7
8
|
import protocol from '@hytopia.com/server-protocol';
|
8
9
|
import RAPIER from '@dimforge/rapier3d-compat';
|
9
10
|
import { SdpMatrix3 } from '@dimforge/rapier3d-compat';
|
11
|
+
import type { Socket as Socket_2 } from 'net';
|
10
12
|
import { Vector } from '@dimforge/rapier3d-compat';
|
11
13
|
import { WebSocket as WebSocket_2 } from 'ws';
|
12
14
|
|
15
|
+
/**
|
16
|
+
* Represents a audio playback in a world.
|
17
|
+
*
|
18
|
+
* @remarks
|
19
|
+
* Audio instances are created directly as instances.
|
20
|
+
* They support a variety of configuration options through
|
21
|
+
* the {@link AudioOptions} constructor argument.
|
22
|
+
*
|
23
|
+
* @example
|
24
|
+
* ```typescript
|
25
|
+
* (new Audio({
|
26
|
+
* uri: 'assets/music/song.mp3',
|
27
|
+
* loop: true,
|
28
|
+
* volume: 0.5,
|
29
|
+
* })).play(world);
|
30
|
+
* ```
|
31
|
+
*
|
32
|
+
* @public
|
33
|
+
*/
|
13
34
|
export declare class Audio implements protocol.Serializable {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
/**
|
51
|
+
* @param audioData - The options for the audio instance.
|
52
|
+
*/
|
53
|
+
constructor(options: AudioOptions);
|
54
|
+
/** The unique identifier for the audio. */
|
30
55
|
get id(): number | undefined;
|
56
|
+
/** The entity to which the audio is attached if explicitly set. */
|
31
57
|
get attachedToEntity(): Entity | undefined;
|
58
|
+
/** The duration of the audio in seconds if explicitly set. */
|
32
59
|
get duration(): number | undefined;
|
60
|
+
/** The detune of the audio in cents if explicitly set. */
|
33
61
|
get detune(): number | undefined;
|
62
|
+
/** The amount of distortion to apply to the audio if explicitly set. */
|
34
63
|
get distortion(): number | undefined;
|
64
|
+
/** Whether the audio is looped. */
|
35
65
|
get loop(): boolean;
|
66
|
+
/** The offset time in seconds from which the audio should start playing if explicitly set. */
|
36
67
|
get offset(): number | undefined;
|
68
|
+
/** Whether the audio has loaded into the world. Audio is loaded the first time play() is called. */
|
37
69
|
get isLoaded(): boolean;
|
70
|
+
/** Whether the audio is currently playing. */
|
38
71
|
get isPlaying(): boolean;
|
72
|
+
/** Whether the audio is positional (Entity or position attached). */
|
39
73
|
get isPositional(): boolean;
|
74
|
+
/** The position of the audio in the world if explicitly set. */
|
40
75
|
get position(): Vector3 | undefined;
|
76
|
+
/** The playback rate of the audio if explicitly set. */
|
41
77
|
get playbackRate(): number | undefined;
|
78
|
+
/** The reference distance of the audio if explicitly set. */
|
42
79
|
get referenceDistance(): number | undefined;
|
80
|
+
/** The server tick at which the audio started playing. */
|
43
81
|
get startTick(): number | undefined;
|
82
|
+
/** The URI of the audio asset. */
|
44
83
|
get uri(): string;
|
84
|
+
/** The volume of the audio if explicitly set. */
|
45
85
|
get volume(): number | undefined;
|
86
|
+
/** The world the audio is in if already loaded. */
|
46
87
|
get world(): World | undefined;
|
88
|
+
/**
|
89
|
+
* Plays or resumes the audio.
|
90
|
+
*
|
91
|
+
* @param world - The world to play the audio in.
|
92
|
+
* @param restart - If true, the audio will restart from the beginning if it is already playing.
|
93
|
+
*/
|
47
94
|
play(world: World, restart?: boolean): void;
|
95
|
+
/**
|
96
|
+
* Pauses the audio.
|
97
|
+
*/
|
48
98
|
pause(): void;
|
99
|
+
/**
|
100
|
+
* Sets the entity to which the audio is attached, following its position.
|
101
|
+
*
|
102
|
+
* @param entity - The entity to attach the audio to.
|
103
|
+
*/
|
49
104
|
setAttachedToEntity(entity: Entity): void;
|
105
|
+
/**
|
106
|
+
* Sets the detune of the audio.
|
107
|
+
*
|
108
|
+
* @param detune - The detune in cents.
|
109
|
+
*/
|
50
110
|
setDetune(detune: number): void;
|
111
|
+
/**
|
112
|
+
* Sets the distortion of the audio.
|
113
|
+
*
|
114
|
+
* @param distortion - The distortion amount.
|
115
|
+
*/
|
51
116
|
setDistortion(distortion: number): void;
|
117
|
+
/**
|
118
|
+
* Sets the position of the audio. Will detach from entity if attached.
|
119
|
+
*
|
120
|
+
* @param position - The position in the world.
|
121
|
+
*/
|
52
122
|
setPosition(position: Vector3): void;
|
123
|
+
/**
|
124
|
+
* Sets the playback rate of the audio.
|
125
|
+
*
|
126
|
+
* @param playbackRate - The playback rate.
|
127
|
+
*/
|
53
128
|
setPlaybackRate(playbackRate: number): void;
|
129
|
+
/**
|
130
|
+
* Sets the reference distance of the audio.
|
131
|
+
*
|
132
|
+
* @param referenceDistance - The reference distance.
|
133
|
+
*/
|
54
134
|
setReferenceDistance(referenceDistance: number): void;
|
135
|
+
/**
|
136
|
+
* Sets the volume of the audio.
|
137
|
+
*
|
138
|
+
* @param volume - The volume level.
|
139
|
+
*/
|
55
140
|
setVolume(volume: number): void;
|
56
|
-
serialize(): protocol.AudioSchema;
|
57
|
-
private _requirePositional;
|
58
|
-
}
|
59
141
|
|
60
|
-
|
61
|
-
attachedToEntity?: Entity;
|
62
|
-
duration?: number;
|
63
|
-
detune?: number;
|
64
|
-
distortion?: number;
|
65
|
-
loop?: boolean;
|
66
|
-
offset?: number;
|
67
|
-
position?: Vector3;
|
68
|
-
playbackRate?: number;
|
69
|
-
referenceDistance?: number;
|
70
|
-
uri: string;
|
71
|
-
volume?: number;
|
142
|
+
|
72
143
|
}
|
73
144
|
|
145
|
+
/** Payloads for events an Audio instance can emit. @public */
|
74
146
|
export declare namespace AudioEventPayload {
|
75
147
|
export interface Pause {
|
76
148
|
audio: Audio;
|
@@ -111,6 +183,7 @@ export declare namespace AudioEventPayload {
|
|
111
183
|
}
|
112
184
|
}
|
113
185
|
|
186
|
+
/** Event types an Audio instance can emit. @public */
|
114
187
|
export declare enum AudioEventType {
|
115
188
|
PAUSE = "AUDIO.PAUSE",
|
116
189
|
PLAY = "AUDIO.PLAY",
|
@@ -124,78 +197,286 @@ export declare enum AudioEventType {
|
|
124
197
|
SET_VOLUME = "AUDIO.SET_VOLUME"
|
125
198
|
}
|
126
199
|
|
200
|
+
/**
|
201
|
+
* Manages audio instances in a world.
|
202
|
+
*
|
203
|
+
* @remarks
|
204
|
+
* The AudioManager is created internally as a singleton
|
205
|
+
* for each {@link World} instance in a game server.
|
206
|
+
* It allows retrieval of all loaded audio, entity
|
207
|
+
* attached audio, looped audio, and more.
|
208
|
+
*
|
209
|
+
* @example
|
210
|
+
* ```typescript
|
211
|
+
* // Stop all audio in the world
|
212
|
+
* const audioManager = world.audioManager;
|
213
|
+
* audioManager.getAllAudios().map(audio => audio.pause());
|
214
|
+
* ```
|
215
|
+
*
|
216
|
+
* @public
|
217
|
+
*/
|
127
218
|
export declare class AudioManager {
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
/** The world the audio manager is for. */
|
132
224
|
get world(): World;
|
133
|
-
|
134
|
-
|
225
|
+
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Retrieves all loaded audio instances for the world.
|
229
|
+
*
|
230
|
+
* @returns An array of audio instances.
|
231
|
+
*/
|
135
232
|
getAllAudios(): Audio[];
|
233
|
+
/**
|
234
|
+
* Retrieves all loaded audio instances attached to a specific entity.
|
235
|
+
*
|
236
|
+
* @param entity - The entity to get attached audio instances for.
|
237
|
+
* @returns An array of audio instances.
|
238
|
+
*/
|
136
239
|
getAllEntityAttachedAudios(entity: Entity): Audio[];
|
240
|
+
/**
|
241
|
+
* Retrieves all looped audio instances for the world.
|
242
|
+
*
|
243
|
+
* @returns An array of audio instances.
|
244
|
+
*/
|
137
245
|
getAllLoopedAudios(): Audio[];
|
246
|
+
/**
|
247
|
+
* Retrieves all oneshot (non-looped) audio instances for the world.
|
248
|
+
*
|
249
|
+
* @returns An array of audio instances.
|
250
|
+
*/
|
138
251
|
getAllOneshotAudios(): Audio[];
|
139
252
|
}
|
140
253
|
|
141
|
-
|
254
|
+
/** Options for creating an Audio instance. @public */
|
255
|
+
export declare interface AudioOptions {
|
256
|
+
/** If set, audio playback will follow the entity's position. */
|
257
|
+
attachedToEntity?: Entity;
|
258
|
+
/** The duration of the audio in seconds. Defaults to full duration. */
|
259
|
+
duration?: number;
|
260
|
+
/** The detuning of the audio in cents. */
|
261
|
+
detune?: number;
|
262
|
+
/** The amount of distortion to apply to the audio. */
|
263
|
+
distortion?: number;
|
264
|
+
/** Whether the audio should loop when it reaches the end. Defaults to false. */
|
265
|
+
loop?: boolean;
|
266
|
+
/** The offset time in seconds from which the audio should start playing. */
|
267
|
+
offset?: number;
|
268
|
+
/** The position in the world where the audio is played. */
|
269
|
+
position?: Vector3;
|
270
|
+
/** The playback speed of the audio. Defaults to 1. */
|
271
|
+
playbackRate?: number;
|
272
|
+
/** The reference distance for reducing volume as the audio source moves away from the listener. */
|
273
|
+
referenceDistance?: number;
|
274
|
+
/** The URI or path to the audio asset to be played. */
|
275
|
+
uri: string;
|
276
|
+
/** The volume level of the audio. Defaults to 0.5. */
|
277
|
+
volume?: number;
|
278
|
+
}
|
279
|
+
|
280
|
+
/**
|
281
|
+
* A base class for character controller implementations.
|
282
|
+
*
|
283
|
+
* @remarks
|
284
|
+
* The BaseCharacterController should be extended
|
285
|
+
* by a more specific character controller that you or a
|
286
|
+
* plugin implements.
|
287
|
+
*
|
288
|
+
* @public
|
289
|
+
*/
|
290
|
+
export declare abstract class BaseCharacterController {
|
291
|
+
/** The entity the controller is for. */
|
142
292
|
readonly entity: Entity;
|
293
|
+
/**
|
294
|
+
* A callback function for when the controller ticks
|
295
|
+
* player movement.
|
296
|
+
* @param inputState - The current input state of the player.
|
297
|
+
* @param orientationState - The current orientation state of the player.
|
298
|
+
* @param deltaTimeMs - The delta time in milliseconds since the last tick.
|
299
|
+
*/
|
143
300
|
onTickPlayerMovement?: (inputState: PlayerInputState, orientationState: PlayerOrientationState, deltaTimeMs: number) => void;
|
301
|
+
/**
|
302
|
+
* A callback function for when the controller ticks
|
303
|
+
* pathfinding movement.
|
304
|
+
* @param destination - The destination to move to.
|
305
|
+
* @param deltaTimeMs - The delta time in milliseconds since the last tick.
|
306
|
+
*/
|
144
307
|
onTickPathfindingMovement?: (destination: Vector3, deltaTimeMs: number) => void;
|
308
|
+
/**
|
309
|
+
* @param entity - The entity the controller is for.
|
310
|
+
* @param _options - Arbitrary options you may provide or omit for your controller implementation.
|
311
|
+
*/
|
145
312
|
constructor(entity: Entity, _options?: Record<string, unknown>);
|
313
|
+
/**
|
314
|
+
* Override this method to create sensor colliders
|
315
|
+
* to be attached to the controlled entity when it spawns.
|
316
|
+
* @returns An array of colliders.
|
317
|
+
*/
|
146
318
|
createSensorColliders(): Collider[];
|
319
|
+
/**
|
320
|
+
* Override this method to handle entity movements
|
321
|
+
* based on player input for your character controller.
|
322
|
+
* @param inputState - The current input state of the player.
|
323
|
+
* @param orientationState - The current orientation state of the player.
|
324
|
+
* @param deltaTimeMs - The delta time in milliseconds since the last tick.
|
325
|
+
*/
|
147
326
|
tickPlayerMovement(inputState: PlayerInputState, orientationState: PlayerOrientationState, deltaTimeMs: number): void;
|
327
|
+
/**
|
328
|
+
* Override this method to implement pathfinding
|
329
|
+
* movement logic for your character controller.
|
330
|
+
* NOTE: This method is not fully supported yet.
|
331
|
+
* @param destination - The destination target to move to.
|
332
|
+
* @param deltaTimeMs - The delta time in milliseconds since the last tick.
|
333
|
+
*/
|
148
334
|
tickPathfindingMovement(destination: Vector3, deltaTimeMs: number): void;
|
149
335
|
}
|
150
336
|
|
337
|
+
/**
|
338
|
+
* Represents a block in a world.
|
339
|
+
*
|
340
|
+
* @remarks
|
341
|
+
* Instances of this class are created internally but made
|
342
|
+
* publicly available through various public facing API
|
343
|
+
* methods.
|
344
|
+
*
|
345
|
+
* @public
|
346
|
+
*/
|
151
347
|
export declare class Block {
|
348
|
+
/** The global coordinate of the block. */
|
152
349
|
readonly globalCoordinate: Vector3;
|
350
|
+
/** The block type of the block. */
|
153
351
|
readonly blockType: BlockType;
|
154
|
-
|
155
|
-
|
352
|
+
|
353
|
+
|
156
354
|
}
|
157
355
|
|
356
|
+
/**
|
357
|
+
* Represents a block type.
|
358
|
+
*
|
359
|
+
* @remarks
|
360
|
+
* Block types are created directly as instances.
|
361
|
+
* They support a variety of configuration options through
|
362
|
+
* the {@link BlockTypeOptions} constructor argument.
|
363
|
+
* Block types are registered with a {@link BlockTypeRegistry} instance,
|
364
|
+
* allowing you to create custom blocks with unique visual representations
|
365
|
+
* and behaviors.
|
366
|
+
*
|
367
|
+
* @example
|
368
|
+
* ```typescript
|
369
|
+
* const stoneBlockTypeId = 10;
|
370
|
+
* world.blockTypeRegistry.registerBlockType(stoneBlockTypeId, new BlockType({
|
371
|
+
* id: stoneBlockTypeId,
|
372
|
+
* textureUri: 'assets/textures/stone.png',
|
373
|
+
* name: 'Stone',
|
374
|
+
* }));
|
375
|
+
*
|
376
|
+
* // Create a stone block at coordinate 0, 1, 0
|
377
|
+
* world.chunkLattice.setBlock({ x: 0, y: 1, z: 0 }, stoneBlockTypeId);
|
378
|
+
* ```
|
379
|
+
*
|
380
|
+
* @public
|
381
|
+
*/
|
158
382
|
export declare class BlockType implements protocol.Serializable {
|
383
|
+
/**
|
384
|
+
* A callback function that is invoked when an entity collides with blocks of this type.
|
385
|
+
* @param entity - The entity that collided with the block.
|
386
|
+
* @param started - Whether the collision started.
|
387
|
+
*/
|
159
388
|
onEntityCollision?: (this: BlockType, entity: Entity, started: boolean) => void;
|
389
|
+
/**
|
390
|
+
* A callback function that is invoked when an entity contacts a block of this type.
|
391
|
+
* @param entity - The entity that contacted the block.
|
392
|
+
* @param contactForceData - The contact force data.
|
393
|
+
*/
|
160
394
|
onEntityContactForce?: (this: BlockType, entity: Entity, contactForceData: ContactForceData) => void;
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
/**
|
400
|
+
* Creates a new block type instance.
|
401
|
+
* @param world - The world the block type is for.
|
402
|
+
* @param options - The options for the block type.
|
403
|
+
*/
|
404
|
+
constructor(options?: BlockTypeOptions);
|
405
|
+
/** The unique identifier for the block type. */
|
168
406
|
get id(): number;
|
407
|
+
/** The collider options for the block type. */
|
169
408
|
get colliderOptions(): ColliderOptions;
|
409
|
+
/** The URI of the texture for the block type. */
|
170
410
|
get textureUri(): string;
|
411
|
+
/** The name of the block type. */
|
171
412
|
get name(): string;
|
172
|
-
|
173
|
-
get isSolid(): boolean;
|
413
|
+
/** Whether the block type is meshable. */
|
174
414
|
get isMeshable(): boolean;
|
175
|
-
|
176
|
-
|
415
|
+
|
416
|
+
|
177
417
|
}
|
178
418
|
|
179
|
-
|
419
|
+
/** Options for creating a block type instance. @public */
|
420
|
+
export declare interface BlockTypeOptions {
|
180
421
|
id: number;
|
181
422
|
textureUri: string;
|
182
423
|
name: string;
|
183
424
|
customColliderOptions?: ColliderOptions;
|
184
|
-
isSolid?: boolean;
|
185
425
|
}
|
186
426
|
|
427
|
+
/**
|
428
|
+
* Manages known block types in a world.
|
429
|
+
*
|
430
|
+
* @remarks
|
431
|
+
* Block type registries are created internally as a singleton
|
432
|
+
* for each {@link World} instance in a game server. A block
|
433
|
+
* type registry allows you to register and retrieve block
|
434
|
+
* types by their unique id for a world.
|
435
|
+
*
|
436
|
+
* @example
|
437
|
+
* ```typescript
|
438
|
+
* world.blockTypeRegistry.registerGenericBlockType({
|
439
|
+
* id: 15,
|
440
|
+
* textureUri: 'assets/textures/dirt.png',
|
441
|
+
* name: 'Dirt',
|
442
|
+
* });
|
443
|
+
* ```
|
444
|
+
*
|
445
|
+
* @public
|
446
|
+
*/
|
187
447
|
export declare class BlockTypeRegistry implements protocol.Serializable {
|
188
|
-
|
189
|
-
|
190
|
-
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
/** The world the block type registry is for. */
|
191
452
|
get world(): World;
|
453
|
+
/**
|
454
|
+
* Get all registered block types.
|
455
|
+
* @returns An array of all registered block types.
|
456
|
+
*/
|
192
457
|
getAllBlockTypes(): BlockType[];
|
458
|
+
/**
|
459
|
+
* Get a registered block type by its id.
|
460
|
+
* @param id - The id of the block type to get.
|
461
|
+
* @returns The block type with the given id.
|
462
|
+
*/
|
193
463
|
getBlockType(id: number): BlockType;
|
194
|
-
|
464
|
+
/**
|
465
|
+
* Register a generic block type.
|
466
|
+
* @param blockTypeOptions - The options for the block type.
|
467
|
+
* @returns The registered block type.
|
468
|
+
*/
|
469
|
+
registerGenericBlockType(blockTypeOptions: BlockTypeOptions): BlockType;
|
470
|
+
/**
|
471
|
+
* Register a block type.
|
472
|
+
* @param id - The id of the block type to register.
|
473
|
+
* @param blockTypeReference - The block type to register.
|
474
|
+
*/
|
195
475
|
registerBlockType(id: number, blockTypeReference: BlockType): void;
|
196
|
-
|
476
|
+
|
197
477
|
}
|
198
478
|
|
479
|
+
/** Payloads for events a BlockTypeRegistry instance can emit. @public */
|
199
480
|
export declare namespace BlockTypeRegistryEventPayload {
|
200
481
|
export interface RegisterBlockType {
|
201
482
|
blockTypeRegistry: BlockTypeRegistry;
|
@@ -204,10 +485,12 @@ export declare namespace BlockTypeRegistryEventPayload {
|
|
204
485
|
}
|
205
486
|
}
|
206
487
|
|
488
|
+
/** Event types a BlockTypeRegistry instance can emit. @public */
|
207
489
|
export declare enum BlockTypeRegistryEventType {
|
208
490
|
REGISTER_BLOCK_TYPE = "BLOCK_TYPE_REGISTRY.REGISTER_BLOCK_TYPE"
|
209
491
|
}
|
210
492
|
|
493
|
+
/** Payloads for events a ChatManager instance can emit. @public */
|
211
494
|
export declare namespace ChatEventPayload {
|
212
495
|
export interface SendBroadcastMessage {
|
213
496
|
message: string;
|
@@ -220,52 +503,185 @@ export declare namespace ChatEventPayload {
|
|
220
503
|
}
|
221
504
|
}
|
222
505
|
|
506
|
+
/** Event types a ChatManager instance can emit. @public */
|
223
507
|
export declare enum ChatEventType {
|
224
508
|
SEND_BROADCAST_MESSAGE = "CHAT.SEND_BROADCAST_MESSAGE",
|
225
509
|
SEND_PLAYER_MESSAGE = "CHAT.SEND_PLAYER_MESSAGE"
|
226
510
|
}
|
227
511
|
|
512
|
+
/**
|
513
|
+
* Manages chat and commands in a world.
|
514
|
+
*
|
515
|
+
* @remarks
|
516
|
+
* The ChatManager is created internally as a singleton
|
517
|
+
* for each {@link World} instance in a game server.
|
518
|
+
* The ChatManager allows you to broadcast messages,
|
519
|
+
* send messages to specific players, and register
|
520
|
+
* commands that can be used in chat to execute game
|
521
|
+
* logic.
|
522
|
+
*
|
523
|
+
* @example
|
524
|
+
* ```typescript
|
525
|
+
* world.chatManager.registerCommand('/kick', (player, args, message) => {
|
526
|
+
* const admins = [ 'arkdev', 'testuser123' ];
|
527
|
+
* if (admins.includes(player.username)) {
|
528
|
+
* const targetUsername = args[0];
|
529
|
+
* const targetPlayer = world.playerManager.getConnectedPlayerByUsername(targetUsername);
|
530
|
+
*
|
531
|
+
* if (targetPlayer) {
|
532
|
+
* targetPlayer.disconnect();
|
533
|
+
* }
|
534
|
+
* }
|
535
|
+
* });
|
536
|
+
* ```
|
537
|
+
*
|
538
|
+
* @public
|
539
|
+
*/
|
228
540
|
export declare class ChatManager {
|
229
|
-
|
230
|
-
|
231
|
-
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
/**
|
545
|
+
* Register a command and its callback.
|
546
|
+
* @param command - The command to register.
|
547
|
+
* @param callback - The callback function to execute when the command is used.
|
548
|
+
*/
|
232
549
|
registerCommand(command: string, callback: CommandCallback): void;
|
550
|
+
/**
|
551
|
+
* Unregister a command.
|
552
|
+
* @param command - The command to unregister.
|
553
|
+
*/
|
233
554
|
unregisterCommand(command: string): void;
|
555
|
+
/**
|
556
|
+
* Send a broadcast message to all players in the world.
|
557
|
+
* @param message - The message to send.
|
558
|
+
* @param color - The color of the message as a hex color code, excluding #.
|
559
|
+
*
|
560
|
+
* @example
|
561
|
+
* ```typescript
|
562
|
+
* chatManager.sendBroadcastMessage('Hello, world!', 'FF00AA');
|
563
|
+
* ```
|
564
|
+
*/
|
234
565
|
sendBroadcastMessage(message: string, color?: string): void;
|
566
|
+
/**
|
567
|
+
* Send a message to a specific player, only visible to them.
|
568
|
+
* @param player - The player to send the message to.
|
569
|
+
* @param message - The message to send.
|
570
|
+
* @param color - The color of the message as a hex color code, excluding #.
|
571
|
+
*
|
572
|
+
* @example
|
573
|
+
* ```typescript
|
574
|
+
* chatManager.sendPlayerMessage(player, 'Hello, player!', 'FF00AA');
|
575
|
+
* ```
|
576
|
+
*/
|
235
577
|
sendPlayerMessage(player: Player, message: string, color?: string): void;
|
236
|
-
|
237
|
-
|
578
|
+
|
579
|
+
|
238
580
|
}
|
239
581
|
|
582
|
+
/**
|
583
|
+
* A 16^3 chunk of blocks. Used to represent a world's terrain.
|
584
|
+
*
|
585
|
+
* @remarks
|
586
|
+
* Chunks make up the bulk of the terrain in a world. Chunks are
|
587
|
+
* fixed size, each containing 16^3 possible blocks as
|
588
|
+
* a 16x16x16 cube. Chunks can be spawned, despawned, have their
|
589
|
+
* unique blocks set or removed, and more. Chunks represent their
|
590
|
+
* internal block coordinates in local space, meaning only coordinates
|
591
|
+
* x: 0...15, y: 0...15, z: 0...15 are valid.
|
592
|
+
*
|
593
|
+
* The Chunk follows a spawn and despawn lifecycle pattern.
|
594
|
+
* When you create a chunk, when you're ready to load it in your
|
595
|
+
* world you use .spawn(). To remove it, you use .despawn().
|
596
|
+
*
|
597
|
+
* Use .setBlock() to set the block type id at a specific local cooridnate.
|
598
|
+
* Block type ids are ones that have been registered in the {@link BlockTypeRegistry}
|
599
|
+
* associated with the {@link World} the chunk belongs to. A block type id of 0
|
600
|
+
* is used to represent no block. Removing a block is done by .setBlock(localCoordinate, 0).
|
601
|
+
*
|
602
|
+
* @example
|
603
|
+
* ```typescript
|
604
|
+
* // Assume we previously registered a stone block with type id of 10..
|
605
|
+
*
|
606
|
+
* const chunk = new Chunk();
|
607
|
+
*
|
608
|
+
* chunk.setBlock({ x: 0, y: 0, z: 0 }, 10); // Set the block at 0, 0, 0 to stone
|
609
|
+
* chunk.spawn(world, { x: 16, y: 0, z: 16 }); // Spawn the chunk at global coordinate 16, 0, 16
|
610
|
+
* ```
|
611
|
+
*
|
612
|
+
* @public
|
613
|
+
*/
|
240
614
|
export declare class Chunk implements protocol.Serializable {
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
/**
|
621
|
+
* Creates a new chunk instance.
|
622
|
+
*/
|
246
623
|
constructor();
|
624
|
+
/** The blocks in the chunk as a flat Uint8Array[4096], each index as 0 or a block type id. */
|
247
625
|
get blocks(): Readonly<Uint8Array>;
|
248
|
-
|
626
|
+
|
627
|
+
/** Whether the chunk is actively simulated in the internal physics engine. */
|
249
628
|
get isSimulated(): boolean;
|
629
|
+
/** Whether the chunk has been spawned. */
|
250
630
|
get isSpawned(): boolean;
|
631
|
+
/** The origin coordinate of the chunk. */
|
251
632
|
get originCoordinate(): Vector3 | undefined;
|
633
|
+
/** The world the chunk belongs to. */
|
252
634
|
get world(): World | undefined;
|
635
|
+
/**
|
636
|
+
* Convert a block index to a local coordinate.
|
637
|
+
* @param index - The index of the block to convert.
|
638
|
+
* @returns The local coordinate of the block.
|
639
|
+
*/
|
253
640
|
static blockIndexToLocalCoordinate(index: number): Vector3;
|
641
|
+
/**
|
642
|
+
* Convert a global coordinate to a local coordinate.
|
643
|
+
* @param globalCoordinate - The global coordinate to convert.
|
644
|
+
* @returns The local coordinate.
|
645
|
+
*/
|
254
646
|
static globalCoordinateToLocalCoordinate(globalCoordinate: Vector3): Vector3;
|
647
|
+
/**
|
648
|
+
* Convert a global coordinate to an origin coordinate.
|
649
|
+
* @param globalCoordinate - The global coordinate to convert.
|
650
|
+
* @returns The origin coordinate.
|
651
|
+
*/
|
255
652
|
static globalCoordinateToOriginCoordinate(globalCoordinate: Vector3): Vector3;
|
653
|
+
/**
|
654
|
+
* Check if an origin coordinate is valid.
|
655
|
+
* @param coordinate - The coordinate to check.
|
656
|
+
* @returns Whether the coordinate is valid.
|
657
|
+
*/
|
256
658
|
static isValidOriginCoordinate(coordinate: Vector3): boolean;
|
659
|
+
/**
|
660
|
+
* Spawn the chunk in the world.
|
661
|
+
* @param world - The world to spawn the chunk in.
|
662
|
+
* @param originCoordinate - The origin coordinate of the chunk.
|
663
|
+
*/
|
257
664
|
spawn(world: World, originCoordinate: Vector3): void;
|
665
|
+
/**
|
666
|
+
* Despawn the chunk from the world.
|
667
|
+
*/
|
258
668
|
despawn(): void;
|
669
|
+
/**
|
670
|
+
* Set the block at a specific local coordinate by block type id.
|
671
|
+
* @param localCoordinate - The local coordinate of the block to set.
|
672
|
+
* @param blockTypeId - The block type id to set.
|
673
|
+
*/
|
259
674
|
setBlock(localCoordinate: Vector3, blockTypeId: number): void;
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
|
267
682
|
}
|
268
683
|
|
684
|
+
/** Payloads for events a Chunk instance can emit. @public */
|
269
685
|
export declare namespace ChunkEventPayload {
|
270
686
|
export interface Despawn {
|
271
687
|
chunk: Chunk;
|
@@ -281,106 +697,241 @@ export declare namespace ChunkEventPayload {
|
|
281
697
|
}
|
282
698
|
}
|
283
699
|
|
700
|
+
/** Event types a Chunk instance can emit. @public */
|
284
701
|
export declare enum ChunkEventType {
|
285
702
|
DESPAWN = "CHUNK.DESPAWN",
|
286
703
|
SET_BLOCK = "CHUNK.SET_BLOCK",
|
287
704
|
SPAWN = "CHUNK.SPAWN"
|
288
705
|
}
|
289
706
|
|
707
|
+
/**
|
708
|
+
* A lattice of chunks that represent a world's terrain.
|
709
|
+
*
|
710
|
+
* @remarks
|
711
|
+
* The ChunkLattice lattice tracks the current terrain of a world,
|
712
|
+
* comprised of {@link Chunk} instances.
|
713
|
+
*
|
714
|
+
* @public
|
715
|
+
*/
|
290
716
|
export declare class ChunkLattice {
|
291
|
-
|
292
|
-
|
717
|
+
|
718
|
+
|
719
|
+
/**
|
720
|
+
* Creates a new chunk lattice instance.
|
721
|
+
* @param world - The world the chunk lattice is for.
|
722
|
+
*/
|
293
723
|
constructor(world: World);
|
294
|
-
|
295
|
-
|
724
|
+
|
725
|
+
|
726
|
+
/**
|
727
|
+
* Get a chunk by its origin coordinate.
|
728
|
+
* @param originCoordinate - The origin coordinate of the chunk to get.
|
729
|
+
* @returns The chunk at the given origin coordinate or undefined if not found.
|
730
|
+
*/
|
296
731
|
getChunk(originCoordinate: Vector3): Chunk | undefined;
|
732
|
+
/**
|
733
|
+
* Get all chunks in the lattice.
|
734
|
+
* @returns An array of all chunks in the lattice.
|
735
|
+
*/
|
297
736
|
getAllChunks(): Chunk[];
|
737
|
+
/**
|
738
|
+
* Check if a chunk exists by its origin coordinate.
|
739
|
+
* @param originCoordinate - The origin coordinate of the chunk to check.
|
740
|
+
* @returns Whether the chunk exists.
|
741
|
+
*/
|
298
742
|
hasChunk(originCoordinate: Vector3): boolean;
|
743
|
+
/**
|
744
|
+
* Set the block at a global coordinate by block type id, automatically
|
745
|
+
* creating a chunk if it doesn't exist.
|
746
|
+
* @param globalCoordinate - The global coordinate of the block to set.
|
747
|
+
* @param blockTypeId - The block type id to set.
|
748
|
+
*/
|
299
749
|
setBlock(globalCoordinate: Vector3, blockTypeId: number): void;
|
300
|
-
|
301
|
-
|
750
|
+
|
751
|
+
|
302
752
|
}
|
303
753
|
|
754
|
+
/**
|
755
|
+
* Represents a collider in a world's physics simulation.
|
756
|
+
*
|
757
|
+
* @remarks
|
758
|
+
* Colliders make up the foundation of the physical interactions
|
759
|
+
* in a world. They are highly configurable and have many
|
760
|
+
* aspects that can be adjusted both before simulation and
|
761
|
+
* while simulated. Colliders will most often be used through
|
762
|
+
* passing {@link ColliderOptions} to a {@link RigidBody} or
|
763
|
+
* an entity's {@link EntityOptions}.
|
764
|
+
*
|
765
|
+
* @public
|
766
|
+
*/
|
304
767
|
export declare class Collider {
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
768
|
+
|
769
|
+
|
770
|
+
|
771
|
+
|
772
|
+
|
773
|
+
|
774
|
+
/**
|
775
|
+
* @param colliderOptions - The options for the collider instance.
|
776
|
+
*/
|
311
777
|
constructor(colliderOptions: ColliderOptions);
|
778
|
+
/** Whether the collider is enabled. */
|
312
779
|
get isEnabled(): boolean;
|
780
|
+
/** Whether the collider has been removed from the simulation. */
|
313
781
|
get isRemoved(): boolean;
|
782
|
+
/** Whether the collider is a sensor. */
|
314
783
|
get isSensor(): boolean;
|
784
|
+
/** Whether the collider is simulated. */
|
315
785
|
get isSimulated(): boolean;
|
786
|
+
/** The parent rigid body of the collider. */
|
316
787
|
get parentRigidBody(): RigidBody | undefined;
|
788
|
+
/** The raw collider object from the Rapier physics engine. */
|
317
789
|
get rawCollider(): RAPIER.Collider | undefined;
|
790
|
+
/** An arbitrary identifier tag of the collider. Useful for your own logic. */
|
318
791
|
get tag(): string | undefined;
|
792
|
+
/**
|
793
|
+
* Gets the bounciness of the collider.
|
794
|
+
* @returns The bounciness of the collider.
|
795
|
+
*/
|
796
|
+
getBounciness(): number;
|
797
|
+
/**
|
798
|
+
* Gets the collision groups the collider belongs to.
|
799
|
+
* @returns The collision groups the collider belongs to.
|
800
|
+
*/
|
319
801
|
getCollisionGroups(): CollisionGroups;
|
802
|
+
/**
|
803
|
+
* Gets the friction of the collider.
|
804
|
+
* @returns The friction of the collider.
|
805
|
+
*/
|
320
806
|
getFriction(): number;
|
321
|
-
|
807
|
+
/**
|
808
|
+
* Gets the relative rotation of the collider.
|
809
|
+
* @returns The relative rotation of the collider.
|
810
|
+
*/
|
322
811
|
getRelativeRotation(): Rotation;
|
812
|
+
/**
|
813
|
+
* Gets the relative translation of the collider to its parent rigid body.
|
814
|
+
* @returns The relative translation of the collider.
|
815
|
+
*/
|
323
816
|
getRelativeTranslation(): Vector3;
|
817
|
+
/**
|
818
|
+
* Sets the bounciness of the collider.
|
819
|
+
* @param bounciness - The bounciness of the collider.
|
820
|
+
*/
|
324
821
|
setBounciness(bounciness: number): void;
|
822
|
+
/**
|
823
|
+
* Sets the on collision callback for the collider.
|
824
|
+
* @param callback - The on collision callback for the collider.
|
825
|
+
*/
|
325
826
|
setOnCollision(callback: CollisionCallback | undefined): void;
|
827
|
+
/**
|
828
|
+
* Sets the collision groups of the collider.
|
829
|
+
* @param collisionGroups - The collision groups of the collider.
|
830
|
+
*/
|
326
831
|
setCollisionGroups(collisionGroups: CollisionGroups): void;
|
832
|
+
/**
|
833
|
+
* Sets whether the collider is enabled.
|
834
|
+
* @param enabled - Whether the collider is enabled.
|
835
|
+
*/
|
327
836
|
setEnabled(enabled: boolean): void;
|
837
|
+
/**
|
838
|
+
* Sets the friction of the collider.
|
839
|
+
* @param friction - The friction of the collider.
|
840
|
+
*/
|
328
841
|
setFriction(friction: number): void;
|
842
|
+
/**
|
843
|
+
* Sets the mass of the collider.
|
844
|
+
* @param mass - The mass of the collider.
|
845
|
+
*/
|
329
846
|
setMass(mass: number): void;
|
847
|
+
/**
|
848
|
+
* Sets the relative rotation of the collider.
|
849
|
+
* @param rotation - The relative rotation of the collider.
|
850
|
+
*/
|
330
851
|
setRelativeRotation(rotation: Rotation): void;
|
852
|
+
/**
|
853
|
+
* Sets the relative translation of the collider to its parent rigid body.
|
854
|
+
* @param translation - The relative translation of the collider.
|
855
|
+
*/
|
331
856
|
setRelativeTranslation(translation: Vector3): void;
|
857
|
+
/**
|
858
|
+
* Sets whether the collider is a sensor.
|
859
|
+
* @param sensor - Whether the collider is a sensor.
|
860
|
+
*/
|
332
861
|
setSensor(sensor: boolean): void;
|
862
|
+
/**
|
863
|
+
* Sets the tag of the collider.
|
864
|
+
* @param tag - The tag of the collider.
|
865
|
+
*/
|
333
866
|
setTag(tag: string): void;
|
867
|
+
/**
|
868
|
+
* Adds the collider to the simulation.
|
869
|
+
* @param simulation - The simulation to add the collider to.
|
870
|
+
* @param parentRigidBody - The parent rigid body of the collider.
|
871
|
+
*/
|
334
872
|
addToSimulation(simulation: Simulation, parentRigidBody?: RigidBody): void;
|
873
|
+
/**
|
874
|
+
* Enables or disables collision events for the collider.
|
875
|
+
* This is automatically enabled if an on collision callback is set.
|
876
|
+
* @param enabled - Whether collision events are enabled.
|
877
|
+
*/
|
335
878
|
enableCollisionEvents(enabled: boolean): void;
|
879
|
+
/**
|
880
|
+
* Enables or disables contact force events for the collider.
|
881
|
+
* This is automatically enabled if an on contact force callback is set.
|
882
|
+
* @param enabled - Whether contact force events are enabled.
|
883
|
+
*/
|
336
884
|
enableContactForceEvents(enabled: boolean): void;
|
885
|
+
/**
|
886
|
+
* Removes the collider from the simulation.
|
887
|
+
*/
|
337
888
|
removeFromSimulation(): void;
|
338
|
-
private _applyColliderOptions;
|
339
|
-
private _autoAddToSimulation;
|
340
|
-
private _createColliderDesc;
|
341
|
-
private _requireNotRemoved;
|
342
|
-
private _setActiveCollisionTypes;
|
343
|
-
}
|
344
889
|
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
getRawColliderBlockType(collider: RAPIER.Collider): BlockType | undefined;
|
350
|
-
getColliderBlockType(collider: Collider): BlockType | undefined;
|
351
|
-
setColliderBlockType(collider: Collider, block: BlockType): void;
|
352
|
-
removeColliderBlockType(collider: Collider): void;
|
353
|
-
getRawColliderCollisionCallback(collider: RAPIER.Collider): CollisionCallback | undefined;
|
354
|
-
getColliderCollisionCallback(collider: Collider): CollisionCallback | undefined;
|
355
|
-
setColliderCollisionCallback(collider: Collider, callback: CollisionCallback): void;
|
356
|
-
removeColliderCollisionCallback(collider: Collider): void;
|
357
|
-
getRawRigidBodyEntity(rigidBody: RAPIER.RigidBody): Entity | undefined;
|
358
|
-
setRawRigidBodyEntity(rigidBody: RAPIER.RigidBody, entity: Entity): void;
|
359
|
-
removeRawRigidBodyEntity(rigidBody: RAPIER.RigidBody): void;
|
360
|
-
private _requireSimulatedCollider;
|
361
|
-
private _requireSimulatedRigidBody;
|
890
|
+
|
891
|
+
|
892
|
+
|
893
|
+
|
362
894
|
}
|
363
895
|
|
896
|
+
/** Options for creating a Collider instance. @public */
|
364
897
|
export declare interface ColliderOptions {
|
898
|
+
/** The shape of the collider. */
|
365
899
|
shape: ColliderShape;
|
900
|
+
/** The border radius of the collider if the shape is a round cylinder. */
|
366
901
|
borderRadius?: number;
|
902
|
+
/** The bounciness of the collider. */
|
367
903
|
bounciness?: number;
|
904
|
+
/** The collision groups the collider belongs to. */
|
368
905
|
collisionGroups?: CollisionGroups;
|
906
|
+
/** Whether the collider is enabled. */
|
369
907
|
enabled?: boolean;
|
908
|
+
/** The friction of the collider. */
|
370
909
|
friction?: number;
|
910
|
+
/** The half extents of the collider if the shape is a block. */
|
371
911
|
halfExtents?: Vector3;
|
912
|
+
/** The half height of the collider if the shape is a capsule, cone, cylinder, or round cylinder. */
|
372
913
|
halfHeight?: number;
|
914
|
+
/** Whether the collider is a sensor. */
|
373
915
|
isSensor?: boolean;
|
916
|
+
/** The mass of the collider. */
|
374
917
|
mass?: number;
|
918
|
+
/** The on collision callback for the collider. */
|
375
919
|
onCollision?: CollisionCallback;
|
920
|
+
/** The parent rigid body of the collider. */
|
376
921
|
parentRigidBody?: RigidBody;
|
922
|
+
/** The radius of the collider if the shape is a ball, capsule, cone, cylinder, or round cylinder. */
|
377
923
|
radius?: number;
|
924
|
+
/** The relative rotation of the collider. Relative to parent rigid body. */
|
378
925
|
relativeRotation?: Rotation;
|
926
|
+
/** The relative translation of the collider. Relative to parent rigid body. */
|
379
927
|
relativeTranslation?: Vector3;
|
928
|
+
/** The simulation the collider is in, if provided the collider will automatically be added to the simulation. */
|
380
929
|
simulation?: Simulation;
|
930
|
+
/** An arbitrary identifier tag of the collider. Useful for your own logic. */
|
381
931
|
tag?: string;
|
382
932
|
}
|
383
933
|
|
934
|
+
/** The shapes a collider can be. @public */
|
384
935
|
export declare enum ColliderShape {
|
385
936
|
BALL = "ball",
|
386
937
|
BLOCK = "block",
|
@@ -390,8 +941,40 @@ export declare enum ColliderShape {
|
|
390
941
|
ROUND_CYLINDER = "round-cylinder"
|
391
942
|
}
|
392
943
|
|
944
|
+
/**
|
945
|
+
* A callback function that is called when a collision occurs.
|
946
|
+
* @param other - The other object involved in the collision, a block or entity.
|
947
|
+
* @param started - Whether the collision has started or ended.
|
948
|
+
* @public
|
949
|
+
*/
|
393
950
|
export declare type CollisionCallback = (other: BlockType | Entity, started: boolean) => void;
|
394
951
|
|
952
|
+
/**
|
953
|
+
* The default collision groups.
|
954
|
+
*
|
955
|
+
* @remarks
|
956
|
+
* The collision groups are used to determine which objects collide and
|
957
|
+
* generate collision and contact force events. The default collision groups
|
958
|
+
* can be used for most entity and block interactions, but you may want to
|
959
|
+
* create your own for more complex scenarios. Up to 15 collision groups can be
|
960
|
+
* registered. Collision groups use pairwise filtering using bit masks.
|
961
|
+
*
|
962
|
+
* This filtering method is based on two 16-bit values:
|
963
|
+
* - The belongsTo groups (the 16 left-most bits of `self.0`).
|
964
|
+
* - The collidesWith mask (the 16 right-most bits of `self.0`).
|
965
|
+
*
|
966
|
+
* An interaction is allowed between two filters `a` and `b` two conditions
|
967
|
+
* are met simultaneously:
|
968
|
+
* - The belongsTo groups of `a` has at least one bit set to `1` in common with the collidesWith mask of `b`.
|
969
|
+
* - The belongsTo groups of `b` has at least one bit set to `1` in common with the collidesWith mask of `a`.
|
970
|
+
* In other words, interactions are allowed between two filter if the following condition is met:
|
971
|
+
*
|
972
|
+
* ```
|
973
|
+
* ((a >> 16) & b) != 0 && ((b >> 16) & a) != 0
|
974
|
+
* ```
|
975
|
+
*
|
976
|
+
* @public
|
977
|
+
*/
|
395
978
|
export declare enum CollisionGroup {
|
396
979
|
BLOCK = 1,
|
397
980
|
ENTITY = 2,
|
@@ -400,139 +983,354 @@ export declare enum CollisionGroup {
|
|
400
983
|
ALL = 65535
|
401
984
|
}
|
402
985
|
|
986
|
+
/** A set of collision groups. @public */
|
403
987
|
export declare type CollisionGroups = {
|
404
988
|
belongsTo: CollisionGroup[];
|
405
989
|
collidesWith: CollisionGroup[];
|
406
990
|
};
|
407
991
|
|
992
|
+
/**
|
993
|
+
* A helper class for building and decoding collision groups.
|
994
|
+
*
|
995
|
+
* @remarks
|
996
|
+
* This class should be used directly with its static methods.
|
997
|
+
* You can assign collision groups to colliders of entities and
|
998
|
+
* blocks to control optimized collision interactions and filterings
|
999
|
+
* between blocks and entities, and entities and other entities.
|
1000
|
+
*
|
1001
|
+
* @public
|
1002
|
+
*/
|
408
1003
|
export declare class CollisionGroupsBuilder {
|
409
1004
|
private static readonly BELONGS_TO_SHIFT;
|
410
1005
|
private static readonly COLLIDES_WITH_MASK;
|
1006
|
+
/**
|
1007
|
+
* Builds a raw set of collision groups from a set of collision groups.
|
1008
|
+
* @param collisionGroups - The set of collision groups to build.
|
1009
|
+
* @returns A raw set of collision groups represented as a 32-bit number.
|
1010
|
+
*/
|
411
1011
|
static buildRawCollisionGroups(collisionGroups: CollisionGroups): RawCollisionGroups;
|
1012
|
+
/**
|
1013
|
+
* Decodes a raw set of collision groups into a set of collision groups.
|
1014
|
+
* @param groups - The raw set of collision groups to decode.
|
1015
|
+
* @returns A set of collision groups.
|
1016
|
+
*/
|
412
1017
|
static decodeRawCollisionGroups(groups: RawCollisionGroups): CollisionGroups;
|
1018
|
+
/**
|
1019
|
+
* Decodes a set of collision groups into a set of their string equivalents.
|
1020
|
+
* @param collisionGroups - The set of collision groups to decode.
|
1021
|
+
* @returns A set of collision groups represented as their string equivalents.
|
1022
|
+
*/
|
413
1023
|
static decodeCollisionGroups(collisionGroups: CollisionGroups): DecodedCollisionGroups;
|
1024
|
+
/**
|
1025
|
+
* Checks if the collision groups are the default collision groups.
|
1026
|
+
* @param collisionGroups - The set of collision groups to check.
|
1027
|
+
* @returns Whether the collision groups are the default collision groups.
|
1028
|
+
*/
|
414
1029
|
static isDefaultCollisionGroups(collisionGroups: CollisionGroups): boolean;
|
1030
|
+
/**
|
1031
|
+
* Combines an array of collision groups into a raw set of collision groups.
|
1032
|
+
* @param groups - The array of collision groups to combine.
|
1033
|
+
* @returns A raw set of collision groups represented as a 32-bit number.
|
1034
|
+
*/
|
415
1035
|
private static combineGroups;
|
416
|
-
private static bitsToGroups;
|
417
|
-
private static groupToName;
|
418
|
-
}
|
419
|
-
|
420
|
-
export declare type CollisionObject = BlockType | Entity | CollisionCallback;
|
421
1036
|
|
422
|
-
export declare type CommandCallback = (player: Player, args: string[], message: string) => void;
|
423
1037
|
|
424
|
-
declare class Connection {
|
425
|
-
private _ws;
|
426
|
-
readonly id: string;
|
427
|
-
constructor(ws: WebSocket_2, req: IncomingMessage);
|
428
|
-
send(packet: AnyPacket): void;
|
429
|
-
close(): void;
|
430
|
-
on<TConnectionEventPayload>(event: ConnectionEventType, callback: (payload: TConnectionEventPayload) => void): void;
|
431
|
-
onPacket<T extends AnyPacket>(id: T[0], callback: (packet: T) => void): void;
|
432
|
-
off<TConnectionEventPayload>(event: ConnectionEventType, callback: (payload: TConnectionEventPayload) => void): void;
|
433
|
-
offAll(): void;
|
434
|
-
offPacket<T extends AnyPacket>(id: T[0], callback: (packet: T) => void): void;
|
435
|
-
private _onClose;
|
436
|
-
private _onError;
|
437
|
-
private _onMessage;
|
438
|
-
private _serialize;
|
439
|
-
private _deserialize;
|
440
|
-
private _instanceEventType;
|
441
1038
|
}
|
442
1039
|
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
1040
|
+
/**
|
1041
|
+
* A callback function for a chat command.
|
1042
|
+
* @param player - The player that sent the command.
|
1043
|
+
* @param args - An array of arguments, comprised of all space separated text after the command.
|
1044
|
+
* @param message - The full message of the command.
|
1045
|
+
* @public
|
1046
|
+
*/
|
1047
|
+
export declare type CommandCallback = (player: Player, args: string[], message: string) => void;
|
450
1048
|
|
1049
|
+
/** Data for contact forces. @public */
|
451
1050
|
declare type ContactForceData = {
|
1051
|
+
/** The total force vector. */
|
452
1052
|
totalForce: RAPIER.Vector;
|
1053
|
+
/** The magnitude of the total force. */
|
453
1054
|
totalForceMagnitude: number;
|
1055
|
+
/** The direction of the maximum force. */
|
454
1056
|
maxForceDirection: RAPIER.Vector;
|
1057
|
+
/** The magnitude of the maximum force. */
|
455
1058
|
maxForceMagnitude: number;
|
456
1059
|
};
|
457
1060
|
|
1061
|
+
/** A decoded set of collision groups represented as their string equivalents. @public */
|
458
1062
|
export declare type DecodedCollisionGroups = {
|
459
1063
|
belongsTo: string[];
|
460
1064
|
collidesWith: string[];
|
461
1065
|
};
|
462
1066
|
|
1067
|
+
/** The default rigid body options when EntityOptions.rigidBodyOptions is not provided. @public */
|
463
1068
|
export declare const DEFAULT_ENTITY_RIGID_BODY_OPTIONS: RigidBodyOptions;
|
464
1069
|
|
1070
|
+
/**
|
1071
|
+
* The default character controller implementation.
|
1072
|
+
*
|
1073
|
+
* @remarks
|
1074
|
+
* This class extends {@link BaseCharacterController}
|
1075
|
+
* and implements the default movement logic for a
|
1076
|
+
* character entity. This is used as the default for
|
1077
|
+
* players when they join your game. This class may be extended
|
1078
|
+
* if you'd like to implement additional logic on top of the
|
1079
|
+
* DefaultCharacterController implementation.
|
1080
|
+
*
|
1081
|
+
* @example
|
1082
|
+
* ```typescript
|
1083
|
+
* // Create a custom character controller for myEntity, prior to spawning it.
|
1084
|
+
* myEntity.createCustomCharacterController = () => {
|
1085
|
+
* return new DefaultCharacterController(myEntity, {
|
1086
|
+
* jumpVelocity: 10,
|
1087
|
+
* runVelocity: 8,
|
1088
|
+
* walkVelocity: 4,
|
1089
|
+
* });
|
1090
|
+
* };
|
1091
|
+
*
|
1092
|
+
* // Spawn the entity in the world.
|
1093
|
+
* myEntity.spawn(world, { x: 53, y: 10, z: 23 });
|
1094
|
+
* ```
|
1095
|
+
*
|
1096
|
+
* @public
|
1097
|
+
*/
|
465
1098
|
export declare class DefaultCharacterController extends BaseCharacterController {
|
1099
|
+
/** The upward velocity applied to the entity when it jumps. */
|
466
1100
|
jumpVelocity: number;
|
1101
|
+
/** The normalized horizontal velocity applied to the entity when it runs. */
|
467
1102
|
runVelocity: number;
|
1103
|
+
/** The normalized horizontal velocity applied to the entity when it walks. */
|
468
1104
|
walkVelocity: number;
|
1105
|
+
/**
|
1106
|
+
* A function allowing custom logic to determine if the entity can walk.
|
1107
|
+
* @param this - The character controller instance.
|
1108
|
+
* @returns Whether the entity can walk.
|
1109
|
+
*/
|
469
1110
|
canWalk: (this: DefaultCharacterController) => boolean;
|
1111
|
+
/**
|
1112
|
+
* A function allowing custom logic to determine if the entity can run.
|
1113
|
+
* @param this - The character controller instance.
|
1114
|
+
* @returns Whether the entity can run.
|
1115
|
+
*/
|
470
1116
|
canRun: (this: DefaultCharacterController) => boolean;
|
1117
|
+
/**
|
1118
|
+
* A function allowing custom logic to determine if the entity can jump.
|
1119
|
+
* @param this - The character controller instance.
|
1120
|
+
* @returns Whether the entity can jump.
|
1121
|
+
*/
|
471
1122
|
canJump: (this: DefaultCharacterController) => boolean;
|
472
|
-
|
473
|
-
|
474
|
-
|
1123
|
+
|
1124
|
+
|
1125
|
+
|
1126
|
+
/**
|
1127
|
+
* @param entity - The entity the controller is for.
|
1128
|
+
* @param options - Options for the controller.
|
1129
|
+
*/
|
475
1130
|
constructor(entity: Entity, options?: DefaultCharacterControllerOptions);
|
1131
|
+
/** Whether the entity is grounded. */
|
476
1132
|
get isGrounded(): boolean;
|
1133
|
+
/** Whether the entity is on a platform, a platform is any entity with a kinematic rigid body. */
|
477
1134
|
get isOnPlatform(): boolean;
|
1135
|
+
/** The platform the entity is on, if any. */
|
478
1136
|
get platform(): Entity | undefined;
|
1137
|
+
/**
|
1138
|
+
* Creates the sensor colliders for the character controller,
|
1139
|
+
* overriding the default implementation.
|
1140
|
+
* @returns An array of colliders.
|
1141
|
+
*/
|
479
1142
|
createSensorColliders(): Collider[];
|
1143
|
+
/**
|
1144
|
+
* Ticks the player movement for the character controller,
|
1145
|
+
* overriding the default implementation.
|
1146
|
+
* @param inputState - The current input state of the player.
|
1147
|
+
* @param orientationState - The current orientation state of the player.
|
1148
|
+
* @param deltaTimeMs - The delta time in milliseconds since the last tick.
|
1149
|
+
*/
|
480
1150
|
tickPlayerMovement(inputState: PlayerInputState, orientationState: PlayerOrientationState, deltaTimeMs: number): void;
|
1151
|
+
/**
|
1152
|
+
* Ticks the pathfinding movement for the character controller,
|
1153
|
+
* overriding the default implementation.
|
1154
|
+
* @param destination - The destination to move to.
|
1155
|
+
* @param deltaTimeMs - The delta time in milliseconds since the last tick.
|
1156
|
+
*/
|
481
1157
|
tickPathfindingMovement(destination: Vector3, deltaTimeMs: number): void;
|
482
1158
|
}
|
483
1159
|
|
1160
|
+
/** Options for creating a DefaultCharacterController instance. @public */
|
484
1161
|
export declare interface DefaultCharacterControllerOptions {
|
1162
|
+
/** The upward velocity applied to the entity when it jumps. */
|
485
1163
|
jumpVelocity?: number;
|
1164
|
+
/** The normalized horizontal velocity applied to the entity when it runs. */
|
486
1165
|
runVelocity?: number;
|
1166
|
+
/** The normalized horizontal velocity applied to the entity when it walks. */
|
487
1167
|
walkVelocity?: number;
|
1168
|
+
/** A function allowing custom logic to determine if the entity can jump. */
|
488
1169
|
canJump?: () => boolean;
|
1170
|
+
/** A function allowing custom logic to determine if the entity can walk. */
|
489
1171
|
canWalk?: () => boolean;
|
1172
|
+
/** A function allowing custom logic to determine if the entity can run. */
|
490
1173
|
canRun?: () => boolean;
|
491
1174
|
}
|
492
1175
|
|
1176
|
+
/**
|
1177
|
+
* Represents an entity in a world.
|
1178
|
+
*
|
1179
|
+
* @remarks
|
1180
|
+
* Entities are highly configurable and controllable. All
|
1181
|
+
* entities are created from a .gltf model asset and
|
1182
|
+
* allow full control of their rigid body and attached collider
|
1183
|
+
* dynamics.
|
1184
|
+
*
|
1185
|
+
* @example
|
1186
|
+
* ```typescript
|
1187
|
+
* const spider = new Entity({
|
1188
|
+
* name: 'Spider',
|
1189
|
+
* modelUri: 'models/spider.gltf',
|
1190
|
+
* modelLoopedAnimations: [ 'walk' ],
|
1191
|
+
* rigidBodyOptions: {
|
1192
|
+
* type: RigidBodyType.DYNAMIC,
|
1193
|
+
* enabledRotations: { x: false, y: true, z: false },
|
1194
|
+
* colliders: [
|
1195
|
+
* {
|
1196
|
+
* shape: ColliderShape.ROUND_CYLINDER,
|
1197
|
+
* borderRadius: 0.1,
|
1198
|
+
* halfHeight: 0.225,
|
1199
|
+
* radius: 0.5,
|
1200
|
+
* tag: 'body',
|
1201
|
+
* }
|
1202
|
+
* ],
|
1203
|
+
* },
|
1204
|
+
* });
|
1205
|
+
*
|
1206
|
+
* spider.spawn(world, { x: 20, y: 6, z: 10 });
|
1207
|
+
* ```
|
1208
|
+
*
|
1209
|
+
* @public
|
1210
|
+
*/
|
493
1211
|
export declare class Entity extends RigidBody implements protocol.Serializable {
|
1212
|
+
/**
|
1213
|
+
* A function that creates a custom character controller for the entity.
|
1214
|
+
* @param this - The Entity instance.
|
1215
|
+
* @returns A character controller that extends {@link BaseCharacterController}.
|
1216
|
+
*/
|
494
1217
|
createCustomCharacterController?: (this: Entity) => BaseCharacterController;
|
1218
|
+
/**
|
1219
|
+
* A function that is called when the entity collides with a block.
|
1220
|
+
* @param this - The Entity instance.
|
1221
|
+
* @param block - The block that the entity collided with.
|
1222
|
+
* @param started - Whether the collision started or ended.
|
1223
|
+
*/
|
495
1224
|
onBlockCollision?: (this: Entity, block: BlockType, started: boolean) => void;
|
1225
|
+
/**
|
1226
|
+
* A function that is called when the entity collides with a block.
|
1227
|
+
* @param this - The Entity instance.
|
1228
|
+
* @param block - The block that the entity collided with.
|
1229
|
+
* @param contactForceData - The contact force data.
|
1230
|
+
*/
|
496
1231
|
onBlockContactForce?: (this: Entity, block: BlockType, contactForceData: ContactForceData) => void;
|
1232
|
+
/**
|
1233
|
+
* A function that is called when the entity collides with another entity.
|
1234
|
+
* @param this - The Entity instance.
|
1235
|
+
* @param entity - The entity that the entity collided with.
|
1236
|
+
* @param started - Whether the collision started or ended.
|
1237
|
+
*/
|
497
1238
|
onEntityCollision?: (this: Entity, entity: Entity, started: boolean) => void;
|
1239
|
+
/**
|
1240
|
+
* A function that is called when the entity contacts another entity.
|
1241
|
+
* @param this - The Entity instance.
|
1242
|
+
* @param entity - The entity that the entity collided with.
|
1243
|
+
* @param contactForceData - The contact force data.
|
1244
|
+
*/
|
498
1245
|
onEntityContactForce?: (this: Entity, entity: Entity, contactForceData: ContactForceData) => void;
|
1246
|
+
/**
|
1247
|
+
* A function that is called when the entity is spawned.
|
1248
|
+
* @param this - The Entity instance.
|
1249
|
+
*/
|
499
1250
|
onSpawn?: (this: Entity) => void;
|
1251
|
+
/**
|
1252
|
+
* A function that is called when the entity is despawned.
|
1253
|
+
* @param this - The Entity instance.
|
1254
|
+
*/
|
500
1255
|
onDespawn?: (this: Entity) => void;
|
1256
|
+
/**
|
1257
|
+
* A function that is called every tick.
|
1258
|
+
* @param this - The Entity instance.
|
1259
|
+
* @param tickDeltaMs - The delta time in milliseconds since the last tick.
|
1260
|
+
*/
|
501
1261
|
onTick?: (this: Entity, tickDeltaMs: number) => void;
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
1262
|
+
|
1263
|
+
|
1264
|
+
|
1265
|
+
|
1266
|
+
|
1267
|
+
|
1268
|
+
|
1269
|
+
|
1270
|
+
|
1271
|
+
|
1272
|
+
/**
|
1273
|
+
* @param options - The options for the entity.
|
1274
|
+
*/
|
512
1275
|
constructor(options: EntityOptions);
|
1276
|
+
/** The unique identifier for the entity. */
|
513
1277
|
get id(): number | undefined;
|
1278
|
+
/** The URI or path to the .gltf model asset to be used for the entity. */
|
514
1279
|
get modelUri(): string | undefined;
|
1280
|
+
/** The looped animations to start when the entity is spawned. */
|
515
1281
|
get modelLoopedAnimations(): ReadonlySet<string>;
|
1282
|
+
/** The scale of the entity's model. */
|
516
1283
|
get modelScale(): number | undefined;
|
1284
|
+
/** The name of the entity. */
|
517
1285
|
get name(): string;
|
1286
|
+
/** The character controller for the entity. */
|
518
1287
|
get characterController(): BaseCharacterController | undefined;
|
1288
|
+
/** Whether the entity is spawned. */
|
519
1289
|
get isSpawned(): boolean;
|
1290
|
+
/** The world the entity is in. */
|
520
1291
|
get world(): World | undefined;
|
1292
|
+
/**
|
1293
|
+
* Spawns the entity in the world.
|
1294
|
+
* @param world - The world to spawn the entity in.
|
1295
|
+
* @param coordinate - The coordinate to spawn the entity at.
|
1296
|
+
*/
|
521
1297
|
spawn(world: World, coordinate: Vector3): void;
|
1298
|
+
/**
|
1299
|
+
* Despawns the entity from the world.
|
1300
|
+
*/
|
522
1301
|
despawn(): void;
|
1302
|
+
/**
|
1303
|
+
* Sets the character controller for the entity.
|
1304
|
+
* @param characterController - The character controller to set.
|
1305
|
+
*/
|
523
1306
|
setCharacterController(characterController: BaseCharacterController): void;
|
1307
|
+
/**
|
1308
|
+
* Starts looped animations for the entity, blending with
|
1309
|
+
* other animations currently playing.
|
1310
|
+
* @param animations - The animations to start.
|
1311
|
+
*/
|
524
1312
|
startModelLoopedAnimations(animations: string[]): void;
|
1313
|
+
/**
|
1314
|
+
* Starts a oneshot animation for the entity, blending with
|
1315
|
+
* other animations currently playing.
|
1316
|
+
* @param animations - The animations to start.
|
1317
|
+
*/
|
525
1318
|
startModelOneshotAnimations(animations: string[]): void;
|
1319
|
+
/**
|
1320
|
+
* Stops the provided model animations for the entity.
|
1321
|
+
* @param animations - The animations to stop.
|
1322
|
+
*/
|
526
1323
|
stopModelAnimations(animations: string[]): void;
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
1324
|
+
|
1325
|
+
|
1326
|
+
|
1327
|
+
|
1328
|
+
|
1329
|
+
|
1330
|
+
|
534
1331
|
}
|
535
1332
|
|
1333
|
+
/** Payloads for events an Entity instance can emit. @public */
|
536
1334
|
export declare namespace EntityEventPayload {
|
537
1335
|
export interface Despawn {
|
538
1336
|
entity: Entity;
|
@@ -562,6 +1360,7 @@ export declare namespace EntityEventPayload {
|
|
562
1360
|
}
|
563
1361
|
}
|
564
1362
|
|
1363
|
+
/** Event types an Entity instance can emit. @public */
|
565
1364
|
export declare enum EntityEventType {
|
566
1365
|
DESPAWN = "ENTITY.DESPAWN",
|
567
1366
|
SPAWN = "ENTITY.SPAWN",
|
@@ -572,63 +1371,199 @@ export declare enum EntityEventType {
|
|
572
1371
|
UPDATE_TRANSLATION = "ENTITY.UPDATE_TRANSLATION"
|
573
1372
|
}
|
574
1373
|
|
1374
|
+
/**
|
1375
|
+
* Manages entities in a world.
|
1376
|
+
*
|
1377
|
+
* @remarks
|
1378
|
+
* The EntityManager is created internally as a singleton
|
1379
|
+
* for each {@link World} instance in a game server.
|
1380
|
+
* It allows retrieval of all entities, player entities,
|
1381
|
+
* and more.
|
1382
|
+
*
|
1383
|
+
* @example
|
1384
|
+
* ```typescript
|
1385
|
+
* // Get all entities in the world
|
1386
|
+
* const entityManager = world.entityManager;
|
1387
|
+
* const entities = entityManager.getAllEntities();
|
1388
|
+
* ```
|
1389
|
+
*
|
1390
|
+
* @public
|
1391
|
+
*/
|
575
1392
|
export declare class EntityManager {
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
1393
|
+
|
1394
|
+
|
1395
|
+
|
1396
|
+
|
1397
|
+
/** The world the entity manager is for. */
|
580
1398
|
get world(): World;
|
581
|
-
|
582
|
-
|
1399
|
+
|
1400
|
+
|
1401
|
+
/**
|
1402
|
+
* Gets all spawned entities in the world.
|
1403
|
+
* @returns All spawned entities in the world.
|
1404
|
+
*/
|
583
1405
|
getAllEntities(): Entity[];
|
1406
|
+
/**
|
1407
|
+
* Gets all spawned entities in the world assigned to a player.
|
1408
|
+
* @param player - The player to get the entities for.
|
1409
|
+
* @returns All spawned entities in the world assigned to the player.
|
1410
|
+
*/
|
584
1411
|
getAllPlayerEntities(player: Player): PlayerEntity[];
|
1412
|
+
/**
|
1413
|
+
* Gets a spawned entity in the world by its id.
|
1414
|
+
* @param id - The id of the entity to get.
|
1415
|
+
* @returns The spawned entity with the provided id, or undefined if no entity is found.
|
1416
|
+
*/
|
585
1417
|
getEntity<T extends Entity>(id: number): T | undefined;
|
586
|
-
|
587
|
-
|
1418
|
+
|
1419
|
+
|
588
1420
|
}
|
589
1421
|
|
1422
|
+
/** Options for creating an Entity instance. @public */
|
590
1423
|
export declare interface EntityOptions {
|
1424
|
+
/** The URI or path to the .gltf model asset to be used for the entity. */
|
591
1425
|
modelUri?: string;
|
1426
|
+
/** The looped animations to start when the entity is spawned. */
|
592
1427
|
modelLoopedAnimations?: string[];
|
1428
|
+
/** The scale of the entity's model. */
|
593
1429
|
modelScale?: number;
|
1430
|
+
/** The name of the entity. */
|
594
1431
|
name?: string;
|
1432
|
+
/** The rigid body options for the entity. */
|
595
1433
|
rigidBodyOptions?: RigidBodyOptions;
|
596
1434
|
}
|
597
1435
|
|
1436
|
+
/** An EventRouter event. @public */
|
598
1437
|
declare interface Event_2<TPayload> {
|
1438
|
+
/** The type of event */
|
599
1439
|
type: string;
|
1440
|
+
/** The payload of the event, passed to listeners */
|
600
1441
|
payload: TPayload;
|
601
1442
|
}
|
602
1443
|
export { Event_2 as Event }
|
603
1444
|
|
1445
|
+
/**
|
1446
|
+
* Manages event emission and assigned listener callbacks.
|
1447
|
+
*
|
1448
|
+
* @remarks
|
1449
|
+
* This class is used as a singleton for global server events via
|
1450
|
+
* {@link EventRouter.serverInstance}. For individual worlds, an
|
1451
|
+
* internal EventRouter instance is instantiated per world. EventRouters
|
1452
|
+
* only have visibility of events emitted and subscribed to relative to
|
1453
|
+
* their unique instances.
|
1454
|
+
*
|
1455
|
+
* @public
|
1456
|
+
*/
|
604
1457
|
export declare class EventRouter {
|
1458
|
+
/** The singleton instance for global server events. */
|
605
1459
|
static readonly serverInstance: EventRouter;
|
606
1460
|
private _emitter;
|
607
1461
|
private _wrappedListenerMap;
|
608
1462
|
private _tag;
|
1463
|
+
/** Enable logging of all events. Default: false */
|
609
1464
|
logAllEvents: boolean;
|
1465
|
+
/** Enable logging of event payloads. Default: false */
|
610
1466
|
logEventsPayloads: boolean;
|
1467
|
+
/** Enable logging of events with no listeners. Default: false */
|
611
1468
|
logUnlistenedEvents: boolean;
|
1469
|
+
/** Array of events to exclude from logging */
|
612
1470
|
logIgnoreEvents: string[];
|
1471
|
+
/** Array of event prefixes to exclude from logging */
|
613
1472
|
logIgnoreEventPrefixes: string[];
|
1473
|
+
/** @param tag - Tag for logging, used to identify EventRouter instances in logs. */
|
614
1474
|
constructor(tag: string);
|
1475
|
+
/**
|
1476
|
+
* Register a listener for a specific event type.
|
1477
|
+
*
|
1478
|
+
* @remarks
|
1479
|
+
* When the same event router instance used to register a listener
|
1480
|
+
* emits an event a listener was registered for, the listener will
|
1481
|
+
* be invoked with the event payload. Listeners are called in the order
|
1482
|
+
* they are registered.
|
1483
|
+
*
|
1484
|
+
* @param eventType - The type of event to listen for.
|
1485
|
+
* @param listener - The listener function to invoke when the event is emitted.
|
1486
|
+
*/
|
615
1487
|
on<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
|
1488
|
+
/**
|
1489
|
+
* Remove a listener for a specific event type.
|
1490
|
+
*
|
1491
|
+
* @param eventType - The type of event to remove the listener from.
|
1492
|
+
* @param listener - The listener function to remove.
|
1493
|
+
*/
|
616
1494
|
off<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
|
1495
|
+
/**
|
1496
|
+
* Remove all listeners for a specific event type.
|
1497
|
+
*
|
1498
|
+
* @param eventType - The type of event to remove all listeners from.
|
1499
|
+
*/
|
617
1500
|
offAll(eventType: string): void;
|
1501
|
+
/**
|
1502
|
+
* Emit an event, invoking all registered listeners for the event type.
|
1503
|
+
*
|
1504
|
+
* @param event - The event to emit.
|
1505
|
+
* @returns `true` if listeners were found and invoked, `false` otherwise.
|
1506
|
+
*/
|
618
1507
|
emit<TPayload>(event: Event_2<TPayload>): boolean;
|
619
1508
|
}
|
620
1509
|
|
1510
|
+
/**
|
1511
|
+
* Manages the game and associated worlds and systems.
|
1512
|
+
*
|
1513
|
+
* @remarks
|
1514
|
+
* This class is used as a singleton and should be
|
1515
|
+
* accessed via the `instance` property
|
1516
|
+
*
|
1517
|
+
* @public
|
1518
|
+
*/
|
1519
|
+
export declare class GameServer {
|
1520
|
+
|
1521
|
+
|
1522
|
+
|
1523
|
+
|
1524
|
+
|
1525
|
+
|
1526
|
+
/** The singleton instance of the game server. */
|
1527
|
+
static get instance(): GameServer;
|
1528
|
+
/** The player manager for the game server. */
|
1529
|
+
get playerManager(): PlayerManager;
|
1530
|
+
|
1531
|
+
|
1532
|
+
/** The worlds managed by the game server. */
|
1533
|
+
get worlds(): {
|
1534
|
+
[id: string]: World;
|
1535
|
+
};
|
1536
|
+
|
1537
|
+
|
1538
|
+
}
|
1539
|
+
|
1540
|
+
/** Payloads for events emitted by a GameServer instance. @public */
|
1541
|
+
export declare namespace GameServerEventPayload {
|
1542
|
+
export interface Start {
|
1543
|
+
startedAtMs: number;
|
1544
|
+
}
|
1545
|
+
export interface Stop {
|
1546
|
+
stoppedAtMs: number;
|
1547
|
+
}
|
1548
|
+
}
|
1549
|
+
|
1550
|
+
/** Event types a GameServer instance can emit. @public */
|
1551
|
+
export declare enum GameServerEventType {
|
1552
|
+
START = "GAMESERVER.START",
|
1553
|
+
STOP = "GAMESERVER.STOP"
|
1554
|
+
}
|
1555
|
+
|
621
1556
|
declare namespace HYTOPIA {
|
622
1557
|
export {
|
623
1558
|
Audio,
|
624
1559
|
AudioEventType,
|
625
|
-
|
1560
|
+
AudioOptions,
|
626
1561
|
AudioEventPayload,
|
627
1562
|
AudioManager,
|
628
1563
|
BaseCharacterController,
|
629
1564
|
Block,
|
630
1565
|
BlockType,
|
631
|
-
|
1566
|
+
BlockTypeOptions,
|
632
1567
|
BlockTypeRegistry,
|
633
1568
|
BlockTypeRegistryEventType,
|
634
1569
|
BlockTypeRegistryEventPayload,
|
@@ -643,9 +1578,7 @@ declare namespace HYTOPIA {
|
|
643
1578
|
Collider,
|
644
1579
|
ColliderShape,
|
645
1580
|
ColliderOptions,
|
646
|
-
ColliderMap,
|
647
1581
|
CollisionCallback,
|
648
|
-
CollisionObject,
|
649
1582
|
CollisionGroupsBuilder,
|
650
1583
|
CollisionGroup,
|
651
1584
|
CollisionGroups,
|
@@ -656,126 +1589,138 @@ declare namespace HYTOPIA {
|
|
656
1589
|
Entity,
|
657
1590
|
EntityEventType,
|
658
1591
|
DEFAULT_ENTITY_RIGID_BODY_OPTIONS,
|
659
|
-
ROTATION_UPDATE_THRESHOLD,
|
660
|
-
TRANSLATION_UPDATE_THRESHOLD_SQ,
|
661
1592
|
EntityOptions,
|
662
1593
|
EntityEventPayload,
|
663
1594
|
EntityManager,
|
664
1595
|
EventRouter,
|
665
1596
|
Event_2 as Event,
|
1597
|
+
GameServer,
|
1598
|
+
GameServerEventType,
|
666
1599
|
startServer,
|
1600
|
+
GameServerEventPayload,
|
667
1601
|
Rotation,
|
668
1602
|
SpdMatrix3,
|
669
1603
|
Vector3,
|
670
1604
|
Vector3Boolean,
|
671
1605
|
Player,
|
672
1606
|
PlayerEventType,
|
1607
|
+
SUPPORTED_INPUT_KEYS,
|
673
1608
|
PlayerInputState,
|
674
1609
|
PlayerOrientationState,
|
675
1610
|
PlayerEventPayload,
|
676
1611
|
PlayerEntity,
|
677
1612
|
PlayerEntityOptions,
|
678
1613
|
PlayerManager,
|
679
|
-
PlayerManagerEventType,
|
680
|
-
PlayerManagerEventPayload,
|
681
1614
|
RigidBody,
|
682
1615
|
RigidBodyType,
|
683
1616
|
RigidBodyAdditionalMassProperties,
|
684
1617
|
RigidBodyOptions,
|
685
1618
|
Simulation,
|
686
|
-
Ticker,
|
687
1619
|
World,
|
688
|
-
|
1620
|
+
WorldMap,
|
1621
|
+
WorldOptions,
|
689
1622
|
WorldLoop
|
690
1623
|
}
|
691
1624
|
}
|
692
1625
|
export default HYTOPIA;
|
693
1626
|
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
private _spawnedEntities;
|
705
|
-
private _world;
|
706
|
-
constructor(world: World);
|
707
|
-
synchronize(): void;
|
708
|
-
private _subscribeToAudioEvents;
|
709
|
-
private _subscribeToBlockTypeRegistryEvents;
|
710
|
-
private _subscribeToChatEvents;
|
711
|
-
private _subscribeToChunkEvents;
|
712
|
-
private _subscribeToEntityEvents;
|
713
|
-
private _subscribeToPlayerEvents;
|
714
|
-
private _subscribeToSimulationEvents;
|
715
|
-
private _onAudioPause;
|
716
|
-
private _onAudioPlay;
|
717
|
-
private _onAudioPlayRestart;
|
718
|
-
private _onAudioSetAttachedToEntity;
|
719
|
-
private _onAudioSetDetune;
|
720
|
-
private _onAudioSetDistortion;
|
721
|
-
private _onAudioSetPosition;
|
722
|
-
private _onAudioSetPlaybackRate;
|
723
|
-
private _onAudioSetReferenceDistance;
|
724
|
-
private _onAudioSetVolume;
|
725
|
-
private _onBlockTypeRegistryRegisterBlockType;
|
726
|
-
private _onChatSendBroadcastMessage;
|
727
|
-
private _onChatSendPlayerMessage;
|
728
|
-
private _onChunkSpawn;
|
729
|
-
private _onChunkDespawn;
|
730
|
-
private _onChunkSetBlock;
|
731
|
-
private _onEntitySpawn;
|
732
|
-
private _onEntityDespawn;
|
733
|
-
private _onEntityStartModelLoopedAnimations;
|
734
|
-
private _onEntityStartModelOneshotAnimations;
|
735
|
-
private _onEntityStopModelAnimations;
|
736
|
-
private _onEntityUpdateRotation;
|
737
|
-
private _onEntityUpdateTranslation;
|
738
|
-
private _onPlayerJoinedWorld;
|
739
|
-
private _onPlayerLeftWorld;
|
740
|
-
private _onPlayerRequestSync;
|
741
|
-
private _onSimulationDebugRaycast;
|
742
|
-
private _onSimulationDebugRender;
|
743
|
-
private _createOrGetQueuedAudioSync;
|
744
|
-
private _createOrGetQueuedBlockSync;
|
745
|
-
private _createOrGetQueuedChunkSync;
|
746
|
-
private _createOrGetQueuedEntitySync;
|
747
|
-
}
|
748
|
-
|
1627
|
+
/**
|
1628
|
+
* A player in the game.
|
1629
|
+
*
|
1630
|
+
* @remarks
|
1631
|
+
* Players are automatically created when they connect and
|
1632
|
+
* authenticate with the game server. This is all handled
|
1633
|
+
* internally.
|
1634
|
+
*
|
1635
|
+
* @public
|
1636
|
+
*/
|
749
1637
|
export declare class Player {
|
1638
|
+
/** The unique identifier for the player. */
|
750
1639
|
readonly id: number;
|
1640
|
+
/** The username for the player. */
|
751
1641
|
readonly username: string;
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
1642
|
+
|
1643
|
+
|
1644
|
+
|
1645
|
+
|
1646
|
+
|
1647
|
+
/** The current {@link PlayerInputState} of the player. */
|
757
1648
|
get inputState(): Readonly<PlayerInputState>;
|
1649
|
+
/** The current {@link PlayerOrientationState} of the player. */
|
758
1650
|
get orientationState(): Readonly<PlayerOrientationState>;
|
1651
|
+
/** The current {@link World} the player is in. */
|
759
1652
|
get world(): World | undefined;
|
1653
|
+
/**
|
1654
|
+
* Joins a player to a world.
|
1655
|
+
*
|
1656
|
+
* @remarks
|
1657
|
+
* If the player is already in a {@link World}, they
|
1658
|
+
* will be removed from their current world before joining
|
1659
|
+
* the new world.
|
1660
|
+
*
|
1661
|
+
* @param world - The world to join the player to.
|
1662
|
+
*/
|
760
1663
|
joinWorld(world: World): void;
|
1664
|
+
/**
|
1665
|
+
* Removes the player from the current {@link World} they are in.
|
1666
|
+
*/
|
761
1667
|
leaveWorld(): void;
|
1668
|
+
/**
|
1669
|
+
* Disconnects the player from the game server.
|
1670
|
+
*/
|
762
1671
|
disconnect(): void;
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
1672
|
+
|
1673
|
+
|
1674
|
+
|
1675
|
+
|
767
1676
|
}
|
768
1677
|
|
1678
|
+
/**
|
1679
|
+
* Represents an entity controlled by a player in a world.
|
1680
|
+
*
|
1681
|
+
* @remarks
|
1682
|
+
* Player entities extend the {@link Entity} class.
|
1683
|
+
* They can be created and assigned to a player when
|
1684
|
+
* a player joins a world. PlayerEntity automatically
|
1685
|
+
* handles mapping player inputs to the associated
|
1686
|
+
* character controller of the entity, calling the
|
1687
|
+
* character controller's onTickPlayerMovement method
|
1688
|
+
* when player input has changed.
|
1689
|
+
*
|
1690
|
+
* @example
|
1691
|
+
* ```typescript
|
1692
|
+
* world.onPlayerJoin = player => {
|
1693
|
+
* const playerEntity = new PlayerEntity({
|
1694
|
+
* player,
|
1695
|
+
* name: 'Player',
|
1696
|
+
* modelUri: 'models/player-with-gun.gltf',
|
1697
|
+
* modelLoopedAnimations: [ 'idle' ],
|
1698
|
+
* modelScale: 0.5,
|
1699
|
+
* });
|
1700
|
+
*
|
1701
|
+
* playerEntity.spawn(world, { x: 10, y: 20, z: 15 });
|
1702
|
+
* };
|
1703
|
+
* ```
|
1704
|
+
*
|
1705
|
+
* @public
|
1706
|
+
*/
|
769
1707
|
export declare class PlayerEntity extends Entity {
|
770
|
-
player
|
1708
|
+
/** The player the player entity is assigned to and controlled by. */
|
1709
|
+
readonly player: Player;
|
1710
|
+
/**
|
1711
|
+
* @param options - The options for the player entity.
|
1712
|
+
*/
|
771
1713
|
constructor(options: PlayerEntityOptions);
|
772
|
-
|
1714
|
+
|
773
1715
|
}
|
774
1716
|
|
1717
|
+
/** Options for creating a PlayerEntity instance. @public */
|
775
1718
|
export declare interface PlayerEntityOptions extends EntityOptions {
|
1719
|
+
/** The player the player entity is assigned to. */
|
776
1720
|
player: Player;
|
777
1721
|
}
|
778
1722
|
|
1723
|
+
/** Payloads for events a Player can emit. @public */
|
779
1724
|
export declare namespace PlayerEventPayload {
|
780
1725
|
export interface ChatMessageSend {
|
781
1726
|
player: Player;
|
@@ -796,6 +1741,7 @@ export declare namespace PlayerEventPayload {
|
|
796
1741
|
}
|
797
1742
|
}
|
798
1743
|
|
1744
|
+
/** Event types a Player can emit. @public */
|
799
1745
|
export declare enum PlayerEventType {
|
800
1746
|
CHAT_MESSAGE_SEND = "PLAYER.CHAT_MESSAGE_SEND",
|
801
1747
|
JOINED_WORLD = "PLAYER.JOINED_WORLD",
|
@@ -803,157 +1749,467 @@ export declare enum PlayerEventType {
|
|
803
1749
|
REQUEST_SYNC = "PLAYER.REQUEST_SYNC"
|
804
1750
|
}
|
805
1751
|
|
1752
|
+
/** The input state of a Player; keys from SUPPORTED_INPUT_KEYS. @public */
|
806
1753
|
export declare type PlayerInputState = Partial<Record<keyof InputSchema, boolean>>;
|
807
1754
|
|
1755
|
+
/**
|
1756
|
+
* Manages all connected players in a game server.
|
1757
|
+
*
|
1758
|
+
* @remarks
|
1759
|
+
* The PlayerManager is created internally as a global
|
1760
|
+
* singleton accessible with the static property
|
1761
|
+
* `PlayerManager.instance`.
|
1762
|
+
*
|
1763
|
+
* @example
|
1764
|
+
* ```typescript
|
1765
|
+
* import { PlayerManager } from 'hytopia';
|
1766
|
+
*
|
1767
|
+
* const playerManager = PlayerManager.instance;
|
1768
|
+
* const connectedPlayers = playerManager.getConnectedPlayers();
|
1769
|
+
* ```
|
1770
|
+
*
|
1771
|
+
* @public
|
1772
|
+
*/
|
808
1773
|
export declare class PlayerManager {
|
1774
|
+
/** The global PlayerManager instance as a singleton. */
|
809
1775
|
static readonly instance: PlayerManager;
|
810
|
-
private _connectionPlayers;
|
811
|
-
private constructor();
|
812
|
-
broadcast(packet: IPacket<number, any>): void;
|
813
|
-
broadcastForWorld(worldId: number, packet: IPacket<number, any>): void;
|
814
|
-
private _onConnectionOpened;
|
815
|
-
private _onConnectionClosed;
|
816
|
-
}
|
817
1776
|
|
818
|
-
export declare namespace PlayerManagerEventPayload {
|
819
|
-
export interface PlayerConnected {
|
820
|
-
player: Player;
|
821
|
-
}
|
822
|
-
export interface PlayerDisconnected {
|
823
|
-
player: Player;
|
824
|
-
}
|
825
|
-
}
|
826
1777
|
|
827
|
-
|
828
|
-
|
829
|
-
|
1778
|
+
|
1779
|
+
|
1780
|
+
/**
|
1781
|
+
* Get all connected players.
|
1782
|
+
* @returns An array of all connected players.
|
1783
|
+
*/
|
1784
|
+
getConnectedPlayers(): Player[];
|
1785
|
+
/**
|
1786
|
+
* Get a connected player by their username (case insensitive).
|
1787
|
+
* @param username - The username of the player to get.
|
1788
|
+
* @returns The connected player with the given username or undefined if not found.
|
1789
|
+
*/
|
1790
|
+
getConnectedPlayerByUsername(username: string): Player | undefined;
|
1791
|
+
|
1792
|
+
|
830
1793
|
}
|
831
1794
|
|
1795
|
+
/** The camera orientation state of a Player. @public */
|
832
1796
|
export declare type PlayerOrientationState = {
|
833
1797
|
pitch: number;
|
834
1798
|
yaw: number;
|
835
1799
|
};
|
836
1800
|
|
1801
|
+
/** A raw set of collision groups represented as a 32-bit number. @public */
|
837
1802
|
export declare type RawCollisionGroups = RAPIER.InteractionGroups;
|
838
1803
|
|
1804
|
+
/** Options for raycasting. @public */
|
839
1805
|
declare type RayCastOptions = {
|
1806
|
+
/** Whether to ignore sensor colliders. */
|
840
1807
|
ignoresSensors?: boolean;
|
1808
|
+
/** The query filter flags. */
|
841
1809
|
filterFlags?: RAPIER.QueryFilterFlags;
|
1810
|
+
/** The collision group to filter by. */
|
842
1811
|
filterGroups?: number;
|
1812
|
+
/** The collider to exclude. */
|
843
1813
|
filterExcludeCollider?: RAPIER.Collider;
|
1814
|
+
/** The rigid body to exclude. */
|
844
1815
|
filterExcludeRigidBody?: RAPIER.RigidBody;
|
1816
|
+
/** The predicate to filter by. */
|
845
1817
|
filterPredicate?: (collider: RAPIER.Collider) => boolean;
|
846
1818
|
};
|
847
1819
|
|
1820
|
+
/**
|
1821
|
+
* Represents a rigid body in a world's physics simulation.
|
1822
|
+
*
|
1823
|
+
* @remarks
|
1824
|
+
* Rigid bodies are the core of the physics simulation. They are
|
1825
|
+
* used to represent physical objects (IE: entities) that can
|
1826
|
+
* interact with each other.
|
1827
|
+
*
|
1828
|
+
* @public
|
1829
|
+
*/
|
848
1830
|
export declare class RigidBody {
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
1831
|
+
|
1832
|
+
|
1833
|
+
|
1834
|
+
|
1835
|
+
|
1836
|
+
|
1837
|
+
|
1838
|
+
|
1839
|
+
|
1840
|
+
|
1841
|
+
/**
|
1842
|
+
* @param options - The options for the rigid body instance.
|
1843
|
+
*/
|
859
1844
|
constructor(options: RigidBodyOptions);
|
1845
|
+
/** The colliders of the rigid body. */
|
860
1846
|
get colliders(): Set<Collider>;
|
1847
|
+
/** Whether the rigid body has continuous collision detection enabled. */
|
861
1848
|
get isCcdEnabled(): boolean;
|
1849
|
+
/** Whether the rigid body is dynamic. */
|
862
1850
|
get isDynamic(): boolean;
|
1851
|
+
/** Whether the rigid body is enabled. */
|
863
1852
|
get isEnabled(): boolean;
|
1853
|
+
/** Whether the rigid body is fixed. */
|
864
1854
|
get isFixed(): boolean;
|
1855
|
+
/** Whether the rigid body is kinematic. */
|
865
1856
|
get isKinematic(): boolean;
|
1857
|
+
/** Whether the rigid body is kinematic position based. */
|
866
1858
|
get isKinematicPositionBased(): boolean;
|
1859
|
+
/** Whether the rigid body is kinematic velocity based. */
|
867
1860
|
get isKinematicVelocityBased(): boolean;
|
1861
|
+
/** Whether the rigid body is moving. */
|
868
1862
|
get isMoving(): boolean;
|
1863
|
+
/** Whether the rigid body has been removed from the simulation. */
|
869
1864
|
get isRemoved(): boolean;
|
1865
|
+
/** Whether the rigid body is simulated. */
|
870
1866
|
get isSimulated(): boolean;
|
1867
|
+
/** Whether the rigid body is sleeping. */
|
871
1868
|
get isSleeping(): boolean;
|
1869
|
+
/** The number of colliders in the rigid body. */
|
872
1870
|
get numColliders(): number;
|
1871
|
+
/** The raw RAPIER rigid body instance. */
|
873
1872
|
get rawRigidBody(): RAPIER.RigidBody | undefined;
|
1873
|
+
/** An arbitrary identifier tag of the rigid body. Useful for your own logic. */
|
874
1874
|
get tag(): string | undefined;
|
1875
|
+
/**
|
1876
|
+
* Gets the additional mass of the rigid body.
|
1877
|
+
* @returns The additional mass of the rigid body.
|
1878
|
+
*/
|
875
1879
|
getAdditionalMass(): number;
|
1880
|
+
/**
|
1881
|
+
* Gets the additional solver iterations of the rigid body.
|
1882
|
+
* @returns The additional solver iterations of the rigid body.
|
1883
|
+
*/
|
876
1884
|
getAdditionalSolverIterations(): number;
|
1885
|
+
/**
|
1886
|
+
* Gets the angular damping of the rigid body.
|
1887
|
+
* @returns The angular damping of the rigid body.
|
1888
|
+
*/
|
877
1889
|
getAngularDamping(): number;
|
1890
|
+
/**
|
1891
|
+
* Gets the angular velocity of the rigid body.
|
1892
|
+
* @returns The angular velocity of the rigid body.
|
1893
|
+
*/
|
878
1894
|
getAngularVelocity(): Vector3;
|
1895
|
+
/**
|
1896
|
+
* Gets the colliders of the rigid body by tag.
|
1897
|
+
* @param tag - The tag to filter by.
|
1898
|
+
* @returns The colliders of the rigid body with the given tag.
|
1899
|
+
*/
|
879
1900
|
getCollidersByTag(tag: string): Collider[];
|
1901
|
+
/**
|
1902
|
+
* Gets the dominance group of the rigid body.
|
1903
|
+
* @returns The dominance group of the rigid body.
|
1904
|
+
*/
|
880
1905
|
getDominanceGroup(): number;
|
1906
|
+
/**
|
1907
|
+
* Gets the direction from the rotation of the rigid body.
|
1908
|
+
* @returns The direction from the rotation of the rigid body.
|
1909
|
+
*/
|
881
1910
|
getDirectionFromRotation(): Vector3;
|
1911
|
+
/**
|
1912
|
+
* Gets the effective angular inertia of the rigid body.
|
1913
|
+
* @returns The effective angular inertia of the rigid body.
|
1914
|
+
*/
|
882
1915
|
getEffectiveAngularInertia(): SpdMatrix3 | undefined;
|
1916
|
+
/**
|
1917
|
+
* Gets the effective inverse mass of the rigid body.
|
1918
|
+
* @returns The effective inverse mass of the rigid body.
|
1919
|
+
*/
|
883
1920
|
getEffectiveInverseMass(): Vector3 | undefined;
|
1921
|
+
/**
|
1922
|
+
* Gets the effective world inverse principal angular inertia square root of the rigid body.
|
1923
|
+
* @returns The effective world inverse principal angular inertia square root of the rigid body.
|
1924
|
+
*/
|
884
1925
|
getEffectiveWorldInversePrincipalAngularInertiaSqrt(): SpdMatrix3 | undefined;
|
1926
|
+
/**
|
1927
|
+
* Gets the enabled rotations of the rigid body.
|
1928
|
+
* @returns The enabled rotations of the rigid body.
|
1929
|
+
*/
|
885
1930
|
getEnabledRotations(): Vector3Boolean;
|
1931
|
+
/**
|
1932
|
+
* Gets the enabled translations of the rigid body.
|
1933
|
+
* @returns The enabled translations of the rigid body.
|
1934
|
+
*/
|
886
1935
|
getEnabledTranslations(): Vector3Boolean;
|
1936
|
+
/**
|
1937
|
+
* Gets the gravity scale of the rigid body.
|
1938
|
+
* @returns The gravity scale of the rigid body.
|
1939
|
+
*/
|
887
1940
|
getGravityScale(): number;
|
1941
|
+
/**
|
1942
|
+
* Gets the inverse mass of the rigid body.
|
1943
|
+
* @returns The inverse mass of the rigid body.
|
1944
|
+
*/
|
888
1945
|
getInverseMass(): number | undefined;
|
1946
|
+
/**
|
1947
|
+
* Gets the inverse principal angular inertia square root of the rigid body.
|
1948
|
+
* @returns The inverse principal angular inertia square root of the rigid body.
|
1949
|
+
*/
|
889
1950
|
getInversePrincipalAngularInertiaSqrt(): Vector3 | undefined;
|
1951
|
+
/**
|
1952
|
+
* Gets the linear damping of the rigid body.
|
1953
|
+
* @returns The linear damping of the rigid body.
|
1954
|
+
*/
|
890
1955
|
getLinearDamping(): number;
|
1956
|
+
/**
|
1957
|
+
* Gets the linear velocity of the rigid body.
|
1958
|
+
* @returns The linear velocity of the rigid body.
|
1959
|
+
*/
|
891
1960
|
getLinearVelocity(): Vector3;
|
1961
|
+
/**
|
1962
|
+
* Gets the local center of mass of the rigid body.
|
1963
|
+
* @returns The local center of mass of the rigid body.
|
1964
|
+
*/
|
892
1965
|
getLocalCenterOfMass(): Vector3;
|
1966
|
+
/**
|
1967
|
+
* Gets the mass of the rigid body.
|
1968
|
+
* @returns The mass of the rigid body.
|
1969
|
+
*/
|
893
1970
|
getMass(): number;
|
1971
|
+
/**
|
1972
|
+
* Gets the next kinematic rotation of the rigid body.
|
1973
|
+
* @returns The next kinematic rotation of the rigid body.
|
1974
|
+
*/
|
894
1975
|
getNextKinematicRotation(): Rotation;
|
1976
|
+
/**
|
1977
|
+
* Gets the next kinematic translation of the rigid body.
|
1978
|
+
* @returns The next kinematic translation of the rigid body.
|
1979
|
+
*/
|
895
1980
|
getNextKinematicTranslation(): Vector3;
|
1981
|
+
/**
|
1982
|
+
* Gets the principal angular inertia of the rigid body.
|
1983
|
+
* @returns The principal angular inertia of the rigid body.
|
1984
|
+
*/
|
896
1985
|
getPrincipalAngularInertia(): Vector3;
|
1986
|
+
/**
|
1987
|
+
* Gets the principal angular inertia local frame of the rigid body.
|
1988
|
+
* @returns The principal angular inertia local frame of the rigid body.
|
1989
|
+
*/
|
897
1990
|
getPrincipalAngularInertiaLocalFrame(): Rotation | undefined;
|
1991
|
+
/**
|
1992
|
+
* Gets the rotation of the rigid body.
|
1993
|
+
* @returns The rotation of the rigid body.
|
1994
|
+
*/
|
898
1995
|
getRotation(): Rotation;
|
1996
|
+
/**
|
1997
|
+
* Gets the soft ccd prediction of the rigid body.
|
1998
|
+
* @returns The soft ccd prediction of the rigid body.
|
1999
|
+
*/
|
899
2000
|
getSoftCcdPrediction(): number;
|
2001
|
+
/**
|
2002
|
+
* Gets the translation of the rigid body.
|
2003
|
+
* @returns The translation of the rigid body.
|
2004
|
+
*/
|
900
2005
|
getTranslation(): Vector3;
|
2006
|
+
/**
|
2007
|
+
* Gets the type of the rigid body.
|
2008
|
+
* @returns The type of the rigid body.
|
2009
|
+
*/
|
901
2010
|
getType(): RigidBodyType;
|
2011
|
+
/**
|
2012
|
+
* Gets the world center of mass of the rigid body.
|
2013
|
+
* @returns The world center of mass of the rigid body.
|
2014
|
+
*/
|
902
2015
|
getWorldCenterOfMass(): Vector3 | undefined;
|
2016
|
+
/**
|
2017
|
+
* Sets the additional mass of the rigid body.
|
2018
|
+
* @param additionalMass - The additional mass of the rigid body.
|
2019
|
+
*/
|
903
2020
|
setAdditionalMass(additionalMass: number): void;
|
2021
|
+
/**
|
2022
|
+
* Sets the additional mass properties of the rigid body.
|
2023
|
+
* @param additionalMassProperties - The additional mass properties of the rigid body.
|
2024
|
+
*/
|
904
2025
|
setAdditionalMassProperties(additionalMassProperties: RigidBodyAdditionalMassProperties): void;
|
2026
|
+
/**
|
2027
|
+
* Sets the additional solver iterations of the rigid body.
|
2028
|
+
* @param solverIterations - The additional solver iterations of the rigid body.
|
2029
|
+
*/
|
905
2030
|
setAdditionalSolverIterations(solverIterations: number): void;
|
2031
|
+
/**
|
2032
|
+
* Sets the angular damping of the rigid body.
|
2033
|
+
* @param angularDamping - The angular damping of the rigid body.
|
2034
|
+
*/
|
906
2035
|
setAngularDamping(angularDamping: number): void;
|
2036
|
+
/**
|
2037
|
+
* Sets the angular velocity of the rigid body.
|
2038
|
+
* @param angularVelocity - The angular velocity of the rigid body.
|
2039
|
+
*/
|
907
2040
|
setAngularVelocity(angularVelocity: Vector): void;
|
2041
|
+
/**
|
2042
|
+
* Sets whether the rigid body has continuous collision detection enabled.
|
2043
|
+
* @param ccdEnabled - Whether the rigid body has continuous collision detection enabled.
|
2044
|
+
*/
|
908
2045
|
setCcdEnabled(ccdEnabled: boolean): void;
|
2046
|
+
/**
|
2047
|
+
* Sets the dominance group of the rigid body.
|
2048
|
+
* @param dominanceGroup - The dominance group of the rigid body.
|
2049
|
+
*/
|
909
2050
|
setDominanceGroup(dominanceGroup: number): void;
|
2051
|
+
/**
|
2052
|
+
* Sets whether the rigid body is enabled.
|
2053
|
+
* @param enabled - Whether the rigid body is enabled.
|
2054
|
+
*/
|
910
2055
|
setEnabled(enabled: boolean): void;
|
2056
|
+
/**
|
2057
|
+
* Sets whether the rigid body has enabled rotations.
|
2058
|
+
* @param enabledRotations - Whether the rigid body has enabled rotations.
|
2059
|
+
*/
|
911
2060
|
setEnabledRotations(enabledRotations: Vector3Boolean): void;
|
2061
|
+
/**
|
2062
|
+
* Sets whether the rigid body has enabled translations.
|
2063
|
+
* @param enabledTranslations - Whether the rigid body has enabled translations.
|
2064
|
+
*/
|
912
2065
|
setEnabledTranslations(enabledTranslations: Vector3Boolean): void;
|
2066
|
+
/**
|
2067
|
+
* Sets the gravity scale of the rigid body.
|
2068
|
+
* @param gravityScale - The gravity scale of the rigid body.
|
2069
|
+
*/
|
913
2070
|
setGravityScale(gravityScale: number): void;
|
2071
|
+
/**
|
2072
|
+
* Sets the linear damping of the rigid body.
|
2073
|
+
* @param linearDamping - The linear damping of the rigid body.
|
2074
|
+
*/
|
914
2075
|
setLinearDamping(linearDamping: number): void;
|
2076
|
+
/**
|
2077
|
+
* Sets the linear velocity of the rigid body.
|
2078
|
+
* @param linearVelocity - The linear velocity of the rigid body.
|
2079
|
+
*/
|
915
2080
|
setLinearVelocity(linearVelocity: Vector): void;
|
2081
|
+
/**
|
2082
|
+
* Sets the next kinematic rotation of the rigid body.
|
2083
|
+
* @param nextKinematicRotation - The next kinematic rotation of the rigid body.
|
2084
|
+
*/
|
916
2085
|
setNextKinematicRotation(nextKinematicRotation: Rotation): void;
|
2086
|
+
/**
|
2087
|
+
* Sets the next kinematic translation of the rigid body.
|
2088
|
+
* @param nextKinematicTranslation - The next kinematic translation of the rigid body.
|
2089
|
+
*/
|
917
2090
|
setNextKinematicTranslation(nextKinematicTranslation: Vector): void;
|
2091
|
+
/**
|
2092
|
+
* Sets the rotation of the rigid body.
|
2093
|
+
* @param rotation - The rotation of the rigid body.
|
2094
|
+
*/
|
918
2095
|
setRotation(rotation: Rotation): void;
|
2096
|
+
/**
|
2097
|
+
* Sets whether the rigid body is sleeping.
|
2098
|
+
* @param sleeping - Whether the rigid body is sleeping.
|
2099
|
+
*/
|
919
2100
|
setSleeping(sleeping: boolean): void;
|
2101
|
+
/**
|
2102
|
+
* Sets the soft ccd prediction of the rigid body.
|
2103
|
+
* @param softCcdPrediction - The soft ccd prediction of the rigid body.
|
2104
|
+
*/
|
920
2105
|
setSoftCcdPrediction(softCcdPrediction: number): void;
|
2106
|
+
/**
|
2107
|
+
* Sets the collision groups for solid colliders (non-sensor) of the rigid body.
|
2108
|
+
* @param collisionGroups - The collision groups for solid colliders of the rigid body.
|
2109
|
+
*/
|
921
2110
|
setCollisionGroupsForSolidColliders(collisionGroups: CollisionGroups): void;
|
2111
|
+
/**
|
2112
|
+
* Sets the tag of the rigid body.
|
2113
|
+
* @param tag - The tag of the rigid body.
|
2114
|
+
*/
|
922
2115
|
setTag(tag: string): void;
|
2116
|
+
/**
|
2117
|
+
* Sets the translation of the rigid body.
|
2118
|
+
* @param translation - The translation of the rigid body.
|
2119
|
+
*/
|
923
2120
|
setTranslation(translation: Vector): void;
|
2121
|
+
/**
|
2122
|
+
* Sets the type of the rigid body.
|
2123
|
+
* @param type - The type of the rigid body.
|
2124
|
+
*/
|
924
2125
|
setType(type: RigidBodyType): void;
|
2126
|
+
/**
|
2127
|
+
* Adds a force to the rigid body.
|
2128
|
+
* @param force - The force to add to the rigid body.
|
2129
|
+
*/
|
925
2130
|
addForce(force: Vector): void;
|
2131
|
+
/**
|
2132
|
+
* Adds a torque to the rigid body.
|
2133
|
+
* @param torque - The torque to add to the rigid body.
|
2134
|
+
*/
|
926
2135
|
addTorque(torque: Vector): void;
|
2136
|
+
/**
|
2137
|
+
* Adds an unsimulated child collider to the rigid body for the simulation it belongs to.
|
2138
|
+
* @param collider - The child collider to add to the rigid body for the simulation it belongs to.
|
2139
|
+
*/
|
927
2140
|
addChildColliderToSimulation(collider: Collider): void;
|
2141
|
+
/**
|
2142
|
+
* Adds the rigid body to a simulation.
|
2143
|
+
* @param simulation - The simulation to add the rigid body to.
|
2144
|
+
*/
|
928
2145
|
addToSimulation(simulation: Simulation): void;
|
2146
|
+
/**
|
2147
|
+
* Applies an impulse to the rigid body.
|
2148
|
+
* @param impulse - The impulse to apply to the rigid body.
|
2149
|
+
*/
|
929
2150
|
applyImpulse(impulse: Vector): void;
|
2151
|
+
/**
|
2152
|
+
* Applies an impulse to the rigid body at a point.
|
2153
|
+
* @param impulse - The impulse to apply to the rigid body.
|
2154
|
+
* @param point - The point at which to apply the impulse.
|
2155
|
+
*/
|
930
2156
|
applyImpulseAtPoint(impulse: Vector, point: Vector): void;
|
2157
|
+
/**
|
2158
|
+
* Applies a torque impulse to the rigid body.
|
2159
|
+
* @param impulse - The torque impulse to apply to the rigid body.
|
2160
|
+
*/
|
931
2161
|
applyTorqueImpulse(impulse: Vector): void;
|
932
|
-
|
933
|
-
|
2162
|
+
/**
|
2163
|
+
* Creates and adds a child collider to the rigid body for the simulation it belongs to.
|
2164
|
+
* @param colliderOptions - The options for the child collider to add.
|
2165
|
+
* @returns The child collider that was added to the rigid body.
|
2166
|
+
*/
|
934
2167
|
createAndAddChildColliderToSimulation(colliderOptions: ColliderOptions): Collider;
|
2168
|
+
/**
|
2169
|
+
* Creates and adds multiple child colliders to the rigid body for the simulation it belongs to.
|
2170
|
+
* @param colliderOptions - The options for the child colliders to add to the rigid body.
|
2171
|
+
* @returns The child colliders that were added to the rigid body.
|
2172
|
+
*/
|
935
2173
|
createAndAddChildCollidersToSimulation(colliderOptions: ColliderOptions[]): Collider[];
|
936
|
-
|
2174
|
+
|
2175
|
+
/**
|
2176
|
+
* Locks all rotations of the rigid body.
|
2177
|
+
*/
|
937
2178
|
lockAllRotations(): void;
|
2179
|
+
/**
|
2180
|
+
* Locks all translations of the rigid body.
|
2181
|
+
*/
|
938
2182
|
lockAllTranslations(): void;
|
2183
|
+
/**
|
2184
|
+
* Removes the rigid body from the simulation it belongs to.
|
2185
|
+
*/
|
939
2186
|
removeFromSimulation(): void;
|
940
|
-
|
2187
|
+
|
2188
|
+
/**
|
2189
|
+
* Explicitly puts the rigid body to sleep. Physics otherwise optimizes sleeping.
|
2190
|
+
*/
|
941
2191
|
sleep(): void;
|
2192
|
+
/**
|
2193
|
+
* Wakes up the rigid body. Physics otherwise optimizes waking it when necessary.
|
2194
|
+
*/
|
942
2195
|
wakeUp(): void;
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
2196
|
+
|
2197
|
+
|
2198
|
+
|
2199
|
+
|
2200
|
+
|
2201
|
+
|
2202
|
+
|
2203
|
+
|
2204
|
+
|
2205
|
+
|
2206
|
+
|
2207
|
+
|
2208
|
+
|
2209
|
+
|
955
2210
|
}
|
956
2211
|
|
2212
|
+
/** Additional mass properties for a RigidBody. @public */
|
957
2213
|
export declare type RigidBodyAdditionalMassProperties = {
|
958
2214
|
additionalMass: number;
|
959
2215
|
centerOfMass: Vector3;
|
@@ -961,30 +2217,53 @@ export declare type RigidBodyAdditionalMassProperties = {
|
|
961
2217
|
principalAngularInertiaLocalFrame: Rotation;
|
962
2218
|
};
|
963
2219
|
|
2220
|
+
/** Options for creating a RigidBody instance. @public */
|
964
2221
|
export declare interface RigidBodyOptions {
|
2222
|
+
/** The type of the rigid body. */
|
965
2223
|
type: RigidBodyType;
|
2224
|
+
/** The additional mass of the rigid body. */
|
966
2225
|
additionalMass?: number;
|
2226
|
+
/** The additional mass properties of the rigid body. */
|
967
2227
|
additionalMassProperties?: RigidBodyAdditionalMassProperties;
|
2228
|
+
/** The additional solver iterations of the rigid body. */
|
968
2229
|
additionalSolverIterations?: number;
|
2230
|
+
/** The angular damping of the rigid body. */
|
969
2231
|
angularDamping?: number;
|
2232
|
+
/** The angular velocity of the rigid body. */
|
970
2233
|
angularVelocity?: Vector3;
|
2234
|
+
/** Whether the rigid body has continuous collision detection enabled. */
|
971
2235
|
ccdEnabled?: boolean;
|
2236
|
+
/** The colliders of the rigid body, provided as {@link ColliderOptions}. */
|
972
2237
|
colliders?: ColliderOptions[];
|
2238
|
+
/** The dominance group of the rigid body. */
|
973
2239
|
dominanceGroup?: number;
|
2240
|
+
/** Whether the rigid body is enabled. */
|
974
2241
|
enabled?: boolean;
|
2242
|
+
/** The enabled rotations of the rigid body. */
|
975
2243
|
enabledRotations?: Vector3Boolean;
|
2244
|
+
/** The enabled translations of the rigid body. */
|
976
2245
|
enabledTranslations?: Vector3Boolean;
|
2246
|
+
/** The gravity scale of the rigid body. */
|
977
2247
|
gravityScale?: number;
|
2248
|
+
/** The linear damping of the rigid body. */
|
978
2249
|
linearDamping?: number;
|
2250
|
+
/** The linear velocity of the rigid body. */
|
979
2251
|
linearVelocity?: Vector3;
|
2252
|
+
/** The rotation of the rigid body. */
|
980
2253
|
rotation?: Rotation;
|
2254
|
+
/** The simulation the rigid body is in. If provided, the rigid body will be automatically added to the simulation. */
|
981
2255
|
simulation?: Simulation;
|
2256
|
+
/** Whether the rigid body is sleeping. */
|
982
2257
|
sleeping?: boolean;
|
2258
|
+
/** The soft continuous collision detection prediction of the rigid body. */
|
983
2259
|
softCcdPrediction?: number;
|
2260
|
+
/** The tag of the rigid body. */
|
984
2261
|
tag?: string;
|
2262
|
+
/** The translation of the rigid body. */
|
985
2263
|
translation?: Vector3;
|
986
2264
|
}
|
987
2265
|
|
2266
|
+
/** The types a RigidBody can be. @public */
|
988
2267
|
export declare enum RigidBodyType {
|
989
2268
|
DYNAMIC = "dynamic",
|
990
2269
|
FIXED = "fixed",
|
@@ -992,6 +2271,7 @@ export declare enum RigidBodyType {
|
|
992
2271
|
KINEMATIC_VELOCITY = "kinematic_velocity"
|
993
2272
|
}
|
994
2273
|
|
2274
|
+
/** A rotation in quaternion form. @public */
|
995
2275
|
export declare interface Rotation {
|
996
2276
|
x: number;
|
997
2277
|
y: number;
|
@@ -999,122 +2279,247 @@ export declare interface Rotation {
|
|
999
2279
|
w: number;
|
1000
2280
|
}
|
1001
2281
|
|
1002
|
-
|
1003
|
-
|
2282
|
+
/**
|
2283
|
+
* Represents the physics simulation for a world.
|
2284
|
+
*
|
2285
|
+
* @remarks
|
2286
|
+
* The simulation internally and automatically handles the physical
|
2287
|
+
* interactions, collisions, contact forces, and events for all aspects
|
2288
|
+
* of the world. Most methods are not often used directly, but are
|
2289
|
+
* provided for advanced usage.
|
2290
|
+
*
|
2291
|
+
* @public
|
2292
|
+
*/
|
1004
2293
|
export declare class Simulation {
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
2294
|
+
|
2295
|
+
|
2296
|
+
|
2297
|
+
|
2298
|
+
|
2299
|
+
|
2300
|
+
/** The gravity vector for the simulation. */
|
1011
2301
|
get gravity(): RAPIER.Vector3;
|
2302
|
+
/** The fixed timestep for the simulation. */
|
1012
2303
|
get timestepS(): number;
|
2304
|
+
/** The world the simulation is for. */
|
1013
2305
|
get world(): World;
|
2306
|
+
/**
|
2307
|
+
* Casts a ray through the simulation.
|
2308
|
+
* @param origin - The origin of the ray.
|
2309
|
+
* @param direction - The direction of the ray.
|
2310
|
+
* @param length - The length of the ray.
|
2311
|
+
* @param options - The options for the raycast.
|
2312
|
+
* @returns The first block or entity hit by the ray, or null if no hit.
|
2313
|
+
*/
|
1014
2314
|
castRay(origin: RAPIER.Vector3, direction: RAPIER.Vector3, length: number, options?: RayCastOptions): Block | Entity | null;
|
1015
|
-
createRawCollider(rawColliderDesc: RAPIER.ColliderDesc, rawParent?: RAPIER.RigidBody): RAPIER.Collider;
|
1016
|
-
createRawRigidBody(rawRigidBodyDesc: RAPIER.RigidBodyDesc): RAPIER.RigidBody;
|
1017
|
-
removeRawCollider(rawCollider: RAPIER.Collider): void;
|
1018
|
-
removeRawRigidBody(rawRigidBody: RAPIER.RigidBody): void;
|
1019
|
-
step: (tickDeltaMs: number) => void;
|
1020
|
-
private _onCollisionEvent;
|
1021
|
-
private _onContactForceEvent;
|
1022
|
-
private _getCollisionObjects;
|
1023
|
-
}
|
1024
2315
|
|
1025
|
-
export declare interface SpdMatrix3 extends SdpMatrix3 {
|
1026
|
-
}
|
1027
2316
|
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
private _fixedTimestepS;
|
1035
|
-
private _nextTickMs;
|
1036
|
-
private _lastLoopTimeMs;
|
1037
|
-
private _tickFunction;
|
1038
|
-
private _tickErrorCallback?;
|
1039
|
-
private _tickHandle;
|
1040
|
-
constructor(ticksPerSecond: number, tickFunction: (tickDeltaMs: number) => void, tickErrorCallback?: (error: Error) => void);
|
1041
|
-
get targetTicksPerSecond(): number;
|
1042
|
-
get fixedTimestepMs(): number;
|
1043
|
-
get fixedTimestepS(): number;
|
1044
|
-
get nextTickMs(): number;
|
1045
|
-
start(): void;
|
1046
|
-
stop(): void;
|
1047
|
-
private _tick;
|
2317
|
+
|
2318
|
+
|
2319
|
+
|
2320
|
+
|
2321
|
+
|
2322
|
+
|
1048
2323
|
}
|
1049
2324
|
|
1050
|
-
|
2325
|
+
/** A 3x3 symmetric positive-definite matrix for spatial dynamics. @public */
|
2326
|
+
export declare interface SpdMatrix3 extends SdpMatrix3 {
|
2327
|
+
}
|
1051
2328
|
|
2329
|
+
/**
|
2330
|
+
* The entry point for running game setup and starting the game server.
|
2331
|
+
*
|
2332
|
+
* @remarks
|
2333
|
+
* This function should always be called first when initializing your
|
2334
|
+
* game. It will internally handle initialization of the physics engine
|
2335
|
+
* and other systems required systems. All of your game setup logic
|
2336
|
+
* should be executed in the init function.
|
2337
|
+
*
|
2338
|
+
* @param init - A function that initializes the world.
|
2339
|
+
*
|
2340
|
+
* @public
|
2341
|
+
*/
|
2342
|
+
export declare function startServer(init: (world: World) => void): void;
|
2343
|
+
|
2344
|
+
/** The input keys included in the PlayerInputState. @public */
|
2345
|
+
export declare const SUPPORTED_INPUT_KEYS: string[];
|
2346
|
+
|
2347
|
+
/** A 3-dimensional vector. @public */
|
1052
2348
|
export declare interface Vector3 {
|
1053
2349
|
x: number;
|
1054
2350
|
y: number;
|
1055
2351
|
z: number;
|
1056
2352
|
}
|
1057
2353
|
|
2354
|
+
/** A 3-dimensional vector of boolean values. @public */
|
1058
2355
|
export declare interface Vector3Boolean {
|
1059
2356
|
x: boolean;
|
1060
2357
|
y: boolean;
|
1061
2358
|
z: boolean;
|
1062
2359
|
}
|
1063
2360
|
|
2361
|
+
/**
|
2362
|
+
* Represents a world in the game server.
|
2363
|
+
*
|
2364
|
+
* @remarks
|
2365
|
+
* Worlds are the primary container for game objects
|
2366
|
+
* and interactions. A game can have multiple worlds running
|
2367
|
+
* simultaneously, each uniquely isolated from each other.
|
2368
|
+
* Players who have joined your server can be assigned to a world
|
2369
|
+
* programmatically by your game logic if desired. This is useful
|
2370
|
+
* for things like mini-games, or complex dungeons with multiple
|
2371
|
+
* floors that can be optimized by splitting them into seperate
|
2372
|
+
* world or "room" simulations, etc. In most cases, the single
|
2373
|
+
* automatically created default world is all you need, but
|
2374
|
+
* this flexibility is available for more complex games.
|
2375
|
+
*
|
2376
|
+
* @example
|
2377
|
+
* ```typescript
|
2378
|
+
* const world = new World({
|
2379
|
+
* id: 1,
|
2380
|
+
* name: 'My World',
|
2381
|
+
* skyboxUri: 'textures/skyboxes/default.png',
|
2382
|
+
* });
|
2383
|
+
* ```
|
2384
|
+
*
|
2385
|
+
* @public
|
2386
|
+
*/
|
1064
2387
|
export declare class World implements protocol.Serializable {
|
2388
|
+
/**
|
2389
|
+
* A function that is called when a player joins the world.
|
2390
|
+
* @param player - The player that joined the world.
|
2391
|
+
*/
|
1065
2392
|
onPlayerJoin?: (player: Player) => void;
|
2393
|
+
/**
|
2394
|
+
* A function that is called when a player leaves the world.
|
2395
|
+
* @param player - The player that left the world.
|
2396
|
+
*/
|
1066
2397
|
onPlayerLeave?: (player: Player) => void;
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
2398
|
+
|
2399
|
+
|
2400
|
+
|
2401
|
+
|
2402
|
+
|
2403
|
+
|
2404
|
+
|
2405
|
+
|
2406
|
+
|
2407
|
+
|
2408
|
+
|
2409
|
+
|
2410
|
+
/**
|
2411
|
+
* @param options - The options for the world.
|
2412
|
+
*/
|
2413
|
+
constructor(options: WorldOptions);
|
2414
|
+
/** The unique ID of the world. */
|
1080
2415
|
get id(): number;
|
2416
|
+
/** The name of the world. */
|
1081
2417
|
get name(): string;
|
2418
|
+
/** The URI of the skybox cubemap for the world. */
|
1082
2419
|
get skyboxUri(): string;
|
2420
|
+
/** The audio manager for the world. */
|
1083
2421
|
get audioManager(): AudioManager;
|
2422
|
+
/** The block type registry for the world. */
|
1084
2423
|
get blockTypeRegistry(): BlockTypeRegistry;
|
2424
|
+
/** The chat manager for the world. */
|
1085
2425
|
get chatManager(): ChatManager;
|
2426
|
+
/** The chunk lattice for the world. */
|
1086
2427
|
get chunkLattice(): ChunkLattice;
|
2428
|
+
/** The entity manager for the world. */
|
1087
2429
|
get entityManager(): EntityManager;
|
2430
|
+
/** The event router for the world. */
|
1088
2431
|
get eventRouter(): EventRouter;
|
2432
|
+
/** The world loop for the world. */
|
1089
2433
|
get loop(): WorldLoop;
|
1090
|
-
|
2434
|
+
|
2435
|
+
/** The simulation for the world. */
|
1091
2436
|
get simulation(): Simulation;
|
2437
|
+
/**
|
2438
|
+
* Loads a map into the world.
|
2439
|
+
* @param map - The map to load.
|
2440
|
+
*/
|
2441
|
+
loadMap(map: WorldMap): void;
|
2442
|
+
/**
|
2443
|
+
* Starts the world loop, which begins ticking physics, entities, etc.
|
2444
|
+
*/
|
1092
2445
|
start(): void;
|
2446
|
+
/**
|
2447
|
+
* Stops the world loop, which stops ticking physics, entities, etc.
|
2448
|
+
*/
|
1093
2449
|
stop(): void;
|
1094
|
-
serialize(): protocol.WorldSchema;
|
1095
|
-
}
|
1096
2450
|
|
1097
|
-
export declare interface WorldData {
|
1098
|
-
id: number;
|
1099
|
-
name: string;
|
1100
|
-
skyboxUri: string;
|
1101
|
-
tickRate?: number;
|
1102
|
-
gravity?: Vector3;
|
1103
2451
|
}
|
1104
2452
|
|
2453
|
+
/**
|
2454
|
+
* Manages the tick loop for a world.
|
2455
|
+
*
|
2456
|
+
* @remarks
|
2457
|
+
* The world loop automatically handles ticking physics,
|
2458
|
+
* entities, and other world logic.
|
2459
|
+
*
|
2460
|
+
* The internal order of tick operations is as follows:
|
2461
|
+
*
|
2462
|
+
* 1. Update chunks and meshing
|
2463
|
+
*
|
2464
|
+
* 2. Tick entity logic
|
2465
|
+
*
|
2466
|
+
* 3. Step physics
|
2467
|
+
*
|
2468
|
+
* 4. Check and emit entity updates
|
2469
|
+
*
|
2470
|
+
* 5. Synchronize network packets with player clients
|
2471
|
+
*
|
2472
|
+
* @public
|
2473
|
+
*/
|
1105
2474
|
export declare class WorldLoop {
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
2475
|
+
|
2476
|
+
|
2477
|
+
|
2478
|
+
|
2479
|
+
/** The current tick of the world loop. */
|
1110
2480
|
get currentTick(): number;
|
2481
|
+
/** The next tick time in milliseconds. */
|
1111
2482
|
get nextTickMs(): number;
|
2483
|
+
/** The fixed timestep of the world loop in seconds. */
|
1112
2484
|
get timestepS(): number;
|
2485
|
+
/** The world that the loop manages. */
|
1113
2486
|
get world(): World;
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
2487
|
+
|
2488
|
+
|
2489
|
+
|
2490
|
+
|
2491
|
+
}
|
2492
|
+
|
2493
|
+
/** A map representation for a world. @public */
|
2494
|
+
export declare interface WorldMap {
|
2495
|
+
/** The block types in the map. */
|
2496
|
+
blockTypes: {
|
2497
|
+
/** The ID of the block type. */
|
2498
|
+
id: number;
|
2499
|
+
/** The name of the block type. */
|
2500
|
+
name: string;
|
2501
|
+
/** The URI of the texture for the block type. */
|
2502
|
+
textureUri: string;
|
2503
|
+
}[];
|
2504
|
+
/** The blocks in the map */
|
2505
|
+
blocks: {
|
2506
|
+
/** The global coordinate to block type id mapping. */
|
2507
|
+
[coordinate: string]: number;
|
2508
|
+
};
|
2509
|
+
}
|
2510
|
+
|
2511
|
+
/** Options for creating a World instance. @public */
|
2512
|
+
export declare interface WorldOptions {
|
2513
|
+
/** The unique ID of the world. */
|
2514
|
+
id: number;
|
2515
|
+
/** The name of the world. */
|
2516
|
+
name: string;
|
2517
|
+
/** The URI of the skybox cubemap for the world. */
|
2518
|
+
skyboxUri: string;
|
2519
|
+
/** The tick rate for the world. */
|
2520
|
+
tickRate?: number;
|
2521
|
+
/** The gravity vector for the world. */
|
2522
|
+
gravity?: Vector3;
|
1118
2523
|
}
|
1119
2524
|
|
1120
2525
|
export { }
|