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::Contains

Syntax

bool Polygon::Contains(const float4 &point, float polygonThicknessSq=1e-5f) const; [68 lines of code]
bool Polygon::Contains(const LineSegment &lineSegment, float polygonThickness=1e-3f) const; [22 lines of code]
bool Polygon::Contains(const Triangle &triangle, float polygonThickness=1e-3f) const; [6 lines of code]
bool Polygon::Contains(const Polygon &polygon, float polygonThickness=1e-3f) const; [7 lines of code]

Tests if the given object, expressed in global (world) space, is fully contained inside this polygon.

Only call this function if the polygon is planar. This test is performed in global space of this polygon, i.e. by specifying the other object in global (world) space coordinates.

Parameters

const float4 &pointThe point to test for containment.

Return Value

True if the given object is fully contained inside this polygon (and the plane of this polygon).

Work in progress:

Todo: in bool Polygon::Contains(const float4 &point, float polygonThicknessSq=1e-5f) const:
Add ContainsConvex(vec/etc.). See RTCD p. 202.

Add Contains(Circle/Disc).