VoxelWorlds
Last updated
Last updated
VoxelWorld acts as the container for voxel data and is responsible for rendering final meshes and materials.
VoxelWorld Maintains dimensional/coordinal data about voxels in world space with a given "offset"
Voxel Worlds can be used to model any volume of voxels - not just worlds. In theory they could be used to model rotating doors, cars, or asteroids.
Placing VoxelDataAssets
VoxelDataAssets - like buildings and other imported assets - can be placed in a VoxelWorld at run time. This can be done via Blueprints or the Voxel Graph
VoxelDataAssets (eg. an imported asset from MagicaVoxel) can be placed in any VoxelWorld at runtime. VoxelWorlds require time to load after the typical BeginPlay event - eventually emitting an On World Loaded event. Placing VoxelDataAssets must be done after that event - an example event listening configuration is provided below:
Blueprints
The VoxelWorld object comes with a number of utility functions that make interacting with events (ie. On Hit events). Below are a series of examples.
Voxel Space vs. World Space
Coordinal data in VoxelWorld is maintained as simple Ints. However, many of your events will originate from world space and manifest as floats. An easy way to sidestep this is to use the convenience helper World Position to Voxel.
Example:
Additionally, helper methods come with a hidden "Convert to Voxel" flag for convenience.
Example:
Voxel Graph
See: Voxel Graphs