This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
VR Development
Двойная точность координат
API
Animations-Related Classes
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
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Сэмплы материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Коллизионные формы (Shapes)

While a body simulates various types of physical behavior, a shape represents the volume of space occupied by a physical body. A physically simulated object usually has one body and one or several shapes which allow objects to collide with each other (therefore, shapes are often referred as collision shapes). Objects with shapes also fall under gravity, bounce off static surfaces or slide along them. A body without a single shape assigned behaves as a dummy body that can be connected to other bodies using joints, but does not collide and is immune to gravity.В то время как тело (body) имитирует различные типы физического поведения, форма (shape) представляет собой объем пространства, занимаемого физическим телом. Физически моделируемый объект обычно имеет одно тело и одну или несколько форм, которые позволяют объектам сталкиваться друг с другом (поэтому формы часто называют коллизионными формами). Объекты с формой также падают под действием силы тяжести, отскакивают от статичных поверхностей или скользят по ним. Тело, которому не назначена единственная форма, ведет себя как фиктивное тело Dummy, которое может соединяться с другими телами с помощью сочленений, но не сталкивается и невосприимчиво к гравитации.

Примечание
The maximum number of collision shapes for one body is limited to 32768.Максимальное количество коллизионных форм для одного тела - 32768.

Basic shape types are as follows:Основные типы форм следующие:

Simple primitives make collision calculations easier while keeping performance high and accuracy acceptable. Convex hulls provide higher precision, however, continuous collision detection is not available for this type of shape. Therefore, convex hulls should not be used for fast-moving objects.Простые примитивы упрощают вычисление столкновений, сохраняя при этом высокую производительность и приемлемую точность. Выпуклые многогранники обеспечивают более высокую точность, однако непрерывное обнаружение столкновений недоступно для этого типа формы. Следовательно, выпуклые многогранники не стоит использовать для быстро движущихся объектов.

Примечание
A shape doesn't have to duplicate the mesh it approximates. It is recommended to use simple primitives. Even though they are not precise, in the majority of cases they provide acceptable results.
The number of shapes should be kept as low as possible. Otherwise, heavy physics calculations will decrease the performance.
Форма не должна дублировать меш, который она аппроксимирует. Рекомендуется использовать простые примитивы. Несмотря на то, что они неточны, в большинстве случаев они обеспечивают приемлемые результаты.
Число форм должно быть как можно меньше. В противном случае тяжелые физические вычисления снизят производительность.

A shape cannot be created without a body and does not have its own position in world coordinates. It is always assigned to a body and positioned relative to it.Форма (shape) не может быть создана без тела (body) и не имеет собственной позиции в мировых координатах. Она всегда присваивается телу и позиционируется относительно него.

See alsoДополнительная информация#

Programming implementation:Программная реализация:

Shape ParametersПараметры формы#

All shapes regardless of their type have the following common parametersВсе формы независимо от их типа имеют следующие общие параметры:

Shape parameters

Enabled A flag indicating if a shape is enabled.Флаг, указывающий, включена ли форма.
Continuous A flag indicating if the continuous collision detection is enabled for the shape.
Примечание
Continuous collision detection is available for sphere and capsule shapes only.Continuous collision detection is available for sphere and capsule shapes only.
Continuous collision detection is available for sphere and capsule shapes only.
Флаг, указывающий, включено ли непрерывное обнаружение столкновений для формы.
Примечание
Continuous collision detection is available for sphere and capsule shapes only.Непрерывное обнаружение столкновений доступно только для сфер и капсул.
Mass Mass of the shape. Changing the mass influences the density, which is calculated by dividing the mass by shape volume. In case if there are several shapes assigned to a body (e.g. a set of convex hulls)Масса формы. Изменение массы влияет на плотность, которая рассчитывается путем деления массы на объем формы. В случае, если телу присвоено несколько форм (например, набор выпуклых многогранников)
Density Density of the shape. Changing the density influences the mass, which is calculated by multiplying shape volume by density.Плотность формы. Изменение плотности влияет на массу, которая рассчитывается путем умножения объема формы на плотность.
Friction Coefficient of friction of the shape. Defines how rough the shape's surface is. The higher the value, the less tendency the shape has to slide.
Примечание
In case if an object contains a surface and a shape, both with specified friction parameter, only the shape's parameter will be used.In case if an object contains a surface and a shape, both with specified friction parameter, only the shape's parameter will be used.
In case if an object contains a surface and a shape, both with specified friction parameter, only the shape's parameter will be used.
Коэффициент трения формы. Определяет шероховатость поверхности формы. Чем выше значение, тем меньше тенденция к скольжению формы.
Примечание
In case if an object contains a surface and a shape, both with specified friction parameter, only the shape's parameter will be used.В случае, если объект содержит поверхность и форму, и для них обеих задан параметр трения, будет использоваться только параметр формы.
Restitution Coefficient of restitution of the shape. Defines how bouncy the shape is when colliding.
  • The minimum value of 0 indicates inelastic collisions (a piece of soft clay hitting the floor)The minimum value of 0 indicates inelastic collisions (a piece of soft clay hitting the floor)
  • The maximum value of 1 represents highly elastic collisions (a rubber ball bouncing off a wall)The maximum value of 1 represents highly elastic collisions (a rubber ball bouncing off a wall)
Примечание
In case if an object contains a surface and a shape, both with specified restitution parameter, only the shape's parameter will be used.In case if an object contains a surface and a shape, both with specified restitution parameter, only the shape's parameter will be used.
The minimum value of 0 indicates inelastic collisions (a piece of soft clay hitting the floor)The maximum value of 1 represents highly elastic collisions (a rubber ball bouncing off a wall)In case if an object contains a surface and a shape, both with specified restitution parameter, only the shape's parameter will be used.
Коэффициент восстановления формы. Определяет упругость формы при столкновении.
  • The minimum value of 0 indicates inelastic collisions (a piece of soft clay hitting the floor)Минимальное значение 0 указывает на неупругие столкновения (кусок мягкой глины, ударяющийся об пол)
  • The maximum value of 1 represents highly elastic collisions (a rubber ball bouncing off a wall)Максимальное значение 1 соответствует очень упругому столкновению (резиновый мяч, отскакивающий от стены).
Примечание
In case if an object contains a surface and a shape, both with specified restitution parameter, only the shape's parameter will be used.В случае, если объект содержит поверхность и форму, и для них обеих задан параметр восстановления, будет использоваться только параметр формы.
Position Position of the shape in the coordinates of the body.Положение формы в координатах тела (body).
Rotation Rotation of the shape in the coordinates of the body.Вращение формы в координатах тела (body).
Physics Intersection mask Physics Intersection bit mask of the shape.Битовая маска формы для определения Physics Intersection.
Collision mask Collision bit mask of the shape. This mask is used to specify collisions of the shape with other ones.Битовая маска столкновений формы. Эта маска используется для указания столкновений формы с другими.
Exclusion mask Exclusion bit mask of the shape. This mask is used to prevent collisions of the shape with other ones.Битовая маска исключений формы. Эта маска используется для предотвращения столкновения формы с другими.

Our video tutorial on physics contains an overview of the shape parameters and clarification on how to use the Exclusion and Collision masks.Наш видеоурок по физике содержит обзор параметров формы и разъяснения по использованию масок Exclusion и Collision.

Adding a ShapeДобавление формы#

To add a shape via UnigineEditor, perform the following steps:Чтобы добавить форму через UnigineEditor, выполните следующие шаги:

You can enable visualization of shapes by checking Helpers panel → Physics item → Shapes option (Visualizer should be enabled).Вы можете включить визуализацию форм, выбрав в панели Helpers → элемент Physics → параметр Shapes (Visualizer должен быть включен).

SphereСфера#

A sphere is the simplest and the fastest shape, as it has only one parameter: a radius. Continuous collision detection is available for spherical shapes. Therefore, passing through other objects even when moving at a high speed is avoided.Сфера — самая простая и быстрая форма, поскольку у нее только один параметр: радиус. Для сферических форм доступно постоянное обнаружение столкновений. Следовательно, прохождения через другие объекты даже при движении с высокой скоростью не произойдет.

Using the spherical shape for any arbitrary mesh ensures that its collisions will always be detected.Использование сферической формы для любого произвольного меша гарантирует, что столкновения с ним всегда будут обнаруживаться.

Формы-сферы

For a shape to fit your object, you can adjust the Radius of the sphere.Чтобы форма соответствовала вашему объекту, вы можете настроить Радиус сферы.

Радиус сферы

CapsuleКапсула#

A capsule is also a very fast collision shape with continuous collision detection available. Capsules are convenient for approximation of elongated objects (pillars, etc.) as well as humanoid characters, because it allows them to go up and down the stairs smoothly, without stumbling at each step (if the steps are not too high). It also ensures that character's limb will not get stuck somewhere unexpectedly.Капсула также представляет собой форму для очень быстрого расчета столкновения с возможностью непрерывного обнаружения столкновения. Капсулы удобны для аппроксимации удлиненных предметов (колонн и т.д.), А также человекообразных персонажей, поскольку позволяют им плавно подниматься и спускаться по лестнице, не спотыкаясь на каждой ступеньке (если ступеньки не слишком высокие). Это также гарантирует, что конечность персонажа не застрянет где-нибудь неожиданно.

Формы-капсулы

For a shape to fit your object, you can adjust the Radius and the Height of the capsule.Чтобы форма соответствовала вашему объекту, вы можете настроить радиус и высоту капсулы.

Высота и радиус капсулы

CylinderЦилиндр#

A cylinder can be used to approximate elongated shapes with flat ends (e.g. a shafts, pylons, etc.). It is similar to a box shape.Цилиндр можно использовать для приближения удлиненных форм с плоскими концами (например, валов, опор и т. д.). Он похож на форму коробки.

Формы-цилиндры

For a shape to fit your object, you can adjust the Radius and the Height of the cylinder.Чтобы форма соответствовала вашему объекту, вы можете отрегулировать радиус и высоту цилиндра.

Высота и радиус цилиндра

BoxКуб#

A box is a cuboid shape which can be used for approximation of volume of various objects. it is suitable for walls, doors, stairs, parts of mechanisms, car bodies, and many other things. The length of a box shape in each dimension can be chosen arbitrarily.Куб можно использовать для аппроксимации объема различных объектов. подходит для отделки стен, дверей, лестниц, деталей механизмов, кузовов автомобилей и многого другого. Измерения формы куба можно выбрать произвольно.

Формы-кубы

For a shape to fit your object, you can adjust the size of the box along each axis: Size X, Size Y, Size Y.Чтобы форма соответствовала вашему объекту, вы можете отрегулировать размер поля по каждой оси: Size X, Size Y, Size Y.

Измерения куба

Convex HullВыпуклый многогранник (Convex hull)#

Convex hull is the slowest of all shapes and is used for objects having complex geometry. The created shape will always be convex, that is, holes and cavities of the mesh are ignored when generating a convex hull. Instead, they are included into the shape volume. Convex shape is the smallest shape that can enclose vertices of the approximated mesh.Convex hull — самая медленная из всех форм и используется для объектов сложной геометрии. Созданная форма всегда будет выпуклой, то есть отверстия и полости меша игнорируются при создании выпуклого многогранника. Вместо этого они включены в объем формы. Выпуклая форма — это наименьшая форма, которая может охватывать вершины аппроксимированного меша.

Выпуклые формы

To generate a convex hull specify an approximation error value:Для создания выпуклого многогранника укажите значение ошибки аппроксимации:

Параметры выпуклой формы

The Approximation error parameter makes it possible to reduce the number of vertices of the created shape. Simple and rough convex hulls with small number of vertices are processed faster, therefore, it is recommended to keep the number of vertices as low as possible.Параметр Approximation error позволяет уменьшить количество вершин создаваемой формы. Простые и грубые выпуклые многогранники с небольшим количеством вершин обрабатываются быстрее, поэтому рекомендуется сохранять количество вершин как можно меньшим.

  • By the value of 0, the shape precisely duplicates the mesh; the whole volume of it is enclosed. При значении 0 форма точно дублирует меш; весь его объем прилагается.
  • The higher the value, the less vertices there are in the created shape, but the more details are skipped.Чем выше значение, тем меньше вершин в созданной форме, но тем больше деталей пропускается.
Zero Approximation Error
Approximation error = 0Ошибка аппроксимации = 0
    Higher value of Approximation Error
Approximation error = 0.1Ошибка аппроксимации = 0,1

AutogeneratedАвтогенерируемая форма#

To approximate a complex concave object and exclude cavities from its volume, use a set of autogenerated convex hulls.Чтобы аппроксимировать сложный вогнутый объект и исключить полости из его объема, используйте набор автоматически сгенерированных выпуклых многогранников.

A complex concave object approximated by a single convex hull (left) and an autogenerated set of convex hulls (right)Сложный вогнутый объект, аппроксимированный единственным выпуклым многогранником (слева) и автоматически сгенерированным набором выпуклых многогранников (справа)

To add an autogenerated set of shapes specify the following parameters:Чтобы добавить автоматически сгенерированный набор форм, укажите следующие параметры:

Параметры для автогенерации

Recursion depth determines the degree of mesh decomposition. If 0 or a negative value is provided, only one shape will be created. The higher the value, the more convex shapes are to be generatedRecursion depth определяет степень декомпозиции меша. Если указан 0 или отрицательное значение, будет создана только одна форма. Чем выше значение, тем больше выпуклых форм будет создано

Approximation error makes it possible to reduce the number of vertices of generated shapes. Simple and rough convex hulls with small number of vertices are processed faster, therefore, it is recommended to keep the number of vertices as low as possible.Approximation error позволяет уменьшить количество вершин генерируемых форм. Простые и грубые выпуклые многогранники с небольшим количеством вершин обрабатываются быстрее, поэтому рекомендуется сохранять количество вершин как можно меньшим.

  • By the value of 0, the shape precisely duplicates the mesh; the whole volume of it is enclosed. При значении 0 форма точно дублирует меш; весь его объем прилагается.
  • The higher the value, the less vertices there are in the created shape, but the more details are skipped.Чем выше значение, тем меньше вершин в созданной форме, но тем больше деталей пропускается.

Merging threshold determines the volume threshold for merging convex shapes after decomposition and can be used to reduce the number of generated shapes: the higher the value, the less convex shapes are to be generated.Merging threshold определяет порог объема для слияния выпуклых форм после декомпозиции и может использоваться для уменьшения количества генерируемых форм: чем выше значение, тем меньше выпуклых форм будут создано.

Последнее обновление: 19.12.2023
Build: ()