Chunks
Moddable voxel sandbox for room-scale VR.
Public Member Functions | Properties | List of all members
Chunks.Geometry.IChunk Interface Reference

Interface for types that define the geometry of one chunk in the world. A chunk is a cubic region of blocks, with the world made up of a regular grid of chunks. More...

Inheritance diagram for Chunks.Geometry.IChunk:

Public Member Functions

bool Raycast (Ray ray, float maxDist, out WorldRaycastHit hitInfo)
 Projects a point along a line, testing to see if it hits any blocks inside the chunk. Returns true if it hits a block, outputting information about the collision. More...
 
bool Sweep (SweptAABB toSweep, float maxDist, out WorldSweepHit hitInfo)
 Projects an axis aligned bounding box, testing to see if it hits any blocks inside the chunk. Returns true if it hits a block, outputting information about the collision. More...
 
bool GetNonEmptyBounds (out IntVector min, out IntVector max)
 
bool Set (IntVector min, IntVector max, [NotNull] Block value, bool replace)
 Sets an axis aligned box of blocks within this chunk to the given value, using a minimum and maximum position in local block space to define the region to set. More...
 
Block Get (IntVector pos)
 Gets the value of a single block inside this chunk from a given position in local block space. More...
 

Properties

int Size [get]
 The number of blocks along each side of this chunk. More...
 
IntVector WorldPos [get]
 

Detailed Description

Interface for types that define the geometry of one chunk in the world. A chunk is a cubic region of blocks, with the world made up of a regular grid of chunks.

Member Function Documentation

Block Chunks.Geometry.IChunk.Get ( IntVector  pos)

Gets the value of a single block inside this chunk from a given position in local block space.

Parameters
posPosition in local block space
bool Chunks.Geometry.IChunk.GetNonEmptyBounds ( out IntVector  min,
out IntVector  max 
)
bool Chunks.Geometry.IChunk.Raycast ( Ray  ray,
float  maxDist,
out WorldRaycastHit  hitInfo 
)

Projects a point along a line, testing to see if it hits any blocks inside the chunk. Returns true if it hits a block, outputting information about the collision.

Parameters
rayA ray describing the starting point relative to the chunk position, and direction to cast
maxDistMaximum distance to cast
hitInfoIf true is returned, contains hit information
bool Chunks.Geometry.IChunk.Set ( IntVector  min,
IntVector  max,
[NotNull] Block  value,
bool  replace 
)

Sets an axis aligned box of blocks within this chunk to the given value, using a minimum and maximum position in local block space to define the region to set.

Parameters
minMinimum bounds position within the chunk
maxMaximum bounds position wihtin the chunk
valueBlock value to set
bool Chunks.Geometry.IChunk.Sweep ( SweptAABB  toSweep,
float  maxDist,
out WorldSweepHit  hitInfo 
)

Projects an axis aligned bounding box, testing to see if it hits any blocks inside the chunk. Returns true if it hits a block, outputting information about the collision.

Parameters
toSweepAxis aligned bounding box to sweep, and the direction to sweep it in
maxDistMaximum distance to sweep the bounding box
hitInfoIf true is returned, contains hit information

Property Documentation

int Chunks.Geometry.IChunk.Size
get

The number of blocks along each side of this chunk.

IntVector Chunks.Geometry.IChunk.WorldPos
get

The documentation for this interface was generated from the following file: