This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Программирование на C#
Рендеринг
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Setting Up Properties
Освещение
Landscape Tool
Sandworm
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Fracture Body

Fracture body enables real-time persuasive destruction of objects. When collision with some body occurs, a destructible object is procedurally fractured into pieces, which in turn can also be fractured until the desired level of destruction is achieved. Fracture bodies are quite inexpensive type, and can be broken into a moderately large number of pieces.

Slice Pieces

Fracture bodies broken into pieces
Notice
Fracture body can be assigned only to dynamic mesh objects and can be used for only for convex meshes.

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. Therefore, it has the following properties:

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, which may contain too much detail for collision geometry. As a rule, it is unnecessary, because a highly detailed shape does not provide noticeable visual difference while significantly affecting performance. Approximation error makes it possible to control the number of vertices in the resulting collision shape:

  • By the value of 0, the shape precisely duplicates the mesh; the whole volume of it is enclosed.
  • The higher the value, the less vertices there are in the created shape, but the more details are skipped and the shape may not cover the whole mesh volume. The maximum value is 1.
Notice
An autogenerated shape of a fracture body is not displayed in the Shapes list on the Physics tab of the Parameters window. You can not remove it or assign any other shape to a fracture body.

Fracturing#

There are three patterns of fracturing:

These patterns determine fracture paths that are relevant to different mechanical properties of materials (e.g., its toughness and porosity). Fracture patterns are available for choosing on the script level.

Slicing#

Slicing is a fracture pattern separating the mesh volume into two pieces by a plane. The plane passes through a specified point of the body. Slicing angle is determined by a specified normal.

Slice Pieces

Fracturing body into two slice pieces

To slice a fracture body use the createSlicePieces() method.

Cracking#

Cracking is a fracture pattern involving formation of radial cracks from the point of collision. All of the crack pieces slightly vary in size to ensure visual realism. Moreover, the mesh 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 be formed by fracturing. The specified distance between the rings is also randomly varied to provide convincing result.

Crack Pieces

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

To crack a fracture body use the createCrackPieces() method.

Shattering#

Shattering is a fracture pattern randomly dividing the mesh volume into the specified number of convex chunks.

Shatter Pieces

Creating different number of shatter pieces

To shatter a fracture body use the createShatterPieces() method.

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 thus controls the level of fracturing. All chunks that are smaller than the specified value, will 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. Unsetting this flag puts the fractured mesh back into unbroken state. The broken body remains represented as one node in the UnigineEditor 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).

Notice
Fractured pieces cannot be manipulated using the UnigineEditor!

Fracture Surface Material#

When fracturing a mesh, it is necessary to set the material that will be applied to all newly created fracture surfaces. Those faces of fracture pieces that were external, keep the initial material.

Fracture Surface Property#

A new property for all fracture surfaces can also be assigned. They define game behavior and additional physical properties, however, body parameters override them.

Physics Intersections#

Physics intersections can be used as a quick way to check if a destructible object was hit by a projectile. You can use the Physics Intersection Mask to enable selective intersection detection for a body (e.g., to make it hittable by certain projectiles). Physics intersections are detected only for matching bit masks.

Performance Optimization Tips#

Although the fracture body is a relatively inexpensive type, in case of large number of fracture pieces, the impact on performance may become significant. To avoid performance drops the following tips can be used:

  • Use volume threshold parameter to reduce the number of fracture pieces.
  • Remove the pieces of a fractured body from the scene.

A code-based example, illustrating how to remove (fade with the time) the fracture pieces from the scene can be found in the Physics section of the UnigineScript samples.

Assigning a Fracture Body#

To assign a fracture body to an object via UnigineEditor perform the following steps:

  1. Open the World Hierarchy window
  2. Select dynamic mesh object to assign a fracture body to.
  3. Go to the Physics tab in the Parameters window and assign a physical body to the selected object by selecting Body -> Fracture.

    Adding a body

  4. Set body's name and change other parameters if necessary.
Last update: 09.04.2021
Build: ()