This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
Tutorials

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: 2021-08-24
Build: ()