@voxelize/core
Enumerations
Core Classes
Effects Classes
Other Classes
- AnimationUtils
- Arm
- Arrow
- AtlasTexture
- BlockRotation
- BoundedLruMap
- BoxLayer
- CSMRenderer
- CanvasBox
- Character
- Chunk
- ChunkPipeline
- ChunkRenderer
- ChunkSharedPool
- Clouds
- Creature
- Debug
- Entity
- EntityLivenessTracker
- Events
- FaceAnimation
- ImageItemRenderer
- ItemRegistry
- ItemRenderer
- ItemSlot
- ItemSlots
- LightCones
- MemoryPressureMonitor
- MeshPipeline
- Method
- NameTag
- Network
- Perspective
- Portrait
- Registry
- Sky
- SpriteText
- ThreeUtils
- VoxelInteract
- WaterOptics
- WebRTCConnection
- WorkerPool
- WorkerTransfer
Utils Classes
Interfaces
- BlockConditionalPart
- BlockDynamicPattern
- CSMConfig
- EntityShadowUniforms
- ImageComp
- ImageItemMeshData
- ItemDef
- NetIntercept
- ShaderLightingUniforms
- TransparentMeshData
- UnderwaterFogSource
- UnderwaterFogUniforms
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. |
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] ; 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. |
isClimbable | boolean | Whether or not can entities climb this block. |
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. |
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. |
isWaterlogged | boolean | Whether or not is the block waterlogged (exists inside water). |
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. |
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" | - |
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
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 |
stage? | number |
BlockUpdate
Ƭ BlockUpdate: Object
A block update to make on the server.
Type declaration
| Name | Type | Description |
|---|---|---|
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. |
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. |
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 }
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 ; retryCount: number ; stage: "requested" } | { data: ChunkProtocol ; source: "update" | "load" ; stage: "processing" } | { chunk: Chunk ; stage: "loaded" }
ChunkUpdateEventData
Ƭ ChunkUpdateEventData: ChunkEventData & { reason: ChunkUpdateReason }
ChunkUpdateReason
Ƭ ChunkUpdateReason: "voxel" | "light"
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. |
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 number of cloud cells to generate, count * count. Defaults to 16. |
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. |
speedFactor | number | The speed at which the clouds move. Defaults to 8. |
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> | - |
width | number | The horizontal count of how many cloud blocks are in a cloud cell. 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]
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. |
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 |
|---|---|
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[] |
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[] |
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. |
LightWorkerModifiedChunk
Ƭ LightWorkerModifiedChunk: Object
Type declaration
| Name | Type |
|---|---|
coords | Coords2 |
lights | Uint32Array |
maxY | number |
minY | number |
LightWorkerResult
Ƭ LightWorkerResult: Object
Type declaration
| Name | Type |
|---|---|
appliedDeltas | { lastSequenceId: number } |
appliedDeltas.lastSequenceId | number |
jobId | string |
modifiedChunks | LightWorkerModifiedChunk[] |
MemoryPressureOptions
Ƭ MemoryPressureOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
recoveryHeapRatio | number | Ratio at or below which pressure is considered relieved. Kept under MemoryPressureOptions.sheddingHeapRatio so the monitor has hysteresis instead of flapping around a single threshold. |
sampleIntervalMs | number | Milliseconds between heap samples. Zero or less disables the watchdog. |
shedCooldownMs | number | Minimum milliseconds between two shed actions while pressure persists. |
sheddingHeapRatio | number | usedJSHeapSize / jsHeapSizeLimit at or above which the renderer is treated as under pressure and load shedding begins. A worker that runs out of V8 heap takes the whole renderer process down with it, so this sits well below the limit rather than near it. |
sheddingSampleCount | number | Consecutive over-threshold samples required before shedding engages, so one transient spike (a large chunk batch mid-flight) does not throw away work that was about to be collected anyway. |
MemoryPressureStatus
Ƭ MemoryPressureStatus: Object
Type declaration
| Name | Type | Description |
|---|---|---|
heapLimitBytes | number | - |
heapRatio | number | - |
heapUsedBytes | number | - |
isHeapReadable | boolean | False on engines that expose no heap numbers; the monitor stays inert. |
isUnderPressure | boolean | - |
shedCount | number | - |
MemoryPressureVerdict
Ƭ MemoryPressureVerdict: "steady" | "shed" | "relieved"
What a sample concluded: shed asks the owner to drop load now,
relieved says pressure is over, steady means do nothing.
MeshResultType
Ƭ MeshResultType: Object
Type declaration
| Name | Type |
|---|---|
indices | Float32Array |
normals | Float32Array |
positions | Float32Array |
MeshTransferBenchmarkIteration
Ƭ MeshTransferBenchmarkIteration: Object
Type declaration
| Name | Type |
|---|---|
inputBytes | number |
outputBytes | number |
serializeMs | number |
totalMs | number |
workerMs | number |
MeshTransferBenchmarkModeResult
Ƭ MeshTransferBenchmarkModeResult: Object
Type declaration
| Name | Type |
|---|---|
avgSerializeMs | number |
avgTotalMs | number |
avgWorkerMs | number |
isSharedArrayBufferAvailable | boolean |
iterations | MeshTransferBenchmarkIteration[] |
measuredIterations | number |
p50TotalMs | number |
p95TotalMs | number |
strategy | WorkerTransferStrategy |
totalInputBytes | number |
totalOutputBytes | number |
warmupIterations | number |
MeshTransferBenchmarkOptions
Ƭ MeshTransferBenchmarkOptions: Object
Type declaration
| Name | Type |
|---|---|
cx | number |
cz | number |
level? | number |
measuredIterations? | number |
warmupIterations? | number |
MeshTransferBenchmarkResult
Ƭ MeshTransferBenchmarkResult: Object
Type declaration
| Name | Type |
|---|---|
cx | number |
cz | number |
level | number |
serializeSpeedup | number |
shared | MeshTransferBenchmarkModeResult |
speedup | number |
transfer | MeshTransferBenchmarkModeResult |
MeshTransferDispatch
Ƭ MeshTransferDispatch: (cx: number, cz: number, level: number) => Promise<{ geometries: object[] ; inputBytes: number ; outputBytes: number ; serializeMs: number ; workerMs: number } | null>
Type declaration
▸ (cx, cz, level): Promise<{ geometries: object[] ; inputBytes: number ; outputBytes: number ; serializeMs: number ; workerMs: number } | null>
Parameters
| Name | Type |
|---|---|
cx | number |
cz | number |
level | number |
Returns
Promise<{ geometries: object[] ; inputBytes: number ; outputBytes: number ; serializeMs: number ; workerMs: number } | null>
MeshWorkerTransferSample
Ƭ MeshWorkerTransferSample: Object
Type declaration
| Name | Type |
|---|---|
at | number |
inputBytes | number |
outputBytes | number |
serializeMs | number |
strategy | WorkerTransferStrategy |
totalMs | number |
workerMs | number |
MeshWorkerTransferStats
Ƭ MeshWorkerTransferStats: Object
Type declaration
| Name | Type |
|---|---|
jobCount | number |
recentSamples | MeshWorkerTransferSample[] |
strategy | WorkerTransferStrategy |
totalInputBytes | number |
totalOutputBytes | number |
totalSerializeMs | number |
totalWorkerMs | number |
NameTagOptions
Ƭ NameTagOptions: Object
Parameters to create a name tag.
Type declaration
| Name | Type | Description |
|---|---|---|
backgroundColor? | string | The background color of the name tag. Defaults to 0x00000077. |
color? | string | The color of the name tag. Defaults to 0xffffff. |
fontFace? | string | The font face to create the name tag. Defaults to "monospace". |
fontSize? | number | The font size to create the name tag. Defaults to 0.1. |
yOffset? | number | The y-offset of the nametag moved upwards. Defaults to 0. |
NetworkConnectionOptions
Ƭ NetworkConnectionOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
reconnectTimeout? | number | Milliseconds between reconnection attempts after the socket drops. Defaults to DEFAULT_RECONNECT_TIMEOUT_MS; pass 0 to disable automatic reconnection. |
secret? | string | - |
useWebRTC? | boolean | - |