FracturedMesh

Creates an Object that is destructible at runtime. A fractured mesh is slightly different than other types of mesh objects; they need to be connected to a Fracture to be sent down to the drawing pipeline. Once a Fracture gets linked with settings of the fractured mesh will tell the system how to convert the Fracture chunks into Shard; and the object is ready to be destroyed.

See Also

Static Variables


Name Description
object Parent Object that contains the active FracturedMesh data.
fracture Reference to the Fracture currently connected to the FracturedMesh.
config FracturedMeshConfig that contains the configuration parameters to convert chunks into Shard.
shard_count Total amount of shards currently created.
fractured Internally set to true if the FracturedMesh have been fractured; else false.

Functions


Name Description
ClearShards Destroy all existing Shard connected to the FracturedMesh.
SetFracture Assign an existing Fracture to the active FracturedMesh.
SetMaterial Assign a Material to a specific LOD primitive.
CopyMaterials Helper function that allows you to copy the current Material settings for a RenderLayer to another.
GetMaterial Retrieve which Material is currently assigned to a specific slot.
SetCoreMaterial Specify the shell core Material to use for a specific RenderLayer.
GetCoreMaterial Retrieve the Asset uid of the Material connected to the core.
GetShardIndex Retrieve the internal index of a specific Shard.
GetShardAt Retrieve the reference of a Shard using its index as key.
DetachAllShards Force the system to activate all shards and remove all RigidConstraint attach to them forcing the Mesh to fracture.
ActivateAllShards Force all Shard to be activated causing the structure to crack (constraints are still attached).
UpdateBounds Manually force an update of the FracturedMesh Bounds.

FracturedMeshConfig


A data structure that contains the configuration parameters to convert the chunks (Geometry generated from the fracture slices) contained in a Fracture an asset to Shard (PhysicObject that will interact with your World when the object gets fractured).

Static Variables


Name Description
corematerial_count Current amount of core material slots assigned to the FracturedMesh.

Variables


Name Description
core_object Unique id of the Object to use as core.
shell_mass Total mass of the shell; based on their volume ratio each Shard mass will be set using a percentage of it.
shard_margin Collision margin to apply on the Shard to avoid penetration.
shard_default_state Specify the default ActivationState of the shards.
shard_collision_bounds Set the type of CollisionBounds the shards will be using.
shard_collider_optimization Enable optimization of the Shard Collider.
shard_remove_broken_constraints Tell the system to remove the Shard constraints as soon as they are broken.
shard_sleeping_multiplier Stabilize the physics simulation by increasing (or decreasing) the sleeping threshold for each Shard.
shard_to_shard_constraint_type Set the RigidConstraintType to use to link each Shard PhysicObject together.
shard_to_shard_breaking_threshold Specify how much impulse or pressure a Shard can handle before it breaks.
shard_to_core_breaking_threshold Specify how much impulse or pressure a Shard connected to the core can handle before it breaks.
shard_physicmaterial A PhysicMaterial Asset unique id to apply on each Shard.
shard_collisionlayer_mask Bit mask of CollisionLayer cap that tells the system where to place the shards collision objects.
shard_collisionlayer_filter Bit mask of CollisionLayer cap that filter with which collision layer the shards can collide with.

Events


Callbacks Description
OnDraw Triggered when the FracturedMesh is about to be sent on GPU for drawing.
OnDisplay Triggered right after the FracturedMesh is done drawing.




NRG - API 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA