Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
ClipPoly.h File Reference

Go to the source code of this file.

Functions

template<class VERTEX_ARRAY >
JPH_NAMESPACE_BEGIN void ClipPolyVsPlane (const VERTEX_ARRAY &inPolygonToClip, Vec3Arg inPlaneOrigin, Vec3Arg inPlaneNormal, VERTEX_ARRAY &outClippedPolygon)
 
template<class VERTEX_ARRAY >
void ClipPolyVsPoly (const VERTEX_ARRAY &inPolygonToClip, const VERTEX_ARRAY &inClippingPolygon, Vec3Arg inClippingPolygonNormal, VERTEX_ARRAY &outClippedPolygon)
 
template<class VERTEX_ARRAY >
void ClipPolyVsEdge (const VERTEX_ARRAY &inPolygonToClip, Vec3Arg inEdgeVertex1, Vec3Arg inEdgeVertex2, Vec3Arg inClippingEdgeNormal, VERTEX_ARRAY &outClippedPolygon)
 
template<class VERTEX_ARRAY >
void ClipPolyVsAABox (const VERTEX_ARRAY &inPolygonToClip, const AABox &inAABox, VERTEX_ARRAY &outClippedPolygon)
 

Function Documentation

◆ ClipPolyVsAABox()

template<class VERTEX_ARRAY >
void ClipPolyVsAABox ( const VERTEX_ARRAY &  inPolygonToClip,
const AABox inAABox,
VERTEX_ARRAY &  outClippedPolygon 
)

Clip polygon vs axis aligned box, inPolygonToClip is assume to be in counter clockwise order. Output will be stored in outClippedPolygon. Everything inside inAABox will be kept.

◆ ClipPolyVsEdge()

template<class VERTEX_ARRAY >
void ClipPolyVsEdge ( const VERTEX_ARRAY &  inPolygonToClip,
Vec3Arg  inEdgeVertex1,
Vec3Arg  inEdgeVertex2,
Vec3Arg  inClippingEdgeNormal,
VERTEX_ARRAY &  outClippedPolygon 
)

Clip inPolygonToClip against an edge, the edge is projected on inPolygonToClip using inClippingEdgeNormal. The positive half space (the side on the edge in the direction of inClippingEdgeNormal) is cut away.

◆ ClipPolyVsPlane()

template<class VERTEX_ARRAY >
JPH_NAMESPACE_BEGIN void ClipPolyVsPlane ( const VERTEX_ARRAY &  inPolygonToClip,
Vec3Arg  inPlaneOrigin,
Vec3Arg  inPlaneNormal,
VERTEX_ARRAY &  outClippedPolygon 
)

Clip inPolygonToClip against the positive halfspace of plane defined by inPlaneOrigin and inPlaneNormal. inPlaneNormal does not need to be normalized.

◆ ClipPolyVsPoly()

template<class VERTEX_ARRAY >
void ClipPolyVsPoly ( const VERTEX_ARRAY &  inPolygonToClip,
const VERTEX_ARRAY &  inClippingPolygon,
Vec3Arg  inClippingPolygonNormal,
VERTEX_ARRAY &  outClippedPolygon 
)

Clip polygon versus polygon. Both polygons are assumed to be in counter clockwise order.

Parameters
inClippingPolygonNormalis used to create planes of all edges in inClippingPolygon against which inPolygonToClip is clipped, inClippingPolygonNormal does not need to be normalized
inClippingPolygonis the polygon which inClippedPolygon is clipped against
inPolygonToClipis the polygon that is clipped
outClippedPolygonwill contain clipped polygon when function returns