Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes

Fracture Body

Fracture body allows to generate persuasive destruction of objects at real-time speed. When collision with some body occurs, a destructible object is procedurally cracked into pieces, which in their turn can be fractured further until the necessary level of destruction is achieved. Fracture bodies are quite inexpensive type, and can be broken into moderately large number of pieces. For example, if, in addition, pieces are removed from the scene (fade with the time), the overhead is fairly insignificant.

Fracture body can be assigned only to dynamic mesh objects.

Notice
Fracture body can be used for meshes that are basically a simple primitive: boxes, spheres, capsules, cylinders, etc. Complex meshes cannot be fractured procedurally.

See also

Physical Approximation

Fracture body (as well as all the pieces it fractures into) is, in fact, a rigid body that moves according to rigid body dynamics. It has such properties as mass, density, damping of velocities, friction, restitution, frozen velocities, and can selectively participate in physical interaction owing to masks.

After the body was fractured, its mass is distributed among the pieces and they tumble down as rigid bodies would do.

Shape Approximation Error

Fracture body is always approximated with a convex hull. However, the result may contain too much detail for collision geometry. In common cases, it is not necessary, because there is no stunning visual difference when highly detailed shapes collide, yet their impact on performance is substantial. Approximation error allows to control the number of vertices in the resulting convex hull:

  • The lower the value, the more accurate and close to the mesh approximated shape is.
  • The maximum value of 1 provides quite rough approximation that may not cover all the mesh volume.

Fracturing

There are three patterns to model fractures in stiff material and divide the object's volume throughout. They determine fracture paths that are relevant to different mechanical properties of materials (for example, its toughness and porosity). Types of fractures are available for choosing on the script level.

Slicing

Fracture body can be sliced into two pieces. The slicing plane passes through some point of the body: either a specified one (for example, the point of collision with another object), or a random one. The slicing angle depends on the given normal.

Slice Pieces

Fracturing body into two slice pieces

Cracking

By cracking, radial cracks diverge from the point of collision. All of the crack pieces slightly vary in size to ensure visual realism. Besides that, a mesh can can be additionally fractured along concentric rings, simulating spread of the impulse. The thiner and more brittle the material is (e.g., glass), the more rings tend to form by fracturing. The specified distance between the rings is also randomly varied for convincing result.

Crack Pieces

Creating crack pieces with different number of radial cracks and concentric rings

Shattering

Shattering randomly divides volume of the mesh into the number of convex chunks.

Shatter Pieces

Creating different number of shatter pieces

Volume Threshold

As the body is fractured, especially for several times, small pieces may start to hit the performance. Volume threshold determines the minimum volume for fractured pieces and in the end controls the level of fracturing. All chunks that are smaller than the defined volume, will simply not be generated.

  • By the minimum value of 0, all the pieces up to the smallest one created by fracturing are simulated.
  • By higher values, only pieces big enough are generated. If no pieces have sufficient volume, the body stays unbroken.

Broken Body

After the body has been fractured, it acquires a Broken flag. Unchecking the box puts the fractured mesh back into unbroken state. The broken body remains represented as one node in the editor hierarchy. Generated fractured pieces are automatically represented as Fracture bodies and they inherit physical parameters of the fractured body (such as damping of linear and angular velocities, friction, restitution and masks); but beware, fractured pieces cannot be manipulated using the editor.

Fracture Surface Material

When fracturing a mesh, it is necessary to select the material that will be applied to all newly created fractured surfaces. Those faces of fractures pieces that were external, remain of the same material.

Fracture Surface Property

Same as the material, new property for all the fractured surfaces can be assigned. They define game behaviour and additional physical properties, however, body parameters override them.

Last update: 2017-07-03