hytopia 0.1.36 → 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/docs/server.audio.md +1 -1
- 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.chunk.blockindextolocalcoordinate.md +2 -2
- package/docs/server.chunk.getblock.md +2 -2
- package/docs/server.chunk.globalcoordinatetolocalcoordinate.md +3 -3
- package/docs/server.chunk.globalcoordinatetoorigincoordinate.md +3 -3
- package/docs/server.chunk.hasblock.md +2 -2
- package/docs/server.chunk.isvalidorigincoordinate.md +2 -2
- package/docs/server.chunk.md +1 -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 +2 -2
- package/docs/server.chunklattice.getchunk.md +2 -2
- package/docs/server.chunklattice.hasblock.md +2 -2
- package/docs/server.chunklattice.haschunk.md +2 -2
- package/docs/server.chunklattice.setblock.md +2 -2
- 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 +1 -1
- package/docs/server.entity.spawn.md +2 -2
- 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.entityoptions.blockhalfextents.md +1 -1
- package/docs/server.entityoptions.md +1 -1
- package/docs/server.facecallback.md +2 -2
- package/docs/server.facecompletecallback.md +2 -2
- package/docs/server.hytopia.audio.md +1 -1
- 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.chunk.blockindextolocalcoordinate.md +2 -2
- package/docs/server.hytopia.chunk.getblock.md +2 -2
- 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 +2 -2
- package/docs/server.hytopia.chunk.isvalidorigincoordinate.md +2 -2
- package/docs/server.hytopia.chunk.md +1 -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 +2 -2
- package/docs/server.hytopia.chunklattice.getchunk.md +2 -2
- package/docs/server.hytopia.chunklattice.hasblock.md +2 -2
- package/docs/server.hytopia.chunklattice.haschunk.md +2 -2
- package/docs/server.hytopia.chunklattice.setblock.md +2 -2
- 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 +1 -1
- package/docs/server.hytopia.entity.spawn.md +2 -2
- 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.entityoptions.blockhalfextents.md +1 -1
- package/docs/server.hytopia.entityoptions.md +1 -1
- package/docs/server.hytopia.facecallback.md +2 -2
- package/docs/server.hytopia.facecompletecallback.md +2 -2
- 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.rotation.w.md → server.hytopia.quaternionlike.w.md} +2 -2
- 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.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.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.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.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.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.worldoptions.gravity.md +1 -1
- package/docs/server.worldoptions.md +1 -1
- package/package.json +2 -2
- package/server.api.json +13435 -8081
- package/server.d.ts +465 -98
- package/server.js +89 -89
- 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/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
|
/**
|
@@ -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
|
|
@@ -626,7 +625,7 @@ export declare class Chunk implements protocol.Serializable {
|
|
626
625
|
/** Whether the chunk has been spawned. */
|
627
626
|
get isSpawned(): boolean;
|
628
627
|
/** The origin coordinate of the chunk. */
|
629
|
-
get originCoordinate():
|
628
|
+
get originCoordinate(): Vector3Like | undefined;
|
630
629
|
/** The world the chunk belongs to. */
|
631
630
|
get world(): World | undefined;
|
632
631
|
/**
|
@@ -634,31 +633,31 @@ export declare class Chunk implements protocol.Serializable {
|
|
634
633
|
* @param index - The index of the block to convert.
|
635
634
|
* @returns The local coordinate of the block.
|
636
635
|
*/
|
637
|
-
static blockIndexToLocalCoordinate(index: number):
|
636
|
+
static blockIndexToLocalCoordinate(index: number): Vector3Like;
|
638
637
|
/**
|
639
638
|
* Convert a global coordinate to a local coordinate.
|
640
639
|
* @param globalCoordinate - The global coordinate to convert.
|
641
640
|
* @returns The local coordinate.
|
642
641
|
*/
|
643
|
-
static globalCoordinateToLocalCoordinate(globalCoordinate:
|
642
|
+
static globalCoordinateToLocalCoordinate(globalCoordinate: Vector3Like): Vector3Like;
|
644
643
|
/**
|
645
644
|
* Convert a global coordinate to an origin coordinate.
|
646
645
|
* @param globalCoordinate - The global coordinate to convert.
|
647
646
|
* @returns The origin coordinate.
|
648
647
|
*/
|
649
|
-
static globalCoordinateToOriginCoordinate(globalCoordinate:
|
648
|
+
static globalCoordinateToOriginCoordinate(globalCoordinate: Vector3Like): Vector3Like;
|
650
649
|
/**
|
651
650
|
* Check if an origin coordinate is valid.
|
652
651
|
* @param coordinate - The coordinate to check.
|
653
652
|
* @returns Whether the coordinate is valid.
|
654
653
|
*/
|
655
|
-
static isValidOriginCoordinate(coordinate:
|
654
|
+
static isValidOriginCoordinate(coordinate: Vector3Like): boolean;
|
656
655
|
/**
|
657
656
|
* Spawn the chunk in the world.
|
658
657
|
* @param world - The world to spawn the chunk in.
|
659
658
|
* @param originCoordinate - The origin coordinate of the chunk.
|
660
659
|
*/
|
661
|
-
spawn(world: World, originCoordinate:
|
660
|
+
spawn(world: World, originCoordinate: Vector3Like): void;
|
662
661
|
/**
|
663
662
|
* Despawn the chunk from the world.
|
664
663
|
*/
|
@@ -668,19 +667,19 @@ export declare class Chunk implements protocol.Serializable {
|
|
668
667
|
* @param localCoordinate - The local coordinate of the block to get.
|
669
668
|
* @returns The block type id.
|
670
669
|
*/
|
671
|
-
getBlock(localCoordinate:
|
670
|
+
getBlock(localCoordinate: Vector3Like): number;
|
672
671
|
/**
|
673
672
|
* Check if a block exists at a specific local coordinate.
|
674
673
|
* @param localCoordinate - The local coordinate of the block to check.
|
675
674
|
* @returns Whether a block exists.
|
676
675
|
*/
|
677
|
-
hasBlock(localCoordinate:
|
676
|
+
hasBlock(localCoordinate: Vector3Like): boolean;
|
678
677
|
/**
|
679
678
|
* Set the block at a specific local coordinate by block type id.
|
680
679
|
* @param localCoordinate - The local coordinate of the block to set.
|
681
680
|
* @param blockTypeId - The block type id to set.
|
682
681
|
*/
|
683
|
-
setBlock(localCoordinate:
|
682
|
+
setBlock(localCoordinate: Vector3Like, blockTypeId: number): void;
|
684
683
|
|
685
684
|
|
686
685
|
|
@@ -697,8 +696,8 @@ export declare namespace ChunkEventPayload {
|
|
697
696
|
}
|
698
697
|
export interface SetBlock {
|
699
698
|
chunk: Chunk;
|
700
|
-
globalCoordinate:
|
701
|
-
localCoordinate:
|
699
|
+
globalCoordinate: Vector3Like;
|
700
|
+
localCoordinate: Vector3Like;
|
702
701
|
blockTypeId: number;
|
703
702
|
}
|
704
703
|
export interface Spawn {
|
@@ -737,13 +736,13 @@ export declare class ChunkLattice {
|
|
737
736
|
* @param globalCoordinate - The global coordinate of the block to get.
|
738
737
|
* @returns The block type id, 0 if no block is set.
|
739
738
|
*/
|
740
|
-
getBlock(globalCoordinate:
|
739
|
+
getBlock(globalCoordinate: Vector3Like): number;
|
741
740
|
/**
|
742
741
|
* Get a chunk by its origin coordinate.
|
743
742
|
* @param originCoordinate - The origin coordinate of the chunk to get.
|
744
743
|
* @returns The chunk at the given origin coordinate or undefined if not found.
|
745
744
|
*/
|
746
|
-
getChunk(originCoordinate:
|
745
|
+
getChunk(originCoordinate: Vector3Like): Chunk | undefined;
|
747
746
|
/**
|
748
747
|
* Get all chunks in the lattice.
|
749
748
|
* @returns An array of all chunks in the lattice.
|
@@ -754,20 +753,20 @@ export declare class ChunkLattice {
|
|
754
753
|
* @param globalCoordinate - The global coordinate of the block to check.
|
755
754
|
* @returns Whether a block exists.
|
756
755
|
*/
|
757
|
-
hasBlock(globalCoordinate:
|
756
|
+
hasBlock(globalCoordinate: Vector3Like): boolean;
|
758
757
|
/**
|
759
758
|
* Check if a chunk exists by its origin coordinate.
|
760
759
|
* @param originCoordinate - The origin coordinate of the chunk to check.
|
761
760
|
* @returns Whether the chunk exists.
|
762
761
|
*/
|
763
|
-
hasChunk(originCoordinate:
|
762
|
+
hasChunk(originCoordinate: Vector3Like): boolean;
|
764
763
|
/**
|
765
764
|
* Set the block at a global coordinate by block type id, automatically
|
766
765
|
* creating a chunk if it doesn't exist. Use block type id 0 for air.
|
767
766
|
* @param globalCoordinate - The global coordinate of the block to set.
|
768
767
|
* @param blockTypeId - The block type id to set. Use 0 to remove the block and replace with air.
|
769
768
|
*/
|
770
|
-
setBlock(globalCoordinate:
|
769
|
+
setBlock(globalCoordinate: Vector3Like, blockTypeId: number): void;
|
771
770
|
|
772
771
|
|
773
772
|
}
|
@@ -832,12 +831,12 @@ export declare class Collider {
|
|
832
831
|
* Gets the relative rotation of the collider.
|
833
832
|
* @returns The relative rotation of the collider.
|
834
833
|
*/
|
835
|
-
getRelativeRotation():
|
834
|
+
getRelativeRotation(): QuaternionLike;
|
836
835
|
/**
|
837
836
|
* Gets the relative translation of the collider to its parent rigid body.
|
838
837
|
* @returns The relative translation of the collider.
|
839
838
|
*/
|
840
|
-
getRelativeTranslation():
|
839
|
+
getRelativeTranslation(): Vector3Like;
|
841
840
|
/**
|
842
841
|
* Sets the bounciness of the collider.
|
843
842
|
* @param bounciness - The bounciness of the collider.
|
@@ -872,12 +871,12 @@ export declare class Collider {
|
|
872
871
|
* Sets the relative rotation of the collider.
|
873
872
|
* @param rotation - The relative rotation of the collider.
|
874
873
|
*/
|
875
|
-
setRelativeRotation(rotation:
|
874
|
+
setRelativeRotation(rotation: QuaternionLike): void;
|
876
875
|
/**
|
877
876
|
* Sets the relative translation of the collider to its parent rigid body.
|
878
877
|
* @param translation - The relative translation of the collider.
|
879
878
|
*/
|
880
|
-
setRelativeTranslation(translation:
|
879
|
+
setRelativeTranslation(translation: Vector3Like): void;
|
881
880
|
/**
|
882
881
|
* Sets whether the collider is a sensor.
|
883
882
|
* @param sensor - Whether the collider is a sensor.
|
@@ -932,7 +931,7 @@ export declare interface ColliderOptions {
|
|
932
931
|
/** The friction of the collider. */
|
933
932
|
friction?: number;
|
934
933
|
/** The half extents of the collider if the shape is a block. */
|
935
|
-
halfExtents?:
|
934
|
+
halfExtents?: Vector3Like;
|
936
935
|
/** The half height of the collider if the shape is a capsule, cone, cylinder, or round cylinder. */
|
937
936
|
halfHeight?: number;
|
938
937
|
/** Whether the collider is a sensor. */
|
@@ -946,9 +945,9 @@ export declare interface ColliderOptions {
|
|
946
945
|
/** The radius of the collider if the shape is a ball, capsule, cone, cylinder, or round cylinder. */
|
947
946
|
radius?: number;
|
948
947
|
/** The relative rotation of the collider. Relative to parent rigid body. */
|
949
|
-
relativeRotation?:
|
948
|
+
relativeRotation?: QuaternionLike;
|
950
949
|
/** The relative translation of the collider. Relative to parent rigid body. */
|
951
|
-
relativeTranslation?:
|
950
|
+
relativeTranslation?: Vector3Like;
|
952
951
|
/** The simulation the collider is in, if provided the collider will automatically be added to the simulation. */
|
953
952
|
simulation?: Simulation;
|
954
953
|
/** An arbitrary identifier tag of the collider. Useful for your own logic. */
|
@@ -1302,7 +1301,7 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1302
1301
|
/** The character controller for the entity. */
|
1303
1302
|
get characterController(): BaseCharacterController | undefined;
|
1304
1303
|
/** The half extends of the visual size of the block entity when blockTextureUri is set. */
|
1305
|
-
get blockHalfExtents():
|
1304
|
+
get blockHalfExtents(): Vector3Like | undefined;
|
1306
1305
|
/** The URI or path to the texture to be used, if this is set, the entity is a block entity. */
|
1307
1306
|
get blockTextureUri(): string | undefined;
|
1308
1307
|
/** The URI or path to the .gltf model asset to be used for the entity. */
|
@@ -1326,7 +1325,7 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1326
1325
|
* @param world - The world to spawn the entity in.
|
1327
1326
|
* @param coordinate - The coordinate to spawn the entity at.
|
1328
1327
|
*/
|
1329
|
-
spawn(world: World, coordinate:
|
1328
|
+
spawn(world: World, coordinate: Vector3Like): void;
|
1330
1329
|
/**
|
1331
1330
|
* Despawns the entity from the world.
|
1332
1331
|
*/
|
@@ -1393,11 +1392,11 @@ export declare namespace EntityEventPayload {
|
|
1393
1392
|
}
|
1394
1393
|
export interface UpdateRotation {
|
1395
1394
|
entity: Entity;
|
1396
|
-
rotation:
|
1395
|
+
rotation: QuaternionLike;
|
1397
1396
|
}
|
1398
1397
|
export interface UpdateTranslation {
|
1399
1398
|
entity: Entity;
|
1400
|
-
translation:
|
1399
|
+
translation: Vector3Like;
|
1401
1400
|
}
|
1402
1401
|
}
|
1403
1402
|
|
@@ -1476,7 +1475,7 @@ export declare class EntityManager {
|
|
1476
1475
|
/** Options for creating an Entity instance. @public */
|
1477
1476
|
export declare interface EntityOptions {
|
1478
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. */
|
1479
|
-
blockHalfExtents?:
|
1478
|
+
blockHalfExtents?: Vector3Like;
|
1480
1479
|
/** The texture uri of a entity if the entity is a block entity, if set rigidBodyOptions collider shape [0] must be a block */
|
1481
1480
|
blockTextureUri?: string;
|
1482
1481
|
/**
|
@@ -1583,7 +1582,7 @@ export declare class EventRouter {
|
|
1583
1582
|
* @param targetRotation - The target rotation of the entity.
|
1584
1583
|
* @public
|
1585
1584
|
*/
|
1586
|
-
export declare type FaceCallback = (currentRotation:
|
1585
|
+
export declare type FaceCallback = (currentRotation: QuaternionLike, targetRotation: QuaternionLike) => void;
|
1587
1586
|
|
1588
1587
|
/**
|
1589
1588
|
* A callback function called when the entity associated with the
|
@@ -1592,7 +1591,7 @@ export declare type FaceCallback = (currentRotation: Rotation, targetRotation: R
|
|
1592
1591
|
* @param endRotation - The rotation of the entity after it has finished rotating.
|
1593
1592
|
* @public
|
1594
1593
|
*/
|
1595
|
-
export declare type FaceCompleteCallback = (endRotation:
|
1594
|
+
export declare type FaceCompleteCallback = (endRotation: QuaternionLike) => void;
|
1596
1595
|
|
1597
1596
|
/**
|
1598
1597
|
* Options for the {@link SimpleCharacterController.face} method.
|
@@ -1697,9 +1696,11 @@ declare namespace HYTOPIA {
|
|
1697
1696
|
startServer,
|
1698
1697
|
GameServerEventPayload,
|
1699
1698
|
RgbColor,
|
1700
|
-
|
1701
|
-
SpdMatrix3,
|
1699
|
+
Quaternion,
|
1702
1700
|
Vector3,
|
1701
|
+
QuaternionLike,
|
1702
|
+
SpdMatrix3,
|
1703
|
+
Vector3Like,
|
1703
1704
|
Vector3Boolean,
|
1704
1705
|
Player,
|
1705
1706
|
PlayerEventType,
|
@@ -1745,7 +1746,7 @@ export default HYTOPIA;
|
|
1745
1746
|
* @param targetTranslation - The target translation of the entity.
|
1746
1747
|
* @public
|
1747
1748
|
*/
|
1748
|
-
export declare type MoveCallback = (currentTranslation:
|
1749
|
+
export declare type MoveCallback = (currentTranslation: Vector3Like, targetTranslation: Vector3Like) => void;
|
1749
1750
|
|
1750
1751
|
/**
|
1751
1752
|
* A callback function called when the entity associated with the
|
@@ -1754,7 +1755,7 @@ export declare type MoveCallback = (currentTranslation: Vector3, targetTranslati
|
|
1754
1755
|
* @param endTranslation - The translation of the entity after it has finished moving.
|
1755
1756
|
* @public
|
1756
1757
|
*/
|
1757
|
-
export declare type MoveCompleteCallback = (endTranslation:
|
1758
|
+
export declare type MoveCompleteCallback = (endTranslation: Vector3Like) => void;
|
1758
1759
|
|
1759
1760
|
/**
|
1760
1761
|
* Options for the {@link SimpleCharacterController.move} method.
|
@@ -1860,7 +1861,7 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1860
1861
|
/** The entity the camera is attached to. */
|
1861
1862
|
get attachedToEntity(): Entity | undefined;
|
1862
1863
|
/** The position the camera is attached to. */
|
1863
|
-
get attachedToPosition():
|
1864
|
+
get attachedToPosition(): Vector3Like | undefined;
|
1864
1865
|
/** The film offset of the camera. A positive value shifts the camera right, a negative value shifts it left. */
|
1865
1866
|
get filmOffset(): number;
|
1866
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. */
|
@@ -1872,11 +1873,11 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1872
1873
|
/** The mode of the camera. */
|
1873
1874
|
get mode(): PlayerCameraMode;
|
1874
1875
|
/** The relative offset of the camera from the entity or position it is attached to. */
|
1875
|
-
get offset():
|
1876
|
+
get offset(): Vector3Like;
|
1876
1877
|
/** The entity the camera will constantly look at, even if the camera attached or tracked entity moves. */
|
1877
1878
|
get trackedEntity(): Entity | undefined;
|
1878
1879
|
/** The position the camera will constantly look at, even if the camera attached entity moves. */
|
1879
|
-
get trackedPosition():
|
1880
|
+
get trackedPosition(): Vector3Like | undefined;
|
1880
1881
|
/** The zoom of the camera. */
|
1881
1882
|
get zoom(): number;
|
1882
1883
|
/**
|
@@ -1892,7 +1893,7 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1892
1893
|
* stop tracking.
|
1893
1894
|
* @param position - The position to look at.
|
1894
1895
|
*/
|
1895
|
-
lookAtPosition(position:
|
1896
|
+
lookAtPosition(position: Vector3Like): void;
|
1896
1897
|
/**
|
1897
1898
|
* Sets the entity the camera is attached to.
|
1898
1899
|
* @param entity - The entity to attach the camera to.
|
@@ -1902,7 +1903,7 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1902
1903
|
* Sets the position the camera is attached to.
|
1903
1904
|
* @param position - The position to attach the camera to.
|
1904
1905
|
*/
|
1905
|
-
setAttachedToPosition(position:
|
1906
|
+
setAttachedToPosition(position: Vector3Like): void;
|
1906
1907
|
/**
|
1907
1908
|
* Sets the film offset of the camera. A positive value
|
1908
1909
|
* shifts the camera right, a negative value shifts it left.
|
@@ -1938,7 +1939,7 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1938
1939
|
* entity or position it is attached to.
|
1939
1940
|
* @param offset - The offset to set.
|
1940
1941
|
*/
|
1941
|
-
setOffset(offset:
|
1942
|
+
setOffset(offset: Vector3Like): void;
|
1942
1943
|
/**
|
1943
1944
|
* Sets the entity the camera will constantly look at,
|
1944
1945
|
* even if the camera attached or tracked entity moves.
|
@@ -1950,7 +1951,7 @@ export declare class PlayerCamera implements protocol.Serializable {
|
|
1950
1951
|
* even if the camera attached entity moves.
|
1951
1952
|
* @param position - The position to track or undefined to stop tracking.
|
1952
1953
|
*/
|
1953
|
-
setTrackedPosition(position:
|
1954
|
+
setTrackedPosition(position: Vector3Like | undefined): void;
|
1954
1955
|
/**
|
1955
1956
|
* Sets the zoom of the camera.
|
1956
1957
|
* @param zoom - The zoom to set, 0 to infinity.
|
@@ -1968,7 +1969,7 @@ export declare namespace PlayerCameraEventPayload {
|
|
1968
1969
|
}
|
1969
1970
|
export interface LookAtPosition {
|
1970
1971
|
playerCamera: PlayerCamera;
|
1971
|
-
position:
|
1972
|
+
position: Vector3Like;
|
1972
1973
|
}
|
1973
1974
|
export interface SetAttachedToEntity {
|
1974
1975
|
playerCamera: PlayerCamera;
|
@@ -1976,7 +1977,7 @@ export declare namespace PlayerCameraEventPayload {
|
|
1976
1977
|
}
|
1977
1978
|
export interface SetAttachedToPosition {
|
1978
1979
|
playerCamera: PlayerCamera;
|
1979
|
-
position:
|
1980
|
+
position: Vector3Like;
|
1980
1981
|
}
|
1981
1982
|
export interface SetFilmOffset {
|
1982
1983
|
playerCamera: PlayerCamera;
|
@@ -2000,7 +2001,7 @@ export declare namespace PlayerCameraEventPayload {
|
|
2000
2001
|
}
|
2001
2002
|
export interface SetOffset {
|
2002
2003
|
playerCamera: PlayerCamera;
|
2003
|
-
offset:
|
2004
|
+
offset: Vector3Like;
|
2004
2005
|
}
|
2005
2006
|
export interface SetTrackedEntity {
|
2006
2007
|
playerCamera: PlayerCamera;
|
@@ -2008,7 +2009,7 @@ export declare namespace PlayerCameraEventPayload {
|
|
2008
2009
|
}
|
2009
2010
|
export interface SetTrackedPosition {
|
2010
2011
|
playerCamera: PlayerCamera;
|
2011
|
-
position:
|
2012
|
+
position: Vector3Like | undefined;
|
2012
2013
|
}
|
2013
2014
|
export interface SetZoom {
|
2014
2015
|
playerCamera: PlayerCamera;
|
@@ -2171,6 +2172,181 @@ export declare type PlayerOrientationState = {
|
|
2171
2172
|
*/
|
2172
2173
|
export declare const PORT: string | 8080;
|
2173
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
|
+
|
2174
2350
|
/** A raw set of collision groups represented as a 32-bit number. @public */
|
2175
2351
|
export declare type RawCollisionGroups = RAPIER.InteractionGroups;
|
2176
2352
|
|
@@ -2268,7 +2444,7 @@ export declare class RigidBody {
|
|
2268
2444
|
* Gets the angular velocity of the rigid body.
|
2269
2445
|
* @returns The angular velocity of the rigid body.
|
2270
2446
|
*/
|
2271
|
-
getAngularVelocity():
|
2447
|
+
getAngularVelocity(): Vector3Like;
|
2272
2448
|
/**
|
2273
2449
|
* Gets the colliders of the rigid body by tag.
|
2274
2450
|
* @param tag - The tag to filter by.
|
@@ -2284,7 +2460,7 @@ export declare class RigidBody {
|
|
2284
2460
|
* Gets the direction from the rotation of the rigid body.
|
2285
2461
|
* @returns The direction from the rotation of the rigid body.
|
2286
2462
|
*/
|
2287
|
-
getDirectionFromRotation():
|
2463
|
+
getDirectionFromRotation(): Vector3Like;
|
2288
2464
|
/**
|
2289
2465
|
* Gets the effective angular inertia of the rigid body.
|
2290
2466
|
* @returns The effective angular inertia of the rigid body.
|
@@ -2294,7 +2470,7 @@ export declare class RigidBody {
|
|
2294
2470
|
* Gets the effective inverse mass of the rigid body.
|
2295
2471
|
* @returns The effective inverse mass of the rigid body.
|
2296
2472
|
*/
|
2297
|
-
getEffectiveInverseMass():
|
2473
|
+
getEffectiveInverseMass(): Vector3Like | undefined;
|
2298
2474
|
/**
|
2299
2475
|
* Gets the effective world inverse principal angular inertia square root of the rigid body.
|
2300
2476
|
* @returns The effective world inverse principal angular inertia square root of the rigid body.
|
@@ -2324,7 +2500,7 @@ export declare class RigidBody {
|
|
2324
2500
|
* Gets the inverse principal angular inertia square root of the rigid body.
|
2325
2501
|
* @returns The inverse principal angular inertia square root of the rigid body.
|
2326
2502
|
*/
|
2327
|
-
getInversePrincipalAngularInertiaSqrt():
|
2503
|
+
getInversePrincipalAngularInertiaSqrt(): Vector3Like | undefined;
|
2328
2504
|
/**
|
2329
2505
|
* Gets the linear damping of the rigid body.
|
2330
2506
|
* @returns The linear damping of the rigid body.
|
@@ -2334,12 +2510,12 @@ export declare class RigidBody {
|
|
2334
2510
|
* Gets the linear velocity of the rigid body.
|
2335
2511
|
* @returns The linear velocity of the rigid body.
|
2336
2512
|
*/
|
2337
|
-
getLinearVelocity():
|
2513
|
+
getLinearVelocity(): Vector3Like;
|
2338
2514
|
/**
|
2339
2515
|
* Gets the local center of mass of the rigid body.
|
2340
2516
|
* @returns The local center of mass of the rigid body.
|
2341
2517
|
*/
|
2342
|
-
getLocalCenterOfMass():
|
2518
|
+
getLocalCenterOfMass(): Vector3Like;
|
2343
2519
|
/**
|
2344
2520
|
* Gets the mass of the rigid body.
|
2345
2521
|
* @returns The mass of the rigid body.
|
@@ -2349,27 +2525,27 @@ export declare class RigidBody {
|
|
2349
2525
|
* Gets the next kinematic rotation of the rigid body.
|
2350
2526
|
* @returns The next kinematic rotation of the rigid body.
|
2351
2527
|
*/
|
2352
|
-
getNextKinematicRotation():
|
2528
|
+
getNextKinematicRotation(): QuaternionLike;
|
2353
2529
|
/**
|
2354
2530
|
* Gets the next kinematic translation of the rigid body.
|
2355
2531
|
* @returns The next kinematic translation of the rigid body.
|
2356
2532
|
*/
|
2357
|
-
getNextKinematicTranslation():
|
2533
|
+
getNextKinematicTranslation(): Vector3Like;
|
2358
2534
|
/**
|
2359
2535
|
* Gets the principal angular inertia of the rigid body.
|
2360
2536
|
* @returns The principal angular inertia of the rigid body.
|
2361
2537
|
*/
|
2362
|
-
getPrincipalAngularInertia():
|
2538
|
+
getPrincipalAngularInertia(): Vector3Like;
|
2363
2539
|
/**
|
2364
2540
|
* Gets the principal angular inertia local frame of the rigid body.
|
2365
2541
|
* @returns The principal angular inertia local frame of the rigid body.
|
2366
2542
|
*/
|
2367
|
-
getPrincipalAngularInertiaLocalFrame():
|
2543
|
+
getPrincipalAngularInertiaLocalFrame(): QuaternionLike | undefined;
|
2368
2544
|
/**
|
2369
2545
|
* Gets the rotation of the rigid body.
|
2370
2546
|
* @returns The rotation of the rigid body.
|
2371
2547
|
*/
|
2372
|
-
getRotation():
|
2548
|
+
getRotation(): QuaternionLike;
|
2373
2549
|
/**
|
2374
2550
|
* Gets the soft ccd prediction of the rigid body.
|
2375
2551
|
* @returns The soft ccd prediction of the rigid body.
|
@@ -2379,7 +2555,7 @@ export declare class RigidBody {
|
|
2379
2555
|
* Gets the translation of the rigid body.
|
2380
2556
|
* @returns The translation of the rigid body.
|
2381
2557
|
*/
|
2382
|
-
getTranslation():
|
2558
|
+
getTranslation(): Vector3Like;
|
2383
2559
|
/**
|
2384
2560
|
* Gets the type of the rigid body.
|
2385
2561
|
* @returns The type of the rigid body.
|
@@ -2389,7 +2565,7 @@ export declare class RigidBody {
|
|
2389
2565
|
* Gets the world center of mass of the rigid body.
|
2390
2566
|
* @returns The world center of mass of the rigid body.
|
2391
2567
|
*/
|
2392
|
-
getWorldCenterOfMass():
|
2568
|
+
getWorldCenterOfMass(): Vector3Like | undefined;
|
2393
2569
|
/**
|
2394
2570
|
* Sets the additional mass of the rigid body.
|
2395
2571
|
* @param additionalMass - The additional mass of the rigid body.
|
@@ -2414,7 +2590,7 @@ export declare class RigidBody {
|
|
2414
2590
|
* Sets the angular velocity of the rigid body.
|
2415
2591
|
* @param angularVelocity - The angular velocity of the rigid body.
|
2416
2592
|
*/
|
2417
|
-
setAngularVelocity(angularVelocity:
|
2593
|
+
setAngularVelocity(angularVelocity: Vector3Like): void;
|
2418
2594
|
/**
|
2419
2595
|
* Sets whether the rigid body has continuous collision detection enabled.
|
2420
2596
|
* @param ccdEnabled - Whether the rigid body has continuous collision detection enabled.
|
@@ -2454,22 +2630,22 @@ export declare class RigidBody {
|
|
2454
2630
|
* Sets the linear velocity of the rigid body.
|
2455
2631
|
* @param linearVelocity - The linear velocity of the rigid body.
|
2456
2632
|
*/
|
2457
|
-
setLinearVelocity(linearVelocity:
|
2633
|
+
setLinearVelocity(linearVelocity: Vector3Like): void;
|
2458
2634
|
/**
|
2459
2635
|
* Sets the next kinematic rotation of the rigid body.
|
2460
2636
|
* @param nextKinematicRotation - The next kinematic rotation of the rigid body.
|
2461
2637
|
*/
|
2462
|
-
setNextKinematicRotation(nextKinematicRotation:
|
2638
|
+
setNextKinematicRotation(nextKinematicRotation: QuaternionLike): void;
|
2463
2639
|
/**
|
2464
2640
|
* Sets the next kinematic translation of the rigid body.
|
2465
2641
|
* @param nextKinematicTranslation - The next kinematic translation of the rigid body.
|
2466
2642
|
*/
|
2467
|
-
setNextKinematicTranslation(nextKinematicTranslation:
|
2643
|
+
setNextKinematicTranslation(nextKinematicTranslation: Vector3Like): void;
|
2468
2644
|
/**
|
2469
2645
|
* Sets the rotation of the rigid body.
|
2470
2646
|
* @param rotation - The rotation of the rigid body.
|
2471
2647
|
*/
|
2472
|
-
setRotation(rotation:
|
2648
|
+
setRotation(rotation: QuaternionLike): void;
|
2473
2649
|
/**
|
2474
2650
|
* Sets whether the rigid body is sleeping.
|
2475
2651
|
* @param sleeping - Whether the rigid body is sleeping.
|
@@ -2489,7 +2665,7 @@ export declare class RigidBody {
|
|
2489
2665
|
* Sets the translation of the rigid body.
|
2490
2666
|
* @param translation - The translation of the rigid body.
|
2491
2667
|
*/
|
2492
|
-
setTranslation(translation:
|
2668
|
+
setTranslation(translation: Vector3Like): void;
|
2493
2669
|
/**
|
2494
2670
|
* Sets the type of the rigid body.
|
2495
2671
|
* @param type - The type of the rigid body.
|
@@ -2499,12 +2675,12 @@ export declare class RigidBody {
|
|
2499
2675
|
* Adds a force to the rigid body.
|
2500
2676
|
* @param force - The force to add to the rigid body.
|
2501
2677
|
*/
|
2502
|
-
addForce(force:
|
2678
|
+
addForce(force: Vector3Like): void;
|
2503
2679
|
/**
|
2504
2680
|
* Adds a torque to the rigid body.
|
2505
2681
|
* @param torque - The torque to add to the rigid body.
|
2506
2682
|
*/
|
2507
|
-
addTorque(torque:
|
2683
|
+
addTorque(torque: Vector3Like): void;
|
2508
2684
|
/**
|
2509
2685
|
* Adds an unsimulated child collider to the rigid body for the simulation it belongs to.
|
2510
2686
|
* @param collider - The child collider to add to the rigid body for the simulation it belongs to.
|
@@ -2519,18 +2695,18 @@ export declare class RigidBody {
|
|
2519
2695
|
* Applies an impulse to the rigid body.
|
2520
2696
|
* @param impulse - The impulse to apply to the rigid body.
|
2521
2697
|
*/
|
2522
|
-
applyImpulse(impulse:
|
2698
|
+
applyImpulse(impulse: Vector3Like): void;
|
2523
2699
|
/**
|
2524
2700
|
* Applies an impulse to the rigid body at a point.
|
2525
2701
|
* @param impulse - The impulse to apply to the rigid body.
|
2526
2702
|
* @param point - The point at which to apply the impulse.
|
2527
2703
|
*/
|
2528
|
-
applyImpulseAtPoint(impulse:
|
2704
|
+
applyImpulseAtPoint(impulse: Vector3Like, point: Vector3Like): void;
|
2529
2705
|
/**
|
2530
2706
|
* Applies a torque impulse to the rigid body.
|
2531
2707
|
* @param impulse - The torque impulse to apply to the rigid body.
|
2532
2708
|
*/
|
2533
|
-
applyTorqueImpulse(impulse:
|
2709
|
+
applyTorqueImpulse(impulse: Vector3Like): void;
|
2534
2710
|
/**
|
2535
2711
|
* Creates and adds a child collider to the rigid body for the simulation it belongs to.
|
2536
2712
|
* @param colliderOptions - The options for the child collider to add.
|
@@ -2584,9 +2760,9 @@ export declare class RigidBody {
|
|
2584
2760
|
/** Additional mass properties for a RigidBody. @public */
|
2585
2761
|
export declare type RigidBodyAdditionalMassProperties = {
|
2586
2762
|
additionalMass: number;
|
2587
|
-
centerOfMass:
|
2588
|
-
principalAngularInertia:
|
2589
|
-
principalAngularInertiaLocalFrame:
|
2763
|
+
centerOfMass: Vector3Like;
|
2764
|
+
principalAngularInertia: Vector3Like;
|
2765
|
+
principalAngularInertiaLocalFrame: QuaternionLike;
|
2590
2766
|
};
|
2591
2767
|
|
2592
2768
|
/** Options for creating a RigidBody instance. @public */
|
@@ -2602,7 +2778,7 @@ export declare interface RigidBodyOptions {
|
|
2602
2778
|
/** The angular damping of the rigid body. */
|
2603
2779
|
angularDamping?: number;
|
2604
2780
|
/** The angular velocity of the rigid body. */
|
2605
|
-
angularVelocity?:
|
2781
|
+
angularVelocity?: Vector3Like;
|
2606
2782
|
/** Whether the rigid body has continuous collision detection enabled. */
|
2607
2783
|
ccdEnabled?: boolean;
|
2608
2784
|
/** The colliders of the rigid body, provided as {@link ColliderOptions}. */
|
@@ -2620,9 +2796,9 @@ export declare interface RigidBodyOptions {
|
|
2620
2796
|
/** The linear damping of the rigid body. */
|
2621
2797
|
linearDamping?: number;
|
2622
2798
|
/** The linear velocity of the rigid body. */
|
2623
|
-
linearVelocity?:
|
2799
|
+
linearVelocity?: Vector3Like;
|
2624
2800
|
/** The rotation of the rigid body. */
|
2625
|
-
rotation?:
|
2801
|
+
rotation?: QuaternionLike;
|
2626
2802
|
/** The simulation the rigid body is in. If provided, the rigid body will be automatically added to the simulation. */
|
2627
2803
|
simulation?: Simulation;
|
2628
2804
|
/** Whether the rigid body is sleeping. */
|
@@ -2630,7 +2806,7 @@ export declare interface RigidBodyOptions {
|
|
2630
2806
|
/** The soft continuous collision detection prediction of the rigid body. */
|
2631
2807
|
softCcdPrediction?: number;
|
2632
2808
|
/** The translation of the rigid body. */
|
2633
|
-
translation?:
|
2809
|
+
translation?: Vector3Like;
|
2634
2810
|
}
|
2635
2811
|
|
2636
2812
|
/** The types a RigidBody can be. @public */
|
@@ -2641,14 +2817,6 @@ export declare enum RigidBodyType {
|
|
2641
2817
|
KINEMATIC_VELOCITY = "kinematic_velocity"
|
2642
2818
|
}
|
2643
2819
|
|
2644
|
-
/** A rotation in quaternion form. @public */
|
2645
|
-
export declare interface Rotation {
|
2646
|
-
x: number;
|
2647
|
-
y: number;
|
2648
|
-
z: number;
|
2649
|
-
w: number;
|
2650
|
-
}
|
2651
|
-
|
2652
2820
|
/**
|
2653
2821
|
* A simple character controller with basic movement functions.
|
2654
2822
|
*
|
@@ -2704,7 +2872,7 @@ export declare class SimpleCharacterController extends BaseCharacterController {
|
|
2704
2872
|
* @param speed - The speed at which to rotate to the target coordinate.
|
2705
2873
|
* @param options - Additional options for the face operation, such as callbacks.
|
2706
2874
|
*/
|
2707
|
-
face(target:
|
2875
|
+
face(target: Vector3Like, speed: number, options?: FaceOptions): void;
|
2708
2876
|
/**
|
2709
2877
|
* Moves the entity at a given speed in a straight line to a target coordinate.
|
2710
2878
|
*
|
@@ -2717,7 +2885,7 @@ export declare class SimpleCharacterController extends BaseCharacterController {
|
|
2717
2885
|
* @param speed - The speed at which to move to the target coordinate.
|
2718
2886
|
* @param options - Additional options for the move operation, such as callbacks.
|
2719
2887
|
*/
|
2720
|
-
move(target:
|
2888
|
+
move(target: Vector3Like, speed: number, options?: MoveOptions): void;
|
2721
2889
|
|
2722
2890
|
}
|
2723
2891
|
|
@@ -2802,11 +2970,203 @@ export declare function startServer(init: (world: World) => void): void;
|
|
2802
2970
|
/** The input keys that can be included in the PlayerInputState. @public */
|
2803
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"];
|
2804
2972
|
|
2805
|
-
/**
|
2806
|
-
|
2807
|
-
|
2808
|
-
|
2809
|
-
|
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;
|
2810
3170
|
}
|
2811
3171
|
|
2812
3172
|
/** A 3-dimensional vector of boolean values. @public */
|
@@ -2816,6 +3176,13 @@ export declare interface Vector3Boolean {
|
|
2816
3176
|
z: boolean;
|
2817
3177
|
}
|
2818
3178
|
|
3179
|
+
/** A 3-dimensional vector. @public */
|
3180
|
+
export declare interface Vector3Like {
|
3181
|
+
x: number;
|
3182
|
+
y: number;
|
3183
|
+
z: number;
|
3184
|
+
}
|
3185
|
+
|
2819
3186
|
/**
|
2820
3187
|
* Represents a world in the game server.
|
2821
3188
|
*
|
@@ -3001,7 +3368,7 @@ export declare interface WorldOptions {
|
|
3001
3368
|
/** The tick rate for the world. */
|
3002
3369
|
tickRate?: number;
|
3003
3370
|
/** The gravity vector for the world. */
|
3004
|
-
gravity?:
|
3371
|
+
gravity?: Vector3Like;
|
3005
3372
|
}
|
3006
3373
|
|
3007
3374
|
export { }
|