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)
Двойная точность координат
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
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine.JointSuspension Class

Inherits from: Joint

Warning
This joint type is deprecated and will be removed in the upcoming releases. It is recommended to use the Wheel Joint instead.

This class is used to create a suspension joint. The bodies that represent both a frame and a wheel must be rigid bodies.

Example
#

The following code illustrates connection of two rigid bodies (frame and wheel) using a suspension joint.

Source code (C#)
JointSuspension joint = new JointSuspension(frame, wheel);

// setting joint anchor coordinates
joint.WorldAnchor = wheel.Object.WorldTransform * new dvec3(0.0f);

// setting joint axes coordinates
joint.WorldAxis0 = new vec3(0.0f,0.0f,1.0f);
joint.WorldAxis1 = new vec3(0.0f,1.0f,0.0f);

// setting linear damping and spring rigidity
joint.LinearDamping = 2.0f;
joint.LinearSpring = 200.0f;

// setting lower and upper suspension ride limits [-0.5; 0.0]
joint.LinearLimitFrom = -0.5f;
joint.LinearLimitTo = 0.0f;

// setting target suspension height 
joint.LinearDistance = 0.5f;

// setting maximum angular velocity and torque
joint.AngularVelocity = -20.0f;
joint.AngularTorque = 10.0f;

// setting common joint constraint parameters
joint.LinearRestitution = 0.2f;
joint.AngularRestitution = 0.2f;
joint.LinearSoftness = 0.2f;
joint.AngularSoftness = 0.2f;

// setting number of iterations
joint.NumIterations = 8;

See Also
#

  • A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/physics/ folder:
    • car_00
    • car_01
    • car_02

JointSuspension Class

Properties

float CurrentLinearDistance#

The current suspension compression.

float CurrentAngularVelocity#

The current velocity of wheel rotation.

float AngularVelocity#

The target velocity of wheel rotation.

float AngularTorque#

The maximum torque of the attached angular motor.

float AngularDamping#

The angular damping of the joint (wheel rotation damping).

float LinearSpring#

The rigidity coefficient of the suspension.

float LinearLimitTo#

The high limit of the suspension ride.

float LinearLimitFrom#

The low limit of the suspension ride.

float LinearDistance#

The target height of the suspension.

float LinearDamping#

The linear damping of the suspension.

vec3 WorldAxis1#

The wheel spindle axis in the world coordinates.

vec3 WorldAxis0#

The suspension axis in the world coordinates.

vec3 Axis11#

The wheel spindle in coordinates of the wheel (body 1).

vec3 Axis10#

The wheel spindle axis in coordinates of the frame (body 0).

vec3 Axis00#

The Suspension axis coordinates.

Members


JointSuspension ( ) #

Constructor. Creates a suspension joint with an anchor at the origin of the world coordinates.

JointSuspension ( Body body0, Body body1 ) #

Constructor. Creates a suspension joint connecting two given bodies. An anchor is placed between centers of mass of the bodies.

Arguments

  • Body body0 - Frame to be connected with the joint.
  • Body body1 - Wheel to be connected with the joint.

JointSuspension ( Body body0, Body body1, vec3 anchor, vec3 axis0, vec3 axis1 ) #

Constructor. Creates a suspension joint connecting two given bodies with specified suspension and spindle axis coordinates and an anchor placed at specified coordinates.

Arguments

  • Body body0 - Frame to be connected with the joint.
  • Body body1 - Wheel to be connected with the joint.
  • vec3 anchor - Anchor coordinates.
  • vec3 axis0 - Suspension axis coordinates.
  • vec3 axis1 - Wheel spindle axis coordinates.
Last update: 19.04.2024
Build: ()