A* Pathfinding Project  4.3.5
The A* Pathfinding Project for Unity 3D
Int3PolygonClipper Struct Reference

Utility for clipping polygons. More...

Detailed Description

Utility for clipping polygons.

Public Member Functions

int ClipPolygon (Int3[] vIn, int n, Int3[] vOut, int multi, int offset, int axis)
 Clips a polygon against an axis aligned half plane. More...
 
void Init ()
 Initialize buffers if they are null. More...
 

Public Attributes

float [] clipPolygonCache
 Cache this buffer to avoid unnecessary allocations. More...
 
int [] clipPolygonIntCache
 Cache this buffer to avoid unnecessary allocations. More...
 

Member Function Documentation

◆ ClipPolygon()

int ClipPolygon ( Int3 []  vIn,
int  n,
Int3 []  vOut,
int  multi,
int  offset,
int  axis 
)

Clips a polygon against an axis aligned half plane.

Parameters
vInInput vertices
nNumber of input vertices (may be less than the length of the vIn array)
vOutOutput vertices, needs to be large enough
multiScale factor for the input vertices
offsetOffset to move the input vertices with before cutting
axisAxis to cut along, either x=0, y=1, z=2
Returns
Number of output vertices

The vertices will be scaled and then offset, after that they will be cut using either the x axis, y axis or the z axis as the cutting line. The resulting vertices will be added to the vOut array in their original space (i.e before scaling and offsetting).

◆ Init()

void Init ( )

Initialize buffers if they are null.

Member Data Documentation

◆ clipPolygonCache

float [] clipPolygonCache

Cache this buffer to avoid unnecessary allocations.

◆ clipPolygonIntCache

int [] clipPolygonIntCache

Cache this buffer to avoid unnecessary allocations.


The documentation for this struct was generated from the following file: