|
Infinity Engine v0.6.20
C++ API Documentation
|
Fundamental unit of spatial partitioning for procedural world generation. More...
#include <Chunk.hpp>
Public Member Functions | |
| Math::Vector3 | position () |
| Gets the center position of the chunk. | |
Public Attributes | |
| uint64_t | id |
| Unique identifier for this chunk. | |
| Spatial::Volume | vol |
| Spatial volume defining the chunk's bounds. | |
Fundamental unit of spatial partitioning for procedural world generation.
Chunk represents a discrete spatial region in a procedurally generated world, combining a unique identifier with a spatial volume. This is the core structure for chunk-based world generation systems, enabling:
The chunk system allows procedural content to be generated on-demand as players or cameras move through the world, while maintaining consistency through the unique chunk ID. Each chunk can be independently generated, saved, and loaded, making it ideal for open-world and streaming scenarios.
Common use cases:
Example usage:
| Math::Vector3 Infinity::Types::Procedural::Chunk::position | ( | ) |
Gets the center position of the chunk.
Convenience method that returns the chunk's volume center position. Equivalent to accessing vol.position directly.
| uint64_t Infinity::Types::Procedural::Chunk::id |
Unique identifier for this chunk.
A 64-bit unique ID that identifies this chunk within the world. Typically derived from grid coordinates or spatial position to ensure deterministic regeneration and efficient lookups.
Common ID generation schemes:
| Spatial::Volume Infinity::Types::Procedural::Chunk::vol |