You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chunks are cubes which contain TDimension^3 references to blocks and handle collisions between entities and their contents. A chunk can be defined by 1 constexpr size which is used for the width, height, and length dimensions. The number of block ids it contains is equivalent to TDimension^3 and are stored as raw ids. Each id is keyed by a Vector3UInt indicating its position within the chunk. It is possible for a chunk to have many blocks which have null or empty ids. Each chunk has a Vector3UInt coordinate within the world.
Coordinates
Because each chunk has a Vector3UInt position and a set of Vector3UInt positions within it, an entities position can be defined as its Vector3UInt chunk coordinate, its Vector3UInt block coordinate (relative to the chunk coordinate) and its Vector3/Vector<f32, 3> offset coordinate (relative to the block coordinate).
Collisions
Each chunk is responsible for running collision checks against entities.
Chunk-Spectrum
An entity is definitely not colliding with a chunk if n + 1 > c where n is a dimension of the entity's current chunk coordinate and c is the same dimension of a given chunk's coordinate. (An entity could be colliding with a chunk if it is in an adjacent chunk but on its boundary).
Broad Block-Spectrum
Assuming each chunk has a sequential fixed-sized list (i.e. an array with no empty values) which represents the block coordinates which are non-empty, an entity is definitely not colliding with a given block if n + 1 > c where nn is the largest dimension of the entity's bounding box and c is any dimension of the block's coordinate within the chunk.
Narrow Block-Spectrum
For an blocks which could be colliding from the Broad Block-Spectrum, those that actually do collide will need to run their own specific collision checks. In most cases, an entity is definitely not colliding with a block if general cube collision fails against the entity's bounds. This can use the rectangular prism collision check against the block's general coordinates. This should be the default case.
The text was updated successfully, but these errors were encountered:
Chunks
Chunks are cubes which contain
TDimension
^3 references to blocks and handle collisions between entities and their contents. A chunk can be defined by 1 constexpr size which is used for thewidth
,height
, andlength
dimensions. The number of block ids it contains is equivalent toTDimension
^3 and are stored as raw ids. Each id is keyed by aVector3UInt
indicating its position within the chunk. It is possible for a chunk to have many blocks which have null or empty ids. Each chunk has aVector3UInt
coordinate within the world.Coordinates
Because each chunk has a
Vector3UInt
position and a set ofVector3UInt
positions within it, an entities position can be defined as itsVector3UInt
chunk coordinate, itsVector3UInt
block coordinate (relative to the chunk coordinate) and itsVector3
/Vector<f32, 3>
offset coordinate (relative to the block coordinate).Collisions
Each chunk is responsible for running collision checks against entities.
Chunk-Spectrum
An entity is definitely not colliding with a chunk if
n + 1 > c
wheren
is a dimension of the entity's current chunk coordinate andc
is the same dimension of a given chunk's coordinate. (An entity could be colliding with a chunk if it is in an adjacent chunk but on its boundary).Broad Block-Spectrum
Assuming each chunk has a sequential fixed-sized list (i.e. an array with no empty values) which represents the block coordinates which are non-empty, an entity is definitely not colliding with a given block if
n + 1 > c
wheren
n is the largest dimension of the entity's bounding box andc
is any dimension of the block's coordinate within the chunk.Narrow Block-Spectrum
For an blocks which could be colliding from the
Broad Block-Spectrum
, those that actually do collide will need to run their own specific collision checks. In most cases, an entity is definitely not colliding with a block if general cube collision fails against the entity's bounds. This can use the rectangular prism collision check against the block's general coordinates. This should be the default case.The text was updated successfully, but these errors were encountered: