This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
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
Content Creation
Content Optimization
Materials
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: ()