This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 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 convex 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 = 0.01f ) #

Creates the convex shape using the given vertices.

Arguments

  • const vec3* v - Vertices.
  • int num_vertex - Number of vertices.
  • float error - Approximation error (value in range [0..1], a higher value mean fewer vertices). This value allows reducing the number of vertices of the created shape. Convex hulls with fewer vertices are processed faster.

Return value

true if the shape was successfully created; otherwise false.

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

Creates the convex shape using the given vertices.

Arguments

  • const dvec3* v - Vertices.
  • int num_vertex - Number of vertices.
  • float error - Approximation error (value in range [0..1], a higher value mean fewer vertices). This value allows reducing the number of vertices of the created shape. Convex hulls with fewer vertices are processed faster.

Return value

true if the shape was successfully created; otherwise false.

int getNumVertex ( ) const#

Returns the number of vertices the 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 merge threshold.

Return value

Merge 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 convex 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: 2024-10-25
Build: ()