A shard is basically a broken piece that is part of a FracturedMesh. Once the mesh is destroyed it will break into shards; each shard can be access independently and respond to its own set of functions and properties.
See Also
Static Variables
Variables
Name | Description |
local_matrix | 4x4 local matrix representing the transformation of the Shard relative to its parent FracturedMesh. |
Declaration
|
selected | Boolean value representing if the Shard is currently selected (editor only). |
Declaration
|
Functions
Name | Description |
SetMaterial | Assign the Material to use when drawing the Shard. |
Declaration void SetMaterial( int renderlayer_cap, unsigned short primitive_index, Material *material ) Parameters
renderlayer_cap : Bit mask of RenderLayer caps telling the system which Material to use for which render layer.
primitive_index : The primitive index to apply the Material too. Where 0 represent the outside shell of the Shard and 1 the inner part of the Shard after fracture. This allows you to have an outside and inside Material applied.
material : Reference to an exisiting Material Asset; pass nil to disconnect.
|
CopyMaterials | Helper that allows you to copy the current Material configuration used for a specific RenderLayer to another. |
Declaration bool CopyMaterials( int from_renderlayer_cap, int to_renderlayer_cap ) Parameters
from_renderlayer_cap : Bitmask of RenderLayer caps to tell the system which Material configuration should be use.
to_renderlayer_cap : Bitmask of RenderLayer caps to copy the configuration to.
Return Value
true if the from_renderlayer_cap parameter correspond to an existing configuration; else return false .
|
GetMaterial | Helper function to retrieve the current Material used for a specific RenderLayer caps configuration. |
Declaration Material *GetMaterial( int renderlayer_cap, unsigned short primitive_index ) Parameters
renderlayer_cap : Bitmask of RenderLayer caps associated to an existing configuration.
primitive_index : The primitive index used in the Material configuration.
Return Value
nil if either the configuration was not found or if the configuration is not associated to any Material; else return the active Material reference.
|
Activate | Force the activation of a Shard. |
Declaration Return Value
true on success; false if the Shard is marked as static in other words marked as part of the FracturedMesh foundation.
|
Detach | Force the Shard to be detached from its parent FracturedMesh. |
Declaration Return Value
-1 if the Shard cannot be detached (not marked as fDestructable ); else return the amount of physic contraints that have been removed in order to detach the Shard.
|