Chunks
Moddable voxel sandbox for room-scale VR.
Classes | Public Member Functions | Protected Member Functions | Properties | List of all members
Chunks.Graphics.Model Class Reference

A resource containing 3D geometry for rendering. More...

Inheritance diagram for Chunks.Graphics.Model:
Chunks.Plugins.PluginResource

Public Member Functions

 Model ()
 Constructs an empty model that can be procedurally generated. More...
 
void Clear ()
 Clears all vertices and faces from the model. More...
 
Model Clone ()
 Creates a copy of this model. More...
 
void SetBounds (Vector min, Vector max)
 Manually sets the render bounds of this model, used for culling. More...
 
void UpdateBounds ()
 Automatically recalculates the render bounds of this model. More...
 
void Update (ModelGenerator modelGen)
 Replaces the model's geometry with that created by a ModelGenerator. More...
 
void Dispose ()
 
- Public Member Functions inherited from Chunks.Plugins.PluginResource
override string ToString ()
 Returns the fully qualified name of this resource. More...
 

Protected Member Functions

override void OnReadDefinition (JToken token, string directory)
 When overridden in an inheriting class, handles reading information about the resource from a json token. More...
 
- Protected Member Functions inherited from Chunks.Plugins.PluginResource
 PluginResource ()
 
void AssertIsValid ()
 
virtual void OnInitialize ()
 
ResourceName GetResourceName (JToken token)
 Converts a json token to a resource name, associating it with the current namespace. Only valid from within OnReadDefinition. More...
 
ResourceName GetResourceName (JToken token, ResourceName @default)
 Converts a json token to a resource name, associating it with the current namespace. Only valid from within OnReadDefinition. If the token is null, default is used. More...
 

Properties

int VertexCount [get]
 The number of vertices currently contained within the model. More...
 
- Properties inherited from Chunks.Plugins.PluginResource
Plugin Plugin [get]
 Plugin this resource was loaded from. More...
 
ResourceName Name [get]
 Name of this resource. More...
 

Additional Inherited Members

- Public Attributes inherited from Chunks.Plugins.PluginResource
bool IsValid => Plugin == null || Plugin.IsLoaded
 

Detailed Description

A resource containing 3D geometry for rendering.

Constructor & Destructor Documentation

Chunks.Graphics.Model.Model ( )

Constructs an empty model that can be procedurally generated.

Member Function Documentation

void Chunks.Graphics.Model.Clear ( )

Clears all vertices and faces from the model.

Model Chunks.Graphics.Model.Clone ( )

Creates a copy of this model.

void Chunks.Graphics.Model.Dispose ( )
override void Chunks.Graphics.Model.OnReadDefinition ( JToken  token,
string  directory 
)
protectedvirtual

When overridden in an inheriting class, handles reading information about the resource from a json token.

Parameters
tokenToken to load the resource from
directoryLocation of the loaded json file's parent directory

Reimplemented from Chunks.Plugins.PluginResource.

void Chunks.Graphics.Model.SetBounds ( Vector  min,
Vector  max 
)

Manually sets the render bounds of this model, used for culling.

Parameters
minMinimum bounds of the model.
maxMaximum bounds of the model.
void Chunks.Graphics.Model.Update ( ModelGenerator  modelGen)

Replaces the model's geometry with that created by a ModelGenerator.

Parameters
modelGenModelGenerator to fetch geometry from
void Chunks.Graphics.Model.UpdateBounds ( )

Automatically recalculates the render bounds of this model.

Property Documentation

int Chunks.Graphics.Model.VertexCount
get

The number of vertices currently contained within the model.


The documentation for this class was generated from the following files: