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
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
Учебные материалы

Unigine::Convex Class

Header: #include <UnigineMathLibConvex.h>

This class creates convex shapes.

Convex Class

Members


static ConvexPtr create ( ) #

Constructor. Initializes the new convex shape by clearing data of the prevoius shape.

static ConvexPtr create ( const Convex& convex ) #

Constructor. Initializes the new convex shape using the given shape.

Arguments

  • const Convex& convex - Input convex shape.

Convex & operator= ( const Convex& convex ) #

Sets the concave shape to be equal the given convex shape.

Arguments

  • const Convex& convex - Convex shape.

Return value

Resulting convex shape.

void clear ( ) #

Clears the data of the prevoius convex shape.

bool create ( const vec3* v, int num_vertex, float error ) #

Creates the convex shape using the given vertices.

Arguments

  • const vec3* v - Vertices.
  • int num_vertex - Number of vertices.
  • float error - Convex generation distance error.
    Notice
    Bigger values of the distance error increase the generation speed (values in rage [0..1]).

Return value

true if the shape was successfully created; otherwise false.

bool create ( const dvec3* v, int num_vertex, float error ) #

Creates the convex shape using the given vertices.

Arguments

  • const dvec3* v - Vertices.
  • int num_vertex - Number of vertices.
  • float error - Error.

Return value

true if the shape was successfully created; otherwise false.

int getNumVertex ( ) const#

Returns the number of vertices this convex shape consists of.

Return value

Number of vertices.

const dvec3 * getVertex ( ) const#

Returns the pointer to the array of vertices for the convex shape.

Return value

Pointer to the array of vertices.

const dvec3 & getVertex ( int num ) const#

Returns the vertex with the given number.

Arguments

  • int num - Number of the vertex.

Return value

Resulting vertex.

int getNumFaces ( ) const#

Returns the number of faces for this convex shape.

Return value

Number of faces.

int getNumFaceVertex ( int face ) const#

Returns the number of vertices for the given face.

Arguments

  • int face - Number of the face.

Return value

Number of vertices.

int getFaceVertex ( int face, int num ) const#

Returns the specified vertex of the specified face.

Arguments

  • int face - Face of the convex shape.
  • int num - Number of the vertex.

Return value

Index of the vertex.

double getVolume ( ) const#

Returns the convex shape's volume.

Return value

Convex shape's volume.

double getThreshold ( ) const#

Returns the distance threshold.

Return value

Distance threshold.

dvec3 getCenter ( ) const#

Returns the center of the convex shape.

Return value

Center of the convex shape.

mat3 getInertia ( ) const#

Returns the inertia matrix.

Return value

Inertia matrix.

dvec3 getClosestPoint ( const dvec3& point ) const#

Returns the closest convex shape's point to the given point.

Arguments

  • const dvec3& point - Given point.

Return value

Closest point (inside or on the edge of the convex shape).

void getBoundBox ( dvec3& min, dvec3& max ) const#

Calculates the concave shape's bounding box (minimum and maximum vertices).

Arguments

  • dvec3& min - Minimum vertex of the shape.
  • dvec3& max - Maximum vertex of the shape.
Last update: 24.08.2021
Build: ()