|
Chunks
Moddable voxel sandbox for room-scale VR.
|
Interface for types that implement a voxel world. More...
Inherited by Chunks.Geometry.IWorldInternal.
Public Member Functions | |
| void | UpdateConfig (WorldConfig config) |
| IntVector | GetBlockPosition (Vector position) |
| Converts a position from world space to world block space. More... | |
| bool | Set (IntVector min, IntVector max, [NotNull] Block value, bool replace=true) |
| Sets an axis aligned box of blocks within this world to the given value, using a minimum and maximum position in world block space to define the region to set. More... | |
| Block | Get (IntVector pos) |
| Gets the value of a single block inside this world from a given position in world block space. Null is returned if the chunk corresponding to the given position hasn't been loaded. More... | |
| bool | Raycast (Ray ray, float maxDist, out WorldRaycastHit hitInfo) |
| bool | Raycast (Ray ray, float maxDist, out EntityRaycastHit hitInfo, Predicate< IRaycastable > predicate=null) |
| bool | RaycastWorld (Ray ray, float maxDist, out WorldRaycastHit hitInfo) |
| Projects a point along a line, testing to see if it hits any blocks inside the world. Returns true if it hits a block, outputting information about the collision. More... | |
| bool | RaycastEntities (Ray ray, float maxDist, out EntityRaycastHit hitInfo, Predicate< IRaycastable > predicate=null) |
| bool | RaycastAll (Ray ray, float maxDist, out RaycastHit hitInfo, Predicate< IRaycastable > entityPredicate=null) |
| 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 world. Returns true if it hits a block, outputting information about the collision. More... | |
| IEnumerable< Entity > | GetRootEntities (bool includeDisabled=false) |
| Gets all entities that don't have parents. More... | |
| IEnumerable< Entity > | GetAllEntities (bool includeDisabled=false) |
| Gets all entities. More... | |
| IEnumerable< TComponent > | GetRootComponents< TComponent > (bool includeDisabled=false) |
| Gets components of the given type from all entities that don't have parents. More... | |
| IEnumerable< TComponent > | GetAllComponents< TComponent > (bool includeDisabled=false) |
| Gets components of the given type from all entities. More... | |
| void | EnableRaycastable (IRaycastable raycastable) |
| void | DisableRaycastable (IRaycastable raycastable) |
| Entity | CreateEntity () |
| Creates a new empty entity in the world. More... | |
| void | InvalidateChunk (IChunk chunk) |
| void | Regenerate (int seed=0) |
| Clears all chunks and regenerates the world. Can optionally set a new seed. More... | |
Properties | |
| int | ChunkSize [get] |
| The size of each chunk of blocks in the world. Block space is then defined by world space scaled by ChunkSize. More... | |
| int | ChunkResolution [get] |
| WorldProperties | Properties [get] |
| GameMode | GameMode [get] |
| The current scripted game mode. More... | |
| CameraRig | CameraRig [get] |
| The player's camera rig. More... | |
| Graphics.Camera | SpectatorCamera [get] |
| float | Time [get] |
| The time since the game started when the last Update began. More... | |
| float | PhysicsTime [get] |
| The time since the game started when the last PhyicsUpdate began. More... | |
| float | DeltaTime [get] |
| The time between the previous Update and this one. More... | |
| float | PhysicsDeltaTime [get] |
| The fixed time step between PhyicsUpdate calls. More... | |
| LightingSettings | Lighting [get] |
Events | |
| ChunkLoadedEventHandler | ChunkLoaded |
| Invoked when a chunk is loaded or generated. More... | |
Interface for types that implement a voxel world.
| Entity Chunks.Geometry.IWorld.CreateEntity | ( | ) |
Creates a new empty entity in the world.
| void Chunks.Geometry.IWorld.DisableRaycastable | ( | IRaycastable | raycastable | ) |
| void Chunks.Geometry.IWorld.EnableRaycastable | ( | IRaycastable | raycastable | ) |
Gets the value of a single block inside this world from a given position in world block space. Null is returned if the chunk corresponding to the given position hasn't been loaded.
| pos | Position in world block space |
| IEnumerable<TComponent> Chunks.Geometry.IWorld.GetAllComponents< TComponent > | ( | bool | includeDisabled = false | ) |
Gets components of the given type from all entities.
| TComponent | Type of component to find |
| TComponent | : | Component |
| IEnumerable<Entity> Chunks.Geometry.IWorld.GetAllEntities | ( | bool | includeDisabled = false | ) |
Gets all entities.
Converts a position from world space to world block space.
| position | Position to get the world block space position for |
| IEnumerable<TComponent> Chunks.Geometry.IWorld.GetRootComponents< TComponent > | ( | bool | includeDisabled = false | ) |
Gets components of the given type from all entities that don't have parents.
| TComponent | Type of component to find |
| TComponent | : | Component |
| IEnumerable<Entity> Chunks.Geometry.IWorld.GetRootEntities | ( | bool | includeDisabled = false | ) |
Gets all entities that don't have parents.
| void Chunks.Geometry.IWorld.InvalidateChunk | ( | IChunk | chunk | ) |
| bool Chunks.Geometry.IWorld.Raycast | ( | Ray | ray, |
| float | maxDist, | ||
| out WorldRaycastHit | hitInfo | ||
| ) |
| bool Chunks.Geometry.IWorld.Raycast | ( | Ray | ray, |
| float | maxDist, | ||
| out EntityRaycastHit | hitInfo, | ||
| Predicate< IRaycastable > | predicate = null |
||
| ) |
| bool Chunks.Geometry.IWorld.RaycastAll | ( | Ray | ray, |
| float | maxDist, | ||
| out RaycastHit | hitInfo, | ||
| Predicate< IRaycastable > | entityPredicate = null |
||
| ) |
| bool Chunks.Geometry.IWorld.RaycastEntities | ( | Ray | ray, |
| float | maxDist, | ||
| out EntityRaycastHit | hitInfo, | ||
| Predicate< IRaycastable > | predicate = null |
||
| ) |
| bool Chunks.Geometry.IWorld.RaycastWorld | ( | Ray | ray, |
| float | maxDist, | ||
| out WorldRaycastHit | hitInfo | ||
| ) |
Projects a point along a line, testing to see if it hits any blocks inside the world. Returns true if it hits a block, outputting information about the collision.
| ray | A ray describing the starting point in world space and direction to cast |
| maxDist | Maximum distance to cast |
| hitInfo | If true is returned, contains hit information |
| void Chunks.Geometry.IWorld.Regenerate | ( | int | seed = 0 | ) |
Clears all chunks and regenerates the world. Can optionally set a new seed.
| seed | The new seed to use, if 0 the old seed is used. |
| bool Chunks.Geometry.IWorld.Set | ( | IntVector | min, |
| IntVector | max, | ||
| [NotNull] Block | value, | ||
| bool | replace = true |
||
| ) |
Sets an axis aligned box of blocks within this world to the given value, using a minimum and maximum position in world block space to define the region to set.
| min | Minimum bounds position within the world |
| max | Maximum bounds position wihtin the world |
| value | Block value to set |
| bool Chunks.Geometry.IWorld.Sweep | ( | SweptAABB | toSweep, |
| float | maxDist, | ||
| out WorldSweepHit | hitInfo | ||
| ) |
Projects an axis aligned bounding box, testing to see if it hits any blocks inside the world. Returns true if it hits a block, outputting information about the collision.
| toSweep | Axis aligned bounding box to sweep, and the direction to sweep it in |
| maxDist | Maximum distance to sweep the bounding box |
| hitInfo | If true is returned, contains hit information |
| void Chunks.Geometry.IWorld.UpdateConfig | ( | WorldConfig | config | ) |
|
get |
The player's camera rig.
|
get |
|
get |
The size of each chunk of blocks in the world. Block space is then defined by world space scaled by ChunkSize.
|
get |
The time between the previous Update and this one.
|
get |
The current scripted game mode.
|
get |
|
get |
The fixed time step between PhyicsUpdate calls.
|
get |
The time since the game started when the last PhyicsUpdate began.
TODO: Use a TimeSpan
|
get |
|
get |
|
get |
The time since the game started when the last Update began.
TODO: Use a TimeSpan
| ChunkLoadedEventHandler Chunks.Geometry.IWorld.ChunkLoaded |
Invoked when a chunk is loaded or generated.
1.8.10