A small voxel model: a map from voxel to linear rgb colour, the way creatures, held items and drops are drawn (coloured cubes, no textures). These are the tools that paint one; a renderer turns it into a mesh through VoxelModel.arrays.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
arrays(
Map< IVec3, Vector3> voxels, double scale, [Vector3? origin]) → VoxelModelArrays? -
The visible faces of
voxelsas mesh arrays, or null for a model with none.scaleis metres per voxel;originis the voxel-space point that maps to the mesh origin (a leg pivots at its hip). Faces between two voxels are culled; each face carries its faceTint. The winding is the chunk mesher's: clockwise seen from the normal side. -
box(
Map< IVec3, Vector3> voxels, IVec3 from, IVec3 to, Vector3 color, [double jitter = 0.05]) → void -
Fills the box
from..to(inclusive) ofvoxelswithcolor, each voxel's brightness varied by up to ±jitterfrom a hash of its position. -
mirrorX(
Map< IVec3, Vector3> voxels) → Map<IVec3, Vector3> -
The same voxels mirrored across the x = 0 plane. A voxel at x covers
x, x+1, so its mirror covers-x-1, -x. Rebuilding the map is how a left wing is made from a right one: scaling a node by -1 would mirror it too, but it also reverses the winding the renderer relies on.