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. Bonds may be defined between any two support chunks, or between a support chunk and "the world." There is no corresponding "world chunk," but the bond represents a connection between the chunk and its external environment. All chunks with a support graph connected to the world will be put into the same actor. An expected use case is to make this actor static (or kinematic). Actors may be queried to determine if they are "world-bound."
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 are no bonds defined between them. If an actor consists of a subsupport chunk (see Definitions), the visible chunk is the same chunk. The same is true if an actor consists of a single support chunk.
Damage is applied during the processing of 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.