@voxelize/core
Enumerations
Core Classes
Effects Classes
Other Classes
- AnimationUtils
- Arm
- Arrow
- AtlasTexture
- BlockAnimations
- BlockProfileTable
- BlockRotation
- BoneTextureManager
- BoundedLruMap
- BoxLayer
- CSMRenderer
- CanvasBox
- Character
- Chunk
- ChunkPipeline
- ChunkRegionArenas
- ChunkRenderer
- ChunkSharedPool
- Clouds
- Creature
- Debug
- Entity
- EntityLivenessTracker
- Events
- FaceAnimation
- FarTerrain
- ImageItemRenderer
- InstancedEntityRoster
- IsolatedFaceLedger
- ItemRegistry
- ItemRenderer
- ItemSlot
- ItemSlots
- LightClusterGrid
- LightCones
- LightSourceRegistry
- LocalLightAirlight
- LocalLightAirlightEffect
- LocalLights
- LocalShadowAtlas
- LocalShadowScheduler
- MemoryPressureMonitor
- MeshPipeline
- Method
- NameTag
- Network
- OrderIndependentTransparency
- Perspective
- Portrait
- Registry
- SectionTracker
- SectionVisibilityGraph
- SeeThroughTexelSplit
- ShaderClock
- ShadowFrameLedger
- Sky
- SpriteText
- StaticGroup
- ThreeUtils
- VoxelBoxTexelFrame
- VoxelBoxWork
- VoxelInteract
- WaterOptics
- WebRTCConnection
- WorkerPool
- WorkerTransfer
Utils Classes
Interfaces
- BlockAnimationHost
- BlockConditionalPart
- BlockDynamicPattern
- BlockLightProfile
- BudgetedDrain
- CSMConfig
- CSMShadowLedger
- ChunkLoadTiming
- ChunkMaterialHost
- ChunkRequestHistory
- ChunkRoundTrip
- CoupledWorldView
- EmitterBlock
- EntityShadowUniforms
- FlickerProfile
- ImageComp
- ImageItemMeshData
- ItemDef
- LazyWorkEntry
- LocalLightDescriptor
- LocalLightSample
- LocalLightStats
- LocalLightsOptions
- LocalLightsWorldConfig
- NetIntercept
- PartBoxDims
- RosterWarmupOptions
- RosterWarmupStats
- ScannableChunk
- ShaderLightingUniforms
- ShadowInvalidationEntry
- ShadowTexelRecord
- TexelDensity
- TransparentMediumSource
- TransparentMeshData
- UnderwaterFogSource
- UnderwaterFogUniforms
- VoxelLightVolume
- WarmablePool
Type Aliases
AirlightInput
Ƭ AirlightInput: Object
Type declaration
| Name | Type | Description |
|---|---|---|
cameraX | number | - |
cameraY | number | - |
cameraZ | number | - |
daylight | number | 0..1: how much of the camera's surroundings the sun lights now. |
grid | LightClusterGrid | - |
isVisible | (fromX: number, fromY: number, fromZ: number, toX: number, toY: number, toZ: number, tolerance: number) => boolean | - |
nowMs | number | - |
registry | LightSourceRegistry | - |
skyExposure | number | 0..1: how far under open sky the camera stands. |
submersion | number | 0..1 camera submersion; the air layer yields to the water optics. |
tier | LightQualityTier | - |
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" |
ArmIdleSway
Ƭ ArmIdleSway: Object
A slow breathing sway the held object makes while it is at rest: neither swinging nor being swapped. It is laid on top of the rest pose each frame and taken off again before the next, so it never accumulates, and it keeps real time, so every frame rate sees the same sway.
Type declaration
| Name | Type | Description |
|---|---|---|
breathLift | number | How far it rises at the top of a breath. |
breathSeconds | number | Seconds per breath. |
breathTilt | number | How far it tips back toward the eye at the top of a breath, radians. |
driftReach | number | How far it drifts to either side. |
driftRoll | number | How far it rolls into the drift, radians. |
driftSeconds | number | Seconds per drift from one side to the other and back. Not a multiple of a breath, so the two never settle into one short loop. |
fadeInSeconds | number | Seconds it takes to come in once the object is at rest. |
fadeOutSeconds | number | Seconds it takes to leave when a swing starts. |
pivot | THREE.Vector3 | The point it sways about, in the arm's frame: where it is held. |
ArmObjectOptions
Ƭ ArmObjectOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
fixedFov? | number | The field of view, in degrees, the object is posed for. While it is held, the arm keeps it the size and place on screen it has at that field of view, whatever Arm.viewCamera is drawn at, so a pose tuned once holds when a player widens or narrows the view. Unset, the object follows the camera's field of view like the world does. |
idleSway? | ArmIdleSway | A breathing sway while the object is at rest. None by default. |
position | THREE.Vector3 | - |
quaternion | THREE.Quaternion | - |
swingPositions? | THREE.Vector3[] | - |
swingQuaternions? | THREE.Quaternion[] | - |
swingRestartAfter? | number | How far through a swing (0 to 1) it has to be before another swing request restarts it. Earlier requests are dropped, and not sent to peers, so a strike that has started always lands. 0, the default, restarts on every request. |
swingRestartBlend? | number | Seconds a restarted swing takes to ease out of the pose it interrupted instead of snapping to its first key. 0, the default, snaps. |
swingTimes? | number[] | - |
ArmOptions
Ƭ ArmOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
armColor? | string | THREE.Color | - |
armObject? | THREE.Object3D | - |
armObjectOptions | ArmObjectOptions | - |
armTexture? | THREE.Texture | - |
blockObjectOptions? | ArmObjectOptions | - |
customObjectOptions? | Record<string, ArmObjectOptions> | - |
minOccluderDepth? | number | - |
receiveHeldObjectShadows? | boolean | - |
receiveShadows? | boolean | - |
recoveryDip? | number | How far whatever the arm holds sinks below its rest, in the arm's units, while Arm.recovery is 0: a game whose swings land harder for waiting shows the hand coming back. It rises with the recovery, late (by the cube of it), so it is up only once the next swing is full. 0, the default, never sinks. |
shadowReach? | number | How far the viewmodel reaches into the world, as a share of the distance it is drawn at: placed with Arm.updateShadowUniforms, its shadows are looked up at that scale about the eye, so a block drawn two blocks down the screen is shaded where a hand would hold it. |
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
AtlasFilteringMode
Ƭ AtlasFilteringMode: "nearest" | "mip-aniso"
See WorldOptions.blockTextureFiltering.
BiomeTintAtOptions
Ƭ BiomeTintAtOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
chunkSize | number | - |
cornersAt | (cx: number, cz: number) => Uint8Array | undefined | - |
lights | Uint32Array | Int32Array | - |
origin | [number, number, number] | World position, in blocks, of a vertex whose position is zero. |
positionBias | number | - |
positionUnits | number | - |
positions | Float32Array | Uint16Array | - |
BlendedKind
Ƭ BlendedKind: "straight" | "premultiplied"
How a blended material's colour reaches the accumulation.
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. |
barrierHeight? | number | How high, in blocks above its voxel's floor, the bodies the server simulates find this block standing (each of its boxes raised to it). Absent for a block with no barrier. The client's own body still collides with the declared boxes; the physics engine reads it through World.getBarrierTopAt only to keep automatic moves (auto-jump, auto-step) from carrying the body over. Mirrors the server barrier_height field. |
blueLightLevel | number | The blue light level of the block. |
branch | BranchShape | null | Draws every voxel of this block as a branch of the radius its stage holds, joined to its neighbours. null for an ordinary block. Mirrors the server branch field; collision and picking follow the drawn shape through branchAABBsAt. |
branchShell | boolean | Draws every voxel of this block as a cell of a wide branch section: its slice of the tube of the core its raw bits point at, wearing that core's faces. Mirrors the server branch_shell. |
branchSockets | BranchSocket[] | The branches this block takes without being one (a leaf, a soil). |
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. |
defaultEntityJson? | string | null | Server-authored initial data for this block's entity. |
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 ; pigmentMask?: number ; range: UV ; regionalTint?: boolean ; stageTintMask?: number ; 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. |
rotationBitsAreState | boolean | Raw bits 16-23 of this block's voxels hold the block's own state, not a rotation: World.getVoxelRotationAt reads the identity rotation for it, and its rotation cannot be set. Mirrors the server rotation_bits_are_state. |
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. |
stageFaces? | { faces: Block["faces"] ; mask: number } | null | The faces a voxel wears instead of faces while its stage holds any of mask's bits: the same cube in another look, each face standing in for the face toward the same side. null (or absent) for a block with one look. Mirrors the server stage_faces. |
standaloneFaceDepth | number | With transparentStandalone, how many voxels in from either side of a mass of this block the faces between its voxels are still meshed, along each face's axis; 0 meshes every layer. A depth also makes a see-through cube a cutout mass, drawn single-sided with inward copies of its surface (see isClosedCutoutCube). |
swimSpeedMultiplier | number | Multiplier applied to an entity's swim speed while this block is the fluid at its feet. 1 is normal swim speed; a viscous fluid (lava) should be lower. |
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 |