A static mesh is a type of mesh that cannot be deformed. It is usually used to represent static geometry within a level (ie walls, floors etc...). StaticMeshes can contain multiple levels of details which have to be manually set by the user. At runtime based on the switching method selected by the user, a specific LOD will automatically be selected based on the Camera distance relative to the static Mesh position in space.
Name | Description |
AddLOD | Create a new LOD slot. |
Declaration unsigned char AddLOD( void ) Return Value
Index of the newly created slot.
|
SetMesh | Connect a Mesh to an existing LOD slot. |
Declaration bool SetMesh( unsigned char lod_index, Mesh *mesh ) Parameters
lod_index : Level of detail slot index.
mesh : Reference to an existing Mesh Asset; to disconnect the Asset from the slot set this parameter to nil .
Return Value
true if the Mesh Asset have been connected/disconnected; false if the LOD slot index is innexistent.
|
GetMesh | Helper that returns the Mesh reference associated to a specific slot. |
Declaration Mesh *GetMesh( unsigned char lod_index ) Parameters
|
SetMaterial | Assign an existing Material to the current StaticMesh. |
Declaration bool SetMaterial( unsigned short lod_index, int renderlayer_cap, unsigned short primitive_index, Material *material ) Parameters
lod_index : The level of detail index to connect the Material too.
renderlayer_cap : Specify the cap of an existing RenderLayer to draw the Material too.
primitive_index : The primitive index of the Mesh connected to the DynamicMesh.
material : The Material asset reference to use for the active parameters; to disconnect a Material pass nil .
Return Value
true on success; false if the lod_index or the primitive_index is invalid.
|
GetMaterial | Retrieve the Material assigned to a specific slot settings. |
Declaration Material *GetMaterial( unsigned char lod_index, int renderlayer_cap, unsigned short primitive_index ) Parameters
lod_index : The level of detail index of the slot to retrieve.
renderlayer_cap : The RenderLayer cap assigned to the slot.
primitive_index : The primitive index used by the slot.
Return Value
A Material reference; nil if no slot match the parameters or if the slot does not have any Material connected to it.
|
CopyMaterials | Copy the current Material settings from a RenderLayer to another. |
Declaration bool CopyMaterials( int from_renderlayer_cap, int to_renderlayer_cap ) Parameters
from_renderlayer_cap : The RenderLayer slot to copy.
to_renderlayer_cap : An existing RenderLayer cap to copy to.
Return Value
true on success; false if the lod_index is invalid or if the from_renderlayer_cap does not exist.
|
SetDistance | Specify the distance to use for the LOD slot. |
Declaration bool SetDistance( unsigned char lod_index, float distance ) Parameters
lod_index : The level of detail index of the slot to modify.
distance : Based on the active LODMethod employed by the StaticMesh the distance will be interpreted accordingly.
Return Value
true if the parameters were updated successfully; else return false .
|
RemoveLOD | Remove a specific LOD slot. |
Declaration bool RemoveLOD( int lod_index ) Parameters
lod_index : Index of the LOD slot to remove; pass -1 to remove them all.
Return Value
true if the slot was removed successfully; false if the lod index is invalid.
|
SwapLODs | Swap two existing LOD slot. |
Declaration bool SwapLODs( unsigned char lod_index0, unsigned char lod_index1 ) Parameters
lod_index0 : Index of the first slot (the source).
lod_index1 : Index of the second slot (the destination).
Return Value
true if the swap actually occur; else return false if the LOD index LOD index are invalid.
|
GetLOD | Helper function that returns the LOD index for a specific clip end. |
Declaration int GetLOD( float clip_end ) Return Value
The LOD index to use for the active distance/clip_end range. If no LOD are available -1 will be returned.
- Note
- The distance used between the StaticMesh and the Camera is the active distance of the Object bounds.
|
SetBase | Set the base LOD index to use internally each time the StaticMesh Geometry is needed. |
Declaration bool SetBase( unsigned char lod_index ) Return Value
false if the lod index provided is invalid; else return true .
- Note
- In the event that the LOD slot gets removed the base will automatically be set to the previous slot.
|