A* Pathfinding Project  3.8.5
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
VoxelPolygonClipper Struct Reference

Utility for clipping polygons. More...

Detailed Description

Utility for clipping polygons.

Public Member Functions

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

Public Attributes

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

Member Function Documentation

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

Clips a polygon against an axis aligned half plane.

Parameters
vInInput vertices in XYZ format, so each group of 3 indices form a single vertex
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).

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).

int ClipPolygonY ( float[]  vIn,
int  n,
float[]  vOut,
float  multi,
float  offset,
int  axis 
)
void Init ( )

Initialize buffers if they are null.

Member Data Documentation

float [] clipPolygonCache

Cache this buffer to avoid unnecessary allocations.

int [] clipPolygonIntCache

Cache this buffer to avoid unnecessary allocations.


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