@voxelize/core
Enumerations
Core Classes
Effects Classes
Other Classes
- AnimationUtils
- Arm
- Arrow
- AtlasTexture
- BlockAnimations
- BlockProfileTable
- BlockRotation
- BoundedLruMap
- BoxLayer
- CSMRenderer
- CanvasBox
- Character
- Chunk
- ChunkPipeline
- ChunkRegionArenas
- ChunkRenderer
- ChunkSharedPool
- Clouds
- Creature
- Debug
- Entity
- EntityLivenessTracker
- Events
- FaceAnimation
- ImageItemRenderer
- IsolatedFaceLedger
- ItemRegistry
- ItemRenderer
- ItemSlot
- ItemSlots
- LightClusterGrid
- LightCones
- LightSourceRegistry
- LocalLights
- LocalShadowAtlas
- LocalShadowScheduler
- MemoryPressureMonitor
- MeshPipeline
- Method
- NameTag
- Network
- Perspective
- Portrait
- Registry
- SectionTracker
- SectionVisibilityGraph
- ShadowFrameLedger
- Sky
- SpriteText
- StaticGroup
- ThreeUtils
- VoxelInteract
- WaterOptics
- WebRTCConnection
- WorkerPool
- WorkerTransfer
Utils Classes
Interfaces
- BlockAnimationHost
- BlockConditionalPart
- BlockDynamicPattern
- BlockLightProfile
- CSMConfig
- CSMShadowLedger
- ChunkLoadTiming
- ChunkMaterialHost
- ChunkRoundTrip
- CoupledWorldView
- EmitterBlock
- EntityShadowUniforms
- FlickerProfile
- ImageComp
- ImageItemMeshData
- ItemDef
- LocalLightDescriptor
- LocalLightSample
- LocalLightStats
- LocalLightsOptions
- LocalLightsWorldConfig
- NetIntercept
- ScannableChunk
- ShaderLightingUniforms
- ShadowInvalidationEntry
- ShadowTexelRecord
- TransparentMeshData
- UnderwaterFogSource
- UnderwaterFogUniforms
- VoxelLightVolume
Type Aliases
ArgMetadata
Ƭ ArgMetadata: Object
Metadata extracted from a Zod schema for UI purposes.
Type declaration
| Name | Type |
|---|---|
defaultValue? | string | number | boolean |
name | string |
options? | string[] |
required | boolean |
tabComplete? | (currentValue: string, context: TabCompleteContext) => string[] |
type | "string" | "number" | "enum" | "boolean" |
ArmOptions
Ƭ ArmOptions: Object
Type declaration
| Name | Type |
|---|---|
armColor? | string | THREE.Color |
armObject? | THREE.Object3D |
armObjectOptions | ArmObjectOptions |
armTexture? | THREE.Texture |
blockObjectOptions? | ArmObjectOptions |
customObjectOptions? | Record<string, ArmObjectOptions> |
minOccluderDepth? | number |
receiveHeldObjectShadows? | boolean |
receiveShadows? | boolean |
ArmsOptions
Ƭ ArmsOptions: ColorCanvasBoxOptions & { shoulderDrop?: number ; shoulderGap?: number }
Parameters to create a character's arms. Defaults to:
{
gap: 0.1 * CHARACTER_SCALE,
layers: 1,
side: THREE.DoubleSide,
width: 0.25 * CHARACTER_SCALE,
widthSegments: 8,
height: 0.5 * CHARACTER_SCALE,
heightSegments: 16,
depth: 0.25 * CHARACTER_SCALE,
depthSegments: 8,
shoulderGap: 0.05 * CHARACTER_SCALE,
shoulderDrop: 0.25 * CHARACTER_SCALE,
}
ArrowOptions
Ƭ ArrowOptions: Object
Parameters to create an arrow.
Type declaration
| Name | Type | Description |
|---|---|---|
color | string | Color | The color of the arrow. Defaults to red. |
coneHeight | number | The height of the head of the arrow. Defaults to 0.2. |
coneRadius | number | The radius of the head of the arrow. Defaults to 0.2. |
height | number | The height of the body of the arrow. Defaults to 0.8. |
radius | number | The radius of the body of the arrow. Defaults to 0.1. |
ArtFunction
Ƭ ArtFunction: (context: CanvasRenderingContext2D, canvas: HTMLCanvasElement) => void
A function to programmatically draw on a canvas.
Type declaration
▸ (context, canvas): void
Parameters
| Name | Type |
|---|---|
context | CanvasRenderingContext2D |
canvas | HTMLCanvasElement |
Returns
void
Block
Ƭ Block: Object
A block type in the world. This is defined by the server.
Type declaration
| Name | Type | Description |
|---|---|---|
aabbs | AABB[] | A list of axis-aligned bounding boxes that this block has. |
blueLightLevel | number | The blue light level of the block. |
castsShadow | boolean | null | Whether this block is drawn into the sun's shadow maps. null defers to blockCastsShadow's rule of thumb; a block the rule gets wrong (a door: see-through to the mesher, a plank slab to the eye) says so here. Mirrors the server casts_shadow field. |
coupledParts | CoupledPart[] | The other voxels of the multi-voxel unit this block is one part of — a door's other leaf, a tall flower's other half. Empty for an ordinary block. The server keeps such units whole at update intake; the client mirrors that in World.updateVoxels so predictions land on the same voxels. Mirrors the server coupled_parts field. |
dynamicFn | (pos: Coords3) => { aabbs: Block["aabbs"] ; faces: Block["faces"] ; isTransparent: Block["isTransparent"] } | - |
dynamicPatterns | BlockDynamicPattern[] | - |
faces | { corners: { pos: [number, number, number] ; uv: number[] }[] ; dir: [number, number, number] ; emissive?: number ; independent: boolean ; isolated: boolean ; name: string ; range: UV ; textureGroup: string | null }[] | A list of block face data that this block has. |
fluidFlowForce | number | The force applied to entities in this fluid, pushing them in the flow direction. |
greenLightLevel | number | The green light level of the block. |
groundFrictionMultiplier | number | Multiplier applied to entity ground friction while standing on this block. 1 is normal grip; lower values are slipperier. |
id | number | The block id. |
independentFaces | Set<string> | A set of block face names that are independent (high resolution or animated). This is generated on the client side. |
isAnimated | boolean | Whether every voxel of this block is meshed as its own geometry (never merged into the chunk's shared buffers) so World.blockAnimations can move one voxel's faces on their own — a door leaf swinging on its hinge. Mirrors the server is_animated field. |
isClimbable | boolean | Whether or not can entities climb this block. |
isCoupledAnchor | boolean | Whether this part is its unit's anchor: the part that is placed, picked and dropped, and whose rotation and stage the other parts follow. |
isDynamic | boolean | Whether or not does the block generate dynamic faces or AABB's. If this is true, the block will use dynamicFn to generate the faces and AABB's. |
isEmpty | boolean | Whether or not is this block empty. By default, only "air" is empty. |
isEntity | boolean | - |
isFluid | boolean | Whether or not is the block a fluid block. |
isLight | boolean | Whether or not is this block a light source. |
isOpaque | boolean | Whether or not is this block opaque (not transparent). |
isPassable | boolean | Whether or not should physics ignore this block. |
isPlant | boolean | Whether this block is plant decoration — a grass tuft, a flower, a crop. The mesher uses it to jitter diagonal faces; the renderer uses it to decide what WorldClientOptions.plantDetailDistance may stop drawing. |
isSeeThrough | boolean | Whether or not is this block see-through (can be opaque and see-through at the same time). |
isTransparent | [boolean, boolean, boolean, boolean, boolean, boolean] | Whether or not is this block transparent viewing from all six sides. The sides are defined as PX, PY, PZ, NX, NY, NZ. |
isWaterloggable | boolean | Whether this block can hold the world's waterlogging fluid alongside itself. Whether a given voxel actually does is per-voxel state, read with World.getVoxelWaterloggedAt. |
isWaterloggingFluid | boolean | Whether this is the fluid that waterlogging fills voxels with. |
isolatedFaces | Set<string> | - |
lightAttenuation | number | Optical density for Beer-Lambert light transmission through this block. 0 keeps normal air rules. 1 is leaves-scale. 2 is water-scale. |
name | string | The name of the block. |
redLightLevel | number | The red light level of the block. |
rotatable | boolean | Whether or not is the block rotatable. |
stackGroup | number | Vertical-run id shared by blocks that should shade/sway as one column (peony bottom+top, kelp+lantern). Zero means the block never stacks. Mirrors the server stack_group field. |
transparentStandalone | boolean | - |
yRotatable | boolean | Whether or not the block is rotatable around the y-axis (has to face either PX or NX). |
yRotatableSegments | "All" | "Eight" | "Four" | - |
BlockAnimation
Ƭ BlockAnimation: Object
Type declaration
| Name | Type | Description |
|---|---|---|
axis | Coords3 | The hinge axis, in the same frame; it turns with the block. |
durationMs | number | How long a move between two rest poses takes. |
easing? | BlockAnimationEasing | Progress curve over 0..1; defaults to easeOutCubic. |
pivot | Coords3 | The hinge point, in the block's unrotated 0..1 frame. |
restPose | (state: BlockAnimationState) => BlockRestPose | - |
BlockAnimationEasing
Ƭ BlockAnimationEasing: (t: number) => number
Type declaration
▸ (t): number
Parameters
| Name | Type |
|---|---|
t | number |
Returns
number
BlockAnimationState
Ƭ BlockAnimationState: Object
The voxel state a rest pose is asked for.
Type declaration
| Name | Type | Description |
|---|---|---|
raw | number | The packed voxel word, for anything the two fields below leave out. |
rotation | BlockRotation | - |
stage | number | - |
BlockAnimationsSnapshot
Ƭ BlockAnimationsSnapshot: Object
The state BlockAnimations.snapshot reports.
Type declaration
| Name | Type | Description |
|---|---|---|
activeCount | number | - |
registered | string[] | Lower-cased block names with a declared motion. |
trackedCount | number | - |
voxels | { angle: number ; block: string ; isMoving: boolean ; progress: number ; restAngle: number ; stage: number ; voxel: Coords3 }[] | - |
BlockEntityUpdateData
Ƭ BlockEntityUpdateData<T>: Object
Type parameters
| Name |
|---|
T |
Type declaration
| Name | Type |
|---|---|
etype | string |
id | string |
newValue | T | null |
oldValue | T | null |
operation | EntityOperation |
voxel | Coords3 |
BlockEntityUpdateListener
Ƭ BlockEntityUpdateListener<T>: (args: BlockEntityUpdateData<T>) => void
Type parameters
| Name |
|---|
T |
Type declaration
▸ (args): void
Parameters
| Name | Type |
|---|---|
args | BlockEntityUpdateData<T> |
Returns
void
BlockRestPose
Ƭ BlockRestPose: Object
Where a state's geometry rests, relative to the stage-0 geometry: turned
angle radians about the hinge, and displaced by offset (block-local,
before the block's rotation).
Type declaration
| Name | Type |
|---|---|
angle | number |
offset? | Coords3 |
BlockRule
Ƭ BlockRule: { type: "none" } | { type: "simple" } & BlockSimpleRule | { logic: BlockRuleLogic ; rules: BlockRule[] ; type: "combination" }
BlockSimpleRule
Ƭ BlockSimpleRule: Object
Type declaration
| Name | Type |
|---|---|
id? | number |
offset | Coords3 |
rotation? | BlockRotation | SerializedBlockRotation |
stage? | number |
BlockUpdate
Ƭ BlockUpdate: Object
A block update to make on the server.
Type declaration
| Name | Type | Description |
|---|---|---|
isWaterlogged? | boolean | Whether the updated voxel holds the world's waterlogging fluid alongside its block. |
rotation? | number | The optional rotation of the updated block. |
stage? | number | The optional stage of the updated block. |
type | number | The voxel type. |
vx | number | The voxel x-coordinate. |
vy | number | The voxel y-coordinate. |
vz | number | The voxel z-coordinate. |
waterlogLevel? | number | The level of the waterlogging fluid the updated voxel holds, 0 through 7. |
yRotation? | number | The optional y-rotation of the updated block. |
BlockUpdateListener
Ƭ BlockUpdateListener: (args: { newValue: number ; oldValue: number ; source: "client" | "server" ; voxel: Coords3 }) => void
Type declaration
▸ (args): void
Parameters
| Name | Type |
|---|---|
args | Object |
args.newValue | number |
args.oldValue | number |
args.source | "client" | "server" |
args.voxel | Coords3 |
Returns
void
BlockUpdateWithSource
Ƭ BlockUpdateWithSource: Object
Type declaration
| Name | Type |
|---|---|
source | "client" | "server" |
update | BlockUpdate |
BodyOptions
Ƭ BodyOptions: ColorCanvasBoxOptions
Parameters to create a character's body. Defaults to:
{
gap: 0.1 * CHARACTER_SCALE,
layers: 1,
side: THREE.DoubleSide,
width: 1 * CHARACTER_SCALE,
widthSegments: 16,
}
where CHARACTER_SCALE is 0.9.
BoundingBox
Ƭ BoundingBox: Object
Type declaration
| Name | Type |
|---|---|
min | Coords3 |
shape | Coords3 |
BoxSides
Ƭ BoxSides: "back" | "front" | "top" | "bottom" | "left" | "right" | "sides" | "all"
The sides of a canvas box.
"all" means all six sides, and "sides" means all the sides except the top and bottom.
CSSMeasurement
Ƭ CSSMeasurement: `${number}${string}`
A CSS measurement. E.g. "30px", "51em"
CameraPerspective
Ƭ CameraPerspective: "px" | "nx" | "py" | "ny" | "pz" | "nz" | "pxy" | "nxy" | "pxz" | "nxz" | "pyz" | "nyz" | "pxyz" | "nxyz"
CanvasBoxOptions
Ƭ CanvasBoxOptions: Object
Parameters to create a canvas box.
Type declaration
| Name | Type | Description |
|---|---|---|
depth? | number | The depth of the box. Defaults to whatever width is. |
depthSegments? | number | The depth segments of the box, which is the number of pixels of the canvases along the depth. Defaults to whatever widthSegments is. |
gap | number | The gap between the layers of the box. Defaults to 0. |
height? | number | The height of the box. Defaults to whatever width is. |
heightSegments? | number | The height segments of the box, which is the number of pixels of the canvases along the height. Defaults to whatever widthSegments is. |
layers | number | The number of layers of this box. Defaults to 1. |
receiveShadows? | boolean | Whether this canvas box should receive shadows. Defaults to false. |
side | Side | The side of the box to render. Defaults to THREE.FrontSide. |
texelsPerBlock? | number | Texture pixels per world unit. When set, widthSegments, heightSegments and depthSegments are derived from the box's dimensions at this density (at least one texel each), so every face has square texels whatever the box's proportions. Without it a 0.3 x 0.14 x 0.06 box gets the same widthSegments along all three axes and its texture is squashed on every non-square face. Prefer this over hand-picked segment counts for anything that is not a cube. |
transparent? | boolean | Whether or not should this canvas box be rendered as transparent. Defaults to false. |
underwaterFog? | boolean | Whether this canvas box tints toward the ambient water color while the camera is submerged, matching the underwater look of instanced entities. Defaults to false. |
width | number | THe width of the box. Defaults to 1. |
widthSegments | number | The width segments of the box, which is the number of pixels of the canvases along the width. Defaults to 8. |
CharacterOptions
Ƭ CharacterOptions: Object
Parameters to create a character.
Type declaration
| Name | Type | Description |
|---|---|---|
arms? | Partial<ArmsOptions> | Parameters to create the character's arms. |
body? | Partial<BodyOptions> | Parameters to create the character's body. |
head? | Partial<HeadOptions> | Parameters to create the character's head. |
idleArmSwing? | number | The speed at which the arms swing when the character is idle. Defaults to 0.06. |
legs? | Partial<LegOptions> | Parameters to create the character's legs. |
nameTagOptions? | Partial<NameTagOptions> | - |
positionLerp? | number | The lerp factor of the character's position change, expressed per frame at 60 FPS and renormalized to the real frame delta. Defaults to 0.7. |
receiveShadows? | boolean | Whether this character should receive shadows. Defaults to false. |
rotationLerp? | number | The lerp factor of the character's rotation change, expressed per frame at 60 FPS and renormalized to the real frame delta. Defaults to 0.2. |
swimEnterLerp? | number | Lerp factor when entering the swimming pose. Defaults to 0.12. |
swimExitLerp? | number | Lerp factor when exiting the swimming pose. Defaults to 0.05. |
swimmingSpeed? | number | The speed at which the arms stroke when the character is swimming. Defaults to 1.8. |
swingLerp? | number | The lerp factor of the swinging motion of the arms and legs. Defaults to 0.8. |
walkingSpeed? | number | The speed at which the arms swing when the character is moving. Defaults to 1.4. |
ChunkDataEventData
Ƭ ChunkDataEventData: Object
Type declaration
| Name | Type |
|---|---|
chunk | Chunk |
coords | Coords2 |
ChunkEventData
Ƭ ChunkEventData: Object
Type declaration
| Name | Type |
|---|---|
allMeshes | Map<number, Mesh[]> |
chunk | Chunk |
coords | Coords2 |
ChunkMeshEventData
Ƭ ChunkMeshEventData: Object
Type declaration
| Name | Type |
|---|---|
chunk | Chunk |
coords | Coords2 |
level | number |
meshes | Mesh[] |
ChunkMeshUpdateEventData
Ƭ ChunkMeshUpdateEventData: ChunkMeshEventData & { reason: ChunkUpdateReason }
ChunkRegionArenasOptions
Ƭ ChunkRegionArenasOptions: Object
Tunables for the per-region BatchedMesh arenas that batch every
shared-opaque chunk section into one multi-draw call per region.
Type declaration
| Name | Type | Description |
|---|---|---|
growthFactor | number | Factor a full arena's capacity is multiplied by when it grows. Growth re-uploads the region's buffers, so it should be rare: geometric growth bounds the number of growth events logarithmically. |
indexPerVertexRatio | number | Index capacity per vertex of capacity. Quad geometry uses six indices for every four vertices, hence the 1.5 default. |
initialVertexCapacity | number | Vertex capacity a region arena is created with. Arenas grow geometrically from here, so this is a floor, not a limit. |
regionSizeInChunks | number | The width and depth of a region, in chunk columns. Every section whose chunk falls inside the same region shares one BatchedMesh. |
slotSlack | number | Multiplier applied to a section's vertex/index count when reserving its arena slot, so small remeshes update in place instead of reallocating. |
ChunkRequestCandidate
Ƭ ChunkRequestCandidate: Object
Type declaration
| Name | Type |
|---|---|
cx | number |
cz | number |
distanceSquared | number |
isInView | boolean |
ChunkSharedPoolStats
Ƭ ChunkSharedPoolStats: Object
Type declaration
| Name | Type |
|---|---|
bytesAllocated | number |
isActive | boolean |
maxSlots | number |
usedSlots | number |
ChunkStage
Ƭ ChunkStage: { requestedAt: number ; sentAt: number | null ; stage: "requested" } | { arrivedAt: number | null ; data: ChunkProtocol ; receivedAt: number ; requestedAt: number | null ; sentAt: number | null ; source: "update" | "load" ; stage: "processing" } | { arrivedAt: number | null ; chunk: Chunk ; loadedAt: number ; receivedAt: number | null ; requestedAt: number | null ; sentAt: number | null ; stage: "loaded" }
ChunkUpdateEventData
Ƭ ChunkUpdateEventData: ChunkEventData & { reason: ChunkUpdateReason }
ChunkUpdateReason
Ƭ ChunkUpdateReason: "voxel" | "light"
ClickOccasion
Ƭ ClickOccasion: "mousedown" | "mouseup"
The occasion a mouse click listener fires on. Mirrors InputOccasion for the keyboard: press and release are separate lanes, so a listener can tell a tap from a hold.
ClickType
Ƭ ClickType: "left" | "middle" | "right"
Three types of clicking for mouse input listening.
CloudsOptions
Ƭ CloudsOptions: Object
Parameters used to create a new Clouds instance.
Type declaration
| Name | Type | Description |
|---|---|---|
alpha | number | The opacity of the clouds. Defaults to 0.8. |
bottomShade | number | Brightness of the underside of a cloud block relative to its top, 0..1. Defaults to 0.7. |
cloudHeight | number | The y-height at which the clouds are generated. Defaults to 256. |
color | string | The color of the clouds. Defaults to #fff. |
count | number | The horizontal count of how many cloud blocks are along each edge of a cloud cell, count * count per cell. Defaults to 16. The whole cloud sheet therefore spans width * count * dimensions[0] blocks: it is width, not this, that adds cells. |
dimensions | Coords3 | The dimension of each cloud block. Defaults to [20, 20, 20]. |
endFadeFarRatio | number | - |
endFadeNearRatio | number | - |
falloff | number | The noise falloff factor used to generate the clouds. Defaults to 0.9. |
height | number | The vertical count of how many cloud blocks are in a cloud cell. This is also used to determine the overall count of cloud blocks of all the clouds. Defaults to 3. |
lerpFactor | number | The lerp factor used to translate cloud blocks from their original position to their new position. Defaults to 0.3. |
noiseScale | number | The scale of the noise used to generate the clouds. Defaults to 0.08. |
octaves | number | The number of octaves used to generate the noise. Defaults to 5. |
seed | number | The seed used to generate the clouds. Defaults to -1. |
sideShade | number | Brightness of the vertical faces of a cloud block relative to its top, 0..1. Defaults to 0.86. |
speedFactor | number | The speed at which the clouds move. Defaults to 8. |
sunTint | number | Extra brightness given to faces pointing at the sun, as a fraction. Defaults to 0.12. |
threshold | number | The threshold at which noise values are considered to be "cloudy" and should generate a new cloud block. Defaults to 0.05. |
uCameraSubmersion? | ShaderUniform<number> | - |
uCameraWaterPlaneY? | ShaderUniform<number> | - |
uCloudEndFadeFar? | ShaderUniform<number> | - |
uCloudEndFadeNear? | ShaderUniform<number> | - |
uCloudFogDistanceScale? | ShaderUniform<number> | - |
uFogColor? | ShaderUniform<Color> | An object that is used as the uniform for the clouds fog color shader. |
uFogFar? | ShaderUniform<number> | An object that is used as the uniform for the clouds fog far shader. |
uFogHeightDensity? | ShaderUniform<number> | - |
uFogHeightOrigin? | ShaderUniform<number> | - |
uFogNear? | ShaderUniform<number> | An object that is used as the uniform for the clouds fog near shader. |
uSkyFogBottomColor? | ShaderUniform<Color> | - |
uSkyFogDimension? | ShaderUniform<number> | - |
uSkyFogExponent? | ShaderUniform<number> | - |
uSkyFogExponent2? | ShaderUniform<number> | - |
uSkyFogMiddleColor? | ShaderUniform<Color> | - |
uSkyFogOffset? | ShaderUniform<number> | - |
uSkyFogStrength? | ShaderUniform<number> | - |
uSkyFogTopColor? | ShaderUniform<Color> | - |
uSkyFogVoidOffset? | ShaderUniform<number> | - |
uSunColor? | ShaderUniform<Color> | - |
uSunDirection? | ShaderUniform<Vector3> | - |
uSunlightIntensity? | ShaderUniform<number> | - |
uUnderwaterAmbient? | ShaderUniform<Color> | - |
verticalNoiseScale? | number | The scale of the noise along the vertical axis. Defaults to noiseScale. Raise it above noiseScale for a shallow deck: a handful of layers span almost no noise at the horizontal scale, so every column fills to the same layer and the top comes out perfectly flat. |
width | number | The number of cloud cells along each axis of the grid, width * width in total. Defaults to 8. |
CommandInfo
Ƭ CommandInfo<T>: Object
Information about a command including its processor and documentation.
Type parameters
| Name | Type |
|---|---|
T | extends ZodObject<Record<string, ZodTypeAny>> = ZodObject<Record<string, never>> |
Type declaration
| Name | Type |
|---|---|
aliases | string[] |
args | T |
category? | string |
description | string |
flags | string[] |
isHidden | boolean |
isTabCompletePreFiltered | boolean |
process | (args: z.infer<T>) => void |
tabComplete | Partial<Record<string, (currentValue: string, context: TabCompleteContext) => string[]>> |
CommandOptions
Ƭ CommandOptions<T>: Object
Type parameters
| Name | Type |
|---|---|
T | extends ZodObject<Record<string, ZodTypeAny>> = ZodObject<Record<string, never>> |
Type declaration
| Name | Type |
|---|---|
aliases? | string[] |
args? | T |
category? | string |
description | string |
flags? | string[] |
isHidden? | boolean |
isTabCompletePreFiltered? | boolean |
tabComplete? | Partial<Record<keyof z.infer<T>, (currentValue: string, context: TabCompleteContext) => string[]>> |
Coords2
Ƭ Coords2: [number, number]
Coords3
Ƭ Coords3: [number, number, number]
CoupledPart
Ƭ CoupledPart: Object
One other voxel a coupled block is stored together with: where it sits
relative to this block's voxel, and the block id it must hold. Mirrors the
server CoupledPart.
Type declaration
| Name | Type |
|---|---|
id | number |
offset | Coords3 |
CreatureBodyOptions
Ƭ CreatureBodyOptions: ColorCanvasBoxOptions
CreatureHeadOptions
Ƭ CreatureHeadOptions: ColorCanvasBoxOptions & { faceColor: Color | string ; neckGap?: number }
CreatureLegOptions
Ƭ CreatureLegOptions: ColorCanvasBoxOptions & { betweenLegsGap?: number ; frontBackGap?: number }
CreatureOptions
Ƭ CreatureOptions: Object
Type declaration
| Name | Type |
|---|---|
body? | Partial<CreatureBodyOptions> |
head? | Partial<CreatureHeadOptions> |
idleLegSwing? | number |
legs? | Partial<CreatureLegOptions> |
nameTagOptions? | Partial<NameTagOptions> |
positionLerp? | number |
rotationLerp? | number |
swingLerp? | number |
walkingSpeed? | number |
CullOptionsType
Ƭ CullOptionsType: Object
Type declaration
| Name | Type |
|---|---|
dimensions | Coords3 |
max | Coords3 |
min | Coords3 |
realMax | Coords3 |
realMin | Coords3 |
CustomChunkShaderMaterial
Ƭ CustomChunkShaderMaterial: ShaderMaterial & { map: Texture }
Custom shader material for chunks, simply a ShaderMaterial from ThreeJS with a map texture. Keep in mind that
if you want to change its map, you also have to change its uniforms.map.
DebugOptions
Ƭ DebugOptions: Object
Type declaration
| Name | Type |
|---|---|
asyncPeriod? | number |
containerId? | string |
dataClass? | string |
dataStyles? | StyleDecl |
entriesClass? | string |
entriesStyles? | StyleDecl |
lineClass? | string |
lineStyles? | StyleDecl |
newLineStyles? | StyleDecl |
onByDefault? | boolean |
showVoxelize? | boolean |
stats? | boolean |
statsStyles? | StyleDecl |
DeepPartial
Ƭ DeepPartial<T>: { [P in keyof T]?: DeepPartial<T[P]> }
Type parameters
| Name |
|---|
T |
EntitiesOptions
Ƭ EntitiesOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
stalenessTimeoutSeconds | number | Seconds an entity may go without any server message before it is considered lost and released. Covers dropped out-of-range and delete notifications so no entity can stay frozen forever. |
streamSilenceGraceSeconds | number | Seconds of total message silence after which staleness releases are suspended, so reconnects and tab suspensions do not purge live entities. |
EntityLivenessOptions
Ƭ EntityLivenessOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
stalenessTimeoutSeconds | number | Seconds an entity may go without any message before it is considered lost and released. The server keep-alive cadence is roughly one second, so this should comfortably exceed several missed keep-alives. |
streamSilenceGraceSeconds | number | Seconds of total message silence after which staleness judgment is suspended. A quiet stream means the connection itself is degraded (disconnect, tab suspension), not that individual entities were lost. |
EntityMetadata
Ƭ EntityMetadata: Object
Type declaration
| Name | Type |
|---|---|
rigidBody? | EntityRigidBodyMetadata |
EntityRigidBodyMetadata
Ƭ EntityRigidBodyMetadata: Object
Type declaration
| Name | Type |
|---|---|
fluidRatio | number |
isInFluid | boolean |
Event
Ƭ Event: Object
A Voxelize event from the server.
Type declaration
| Name | Type | Description |
|---|---|---|
name | string | The name to identify the event. |
payload? | EventPayload | Additional information of the event. |
EventHandler
Ƭ EventHandler<TPayload>: (payload: TPayload) => void
The handler for an event sent from the Voxelize server.
Type parameters
| Name | Type |
|---|---|
TPayload | EventPayload |
Type declaration
▸ (payload): void
Parameters
| Name | Type |
|---|---|
payload | TPayload |
Returns
void
EventPayload
Ƭ EventPayload: JsonPrimitive | { [key: string]: EventPayload | undefined; } | EventPayload[]
FindSimilarOptions
Ƭ FindSimilarOptions: Object
Type declaration
| Name | Type |
|---|---|
maxSuggestions? | number |
FluidQuery
Ƭ FluidQuery: (vx: number, vy: number, vz: number) => boolean
Type declaration
▸ (vx, vy, vz): boolean
Parameters
| Name | Type |
|---|---|
vx | number |
vy | number |
vz | number |
Returns
boolean
FormatSuggestionOptions
Ƭ FormatSuggestionOptions: Object
Type declaration
| Name | Type |
|---|---|
maxFallbackItems? | number |
HeadOptions
Ƭ HeadOptions: ColorCanvasBoxOptions & { faceColor: Color | string ; neckGap?: number }
HeapReader
Ƭ HeapReader: () => HeapSample | null
Reads the current heap, or returns null when the engine exposes no heap
numbers at all (every non-Chromium browser).
Type declaration
▸ (): HeapSample | null
Returns
HeapSample | null
HeapSample
Ƭ HeapSample: Object
A single reading of the renderer's JavaScript heap.
Type declaration
| Name | Type |
|---|---|
limitBytes | number |
usedBytes | number |
ImageResolver
Ƭ ImageResolver: (name: string) => string
Type declaration
▸ (name): string
Parameters
| Name | Type |
|---|---|
name | string |
Returns
string
InputOccasion
Ƭ InputOccasion: "keydown" | "keypress" | "keyup"
The occasion that the input should be fired.
InputSpecifics
Ƭ InputSpecifics: Object
The specific options of the key to listen to.
Type declaration
| Name | Type | Description |
|---|---|---|
checkType? | "key" | "code" | The type of key to check for. Defaults to key. |
identifier? | string | A special identifier to tag this input with. This is useful for removing specific inputs from the input listener later on. |
occasion? | InputOccasion | The occasion that the input should be fired. Defaults to keydown. |
IsolatedFaceEntry
Ƭ IsolatedFaceEntry<TMaterial>: Object
Type parameters
| Name |
|---|
TMaterial |
Type declaration
| Name | Type |
|---|---|
blockId | number |
createdAt | number |
faceName | string |
material | TMaterial |
state | SurfaceState |
voxel | Coords3 |
ItemRendererFactory
Ƭ ItemRendererFactory: (itemDef: ItemDef, world: World) => ItemRenderer
Type declaration
▸ (itemDef, world): ItemRenderer
Parameters
| Name | Type |
|---|---|
itemDef | ItemDef |
world | World |
Returns
ItemSlotsOptions
Ƭ ItemSlotsOptions: Object
Type declaration
| Name | Type |
|---|---|
activatedByDefault | boolean |
focusFirstByDefault | boolean |
horizontalCount | number |
perspective | CameraPerspective |
scrollable? | boolean |
slotClass | string |
slotFocusClass | string |
slotGap | number |
slotHeight | number |
slotHoverClass | string |
slotMargin | number |
slotPadding | number |
slotStyles | Partial<CSSStyleDeclaration> |
slotSubscriptClass | string |
slotSubscriptStyles | Partial<CSSStyleDeclaration> |
slotWidth | number |
verticalCount | number |
wrapperClass | string |
wrapperPadding | number |
wrapperStyles | Partial<CSSStyleDeclaration> |
zoom | number |
LegOptions
Ƭ LegOptions: ColorCanvasBoxOptions & { betweenLegsGap?: number }
Parameters to create the legs of a character. Defaults to:
{
gap: 0.1 * CHARACTER_SCALE,
layers: 1,
side: THREE.DoubleSide,
width: 0.25 * CHARACTER_SCALE,
widthSegments: 3,
height: 0.25 * CHARACTER_SCALE,
heightSegments: 3,
depth: 0.25 * CHARACTER_SCALE,
depthSegments: 3,
betweenLegsGap: 0.2 * CHARACTER_SCALE,
}
where CHARACTER_SCALE is 0.9.
LightBatch
Ƭ LightBatch: Object
Type declaration
| Name | Type | Description |
|---|---|---|
batchId | number | - |
completedJobs | number | - |
jobs | LightJob[] | - |
pendingDispatch | LightJob[] | Jobs of this batch that have not been handed to a worker yet. Dispatch serializes every chunk the job's bounding box covers, so jobs wait here as cheap descriptors instead of as multi-megabyte copies. |
results | LightBatchResult[] | - |
startSequenceId | number | - |
totalJobs | number | - |
LightBatchResult
Ƭ LightBatchResult: Object
Type declaration
| Name | Type |
|---|---|
borderNeighbors | LightWorkerBorderNeighbor[] |
boundingBox | BoundingBox |
color | LightColor |
modifiedChunks | LightWorkerModifiedChunk[] |
LightColor
Ƭ LightColor: "RED" | "GREEN" | "BLUE" | "SUNLIGHT"
Sunlight or the color of torch light.
LightConeInput
Ƭ LightConeInput: Object
Type declaration
| Name | Type | Description |
|---|---|---|
angleDeg | number | Full outer cone angle in degrees. |
color | Color | - |
direction | Vector3 | - |
innerRatio | number | Inner (full-brightness) cone angle as a fraction of the outer angle. |
intensity | number | - |
origin | Vector3 | - |
range | number | - |
scatterStrength | number | - |
submersion | number | 0 above water to 1 submerged; drives extinction and beam glow. |
LightConeUniformBinding
Ƭ LightConeUniformBinding: LightConeUniforms[keyof LightConeUniforms]
LightConeUniforms
Ƭ LightConeUniforms: Object
Type declaration
| Name | Type |
|---|---|
coneColors | { value: Color[] } |
coneColors.value | Color[] |
coneCount | { value: number } |
coneCount.value | number |
coneDirections | { value: Vector3[] } |
coneDirections.value | Vector3[] |
coneOrigins | { value: Vector4[] } |
coneOrigins.value | Vector4[] |
coneShapes | { value: Vector4[] } |
coneShapes.value | Vector4[] |
LightHandle
Ƭ LightHandle: number
Stable identity of a registered local light. Packed index:20 | generation:12;
0 is the invalid handle. Handles are plain numbers: storable, comparable,
and allocation-free.
LightJob
Ƭ LightJob: Object
Type declaration
| Name | Type |
|---|---|
batchId | number |
boundingBox | BoundingBox |
color | LightColor |
jobId | string |
lightOps | { floods: LightNode[] ; removals: Coords3[] } |
lightOps.floods | LightNode[] |
lightOps.removals | Coords3[] |
retryCount | number |
startSequenceId | number |
LightNode
Ƭ LightNode: Object
Type declaration
| Name | Type |
|---|---|
level | number |
voxel | Coords3 |
LightOperations
Ƭ LightOperations: Object
Type declaration
| Name | Type |
|---|---|
floods | { blue: LightNode[] ; green: LightNode[] ; red: LightNode[] ; sunlight: LightNode[] } |
floods.blue | LightNode[] |
floods.green | LightNode[] |
floods.red | LightNode[] |
floods.sunlight | LightNode[] |
hasOperations | boolean |
removals | { blue: Coords3[] ; green: Coords3[] ; red: Coords3[] ; sunlight: Coords3[] } |
removals.blue | Coords3[] |
removals.green | Coords3[] |
removals.red | Coords3[] |
removals.sunlight | Coords3[] |
LightQualityTier
Ƭ LightQualityTier: "ultra" | "high" | "medium" | "low" | "potato" | "off"
off is the user-facing disable: exactly the legacy flood-lit frame plus
emissive faces. potato is the identical-looking low-end fallback tier —
same rendering, kept separate so a device auto-downgrade and an explicit
user setting remain distinguishable.
LightShadowPolicy
Ƭ LightShadowPolicy: "none" | "voxelMask" | "shadowMap"
LightShape
Ƭ LightShape: "point" | "spot" | "capsule"
LightShinedOptions
Ƭ LightShinedOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
lerpFactor | number | The lerping factor of the brightness of each mesh. Defaults to 0.1. |
maxBrightness | number | The maximum brightness cap for the light effect. Defaults to 2.5. |
resampleDistance | number | Movement in blocks past which an object is resampled immediately instead of waiting out its interval: light data is voxel-grained, so a fast mover can cross into differently-lit voxels between scheduled samples. Defaults to 0.5. |
sampleIntervalFrames | number | Frames between fresh light samples for a stationary object. Each sample pays a sun raycast, a water-column walk, and a local-light query, while the sampled color is only ever consumed through the per-frame lerpFactor smoothing — a filter whose settling time is already several frames long, so a stationary object cannot display the difference between "sampled every frame" and "sampled every few frames". Objects are phase-staggered so the samples spread across frames instead of bunching. Defaults to 4. |
LightWorkerBorderNeighbor
Ƭ LightWorkerBorderNeighbor: Object
Type declaration
| Name | Type |
|---|---|
coords | Coords2 |
maxY | number |
minY | number |
LightWorkerModifiedChunk
Ƭ LightWorkerModifiedChunk: Object
Type declaration
| Name | Type |
|---|---|
coords | Coords2 |
lights | Uint32Array |
maxY | number |
minY | number |
LightWorkerResult
Ƭ LightWorkerResult: Object