This library is intended to replace APEX Destruction. It is being developed with years of user feedback and experience, with the goal of addressing shortcomings in performance, stability, and customizability of the APEX Destruction module.
The static data associated with a destructible is stored in an asset. Assets are instanced into actors, which may be damaged and fractured. When fractured, actors are broken into pieces called chunks. Connected groups of chunks belong to new actors. The grouping of chunks into actors is determined by the support graph in the asset.
Chunks are defined hierarchically, so that when a chunk is fractured its child chunks are created. The user may tag any chunk in this hierarchy as a support chunk. This is covered in more detail in the Support Model section. The user also supplies a description of the connections between support chunks. A bond represents the surface joining neighboring chunks. A bond is represented by a surface centroid, an average surface normal, and the surface area. These quantities don't need to be exact for Blast™ to operate effectively.
Multiple chunk hierarchies may exist in a single asset. The root chunks (see Definitions) will be visible when the asset is initially instanced. Subsequent fracturing has the effect of breaking the root chunks into their hierarchical descendants.
Support chunks that are joined by bonds will be grouped together in the same actor when fracturing occurs. In order to take advantage of the chunk hieararchy to reduce the number of chunks which represent an actor physically and graphically, Blast™ calculates a list of visible chunks from the support chunks in an actor. These may be the support chunks, or they may be ancestors of support chunks if all descendant support chunks are in the actor.
Support chunks do not have to be leaves in the chunk hierarchy, nor do they have to be at the same depth in the hierarchy. Children of support chunks will always be the sole chunk in their actor, since there is no bond defined between them. If an actor consists of of a subsupport chunk (see Definitions), the visible chunk is the same chunk.
Damage is applied from a damage event buffer. After all damage events are processed, bonds with non-positive healths are considered to be broken. Blast™ performs island detection on the support graph to find all groups of support chunks that are connected by unbroken bonds, and any new islands found result in new actors.
If an actor is composed of a single support or subsupport chunk with subsupport descendants, then there is no bond structure to model damage. Instead, such a chunk is considered to have its own health value, which may be decreased by damage. When such a lower-support (see Definitions) chunk's health is non-positive, its associated actor is deleted and replaced by actors that represent its child chunks, if any.
The effect of damage on leaf chunks depends upon which API is used. The low-level API does not delete leaf chunks. It is up to the user to delete them, and manage their physical and graphical representation outside of Blast™ if so desired.