A* Pathfinding Project
3.8.5
The A* Pathfinding Project for Unity 3D
|
Utility for clipping polygons. More...
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. | |
int ClipPolygon | ( | float[] | vIn, |
int | n, | ||
float[] | vOut, | ||
float | multi, | ||
float | offset, | ||
int | axis | ||
) |
Clips a polygon against an axis aligned half plane.
vIn | Input vertices in XYZ format, so each group of 3 indices form a single vertex |
n | Number of input vertices (may be less than the length of the vIn array) |
vOut | Output vertices, needs to be large enough |
multi | Scale factor for the input vertices |
offset | Offset to move the input vertices with before cutting |
axis | Axis to cut along, either x=0, y=1, z=2 |
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).
Clips a polygon against an axis aligned half plane.
vIn | Input vertices |
n | Number of input vertices (may be less than the length of the vIn array) |
vOut | Output vertices, needs to be large enough |
multi | Scale factor for the input vertices |
offset | Offset to move the input vertices with before cutting |
axis | Axis to cut along, either x=0, y=1, z=2 |
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.
float [] clipPolygonCache |
Cache this buffer to avoid unnecessary allocations.
int [] clipPolygonIntCache |
Cache this buffer to avoid unnecessary allocations.