hytopia 0.1.34 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/docs/server.audio.md +2 -2
- package/docs/server.audio.position.md +1 -1
- package/docs/server.audio.setposition.md +2 -2
- package/docs/server.audioeventpayload.setposition.md +1 -1
- package/docs/server.audioeventpayload.setposition.position.md +1 -1
- package/docs/server.audiooptions.md +1 -1
- package/docs/server.audiooptions.position.md +1 -1
- package/docs/server.block.globalcoordinate.md +1 -1
- package/docs/server.block.md +1 -1
- package/docs/server.blocktype.md +1 -1
- package/docs/server.blocktyperegistry.md +2 -2
- package/docs/server.blocktyperegistry.registerblocktype.md +2 -18
- package/docs/server.chunk.blockindextolocalcoordinate.md +2 -2
- package/docs/server.chunk.getblock.md +55 -0
- package/docs/server.chunk.globalcoordinatetolocalcoordinate.md +3 -3
- package/docs/server.chunk.globalcoordinatetoorigincoordinate.md +3 -3
- package/docs/server.chunk.hasblock.md +55 -0
- package/docs/server.chunk.isvalidorigincoordinate.md +2 -2
- package/docs/server.chunk.md +29 -1
- package/docs/server.chunk.origincoordinate.md +1 -1
- package/docs/server.chunk.setblock.md +2 -2
- package/docs/server.chunk.spawn.md +2 -2
- package/docs/server.chunkeventpayload.setblock.globalcoordinate.md +1 -1
- package/docs/server.chunkeventpayload.setblock.localcoordinate.md +1 -1
- package/docs/server.chunkeventpayload.setblock.md +2 -2
- package/docs/server.chunklattice.getblock.md +55 -0
- package/docs/server.chunklattice.getchunk.md +2 -2
- package/docs/server.chunklattice.hasblock.md +55 -0
- package/docs/server.chunklattice.haschunk.md +2 -2
- package/docs/server.chunklattice.md +29 -1
- package/docs/server.chunklattice.setblock.md +4 -4
- package/docs/server.collider.getrelativerotation.md +2 -2
- package/docs/server.collider.getrelativetranslation.md +2 -2
- package/docs/server.collider.setrelativerotation.md +2 -2
- package/docs/server.collider.setrelativetranslation.md +2 -2
- package/docs/server.collideroptions.halfextents.md +1 -1
- package/docs/server.collideroptions.md +3 -3
- package/docs/server.collideroptions.relativerotation.md +1 -1
- package/docs/server.collideroptions.relativetranslation.md +1 -1
- package/docs/server.entity.blockhalfextents.md +1 -1
- package/docs/server.entity.md +36 -1
- package/docs/server.entity.settintcolor.md +53 -0
- package/docs/server.entity.spawn.md +2 -2
- package/docs/server.entity.tintcolor.md +13 -0
- package/docs/server.entityeventpayload.md +9 -0
- package/docs/server.entityeventpayload.settintcolor.entity.md +11 -0
- package/docs/server.entityeventpayload.settintcolor.md +70 -0
- package/docs/server.entityeventpayload.settintcolor.tintcolor.md +11 -0
- package/docs/server.entityeventpayload.updaterotation.md +1 -1
- package/docs/server.entityeventpayload.updaterotation.rotation.md +1 -1
- package/docs/server.entityeventpayload.updatetranslation.md +1 -1
- package/docs/server.entityeventpayload.updatetranslation.translation.md +1 -1
- package/docs/server.entityeventtype.md +15 -1
- package/docs/server.entityoptions.blockhalfextents.md +1 -1
- package/docs/server.entityoptions.md +20 -1
- package/docs/server.entityoptions.tintcolor.md +13 -0
- package/docs/server.facecallback.md +2 -2
- package/docs/server.facecompletecallback.md +2 -2
- package/docs/server.gameserver.md +1 -1
- package/docs/server.hytopia.audio.md +2 -2
- package/docs/server.hytopia.audio.position.md +1 -1
- package/docs/server.hytopia.audio.setposition.md +2 -2
- package/docs/server.hytopia.audioeventpayload.setposition.md +1 -1
- package/docs/server.hytopia.audioeventpayload.setposition.position.md +1 -1
- package/docs/server.hytopia.audiooptions.md +1 -1
- package/docs/server.hytopia.audiooptions.position.md +1 -1
- package/docs/server.hytopia.block.globalcoordinate.md +1 -1
- package/docs/server.hytopia.block.md +1 -1
- package/docs/server.hytopia.blocktype.md +1 -1
- package/docs/server.hytopia.blocktyperegistry.md +2 -2
- package/docs/server.hytopia.blocktyperegistry.registerblocktype.md +2 -18
- package/docs/server.hytopia.chunk.blockindextolocalcoordinate.md +2 -2
- package/docs/server.hytopia.chunk.getblock.md +55 -0
- package/docs/server.hytopia.chunk.globalcoordinatetolocalcoordinate.md +3 -3
- package/docs/server.hytopia.chunk.globalcoordinatetoorigincoordinate.md +3 -3
- package/docs/server.hytopia.chunk.hasblock.md +55 -0
- package/docs/server.hytopia.chunk.isvalidorigincoordinate.md +2 -2
- package/docs/server.hytopia.chunk.md +29 -1
- package/docs/server.hytopia.chunk.origincoordinate.md +1 -1
- package/docs/server.hytopia.chunk.setblock.md +2 -2
- package/docs/server.hytopia.chunk.spawn.md +2 -2
- package/docs/server.hytopia.chunkeventpayload.setblock.globalcoordinate.md +1 -1
- package/docs/server.hytopia.chunkeventpayload.setblock.localcoordinate.md +1 -1
- package/docs/server.hytopia.chunkeventpayload.setblock.md +2 -2
- package/docs/server.hytopia.chunklattice.getblock.md +55 -0
- package/docs/server.hytopia.chunklattice.getchunk.md +2 -2
- package/docs/server.hytopia.chunklattice.hasblock.md +55 -0
- package/docs/server.hytopia.chunklattice.haschunk.md +2 -2
- package/docs/server.hytopia.chunklattice.md +29 -1
- package/docs/server.hytopia.chunklattice.setblock.md +4 -4
- package/docs/server.hytopia.collider.getrelativerotation.md +2 -2
- package/docs/server.hytopia.collider.getrelativetranslation.md +2 -2
- package/docs/server.hytopia.collider.setrelativerotation.md +2 -2
- package/docs/server.hytopia.collider.setrelativetranslation.md +2 -2
- package/docs/server.hytopia.collideroptions.halfextents.md +1 -1
- package/docs/server.hytopia.collideroptions.md +3 -3
- package/docs/server.hytopia.collideroptions.relativerotation.md +1 -1
- package/docs/server.hytopia.collideroptions.relativetranslation.md +1 -1
- package/docs/server.hytopia.entity.blockhalfextents.md +1 -1
- package/docs/server.hytopia.entity.md +36 -1
- package/docs/server.hytopia.entity.settintcolor.md +53 -0
- package/docs/server.hytopia.entity.spawn.md +2 -2
- package/docs/server.hytopia.entity.tintcolor.md +13 -0
- package/docs/server.hytopia.entityeventpayload.md +9 -0
- package/docs/server.hytopia.entityeventpayload.settintcolor.entity.md +11 -0
- package/docs/server.hytopia.entityeventpayload.settintcolor.md +70 -0
- package/docs/server.hytopia.entityeventpayload.settintcolor.tintcolor.md +11 -0
- package/docs/server.hytopia.entityeventpayload.updaterotation.md +1 -1
- package/docs/server.hytopia.entityeventpayload.updaterotation.rotation.md +1 -1
- package/docs/server.hytopia.entityeventpayload.updatetranslation.md +1 -1
- package/docs/server.hytopia.entityeventpayload.updatetranslation.translation.md +1 -1
- package/docs/server.hytopia.entityeventtype.md +15 -1
- package/docs/server.hytopia.entityoptions.blockhalfextents.md +1 -1
- package/docs/server.hytopia.entityoptions.md +20 -1
- package/docs/server.hytopia.entityoptions.tintcolor.md +13 -0
- package/docs/server.hytopia.facecallback.md +2 -2
- package/docs/server.hytopia.facecompletecallback.md +2 -2
- package/docs/server.hytopia.gameserver.md +1 -1
- package/docs/server.hytopia.md +32 -10
- package/docs/server.hytopia.movecallback.md +2 -2
- package/docs/server.hytopia.movecompletecallback.md +2 -2
- package/docs/server.hytopia.playercamera.attachedtoposition.md +1 -1
- package/docs/server.hytopia.playercamera.lookatposition.md +2 -2
- package/docs/server.hytopia.playercamera.md +3 -3
- package/docs/server.hytopia.playercamera.offset.md +1 -1
- package/docs/server.hytopia.playercamera.setattachedtoposition.md +2 -2
- package/docs/server.hytopia.playercamera.setoffset.md +2 -2
- package/docs/server.hytopia.playercamera.settrackedposition.md +2 -2
- package/docs/server.hytopia.playercamera.trackedposition.md +1 -1
- package/docs/server.hytopia.playercameraeventpayload.lookatposition.md +1 -1
- package/docs/server.hytopia.playercameraeventpayload.lookatposition.position.md +1 -1
- package/docs/server.hytopia.playercameraeventpayload.setattachedtoposition.md +1 -1
- package/docs/server.hytopia.playercameraeventpayload.setattachedtoposition.position.md +1 -1
- package/docs/server.hytopia.playercameraeventpayload.setoffset.md +1 -1
- package/docs/server.hytopia.playercameraeventpayload.setoffset.offset.md +1 -1
- package/docs/server.hytopia.playercameraeventpayload.settrackedposition.md +1 -1
- package/docs/server.hytopia.playercameraeventpayload.settrackedposition.position.md +1 -1
- package/docs/server.hytopia.quaternion._constructor_.md +89 -0
- package/docs/server.hytopia.quaternion.clone.md +19 -0
- package/docs/server.hytopia.quaternion.conjugate.md +19 -0
- package/docs/server.hytopia.quaternion.copy.md +53 -0
- package/docs/server.hytopia.quaternion.dot.md +53 -0
- package/docs/server.hytopia.quaternion.equals.md +53 -0
- package/docs/server.hytopia.quaternion.exactequals.md +53 -0
- package/docs/server.hytopia.quaternion.exponential.md +19 -0
- package/docs/server.hytopia.quaternion.fromeuler.md +85 -0
- package/docs/server.hytopia.quaternion.fromquaternionlike.md +53 -0
- package/docs/server.hytopia.quaternion.getangle.md +53 -0
- package/docs/server.hytopia.quaternion.invert.md +19 -0
- package/docs/server.hytopia.quaternion.lerp.md +69 -0
- package/docs/server.hytopia.quaternion.magnitude.md +13 -0
- package/docs/server.hytopia.quaternion.md +501 -0
- package/docs/server.hytopia.quaternion.multiply.md +53 -0
- package/docs/server.hytopia.quaternion.normalize.md +19 -0
- package/docs/server.hytopia.quaternion.rotatex.md +55 -0
- package/docs/server.hytopia.quaternion.rotatey.md +55 -0
- package/docs/server.hytopia.quaternion.rotatez.md +55 -0
- package/docs/server.hytopia.quaternion.scale.md +55 -0
- package/docs/server.hytopia.quaternion.slerp.md +71 -0
- package/docs/server.hytopia.quaternion.squaredmagnitude.md +13 -0
- package/docs/server.hytopia.quaternion.tostring.md +19 -0
- package/docs/server.hytopia.quaternion.w.md +15 -0
- package/docs/server.hytopia.quaternion.x.md +15 -0
- package/docs/server.hytopia.quaternion.y.md +15 -0
- package/docs/server.hytopia.quaternion.z.md +15 -0
- package/docs/{server.hytopia.rotation.md → server.hytopia.quaternionlike.md} +8 -8
- package/docs/server.hytopia.quaternionlike.w.md +11 -0
- package/docs/server.hytopia.quaternionlike.x.md +11 -0
- package/docs/server.hytopia.quaternionlike.y.md +11 -0
- package/docs/server.hytopia.quaternionlike.z.md +11 -0
- package/docs/{server.hytopia.rotation.w.md → server.hytopia.rgbcolor.b.md} +3 -3
- package/docs/server.hytopia.rgbcolor.g.md +11 -0
- package/docs/server.hytopia.rgbcolor.md +89 -0
- package/docs/server.hytopia.rgbcolor.r.md +11 -0
- package/docs/server.hytopia.rigidbody.addforce.md +2 -2
- package/docs/server.hytopia.rigidbody.addtorque.md +2 -2
- package/docs/server.hytopia.rigidbody.applyimpulse.md +2 -2
- package/docs/server.hytopia.rigidbody.applyimpulseatpoint.md +3 -3
- package/docs/server.hytopia.rigidbody.applytorqueimpulse.md +2 -2
- package/docs/server.hytopia.rigidbody.getangularvelocity.md +2 -2
- package/docs/server.hytopia.rigidbody.getdirectionfromrotation.md +2 -2
- package/docs/server.hytopia.rigidbody.geteffectiveinversemass.md +2 -2
- package/docs/server.hytopia.rigidbody.getinverseprincipalangularinertiasqrt.md +2 -2
- package/docs/server.hytopia.rigidbody.getlinearvelocity.md +2 -2
- package/docs/server.hytopia.rigidbody.getlocalcenterofmass.md +2 -2
- package/docs/server.hytopia.rigidbody.getnextkinematicrotation.md +2 -2
- package/docs/server.hytopia.rigidbody.getnextkinematictranslation.md +2 -2
- package/docs/server.hytopia.rigidbody.getprincipalangularinertia.md +2 -2
- package/docs/server.hytopia.rigidbody.getprincipalangularinertialocalframe.md +2 -2
- package/docs/server.hytopia.rigidbody.getrotation.md +2 -2
- package/docs/server.hytopia.rigidbody.gettranslation.md +2 -2
- package/docs/server.hytopia.rigidbody.getworldcenterofmass.md +2 -2
- package/docs/server.hytopia.rigidbody.setangularvelocity.md +2 -2
- package/docs/server.hytopia.rigidbody.setlinearvelocity.md +2 -2
- package/docs/server.hytopia.rigidbody.setnextkinematicrotation.md +2 -2
- package/docs/server.hytopia.rigidbody.setnextkinematictranslation.md +2 -2
- package/docs/server.hytopia.rigidbody.setrotation.md +2 -2
- package/docs/server.hytopia.rigidbody.settranslation.md +2 -2
- package/docs/server.hytopia.rigidbodyadditionalmassproperties.md +4 -4
- package/docs/server.hytopia.rigidbodyoptions.angularvelocity.md +1 -1
- package/docs/server.hytopia.rigidbodyoptions.linearvelocity.md +1 -1
- package/docs/server.hytopia.rigidbodyoptions.md +4 -4
- package/docs/server.hytopia.rigidbodyoptions.rotation.md +1 -1
- package/docs/server.hytopia.rigidbodyoptions.translation.md +1 -1
- package/docs/server.hytopia.simplecharactercontroller.face.md +2 -2
- package/docs/server.hytopia.simplecharactercontroller.move.md +2 -2
- package/docs/server.hytopia.simulation.md +14 -0
- package/docs/server.hytopia.simulation.setgravity.md +53 -0
- package/docs/server.hytopia.vector3._constructor_.md +75 -0
- package/docs/server.hytopia.vector3.add.md +55 -0
- package/docs/server.hytopia.vector3.ceil.md +19 -0
- package/docs/server.hytopia.vector3.clone.md +19 -0
- package/docs/server.hytopia.vector3.copy.md +55 -0
- package/docs/server.hytopia.vector3.cross.md +55 -0
- package/docs/server.hytopia.vector3.distance.md +55 -0
- package/docs/server.hytopia.vector3.divide.md +55 -0
- package/docs/server.hytopia.vector3.equals.md +55 -0
- package/docs/server.hytopia.vector3.exactequals.md +55 -0
- package/docs/server.hytopia.vector3.floor.md +19 -0
- package/docs/server.hytopia.vector3.fromvector3like.md +55 -0
- package/docs/server.hytopia.vector3.invert.md +19 -0
- package/docs/server.hytopia.vector3.lerp.md +71 -0
- package/docs/server.hytopia.vector3.magnitude.md +13 -0
- package/docs/server.hytopia.vector3.max.md +55 -0
- package/docs/server.hytopia.vector3.md +464 -3
- package/docs/server.hytopia.vector3.min.md +55 -0
- package/docs/server.hytopia.vector3.multiply.md +55 -0
- package/docs/server.hytopia.vector3.negate.md +19 -0
- package/docs/server.hytopia.vector3.normalize.md +19 -0
- package/docs/server.hytopia.vector3.rotatex.md +71 -0
- package/docs/server.hytopia.vector3.rotatey.md +71 -0
- package/docs/server.hytopia.vector3.rotatez.md +71 -0
- package/docs/server.hytopia.vector3.round.md +19 -0
- package/docs/server.hytopia.vector3.scale.md +55 -0
- package/docs/server.hytopia.vector3.squaredmagnitude.md +13 -0
- package/docs/server.hytopia.vector3.subtract.md +55 -0
- package/docs/server.hytopia.vector3.tostring.md +19 -0
- package/docs/server.hytopia.vector3.x.md +5 -1
- package/docs/server.hytopia.vector3.y.md +5 -1
- package/docs/server.hytopia.vector3.z.md +5 -1
- package/docs/server.hytopia.vector3like.md +89 -0
- package/docs/{server.hytopia.rotation.x.md → server.hytopia.vector3like.x.md} +2 -2
- package/docs/{server.hytopia.rotation.y.md → server.hytopia.vector3like.y.md} +2 -2
- package/docs/{server.hytopia.rotation.z.md → server.hytopia.vector3like.z.md} +2 -2
- package/docs/server.hytopia.worldmap.blocktypes.md +1 -5
- package/docs/server.hytopia.worldmap.md +1 -1
- package/docs/server.hytopia.worldoptions.gravity.md +1 -1
- package/docs/server.hytopia.worldoptions.md +1 -1
- package/docs/server.md +32 -10
- package/docs/server.movecallback.md +2 -2
- package/docs/server.movecompletecallback.md +2 -2
- package/docs/server.playercamera.attachedtoposition.md +1 -1
- package/docs/server.playercamera.lookatposition.md +2 -2
- package/docs/server.playercamera.md +3 -3
- package/docs/server.playercamera.offset.md +1 -1
- package/docs/server.playercamera.setattachedtoposition.md +2 -2
- package/docs/server.playercamera.setoffset.md +2 -2
- package/docs/server.playercamera.settrackedposition.md +2 -2
- package/docs/server.playercamera.trackedposition.md +1 -1
- package/docs/server.playercameraeventpayload.lookatposition.md +1 -1
- package/docs/server.playercameraeventpayload.lookatposition.position.md +1 -1
- package/docs/server.playercameraeventpayload.setattachedtoposition.md +1 -1
- package/docs/server.playercameraeventpayload.setattachedtoposition.position.md +1 -1
- package/docs/server.playercameraeventpayload.setoffset.md +1 -1
- package/docs/server.playercameraeventpayload.setoffset.offset.md +1 -1
- package/docs/server.playercameraeventpayload.settrackedposition.md +1 -1
- package/docs/server.playercameraeventpayload.settrackedposition.position.md +1 -1
- package/docs/server.quaternion._constructor_.md +89 -0
- package/docs/server.quaternion.clone.md +19 -0
- package/docs/server.quaternion.conjugate.md +19 -0
- package/docs/server.quaternion.copy.md +53 -0
- package/docs/server.quaternion.dot.md +53 -0
- package/docs/server.quaternion.equals.md +53 -0
- package/docs/server.quaternion.exactequals.md +53 -0
- package/docs/server.quaternion.exponential.md +19 -0
- package/docs/server.quaternion.fromeuler.md +85 -0
- package/docs/server.quaternion.fromquaternionlike.md +53 -0
- package/docs/server.quaternion.getangle.md +53 -0
- package/docs/server.quaternion.invert.md +19 -0
- package/docs/server.quaternion.lerp.md +69 -0
- package/docs/server.quaternion.magnitude.md +13 -0
- package/docs/server.quaternion.md +501 -0
- package/docs/server.quaternion.multiply.md +53 -0
- package/docs/server.quaternion.normalize.md +19 -0
- package/docs/server.quaternion.rotatex.md +55 -0
- package/docs/server.quaternion.rotatey.md +55 -0
- package/docs/server.quaternion.rotatez.md +55 -0
- package/docs/server.quaternion.scale.md +55 -0
- package/docs/server.quaternion.slerp.md +71 -0
- package/docs/server.quaternion.squaredmagnitude.md +13 -0
- package/docs/server.quaternion.tostring.md +19 -0
- package/docs/server.quaternion.w.md +15 -0
- package/docs/server.quaternion.x.md +15 -0
- package/docs/server.quaternion.y.md +15 -0
- package/docs/server.quaternion.z.md +15 -0
- package/docs/{server.rotation.md → server.quaternionlike.md} +8 -8
- package/docs/server.quaternionlike.w.md +11 -0
- package/docs/server.quaternionlike.x.md +11 -0
- package/docs/server.quaternionlike.y.md +11 -0
- package/docs/server.quaternionlike.z.md +11 -0
- package/docs/server.rgbcolor.b.md +11 -0
- package/docs/server.rgbcolor.g.md +11 -0
- package/docs/server.rgbcolor.md +89 -0
- package/docs/server.rgbcolor.r.md +11 -0
- package/docs/server.rigidbody.addforce.md +2 -2
- package/docs/server.rigidbody.addtorque.md +2 -2
- package/docs/server.rigidbody.applyimpulse.md +2 -2
- package/docs/server.rigidbody.applyimpulseatpoint.md +3 -3
- package/docs/server.rigidbody.applytorqueimpulse.md +2 -2
- package/docs/server.rigidbody.getangularvelocity.md +2 -2
- package/docs/server.rigidbody.getdirectionfromrotation.md +2 -2
- package/docs/server.rigidbody.geteffectiveinversemass.md +2 -2
- package/docs/server.rigidbody.getinverseprincipalangularinertiasqrt.md +2 -2
- package/docs/server.rigidbody.getlinearvelocity.md +2 -2
- package/docs/server.rigidbody.getlocalcenterofmass.md +2 -2
- package/docs/server.rigidbody.getnextkinematicrotation.md +2 -2
- package/docs/server.rigidbody.getnextkinematictranslation.md +2 -2
- package/docs/server.rigidbody.getprincipalangularinertia.md +2 -2
- package/docs/server.rigidbody.getprincipalangularinertialocalframe.md +2 -2
- package/docs/server.rigidbody.getrotation.md +2 -2
- package/docs/server.rigidbody.gettranslation.md +2 -2
- package/docs/server.rigidbody.getworldcenterofmass.md +2 -2
- package/docs/server.rigidbody.setangularvelocity.md +2 -2
- package/docs/server.rigidbody.setlinearvelocity.md +2 -2
- package/docs/server.rigidbody.setnextkinematicrotation.md +2 -2
- package/docs/server.rigidbody.setnextkinematictranslation.md +2 -2
- package/docs/server.rigidbody.setrotation.md +2 -2
- package/docs/server.rigidbody.settranslation.md +2 -2
- package/docs/server.rigidbodyadditionalmassproperties.md +4 -4
- package/docs/server.rigidbodyoptions.angularvelocity.md +1 -1
- package/docs/server.rigidbodyoptions.linearvelocity.md +1 -1
- package/docs/server.rigidbodyoptions.md +4 -4
- package/docs/server.rigidbodyoptions.rotation.md +1 -1
- package/docs/server.rigidbodyoptions.translation.md +1 -1
- package/docs/server.simplecharactercontroller.face.md +2 -2
- package/docs/server.simplecharactercontroller.move.md +2 -2
- package/docs/server.simulation.md +14 -0
- package/docs/server.simulation.setgravity.md +53 -0
- package/docs/server.vector3._constructor_.md +75 -0
- package/docs/server.vector3.add.md +55 -0
- package/docs/server.vector3.ceil.md +19 -0
- package/docs/server.vector3.clone.md +19 -0
- package/docs/server.vector3.copy.md +55 -0
- package/docs/server.vector3.cross.md +55 -0
- package/docs/server.vector3.distance.md +55 -0
- package/docs/server.vector3.divide.md +55 -0
- package/docs/server.vector3.equals.md +55 -0
- package/docs/server.vector3.exactequals.md +55 -0
- package/docs/server.vector3.floor.md +19 -0
- package/docs/server.vector3.fromvector3like.md +55 -0
- package/docs/server.vector3.invert.md +19 -0
- package/docs/server.vector3.lerp.md +71 -0
- package/docs/server.vector3.magnitude.md +13 -0
- package/docs/server.vector3.max.md +55 -0
- package/docs/server.vector3.md +464 -3
- package/docs/server.vector3.min.md +55 -0
- package/docs/server.vector3.multiply.md +55 -0
- package/docs/server.vector3.negate.md +19 -0
- package/docs/server.vector3.normalize.md +19 -0
- package/docs/server.vector3.rotatex.md +71 -0
- package/docs/server.vector3.rotatey.md +71 -0
- package/docs/server.vector3.rotatez.md +71 -0
- package/docs/server.vector3.round.md +19 -0
- package/docs/server.vector3.scale.md +55 -0
- package/docs/server.vector3.squaredmagnitude.md +13 -0
- package/docs/server.vector3.subtract.md +55 -0
- package/docs/server.vector3.tostring.md +19 -0
- package/docs/server.vector3.x.md +5 -1
- package/docs/server.vector3.y.md +5 -1
- package/docs/server.vector3.z.md +5 -1
- package/docs/server.vector3like.md +89 -0
- package/docs/server.vector3like.x.md +11 -0
- package/docs/server.vector3like.y.md +11 -0
- package/docs/server.vector3like.z.md +11 -0
- package/docs/server.worldmap.blocktypes.md +1 -5
- package/docs/server.worldmap.md +1 -1
- package/docs/server.worldoptions.gravity.md +1 -1
- package/docs/server.worldoptions.md +1 -1
- package/package.json +2 -2
- package/readme/assets/banner-2.jpeg +0 -0
- package/server.api.json +14474 -8062
- package/server.d.ts +520 -134
- package/server.js +89 -89
- package/docs/server.hytopia.webserver.md +0 -20
- package/docs/server.rotation.w.md +0 -11
- package/docs/server.rotation.x.md +0 -11
- package/docs/server.rotation.y.md +0 -11
- package/docs/server.rotation.z.md +0 -11
- package/docs/server.webserver.md +0 -20
package/server.d.ts
CHANGED
@@ -9,7 +9,6 @@ import protocol from '@hytopia.com/server-protocol';
|
|
9
9
|
import RAPIER from '@dimforge/rapier3d-compat';
|
10
10
|
import { SdpMatrix3 } from '@dimforge/rapier3d-compat';
|
11
11
|
import type { Socket as Socket_2 } from 'net';
|
12
|
-
import { Vector } from '@dimforge/rapier3d-compat';
|
13
12
|
import { WebSocket as WebSocket_2 } from 'ws';
|
14
13
|
|
15
14
|
/**
|
@@ -23,7 +22,7 @@ import { WebSocket as WebSocket_2 } from 'ws';
|
|
23
22
|
* @example
|
24
23
|
* ```typescript
|
25
24
|
* (new Audio({
|
26
|
-
* uri: 'assets/music/song.mp3
|
25
|
+
* uri: 'music/song.mp3', // relative to the server's assets directory in the project root, resolves to assets/music/song.mp3
|
27
26
|
* loop: true,
|
28
27
|
* volume: 0.5,
|
29
28
|
* })).play(world);
|
@@ -72,7 +71,7 @@ export declare class Audio implements protocol.Serializable {
|
|
72
71
|
/** Whether the audio is positional (Entity or position attached). */
|
73
72
|
get isPositional(): boolean;
|
74
73
|
/** The position of the audio in the world if explicitly set. */
|
75
|
-
get position():
|
74
|
+
get position(): Vector3Like | undefined;
|
76
75
|
/** The playback rate of the audio if explicitly set. */
|
77
76
|
get playbackRate(): number | undefined;
|
78
77
|
/** The reference distance of the audio if explicitly set. */
|
@@ -119,7 +118,7 @@ export declare class Audio implements protocol.Serializable {
|
|
119
118
|
*
|
120
119
|
* @param position - The position in the world.
|
121
120
|
*/
|
122
|
-
setPosition(position:
|
121
|
+
setPosition(position: Vector3Like): void;
|
123
122
|
/**
|
124
123
|
* Sets the playback rate of the audio.
|
125
124
|
*
|
@@ -167,7 +166,7 @@ export declare namespace AudioEventPayload {
|
|
167
166
|
}
|
168
167
|
export interface SetPosition {
|
169
168
|
audio: Audio;
|
170
|
-
position:
|
169
|
+
position: Vector3Like;
|
171
170
|
}
|
172
171
|
export interface SetPlaybackRate {
|
173
172
|
audio: Audio;
|
@@ -266,7 +265,7 @@ export declare interface AudioOptions {
|
|
266
265
|
/** The offset time in seconds from which the audio should start playing. */
|
267
266
|
offset?: number;
|
268
267
|
/** The position in the world where the audio is played. */
|
269
|
-
position?:
|
268
|
+
position?: Vector3Like;
|
270
269
|
/** The playback speed of the audio. Defaults to 1. */
|
271
270
|
playbackRate?: number;
|
272
271
|
/** The reference distance for reducing volume as the audio source moves away from the listener. */
|
@@ -342,7 +341,7 @@ export declare abstract class BaseCharacterController {
|
|
342
341
|
*/
|
343
342
|
export declare class Block {
|
344
343
|
/** The global coordinate of the block. */
|
345
|
-
readonly globalCoordinate:
|
344
|
+
readonly globalCoordinate: Vector3Like;
|
346
345
|
/** The block type of the block. */
|
347
346
|
readonly blockType: BlockType;
|
348
347
|
|
@@ -365,7 +364,7 @@ export declare class Block {
|
|
365
364
|
* const stoneBlockTypeId = 10;
|
366
365
|
* world.blockTypeRegistry.registerBlockType(stoneBlockTypeId, new BlockType({
|
367
366
|
* id: stoneBlockTypeId,
|
368
|
-
* textureUri: '
|
367
|
+
* textureUri: 'textures/stone.png',
|
369
368
|
* name: 'Stone',
|
370
369
|
* }));
|
371
370
|
*
|
@@ -435,7 +434,7 @@ export declare interface BlockTypeOptions {
|
|
435
434
|
* ```typescript
|
436
435
|
* world.blockTypeRegistry.registerGenericBlockType({
|
437
436
|
* id: 15,
|
438
|
-
* textureUri: '
|
437
|
+
* textureUri: 'textures/dirt.png',
|
439
438
|
* name: 'Dirt',
|
440
439
|
* });
|
441
440
|
* ```
|
@@ -467,10 +466,9 @@ export declare class BlockTypeRegistry implements protocol.Serializable {
|
|
467
466
|
registerGenericBlockType(blockTypeOptions: BlockTypeOptions): BlockType;
|
468
467
|
/**
|
469
468
|
* Register a block type.
|
470
|
-
* @param
|
471
|
-
* @param blockTypeReference - The block type to register.
|
469
|
+
* @param blockType - The block type to register.
|
472
470
|
*/
|
473
|
-
registerBlockType(
|
471
|
+
registerBlockType(blockType: BlockType): void;
|
474
472
|
|
475
473
|
}
|
476
474
|
|
@@ -627,7 +625,7 @@ export declare class Chunk implements protocol.Serializable {
|
|
627
625
|
/** Whether the chunk has been spawned. */
|
628
626
|
get isSpawned(): boolean;
|
629
627
|
/** The origin coordinate of the chunk. */
|
630
|
-
get originCoordinate():
|
628
|
+
get originCoordinate(): Vector3Like | undefined;
|
631
629
|
/** The world the chunk belongs to. */
|
632
630
|
get world(): World | undefined;
|
633
631
|
/**
|
@@ -635,41 +633,53 @@ export declare class Chunk implements protocol.Serializable {
|
|
635
633
|
* @param index - The index of the block to convert.
|
636
634
|
* @returns The local coordinate of the block.
|
637
635
|
*/
|
638
|
-
static blockIndexToLocalCoordinate(index: number):
|
636
|
+
static blockIndexToLocalCoordinate(index: number): Vector3Like;
|
639
637
|
/**
|
640
638
|
* Convert a global coordinate to a local coordinate.
|
641
639
|
* @param globalCoordinate - The global coordinate to convert.
|
642
640
|
* @returns The local coordinate.
|
643
641
|
*/
|
644
|
-
static globalCoordinateToLocalCoordinate(globalCoordinate:
|
642
|
+
static globalCoordinateToLocalCoordinate(globalCoordinate: Vector3Like): Vector3Like;
|
645
643
|
/**
|
646
644
|
* Convert a global coordinate to an origin coordinate.
|
647
645
|
* @param globalCoordinate - The global coordinate to convert.
|
648
646
|
* @returns The origin coordinate.
|
649
647
|
*/
|
650
|
-
static globalCoordinateToOriginCoordinate(globalCoordinate:
|
648
|
+
static globalCoordinateToOriginCoordinate(globalCoordinate: Vector3Like): Vector3Like;
|
651
649
|
/**
|
652
650
|
* Check if an origin coordinate is valid.
|
653
651
|
* @param coordinate - The coordinate to check.
|
654
652
|
* @returns Whether the coordinate is valid.
|
655
653
|
*/
|
656
|
-
static isValidOriginCoordinate(coordinate:
|
654
|
+
static isValidOriginCoordinate(coordinate: Vector3Like): boolean;
|
657
655
|
/**
|
658
656
|
* Spawn the chunk in the world.
|
659
657
|
* @param world - The world to spawn the chunk in.
|
660
658
|
* @param originCoordinate - The origin coordinate of the chunk.
|
661
659
|
*/
|
662
|
-
spawn(world: World, originCoordinate:
|
660
|
+
spawn(world: World, originCoordinate: Vector3Like): void;
|
663
661
|
/**
|
664
662
|
* Despawn the chunk from the world.
|
665
663
|
*/
|
666
664
|
despawn(): void;
|
665
|
+
/**
|
666
|
+
* Get the block type id at a specific local coordinate.
|
667
|
+
* @param localCoordinate - The local coordinate of the block to get.
|
668
|
+
* @returns The block type id.
|
669
|
+
*/
|
670
|
+
getBlock(localCoordinate: Vector3Like): number;
|
671
|
+
/**
|
672
|
+
* Check if a block exists at a specific local coordinate.
|
673
|
+
* @param localCoordinate - The local coordinate of the block to check.
|
674
|
+
* @returns Whether a block exists.
|
675
|
+
*/
|
676
|
+
hasBlock(localCoordinate: Vector3Like): boolean;
|
667
677
|
/**
|
668
678
|
* Set the block at a specific local coordinate by block type id.
|
669
679
|
* @param localCoordinate - The local coordinate of the block to set.
|
670
680
|
* @param blockTypeId - The block type id to set.
|
671
681
|
*/
|
672
|
-
setBlock(localCoordinate:
|
682
|
+
setBlock(localCoordinate: Vector3Like, blockTypeId: number): void;
|
673
683
|
|
674
684
|
|
675
685
|
|
@@ -686,8 +696,8 @@ export declare namespace ChunkEventPayload {
|
|
686
696
|
}
|
687
697
|
export interface SetBlock {
|
688
698
|
chunk: Chunk;
|
689
|
-
globalCoordinate:
|
690
|
-
localCoordinate:
|
699
|
+
globalCoordinate: Vector3Like;
|
700
|
+
localCoordinate: Vector3Like;
|
691
701
|
blockTypeId: number;
|
692
702
|
}
|
693
703
|
export interface Spawn {
|
@@ -721,30 +731,42 @@ export declare class ChunkLattice {
|
|
721
731
|
constructor(world: World);
|
722
732
|
|
723
733
|
|
734
|
+
/**
|
735
|
+
* Get the block type id at a specific global coordinate.
|
736
|
+
* @param globalCoordinate - The global coordinate of the block to get.
|
737
|
+
* @returns The block type id, 0 if no block is set.
|
738
|
+
*/
|
739
|
+
getBlock(globalCoordinate: Vector3Like): number;
|
724
740
|
/**
|
725
741
|
* Get a chunk by its origin coordinate.
|
726
742
|
* @param originCoordinate - The origin coordinate of the chunk to get.
|
727
743
|
* @returns The chunk at the given origin coordinate or undefined if not found.
|
728
744
|
*/
|
729
|
-
getChunk(originCoordinate:
|
745
|
+
getChunk(originCoordinate: Vector3Like): Chunk | undefined;
|
730
746
|
/**
|
731
747
|
* Get all chunks in the lattice.
|
732
748
|
* @returns An array of all chunks in the lattice.
|
733
749
|
*/
|
734
750
|
getAllChunks(): Chunk[];
|
751
|
+
/**
|
752
|
+
* Check if a block exists at a specific global coordinate.
|
753
|
+
* @param globalCoordinate - The global coordinate of the block to check.
|
754
|
+
* @returns Whether a block exists.
|
755
|
+
*/
|
756
|
+
hasBlock(globalCoordinate: Vector3Like): boolean;
|
735
757
|
/**
|
736
758
|
* Check if a chunk exists by its origin coordinate.
|
737
759
|
* @param originCoordinate - The origin coordinate of the chunk to check.
|
738
760
|
* @returns Whether the chunk exists.
|
739
761
|
*/
|
740
|
-
hasChunk(originCoordinate:
|
762
|
+
hasChunk(originCoordinate: Vector3Like): boolean;
|
741
763
|
/**
|
742
764
|
* Set the block at a global coordinate by block type id, automatically
|
743
|
-
* creating a chunk if it doesn't exist.
|
765
|
+
* creating a chunk if it doesn't exist. Use block type id 0 for air.
|
744
766
|
* @param globalCoordinate - The global coordinate of the block to set.
|
745
|
-
* @param blockTypeId - The block type id to set.
|
767
|
+
* @param blockTypeId - The block type id to set. Use 0 to remove the block and replace with air.
|
746
768
|
*/
|
747
|
-
setBlock(globalCoordinate:
|
769
|
+
setBlock(globalCoordinate: Vector3Like, blockTypeId: number): void;
|
748
770
|
|
749
771
|
|
750
772
|
}
|
@@ -809,12 +831,12 @@ export declare class Collider {
|
|
809
831
|
* Gets the relative rotation of the collider.
|
810
832
|
* @returns The relative rotation of the collider.
|
811
833
|
*/
|
812
|
-
getRelativeRotation():
|
834
|
+
getRelativeRotation(): QuaternionLike;
|
813
835
|
/**
|
814
836
|
* Gets the relative translation of the collider to its parent rigid body.
|
815
837
|
* @returns The relative translation of the collider.
|
816
838
|
*/
|
817
|
-
getRelativeTranslation():
|
839
|
+
getRelativeTranslation(): Vector3Like;
|
818
840
|
/**
|
819
841
|
* Sets the bounciness of the collider.
|
820
842
|
* @param bounciness - The bounciness of the collider.
|
@@ -849,12 +871,12 @@ export declare class Collider {
|
|
849
871
|
* Sets the relative rotation of the collider.
|
850
872
|
* @param rotation - The relative rotation of the collider.
|
851
873
|
*/
|
852
|
-
setRelativeRotation(rotation:
|
874
|
+
setRelativeRotation(rotation: QuaternionLike): void;
|
853
875
|
/**
|
854
876
|
* Sets the relative translation of the collider to its parent rigid body.
|
855
877
|
* @param translation - The relative translation of the collider.
|
856
878
|
*/
|
857
|
-
setRelativeTranslation(translation:
|
879
|
+
setRelativeTranslation(translation: Vector3Like): void;
|
858
880
|
/**
|
859
881
|
* Sets whether the collider is a sensor.
|
860
882
|
* @param sensor - Whether the collider is a sensor.
|
@@ -909,7 +931,7 @@ export declare interface ColliderOptions {
|
|
909
931
|
/** The friction of the collider. */
|
910
932
|
friction?: number;
|
911
933
|
/** The half extents of the collider if the shape is a block. */
|
912
|
-
halfExtents?:
|
934
|
+
halfExtents?: Vector3Like;
|
913
935
|
/** The half height of the collider if the shape is a capsule, cone, cylinder, or round cylinder. */
|
914
936
|
halfHeight?: number;
|
915
937
|
/** Whether the collider is a sensor. */
|
@@ -923,9 +945,9 @@ export declare interface ColliderOptions {
|
|
923
945
|
/** The radius of the collider if the shape is a ball, capsule, cone, cylinder, or round cylinder. */
|
924
946
|
radius?: number;
|
925
947
|
/** The relative rotation of the collider. Relative to parent rigid body. */
|
926
|
-
relativeRotation?:
|
948
|
+
relativeRotation?: QuaternionLike;
|
927
949
|
/** The relative translation of the collider. Relative to parent rigid body. */
|
928
|
-
relativeTranslation?:
|
950
|
+
relativeTranslation?: Vector3Like;
|
929
951
|
/** The simulation the collider is in, if provided the collider will automatically be added to the simulation. */
|
930
952
|
simulation?: Simulation;
|
931
953
|
/** An arbitrary identifier tag of the collider. Useful for your own logic. */
|
@@ -1269,6 +1291,7 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1269
1291
|
|
1270
1292
|
|
1271
1293
|
|
1294
|
+
|
1272
1295
|
/**
|
1273
1296
|
* @param options - The options for the entity.
|
1274
1297
|
*/
|
@@ -1278,7 +1301,7 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1278
1301
|
/** The character controller for the entity. */
|
1279
1302
|
get characterController(): BaseCharacterController | undefined;
|
1280
1303
|
/** The half extends of the visual size of the block entity when blockTextureUri is set. */
|
1281
|
-
get blockHalfExtents():
|
1304
|
+
get blockHalfExtents(): Vector3Like | undefined;
|
1282
1305
|
/** The URI or path to the texture to be used, if this is set, the entity is a block entity. */
|
1283
1306
|
get blockTextureUri(): string | undefined;
|
1284
1307
|
/** The URI or path to the .gltf model asset to be used for the entity. */
|
@@ -1291,6 +1314,8 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1291
1314
|
get name(): string;
|
1292
1315
|
/** An arbitrary identifier tag of the entity. Useful for your own logic. */
|
1293
1316
|
get tag(): string | undefined;
|
1317
|
+
/** The tint color of the entity. */
|
1318
|
+
get tintColor(): RgbColor | undefined;
|
1294
1319
|
/** Whether the entity is spawned. */
|
1295
1320
|
get isSpawned(): boolean;
|
1296
1321
|
/** The world the entity is in. */
|
@@ -1300,7 +1325,7 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1300
1325
|
* @param world - The world to spawn the entity in.
|
1301
1326
|
* @param coordinate - The coordinate to spawn the entity at.
|
1302
1327
|
*/
|
1303
|
-
spawn(world: World, coordinate:
|
1328
|
+
spawn(world: World, coordinate: Vector3Like): void;
|
1304
1329
|
/**
|
1305
1330
|
* Despawns the entity from the world.
|
1306
1331
|
*/
|
@@ -1310,6 +1335,11 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1310
1335
|
* @param characterController - The character controller to set.
|
1311
1336
|
*/
|
1312
1337
|
setCharacterController(characterController: BaseCharacterController): void;
|
1338
|
+
/**
|
1339
|
+
* Sets the tint color of the entity.
|
1340
|
+
* @param tintColor - The tint color of the entity.
|
1341
|
+
*/
|
1342
|
+
setTintColor(tintColor: RgbColor | undefined): void;
|
1313
1343
|
/**
|
1314
1344
|
* Starts looped animations for the entity, blending with
|
1315
1345
|
* other animations currently playing.
|
@@ -1341,6 +1371,10 @@ export declare namespace EntityEventPayload {
|
|
1341
1371
|
export interface Despawn {
|
1342
1372
|
entity: Entity;
|
1343
1373
|
}
|
1374
|
+
export interface SetTintColor {
|
1375
|
+
entity: Entity;
|
1376
|
+
tintColor: RgbColor | undefined;
|
1377
|
+
}
|
1344
1378
|
export interface Spawn {
|
1345
1379
|
entity: Entity;
|
1346
1380
|
}
|
@@ -1358,19 +1392,20 @@ export declare namespace EntityEventPayload {
|
|
1358
1392
|
}
|
1359
1393
|
export interface UpdateRotation {
|
1360
1394
|
entity: Entity;
|
1361
|
-
rotation:
|
1395
|
+
rotation: QuaternionLike;
|
1362
1396
|
}
|
1363
1397
|
export interface UpdateTranslation {
|
1364
1398
|
entity: Entity;
|
1365
|
-
translation:
|
1399
|
+
translation: Vector3Like;
|
1366
1400
|
}
|
1367
1401
|
}
|
1368
1402
|
|
1369
1403
|
/** Event types an Entity instance can emit. @public */
|
1370
1404
|
export declare enum EntityEventType {
|
1371
1405
|
DESPAWN = "ENTITY.DESPAWN",
|
1406
|
+
SET_TINT_COLOR = "ENTITY.SET_TINT_COLOR",
|
1372
1407
|
SPAWN = "ENTITY.SPAWN",
|
1373
|
-
START_MODEL_LOOPED_ANIMATIONS = "ENTITY.
|
1408
|
+
START_MODEL_LOOPED_ANIMATIONS = "ENTITY.START_MODEL_LOOPED_ANIMATIONS",
|
1374
1409
|
START_MODEL_ONESHOT_ANIMATIONS = "ENTITY.START_MODEL_ONESHOT_ANIMATIONS",
|
1375
1410
|
STOP_MODEL_ANIMATIONS = "ENTITY.STOP_MODEL_ANIMATIONS",
|
1376
1411
|
UPDATE_ROTATION = "ENTITY.UPDATE_ROTATION",
|
@@ -1440,7 +1475,7 @@ export declare class EntityManager {
|
|
1440
1475
|
/** Options for creating an Entity instance. @public */
|
1441
1476
|
export declare interface EntityOptions {
|
1442
1477
|
/** The half extents of the visual size of the block entity when blockTextureUri is set. If no rigidBodyOptions.colliders are provided, a block collider with the size of the half extents will be created. */
|
1443
|
-
blockHalfExtents?:
|
1478
|
+
blockHalfExtents?: Vector3Like;
|
1444
1479
|
/** The texture uri of a entity if the entity is a block entity, if set rigidBodyOptions collider shape [0] must be a block */
|
1445
1480
|
blockTextureUri?: string;
|
1446
1481
|
/**
|
@@ -1461,6 +1496,8 @@ export declare interface EntityOptions {
|
|
1461
1496
|
rigidBodyOptions?: RigidBodyOptions;
|
1462
1497
|
/** An arbitrary identifier tag of the entity. Useful for your own logic. */
|
1463
1498
|
tag?: string;
|
1499
|
+
/** The tint color of the entity as a hex code. */
|
1500
|
+
tintColor?: RgbColor;
|
1464
1501
|
}
|
1465
1502
|
|
1466
1503
|
/** An EventRouter event. @public */
|
@@ -1545,7 +1582,7 @@ export declare class EventRouter {
|
|
1545
1582
|
* @param targetRotation - The target rotation of the entity.
|
1546
1583
|
* @public
|
1547
1584
|
*/
|
1548
|
-
export declare type FaceCallback = (currentRotation:
|
1585
|
+
export declare type FaceCallback = (currentRotation: QuaternionLike, targetRotation: QuaternionLike) => void;
|
1549
1586
|
|
1550
1587
|
/**
|
1551
1588
|
* A callback function called when the entity associated with the
|
@@ -1554,7 +1591,7 @@ export declare type FaceCallback = (currentRotation: Rotation, targetRotation: R
|
|
1554
1591
|
* @param endRotation - The rotation of the entity after it has finished rotating.
|
1555
1592
|
* @public
|
1556
1593
|
*/
|
1557
|
-
export declare type FaceCompleteCallback = (endRotation:
|
1594
|
+
export declare type FaceCompleteCallback = (endRotation: QuaternionLike) => void;
|
1558
1595
|
|
1559
1596
|
/**
|
1560
1597
|
* Options for the {@link SimpleCharacterController.face} method.
|
@@ -1658,9 +1695,12 @@ declare namespace HYTOPIA {
|
|
1658
1695
|
GameServerEventType,
|
1659
1696
|
startServer,
|
1660
1697
|
GameServerEventPayload,
|
1661
|
-
|
1662
|
-
|
1698
|
+
RgbColor,
|
1699
|
+
Quaternion,
|
1663
1700
|
Vector3,
|
1701
|
+
QuaternionLike,
|
1702
|
+
SpdMatrix3,
|
1703
|
+
Vector3Like,
|
1664
1704
|
Vector3Boolean,
|
1665
1705
|
Player,
|
1666
1706
|
PlayerEventType,
|
@@ -1687,7 +1727,6 @@ declare namespace HYTOPIA {
|
|
1687
1727
|
MoveCompleteCallback,
|
1688
1728
|
MoveOptions,
|
1689
1729
|
Simulation,
|
1690
|
-
WebServer,
|
1691
1730
|
PORT,
|
1692
1731
|
World,
|
1693
1732
|
WorldMap,
|
@@ -1707,7 +1746,7 @@ export default HYTOPIA;
|
|
1707
1746
|
* @param targetTranslation - The target translation of the entity.
|
1708
1747
|
* @public
|
1709
1748
|
*/
|
1710
|
-
export declare type MoveCallback = (currentTranslation:
|
1749
|
+
export declare type MoveCallback = (currentTranslation: Vector3Like, targetTranslation: Vector3Like) => void;
|
1711
1750
|
|
1712
1751
|
/**
|
1713
1752
|
* A callback function called when the entity associated with the
|
@@ -1716,7 +1755,7 @@ export declare type MoveCallback = (currentTranslation: Vector3, targetTranslati
|
|
1716
1755
|
* @param endTranslation - The translation of the entity after it has finished moving.
|
1717
1756
|
* @public
|
1718
1757
|
*/
|
1719
|
-
export declare type MoveCompleteCallback = (endTranslation:
|
1758
|
+
export declare type MoveCompleteCallback = (endTranslation: Vector3Like) => void;
|
1720
1759
|
|
1721
1760
|
/**
|
1722
1761
|
* Options for the {@link SimpleCharacterController.move} method.
|
@@ -1822,7 +1861,7 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1822
1861
|
/** The entity the camera is attached to. */
|
1823
1862
|
get attachedToEntity(): Entity | undefined;
|
1824
1863
|
/** The position the camera is attached to. */
|
1825
|
-
get attachedToPosition():
|
1864
|
+
get attachedToPosition(): Vector3Like | undefined;
|
1826
1865
|
/** The film offset of the camera. A positive value shifts the camera right, a negative value shifts it left. */
|
1827
1866
|
get filmOffset(): number;
|
1828
1867
|
/** Only used in first-person mode. The forward offset of the camera. A positive number shifts the camera forward, a negative number shifts it backward. */
|
@@ -1834,11 +1873,11 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1834
1873
|
/** The mode of the camera. */
|
1835
1874
|
get mode(): PlayerCameraMode;
|
1836
1875
|
/** The relative offset of the camera from the entity or position it is attached to. */
|
1837
|
-
get offset():
|
1876
|
+
get offset(): Vector3Like;
|
1838
1877
|
/** The entity the camera will constantly look at, even if the camera attached or tracked entity moves. */
|
1839
1878
|
get trackedEntity(): Entity | undefined;
|
1840
1879
|
/** The position the camera will constantly look at, even if the camera attached entity moves. */
|
1841
|
-
get trackedPosition():
|
1880
|
+
get trackedPosition(): Vector3Like | undefined;
|
1842
1881
|
/** The zoom of the camera. */
|
1843
1882
|
get zoom(): number;
|
1844
1883
|
/**
|
@@ -1854,7 +1893,7 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1854
1893
|
* stop tracking.
|
1855
1894
|
* @param position - The position to look at.
|
1856
1895
|
*/
|
1857
|
-
lookAtPosition(position:
|
1896
|
+
lookAtPosition(position: Vector3Like): void;
|
1858
1897
|
/**
|
1859
1898
|
* Sets the entity the camera is attached to.
|
1860
1899
|
* @param entity - The entity to attach the camera to.
|
@@ -1864,7 +1903,7 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1864
1903
|
* Sets the position the camera is attached to.
|
1865
1904
|
* @param position - The position to attach the camera to.
|
1866
1905
|
*/
|
1867
|
-
setAttachedToPosition(position:
|
1906
|
+
setAttachedToPosition(position: Vector3Like): void;
|
1868
1907
|
/**
|
1869
1908
|
* Sets the film offset of the camera. A positive value
|
1870
1909
|
* shifts the camera right, a negative value shifts it left.
|
@@ -1900,7 +1939,7 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1900
1939
|
* entity or position it is attached to.
|
1901
1940
|
* @param offset - The offset to set.
|
1902
1941
|
*/
|
1903
|
-
setOffset(offset:
|
1942
|
+
setOffset(offset: Vector3Like): void;
|
1904
1943
|
/**
|
1905
1944
|
* Sets the entity the camera will constantly look at,
|
1906
1945
|
* even if the camera attached or tracked entity moves.
|
@@ -1912,7 +1951,7 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1912
1951
|
* even if the camera attached entity moves.
|
1913
1952
|
* @param position - The position to track or undefined to stop tracking.
|
1914
1953
|
*/
|
1915
|
-
setTrackedPosition(position:
|
1954
|
+
setTrackedPosition(position: Vector3Like | undefined): void;
|
1916
1955
|
/**
|
1917
1956
|
* Sets the zoom of the camera.
|
1918
1957
|
* @param zoom - The zoom to set, 0 to infinity.
|
@@ -1930,7 +1969,7 @@ export declare namespace PlayerCameraEventPayload {
|
|
1930
1969
|
}
|
1931
1970
|
export interface LookAtPosition {
|
1932
1971
|
playerCamera: PlayerCamera;
|
1933
|
-
position:
|
1972
|
+
position: Vector3Like;
|
1934
1973
|
}
|
1935
1974
|
export interface SetAttachedToEntity {
|
1936
1975
|
playerCamera: PlayerCamera;
|
@@ -1938,7 +1977,7 @@ export declare namespace PlayerCameraEventPayload {
|
|
1938
1977
|
}
|
1939
1978
|
export interface SetAttachedToPosition {
|
1940
1979
|
playerCamera: PlayerCamera;
|
1941
|
-
position:
|
1980
|
+
position: Vector3Like;
|
1942
1981
|
}
|
1943
1982
|
export interface SetFilmOffset {
|
1944
1983
|
playerCamera: PlayerCamera;
|
@@ -1962,7 +2001,7 @@ export declare namespace PlayerCameraEventPayload {
|
|
1962
2001
|
}
|
1963
2002
|
export interface SetOffset {
|
1964
2003
|
playerCamera: PlayerCamera;
|
1965
|
-
offset:
|
2004
|
+
offset: Vector3Like;
|
1966
2005
|
}
|
1967
2006
|
export interface SetTrackedEntity {
|
1968
2007
|
playerCamera: PlayerCamera;
|
@@ -1970,7 +2009,7 @@ export declare namespace PlayerCameraEventPayload {
|
|
1970
2009
|
}
|
1971
2010
|
export interface SetTrackedPosition {
|
1972
2011
|
playerCamera: PlayerCamera;
|
1973
|
-
position:
|
2012
|
+
position: Vector3Like | undefined;
|
1974
2013
|
}
|
1975
2014
|
export interface SetZoom {
|
1976
2015
|
playerCamera: PlayerCamera;
|
@@ -2133,6 +2172,181 @@ export declare type PlayerOrientationState = {
|
|
2133
2172
|
*/
|
2134
2173
|
export declare const PORT: string | 8080;
|
2135
2174
|
|
2175
|
+
/**
|
2176
|
+
* Represents a quaternion.
|
2177
|
+
*
|
2178
|
+
* @remarks
|
2179
|
+
* All quaternion methods result in mutation of the quaternion instance.
|
2180
|
+
* This class extends `Float32Array` to provide an efficient way to
|
2181
|
+
* create and manipulate a quaternion. Various convenience methods are
|
2182
|
+
* provided for common quaternion operations.
|
2183
|
+
*
|
2184
|
+
* @public
|
2185
|
+
*/
|
2186
|
+
export declare class Quaternion extends Float32Array implements QuaternionLike {
|
2187
|
+
constructor(x: number, y: number, z: number, w: number);
|
2188
|
+
/** The magnitude of the quaternion. Also known as the length. */
|
2189
|
+
get magnitude(): number;
|
2190
|
+
/** The squared magnitude of the quaternion. Also known as the squared length. */
|
2191
|
+
get squaredMagnitude(): number;
|
2192
|
+
/** The x-component of the quaternion. */
|
2193
|
+
get x(): number;
|
2194
|
+
set x(value: number);
|
2195
|
+
/** The y-component of the quaternion. */
|
2196
|
+
get y(): number;
|
2197
|
+
set y(value: number);
|
2198
|
+
/** The z-component of the quaternion. */
|
2199
|
+
get z(): number;
|
2200
|
+
set z(value: number);
|
2201
|
+
/** The w-component of the quaternion. */
|
2202
|
+
get w(): number;
|
2203
|
+
set w(value: number);
|
2204
|
+
/**
|
2205
|
+
* Creates a quaternion from Euler angles.
|
2206
|
+
*
|
2207
|
+
* @param x - The x-component of the Euler angles in degrees.
|
2208
|
+
* @param y - The y-component of the Euler angles in degrees.
|
2209
|
+
* @param z - The z-component of the Euler angles in degrees.
|
2210
|
+
*/
|
2211
|
+
static fromEuler(x: number, y: number, z: number): Quaternion;
|
2212
|
+
/**
|
2213
|
+
* Creates a quaternion from a `QuaternionLike` object.
|
2214
|
+
*
|
2215
|
+
* @param quaternionLike - The `QuaternionLike` object to create the quaternion from.
|
2216
|
+
*/
|
2217
|
+
static fromQuaternionLike(quaternionLike: QuaternionLike): Quaternion;
|
2218
|
+
/**
|
2219
|
+
* Creates a clone of the current quaternion.
|
2220
|
+
*
|
2221
|
+
* @returns A new `Quaternion` instance.
|
2222
|
+
*/
|
2223
|
+
clone(): Quaternion;
|
2224
|
+
/**
|
2225
|
+
* Conjugates the current quaternion.
|
2226
|
+
*
|
2227
|
+
* @returns The current quaternion.
|
2228
|
+
*/
|
2229
|
+
conjugate(): Quaternion;
|
2230
|
+
/**
|
2231
|
+
* Copies the components of a `QuaternionLike` object to the current quaternion.
|
2232
|
+
*
|
2233
|
+
* @param quaternionLike - The `QuaternionLike` object to copy the components from.
|
2234
|
+
* @returns The current quaternion.
|
2235
|
+
*/
|
2236
|
+
copy(quaternion: Quaternion): Quaternion;
|
2237
|
+
/**
|
2238
|
+
* Calculates the dot product of the current quaternion and another quaternion.
|
2239
|
+
*
|
2240
|
+
* @param quaternionLike - The quaternion to calculate the dot product with.
|
2241
|
+
* @returns The dot product.
|
2242
|
+
*/
|
2243
|
+
dot(quaternion: Quaternion): number;
|
2244
|
+
/**
|
2245
|
+
* Calculates and sets the current quaternion to its exponential.
|
2246
|
+
*
|
2247
|
+
* @returns The current quaternion.
|
2248
|
+
*/
|
2249
|
+
exponential(): Quaternion;
|
2250
|
+
/**
|
2251
|
+
* Checks if the current quaternion is approximately equal to another quaternion.
|
2252
|
+
*
|
2253
|
+
* @param quaternionLike - The quaternion to check against.
|
2254
|
+
* @returns `true` if the quaternions are approximately equal, `false` otherwise.
|
2255
|
+
*/
|
2256
|
+
equals(quaternion: Quaternion): boolean;
|
2257
|
+
/**
|
2258
|
+
* Checks if the current quaternion is exactly equal to another quaternion.
|
2259
|
+
*
|
2260
|
+
* @param quaternionLike - The quaternion to check against.
|
2261
|
+
* @returns `true` if the quaternions are exactly equal, `false` otherwise.
|
2262
|
+
*/
|
2263
|
+
exactEquals(quaternion: Quaternion): boolean;
|
2264
|
+
/**
|
2265
|
+
* Calculates and returns the angle between the current quaternion and another quaternion.
|
2266
|
+
*
|
2267
|
+
* @param quaternionLike - The quaternion to calculate the angle with.
|
2268
|
+
* @returns The angle in degrees.
|
2269
|
+
*/
|
2270
|
+
getAngle(quaternion: Quaternion): number;
|
2271
|
+
/**
|
2272
|
+
* Inverts each component of the quaternion.
|
2273
|
+
*
|
2274
|
+
* @returns The current quaternion.
|
2275
|
+
*/
|
2276
|
+
invert(): Quaternion;
|
2277
|
+
/**
|
2278
|
+
* Linearly interpolates between the current quaternion and another quaternion.
|
2279
|
+
*
|
2280
|
+
* @param quaternionLike - The quaternion to interpolate with.
|
2281
|
+
* @param t - The interpolation factor.
|
2282
|
+
* @returns The current quaternion.
|
2283
|
+
*/
|
2284
|
+
lerp(quaternion: Quaternion, t: number): Quaternion;
|
2285
|
+
/**
|
2286
|
+
* Multiplies the quaternion by another quaternion.
|
2287
|
+
*
|
2288
|
+
* @param quaternionLike - The quaternion to multiply by.
|
2289
|
+
* @returns The current quaternion.
|
2290
|
+
*/
|
2291
|
+
multiply(quaternion: Quaternion): Quaternion;
|
2292
|
+
/**
|
2293
|
+
* Normalizes the quaternion.
|
2294
|
+
*
|
2295
|
+
* @returns The current quaternion.
|
2296
|
+
*/
|
2297
|
+
normalize(): Quaternion;
|
2298
|
+
/**
|
2299
|
+
* Rotates the quaternion around the x-axis.
|
2300
|
+
*
|
2301
|
+
* @param angle - The angle to rotate in degrees.
|
2302
|
+
* @returns The current quaternion.
|
2303
|
+
*/
|
2304
|
+
rotateX(angle: number): Quaternion;
|
2305
|
+
/**
|
2306
|
+
* Rotates the quaternion around the y-axis.
|
2307
|
+
*
|
2308
|
+
* @param angle - The angle to rotate in degrees.
|
2309
|
+
* @returns The current quaternion.
|
2310
|
+
*/
|
2311
|
+
rotateY(angle: number): Quaternion;
|
2312
|
+
/**
|
2313
|
+
* Rotates the quaternion around the z-axis.
|
2314
|
+
*
|
2315
|
+
* @param angle - The angle to rotate in degrees.
|
2316
|
+
* @returns The current quaternion.
|
2317
|
+
*/
|
2318
|
+
rotateZ(angle: number): Quaternion;
|
2319
|
+
/**
|
2320
|
+
* Scales the quaternion by a scalar value.
|
2321
|
+
*
|
2322
|
+
* @param scale - The scalar value to scale the quaternion by.
|
2323
|
+
* @returns The current quaternion.
|
2324
|
+
*/
|
2325
|
+
scale(scale: number): Quaternion;
|
2326
|
+
/**
|
2327
|
+
* Spherically interpolates between the current quaternion and another quaternion.
|
2328
|
+
*
|
2329
|
+
* @param quaternion - The quaternion to interpolate with.
|
2330
|
+
* @param t - The interpolation factor.
|
2331
|
+
* @returns The current quaternion.
|
2332
|
+
*/
|
2333
|
+
slerp(quaternion: Quaternion, t: number): Quaternion;
|
2334
|
+
/**
|
2335
|
+
* Returns a string representation of the quaternion in x,y,z,w format.
|
2336
|
+
*
|
2337
|
+
* @returns A string representation of the quaternion in the format x,y,z,w.
|
2338
|
+
*/
|
2339
|
+
toString(): string;
|
2340
|
+
}
|
2341
|
+
|
2342
|
+
/** A quaternion. @public */
|
2343
|
+
export declare interface QuaternionLike {
|
2344
|
+
x: number;
|
2345
|
+
y: number;
|
2346
|
+
z: number;
|
2347
|
+
w: number;
|
2348
|
+
}
|
2349
|
+
|
2136
2350
|
/** A raw set of collision groups represented as a 32-bit number. @public */
|
2137
2351
|
export declare type RawCollisionGroups = RAPIER.InteractionGroups;
|
2138
2352
|
|
@@ -2152,6 +2366,13 @@ declare type RayCastOptions = {
|
|
2152
2366
|
filterPredicate?: (collider: RAPIER.Collider) => boolean;
|
2153
2367
|
};
|
2154
2368
|
|
2369
|
+
/** A RGB color. @public */
|
2370
|
+
export declare interface RgbColor {
|
2371
|
+
r: number;
|
2372
|
+
g: number;
|
2373
|
+
b: number;
|
2374
|
+
}
|
2375
|
+
|
2155
2376
|
/**
|
2156
2377
|
* Represents a rigid body in a world's physics simulation.
|
2157
2378
|
*
|
@@ -2223,7 +2444,7 @@ export declare class RigidBody {
|
|
2223
2444
|
* Gets the angular velocity of the rigid body.
|
2224
2445
|
* @returns The angular velocity of the rigid body.
|
2225
2446
|
*/
|
2226
|
-
getAngularVelocity():
|
2447
|
+
getAngularVelocity(): Vector3Like;
|
2227
2448
|
/**
|
2228
2449
|
* Gets the colliders of the rigid body by tag.
|
2229
2450
|
* @param tag - The tag to filter by.
|
@@ -2239,7 +2460,7 @@ export declare class RigidBody {
|
|
2239
2460
|
* Gets the direction from the rotation of the rigid body.
|
2240
2461
|
* @returns The direction from the rotation of the rigid body.
|
2241
2462
|
*/
|
2242
|
-
getDirectionFromRotation():
|
2463
|
+
getDirectionFromRotation(): Vector3Like;
|
2243
2464
|
/**
|
2244
2465
|
* Gets the effective angular inertia of the rigid body.
|
2245
2466
|
* @returns The effective angular inertia of the rigid body.
|
@@ -2249,7 +2470,7 @@ export declare class RigidBody {
|
|
2249
2470
|
* Gets the effective inverse mass of the rigid body.
|
2250
2471
|
* @returns The effective inverse mass of the rigid body.
|
2251
2472
|
*/
|
2252
|
-
getEffectiveInverseMass():
|
2473
|
+
getEffectiveInverseMass(): Vector3Like | undefined;
|
2253
2474
|
/**
|
2254
2475
|
* Gets the effective world inverse principal angular inertia square root of the rigid body.
|
2255
2476
|
* @returns The effective world inverse principal angular inertia square root of the rigid body.
|
@@ -2279,7 +2500,7 @@ export declare class RigidBody {
|
|
2279
2500
|
* Gets the inverse principal angular inertia square root of the rigid body.
|
2280
2501
|
* @returns The inverse principal angular inertia square root of the rigid body.
|
2281
2502
|
*/
|
2282
|
-
getInversePrincipalAngularInertiaSqrt():
|
2503
|
+
getInversePrincipalAngularInertiaSqrt(): Vector3Like | undefined;
|
2283
2504
|
/**
|
2284
2505
|
* Gets the linear damping of the rigid body.
|
2285
2506
|
* @returns The linear damping of the rigid body.
|
@@ -2289,12 +2510,12 @@ export declare class RigidBody {
|
|
2289
2510
|
* Gets the linear velocity of the rigid body.
|
2290
2511
|
* @returns The linear velocity of the rigid body.
|
2291
2512
|
*/
|
2292
|
-
getLinearVelocity():
|
2513
|
+
getLinearVelocity(): Vector3Like;
|
2293
2514
|
/**
|
2294
2515
|
* Gets the local center of mass of the rigid body.
|
2295
2516
|
* @returns The local center of mass of the rigid body.
|
2296
2517
|
*/
|
2297
|
-
getLocalCenterOfMass():
|
2518
|
+
getLocalCenterOfMass(): Vector3Like;
|
2298
2519
|
/**
|
2299
2520
|
* Gets the mass of the rigid body.
|
2300
2521
|
* @returns The mass of the rigid body.
|
@@ -2304,27 +2525,27 @@ export declare class RigidBody {
|
|
2304
2525
|
* Gets the next kinematic rotation of the rigid body.
|
2305
2526
|
* @returns The next kinematic rotation of the rigid body.
|
2306
2527
|
*/
|
2307
|
-
getNextKinematicRotation():
|
2528
|
+
getNextKinematicRotation(): QuaternionLike;
|
2308
2529
|
/**
|
2309
2530
|
* Gets the next kinematic translation of the rigid body.
|
2310
2531
|
* @returns The next kinematic translation of the rigid body.
|
2311
2532
|
*/
|
2312
|
-
getNextKinematicTranslation():
|
2533
|
+
getNextKinematicTranslation(): Vector3Like;
|
2313
2534
|
/**
|
2314
2535
|
* Gets the principal angular inertia of the rigid body.
|
2315
2536
|
* @returns The principal angular inertia of the rigid body.
|
2316
2537
|
*/
|
2317
|
-
getPrincipalAngularInertia():
|
2538
|
+
getPrincipalAngularInertia(): Vector3Like;
|
2318
2539
|
/**
|
2319
2540
|
* Gets the principal angular inertia local frame of the rigid body.
|
2320
2541
|
* @returns The principal angular inertia local frame of the rigid body.
|
2321
2542
|
*/
|
2322
|
-
getPrincipalAngularInertiaLocalFrame():
|
2543
|
+
getPrincipalAngularInertiaLocalFrame(): QuaternionLike | undefined;
|
2323
2544
|
/**
|
2324
2545
|
* Gets the rotation of the rigid body.
|
2325
2546
|
* @returns The rotation of the rigid body.
|
2326
2547
|
*/
|
2327
|
-
getRotation():
|
2548
|
+
getRotation(): QuaternionLike;
|
2328
2549
|
/**
|
2329
2550
|
* Gets the soft ccd prediction of the rigid body.
|
2330
2551
|
* @returns The soft ccd prediction of the rigid body.
|
@@ -2334,7 +2555,7 @@ export declare class RigidBody {
|
|
2334
2555
|
* Gets the translation of the rigid body.
|
2335
2556
|
* @returns The translation of the rigid body.
|
2336
2557
|
*/
|
2337
|
-
getTranslation():
|
2558
|
+
getTranslation(): Vector3Like;
|
2338
2559
|
/**
|
2339
2560
|
* Gets the type of the rigid body.
|
2340
2561
|
* @returns The type of the rigid body.
|
@@ -2344,7 +2565,7 @@ export declare class RigidBody {
|
|
2344
2565
|
* Gets the world center of mass of the rigid body.
|
2345
2566
|
* @returns The world center of mass of the rigid body.
|
2346
2567
|
*/
|
2347
|
-
getWorldCenterOfMass():
|
2568
|
+
getWorldCenterOfMass(): Vector3Like | undefined;
|
2348
2569
|
/**
|
2349
2570
|
* Sets the additional mass of the rigid body.
|
2350
2571
|
* @param additionalMass - The additional mass of the rigid body.
|
@@ -2369,7 +2590,7 @@ export declare class RigidBody {
|
|
2369
2590
|
* Sets the angular velocity of the rigid body.
|
2370
2591
|
* @param angularVelocity - The angular velocity of the rigid body.
|
2371
2592
|
*/
|
2372
|
-
setAngularVelocity(angularVelocity:
|
2593
|
+
setAngularVelocity(angularVelocity: Vector3Like): void;
|
2373
2594
|
/**
|
2374
2595
|
* Sets whether the rigid body has continuous collision detection enabled.
|
2375
2596
|
* @param ccdEnabled - Whether the rigid body has continuous collision detection enabled.
|
@@ -2409,22 +2630,22 @@ export declare class RigidBody {
|
|
2409
2630
|
* Sets the linear velocity of the rigid body.
|
2410
2631
|
* @param linearVelocity - The linear velocity of the rigid body.
|
2411
2632
|
*/
|
2412
|
-
setLinearVelocity(linearVelocity:
|
2633
|
+
setLinearVelocity(linearVelocity: Vector3Like): void;
|
2413
2634
|
/**
|
2414
2635
|
* Sets the next kinematic rotation of the rigid body.
|
2415
2636
|
* @param nextKinematicRotation - The next kinematic rotation of the rigid body.
|
2416
2637
|
*/
|
2417
|
-
setNextKinematicRotation(nextKinematicRotation:
|
2638
|
+
setNextKinematicRotation(nextKinematicRotation: QuaternionLike): void;
|
2418
2639
|
/**
|
2419
2640
|
* Sets the next kinematic translation of the rigid body.
|
2420
2641
|
* @param nextKinematicTranslation - The next kinematic translation of the rigid body.
|
2421
2642
|
*/
|
2422
|
-
setNextKinematicTranslation(nextKinematicTranslation:
|
2643
|
+
setNextKinematicTranslation(nextKinematicTranslation: Vector3Like): void;
|
2423
2644
|
/**
|
2424
2645
|
* Sets the rotation of the rigid body.
|
2425
2646
|
* @param rotation - The rotation of the rigid body.
|
2426
2647
|
*/
|
2427
|
-
setRotation(rotation:
|
2648
|
+
setRotation(rotation: QuaternionLike): void;
|
2428
2649
|
/**
|
2429
2650
|
* Sets whether the rigid body is sleeping.
|
2430
2651
|
* @param sleeping - Whether the rigid body is sleeping.
|
@@ -2444,7 +2665,7 @@ export declare class RigidBody {
|
|
2444
2665
|
* Sets the translation of the rigid body.
|
2445
2666
|
* @param translation - The translation of the rigid body.
|
2446
2667
|
*/
|
2447
|
-
setTranslation(translation:
|
2668
|
+
setTranslation(translation: Vector3Like): void;
|
2448
2669
|
/**
|
2449
2670
|
* Sets the type of the rigid body.
|
2450
2671
|
* @param type - The type of the rigid body.
|
@@ -2454,12 +2675,12 @@ export declare class RigidBody {
|
|
2454
2675
|
* Adds a force to the rigid body.
|
2455
2676
|
* @param force - The force to add to the rigid body.
|
2456
2677
|
*/
|
2457
|
-
addForce(force:
|
2678
|
+
addForce(force: Vector3Like): void;
|
2458
2679
|
/**
|
2459
2680
|
* Adds a torque to the rigid body.
|
2460
2681
|
* @param torque - The torque to add to the rigid body.
|
2461
2682
|
*/
|
2462
|
-
addTorque(torque:
|
2683
|
+
addTorque(torque: Vector3Like): void;
|
2463
2684
|
/**
|
2464
2685
|
* Adds an unsimulated child collider to the rigid body for the simulation it belongs to.
|
2465
2686
|
* @param collider - The child collider to add to the rigid body for the simulation it belongs to.
|
@@ -2474,18 +2695,18 @@ export declare class RigidBody {
|
|
2474
2695
|
* Applies an impulse to the rigid body.
|
2475
2696
|
* @param impulse - The impulse to apply to the rigid body.
|
2476
2697
|
*/
|
2477
|
-
applyImpulse(impulse:
|
2698
|
+
applyImpulse(impulse: Vector3Like): void;
|
2478
2699
|
/**
|
2479
2700
|
* Applies an impulse to the rigid body at a point.
|
2480
2701
|
* @param impulse - The impulse to apply to the rigid body.
|
2481
2702
|
* @param point - The point at which to apply the impulse.
|
2482
2703
|
*/
|
2483
|
-
applyImpulseAtPoint(impulse:
|
2704
|
+
applyImpulseAtPoint(impulse: Vector3Like, point: Vector3Like): void;
|
2484
2705
|
/**
|
2485
2706
|
* Applies a torque impulse to the rigid body.
|
2486
2707
|
* @param impulse - The torque impulse to apply to the rigid body.
|
2487
2708
|
*/
|
2488
|
-
applyTorqueImpulse(impulse:
|
2709
|
+
applyTorqueImpulse(impulse: Vector3Like): void;
|
2489
2710
|
/**
|
2490
2711
|
* Creates and adds a child collider to the rigid body for the simulation it belongs to.
|
2491
2712
|
* @param colliderOptions - The options for the child collider to add.
|
@@ -2539,9 +2760,9 @@ export declare class RigidBody {
|
|
2539
2760
|
/** Additional mass properties for a RigidBody. @public */
|
2540
2761
|
export declare type RigidBodyAdditionalMassProperties = {
|
2541
2762
|
additionalMass: number;
|
2542
|
-
centerOfMass:
|
2543
|
-
principalAngularInertia:
|
2544
|
-
principalAngularInertiaLocalFrame:
|
2763
|
+
centerOfMass: Vector3Like;
|
2764
|
+
principalAngularInertia: Vector3Like;
|
2765
|
+
principalAngularInertiaLocalFrame: QuaternionLike;
|
2545
2766
|
};
|
2546
2767
|
|
2547
2768
|
/** Options for creating a RigidBody instance. @public */
|
@@ -2557,7 +2778,7 @@ export declare interface RigidBodyOptions {
|
|
2557
2778
|
/** The angular damping of the rigid body. */
|
2558
2779
|
angularDamping?: number;
|
2559
2780
|
/** The angular velocity of the rigid body. */
|
2560
|
-
angularVelocity?:
|
2781
|
+
angularVelocity?: Vector3Like;
|
2561
2782
|
/** Whether the rigid body has continuous collision detection enabled. */
|
2562
2783
|
ccdEnabled?: boolean;
|
2563
2784
|
/** The colliders of the rigid body, provided as {@link ColliderOptions}. */
|
@@ -2575,9 +2796,9 @@ export declare interface RigidBodyOptions {
|
|
2575
2796
|
/** The linear damping of the rigid body. */
|
2576
2797
|
linearDamping?: number;
|
2577
2798
|
/** The linear velocity of the rigid body. */
|
2578
|
-
linearVelocity?:
|
2799
|
+
linearVelocity?: Vector3Like;
|
2579
2800
|
/** The rotation of the rigid body. */
|
2580
|
-
rotation?:
|
2801
|
+
rotation?: QuaternionLike;
|
2581
2802
|
/** The simulation the rigid body is in. If provided, the rigid body will be automatically added to the simulation. */
|
2582
2803
|
simulation?: Simulation;
|
2583
2804
|
/** Whether the rigid body is sleeping. */
|
@@ -2585,7 +2806,7 @@ export declare interface RigidBodyOptions {
|
|
2585
2806
|
/** The soft continuous collision detection prediction of the rigid body. */
|
2586
2807
|
softCcdPrediction?: number;
|
2587
2808
|
/** The translation of the rigid body. */
|
2588
|
-
translation?:
|
2809
|
+
translation?: Vector3Like;
|
2589
2810
|
}
|
2590
2811
|
|
2591
2812
|
/** The types a RigidBody can be. @public */
|
@@ -2596,14 +2817,6 @@ export declare enum RigidBodyType {
|
|
2596
2817
|
KINEMATIC_VELOCITY = "kinematic_velocity"
|
2597
2818
|
}
|
2598
2819
|
|
2599
|
-
/** A rotation in quaternion form. @public */
|
2600
|
-
export declare interface Rotation {
|
2601
|
-
x: number;
|
2602
|
-
y: number;
|
2603
|
-
z: number;
|
2604
|
-
w: number;
|
2605
|
-
}
|
2606
|
-
|
2607
2820
|
/**
|
2608
2821
|
* A simple character controller with basic movement functions.
|
2609
2822
|
*
|
@@ -2659,7 +2872,7 @@ export declare class SimpleCharacterController extends BaseCharacterController {
|
|
2659
2872
|
* @param speed - The speed at which to rotate to the target coordinate.
|
2660
2873
|
* @param options - Additional options for the face operation, such as callbacks.
|
2661
2874
|
*/
|
2662
|
-
face(target:
|
2875
|
+
face(target: Vector3Like, speed: number, options?: FaceOptions): void;
|
2663
2876
|
/**
|
2664
2877
|
* Moves the entity at a given speed in a straight line to a target coordinate.
|
2665
2878
|
*
|
@@ -2672,7 +2885,7 @@ export declare class SimpleCharacterController extends BaseCharacterController {
|
|
2672
2885
|
* @param speed - The speed at which to move to the target coordinate.
|
2673
2886
|
* @param options - Additional options for the move operation, such as callbacks.
|
2674
2887
|
*/
|
2675
|
-
move(target:
|
2888
|
+
move(target: Vector3Like, speed: number, options?: MoveOptions): void;
|
2676
2889
|
|
2677
2890
|
}
|
2678
2891
|
|
@@ -2724,6 +2937,11 @@ export declare class Simulation {
|
|
2724
2937
|
enableDebugRendering(enabled: boolean): void;
|
2725
2938
|
|
2726
2939
|
|
2940
|
+
/**
|
2941
|
+
* Sets the gravity vector for the simulation.
|
2942
|
+
* @param gravity - The gravity vector.
|
2943
|
+
*/
|
2944
|
+
setGravity(gravity: RAPIER.Vector3): void;
|
2727
2945
|
|
2728
2946
|
|
2729
2947
|
|
@@ -2752,11 +2970,203 @@ export declare function startServer(init: (world: World) => void): void;
|
|
2752
2970
|
/** The input keys that can be included in the PlayerInputState. @public */
|
2753
2971
|
export declare const SUPPORTED_INPUT_KEYS: readonly ["w", "a", "s", "d", "sp", "sh", "tb", "ml", "mr", "q", "e", "r", "f", "z", "x", "c", "v", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
|
2754
2972
|
|
2755
|
-
/**
|
2756
|
-
|
2757
|
-
|
2758
|
-
|
2759
|
-
|
2973
|
+
/**
|
2974
|
+
* Represents a 3-dimensional vector.
|
2975
|
+
*
|
2976
|
+
* @remarks
|
2977
|
+
* All vector methods result in mutation of the vector instance.
|
2978
|
+
* This class extends `Float32Array` to provide an efficient way to
|
2979
|
+
* create and manipulate a 3-dimensional vector. Various convenience
|
2980
|
+
* methods are provided for common vector operations.
|
2981
|
+
*
|
2982
|
+
* @public
|
2983
|
+
*/
|
2984
|
+
export declare class Vector3 extends Float32Array implements Vector3Like {
|
2985
|
+
constructor(x: number, y: number, z: number);
|
2986
|
+
/** The magnitude of the vector. Also known as the length. */
|
2987
|
+
get magnitude(): number;
|
2988
|
+
/** The squared magnitude of the vector. Also known as the squared length. */
|
2989
|
+
get squaredMagnitude(): number;
|
2990
|
+
/** The x-component of the vector. */
|
2991
|
+
get x(): number;
|
2992
|
+
set x(value: number);
|
2993
|
+
/** The y-component of the vector. */
|
2994
|
+
get y(): number;
|
2995
|
+
set y(value: number);
|
2996
|
+
/** The z-component of the vector. */
|
2997
|
+
get z(): number;
|
2998
|
+
set z(value: number);
|
2999
|
+
/**
|
3000
|
+
* Creates a new `Vector3` instance from a `Vector3Like` object.
|
3001
|
+
*
|
3002
|
+
* @param vector3Like - The `Vector3Like` object to create the `Vector3` instance from.
|
3003
|
+
* @returns A new `Vector3` instance.
|
3004
|
+
*/
|
3005
|
+
static fromVector3Like(vector3Like: Vector3Like): Vector3;
|
3006
|
+
/**
|
3007
|
+
* Adds a vector to the current vector.
|
3008
|
+
*
|
3009
|
+
* @param vector3 - The vector to add to the current vector.
|
3010
|
+
* @returns The current vector.
|
3011
|
+
*/
|
3012
|
+
add(vector3: Vector3): Vector3;
|
3013
|
+
/**
|
3014
|
+
* Rounds each component of the vector up to the nearest integer.
|
3015
|
+
*
|
3016
|
+
* @returns The current vector.
|
3017
|
+
*/
|
3018
|
+
ceil(): Vector3;
|
3019
|
+
/**
|
3020
|
+
* Returns a new vector with the same components as the current vector.
|
3021
|
+
*
|
3022
|
+
* @returns A new vector.
|
3023
|
+
*/
|
3024
|
+
clone(): Vector3;
|
3025
|
+
/**
|
3026
|
+
* Copies the components of a vector to the current vector.
|
3027
|
+
*
|
3028
|
+
* @param vector3 - The vector to copy the components from.
|
3029
|
+
* @returns The current vector.
|
3030
|
+
*/
|
3031
|
+
copy(vector3: Vector3): Vector3;
|
3032
|
+
/**
|
3033
|
+
* Calculates the cross product of the current vector and another vector.
|
3034
|
+
*
|
3035
|
+
* @param vector3 - The vector to calculate the cross product with.
|
3036
|
+
* @returns The current vector.
|
3037
|
+
*/
|
3038
|
+
cross(vector3: Vector3): Vector3;
|
3039
|
+
/**
|
3040
|
+
* Calculates the distance between the current vector and another vector.
|
3041
|
+
*
|
3042
|
+
* @param vector3 - The vector to calculate the distance to.
|
3043
|
+
* @returns The distance between the two vectors.
|
3044
|
+
*/
|
3045
|
+
distance(vector3: Vector3): number;
|
3046
|
+
/**
|
3047
|
+
* Divides each component of the current vector by the corresponding component of another vector.
|
3048
|
+
*
|
3049
|
+
* @param vector3 - The vector to divide the current vector by.
|
3050
|
+
* @returns The current vector.
|
3051
|
+
*/
|
3052
|
+
divide(vector3: Vector3): Vector3;
|
3053
|
+
/**
|
3054
|
+
* Checks if the current vector is approximately equal to another vector.
|
3055
|
+
*
|
3056
|
+
* @param vector3 - The vector to compare to.
|
3057
|
+
* @returns A boolean indicating whether the two vectors are approximately equal.
|
3058
|
+
*/
|
3059
|
+
equals(vector3: Vector3): boolean;
|
3060
|
+
/**
|
3061
|
+
* Checks if the current vector is exactly equal to another vector.
|
3062
|
+
*
|
3063
|
+
* @param vector3 - The vector to compare to.
|
3064
|
+
* @returns A boolean indicating whether the two vectors are exactly equal.
|
3065
|
+
*/
|
3066
|
+
exactEquals(vector3: Vector3): boolean;
|
3067
|
+
/**
|
3068
|
+
* Rounds each component of the vector down to the nearest integer.
|
3069
|
+
*
|
3070
|
+
* @returns The current vector.
|
3071
|
+
*/
|
3072
|
+
floor(): Vector3;
|
3073
|
+
/**
|
3074
|
+
* Inverts each component of the vector.
|
3075
|
+
*
|
3076
|
+
* @returns The current vector.
|
3077
|
+
*/
|
3078
|
+
invert(): Vector3;
|
3079
|
+
/**
|
3080
|
+
* Linearly interpolates between the current vector and another vector.
|
3081
|
+
*
|
3082
|
+
* @param vector3 - The vector to interpolate to.
|
3083
|
+
* @param t - The interpolation factor. A value between 0 and 1.
|
3084
|
+
* @returns The current vector.
|
3085
|
+
*/
|
3086
|
+
lerp(vector3: Vector3, t: number): Vector3;
|
3087
|
+
/**
|
3088
|
+
* Sets each component of the vector to the maximum of the current vector and another vector.
|
3089
|
+
*
|
3090
|
+
* @param vector3 - The vector to compare to.
|
3091
|
+
* @returns The current vector.
|
3092
|
+
*/
|
3093
|
+
max(vector3: Vector3): Vector3;
|
3094
|
+
/**
|
3095
|
+
* Sets each component of the vector to the minimum of the current vector and another vector.
|
3096
|
+
*
|
3097
|
+
* @param vector3 - The vector to compare to.
|
3098
|
+
* @returns The current vector.
|
3099
|
+
*/
|
3100
|
+
min(vector3: Vector3): Vector3;
|
3101
|
+
/**
|
3102
|
+
* Multiplies each component of the current vector by the corresponding component of another vector.
|
3103
|
+
*
|
3104
|
+
* @param vector3 - The vector to multiply the current vector by.
|
3105
|
+
* @returns The current vector.
|
3106
|
+
*/
|
3107
|
+
multiply(vector3: Vector3): Vector3;
|
3108
|
+
/**
|
3109
|
+
* Negates each component of the vector.
|
3110
|
+
*
|
3111
|
+
* @returns The current vector.
|
3112
|
+
*/
|
3113
|
+
negate(): Vector3;
|
3114
|
+
/**
|
3115
|
+
* Normalizes the vector.
|
3116
|
+
*
|
3117
|
+
* @returns The current vector.
|
3118
|
+
*/
|
3119
|
+
normalize(): Vector3;
|
3120
|
+
/**
|
3121
|
+
* Rotates the vector around the x-axis.
|
3122
|
+
*
|
3123
|
+
* @param vector3 - The origin vector to rotate around.
|
3124
|
+
* @param angle - The angle to rotate the vector by.
|
3125
|
+
* @returns The current vector.
|
3126
|
+
*/
|
3127
|
+
rotateX(vector3: Vector3, angle: number): Vector3;
|
3128
|
+
/**
|
3129
|
+
* Rotates the vector around the y-axis.
|
3130
|
+
*
|
3131
|
+
* @param vector3 - The origin vector to rotate around.
|
3132
|
+
* @param angle - The angle to rotate the vector by.
|
3133
|
+
* @returns The current vector.
|
3134
|
+
*/
|
3135
|
+
rotateY(vector3: Vector3, angle: number): Vector3;
|
3136
|
+
/**
|
3137
|
+
* Rotates the vector around the z-axis.
|
3138
|
+
*
|
3139
|
+
* @param vector3 - The origin vector to rotate around.
|
3140
|
+
* @param angle - The angle to rotate the vector by.
|
3141
|
+
* @returns The current vector.
|
3142
|
+
*/
|
3143
|
+
rotateZ(vector3: Vector3, angle: number): Vector3;
|
3144
|
+
/**
|
3145
|
+
* Rounds each component of the vector to the nearest integer.
|
3146
|
+
*
|
3147
|
+
* @returns The current vector.
|
3148
|
+
*/
|
3149
|
+
round(): Vector3;
|
3150
|
+
/**
|
3151
|
+
* Scales each component of the vector by a scalar value.
|
3152
|
+
*
|
3153
|
+
* @param scale - The scalar value to scale the vector by.
|
3154
|
+
* @returns The current vector.
|
3155
|
+
*/
|
3156
|
+
scale(scale: number): Vector3;
|
3157
|
+
/**
|
3158
|
+
* Subtracts a vector from the current vector.
|
3159
|
+
*
|
3160
|
+
* @param vector3 - The vector to subtract from the current vector.
|
3161
|
+
* @returns The current vector.
|
3162
|
+
*/
|
3163
|
+
subtract(vector3: Vector3): Vector3;
|
3164
|
+
/**
|
3165
|
+
* Returns a string representation of the vector in x,y,z format.
|
3166
|
+
*
|
3167
|
+
* @returns A string representation of the vector in the format x,y,z.
|
3168
|
+
*/
|
3169
|
+
toString(): string;
|
2760
3170
|
}
|
2761
3171
|
|
2762
3172
|
/** A 3-dimensional vector of boolean values. @public */
|
@@ -2766,28 +3176,11 @@ export declare interface Vector3Boolean {
|
|
2766
3176
|
z: boolean;
|
2767
3177
|
}
|
2768
3178
|
|
2769
|
-
/**
|
2770
|
-
|
2771
|
-
|
2772
|
-
|
2773
|
-
|
2774
|
-
* accessed via the GameServer.webServer property.
|
2775
|
-
*
|
2776
|
-
* @public
|
2777
|
-
*/
|
2778
|
-
export declare class WebServer {
|
2779
|
-
|
2780
|
-
|
2781
|
-
|
2782
|
-
|
2783
|
-
|
2784
|
-
|
2785
|
-
|
2786
|
-
|
2787
|
-
|
2788
|
-
|
2789
|
-
|
2790
|
-
|
3179
|
+
/** A 3-dimensional vector. @public */
|
3180
|
+
export declare interface Vector3Like {
|
3181
|
+
x: number;
|
3182
|
+
y: number;
|
3183
|
+
z: number;
|
2791
3184
|
}
|
2792
3185
|
|
2793
3186
|
/**
|
@@ -2956,14 +3349,7 @@ export declare enum WorldLoopEventType {
|
|
2956
3349
|
/** A map representation for a world. @public */
|
2957
3350
|
export declare interface WorldMap {
|
2958
3351
|
/** The block types in the map. */
|
2959
|
-
blockTypes:
|
2960
|
-
/** The ID of the block type. */
|
2961
|
-
id: number;
|
2962
|
-
/** The name of the block type. */
|
2963
|
-
name: string;
|
2964
|
-
/** The URI of the texture for the block type. */
|
2965
|
-
textureUri: string;
|
2966
|
-
}[];
|
3352
|
+
blockTypes: BlockTypeOptions[];
|
2967
3353
|
/** The blocks in the map */
|
2968
3354
|
blocks: {
|
2969
3355
|
/** The global coordinate to block type id mapping. */
|
@@ -2982,7 +3368,7 @@ export declare interface WorldOptions {
|
|
2982
3368
|
/** The tick rate for the world. */
|
2983
3369
|
tickRate?: number;
|
2984
3370
|
/** The gravity vector for the world. */
|
2985
|
-
gravity?:
|
3371
|
+
gravity?: Vector3Like;
|
2986
3372
|
}
|
2987
3373
|
|
2988
3374
|
export { }
|