Back to class index
Polygon[Class Summary]
p
ctor
NumEdges()[const]
NumVertices()[const]
VertexArrayPtr() (+1 overload)
AnyPointFast()[const]
Vertex(vertexIndex)[const]
Edge(edgeIndex)[const]
Edge2D(edgeIndex)[const]
EdgeNormal(edgeIndex)[const]
EdgePlane(edgeIndex)[const]
ExtremePoint(direction)[const] (+1 overload)
ProjectToAxis(...)[const]
DiagonalExists(i,j)[const]
Diagonal(i,j)[const]
IsConvex()[const]
IsPlanar(epsilonSq)[const]
IsSimple()[const]
IsNull()[const]
IsFinite()[const]
IsDegenerate(epsilon)[const]
BasisU()[const]
BasisV()[const]
MapTo2D(i)[const] (+1 overload)
MapFrom2D(point)[const]
NormalCCW()[const]
NormalCW()[const]
PlaneCCW()[const]
PlaneCW()[const]
Translate(offset)
Transform(transform) (+3 overloads)
Contains(...)[const] (+3 overloads)
Contains2D(...)[const]
Intersects(line)[const] (+11 overloads)
ConvexIntersects(aabb)[const] (+2 overloads)
ClosestPoint(...)[const] (+2 overloads)
Distance(point)[const]
Area()[const]
Perimeter()[const]
Centroid()[const]
CenterPoint()[const]
PointOnEdge(normalizedDistance)[const]
RandomPointOnEdge(rng)[const]
FastRandomPointInside(rng)[const]
ToPolyhedron()[const]
Triangulate()[const]
MinimalEnclosingAABB()[const]
ToString()[const]
SerializeToString()[const]
Equals(other)[const]
BitEquals(other)[const]
NumFaces()[static]
FromString(str,outEndStr)[static] (+1 overload)

Polygon::ProjectToAxis

Syntax

void Polygon::ProjectToAxis(const float4 &direction, float &outMin, float &outMax) const; [8 lines of code]

Projects this Polygon onto the given 1D axis direction vector.

This function collapses this Polygon onto an 1D axis for the purposes of e.g. separate axis test computations. The function returns a 1D range [outMin, outMax] denoting the interval of the projection.

Parameters

const float4 &directionThe 1D axis to project to. This vector may be unnormalized, in which case the output of this function gets scaled by the length of this vector. float &outMin [out]Returns the minimum extent of this object along the projection axis.float &outMax [out]Returns the maximum extent of this object along the projection axis.

Work in progress:

Todo: in void Polygon::ProjectToAxis(const float4 &direction, float &outMin, float &outMax) const:
Optimize!