Back to class index
Polyhedron[Class Summary]
v
f
ctor
NumVertices()[const]
NumFaces()[const]
NumEdges()[const]
VertexArrayPtr() (+1 overload)
Vertex(vertexIndex)[const]
Edge(edgeIndex)[const]
Edges()[const]
Faces()[const]
EdgeIndices()[const]
FacePolygon(faceIndex)[const]
FacePlane(faceIndex)[const]
FaceNormal(faceIndex)[const]
ExtremeVertex(direction)[const]
ExtremePoint(direction)[const]
ProjectToAxis(...)[const]
ConvexCentroid()[const]
ApproximateConvexCentroid()[const]
SurfaceArea()[const]
Volume()[const]
MinimalEnclosingAABB()[const]
MergeAdjacentPlanarFaces()
FaceIndicesValid()[const]
FlipWindingOrder()
OrientNormalsOutsideConvex()
RemoveRedundantVertices()
IsNull()[const]
IsClosed()[const]
IsConvex()[const]
EulerFormulaHolds()[const]
FacesAreNondegeneratePlanar(epsilon)[const]
ClipLineSegmentToConvexPolyhedron(...)[const]
NearestVertex(point)[const]
Contains(point)[const] (+7 overloads)
FaceContains(...)[const]
FaceContainmentDistance2D(...)[const]
ContainsConvex(point,epsilon)[const] (+2 overloads)
ClosestPoint(...)[const] (+2 overloads)
ClosestPointConvex(point)[const]
Distance(point)[const]
Intersects(lineSegment)[const] (+11 overloads)
IntersectsConvex(line)[const] (+2 overloads)
MergeConvex(point)
Translate(offset)
Transform(transform) (+3 overloads)
SetEquals(p2)
SwapVertices(i,j)
CanonicalizeFaceArray()
ContainsFace(face)[const]
FindClosestVertex(pt,outDistanceSq)[const]
Triangulate()[const]
ToString()[const]
ConvexHull(...)[static]
Tetrahedron(...)[static]
Octahedron(...)[static]
Hexahedron(...)[static]
Icosahedron(...)[static]
Dodecahedron(...)[static]

Polyhedron::ClosestPoint

Syntax

float4 Polyhedron::ClosestPoint(const LineSegment &lineSegment, float4 *lineSegmentPt) const; [33 lines of code]
float4 Polyhedron::ClosestPoint(const LineSegment &lineSegment) const; [4 lines of code]
float4 Polyhedron::ClosestPoint(const float4 &point) const; [18 lines of code]

Computes the closest point on this polyhedron to the given object.

If the other object intersects this polyhedron, this function will return an arbitrary point inside the region of intersection.

Note
This function assumes that this polyhedron is closed and the edges are not self-intersecting.

Parameters

const LineSegment &lineSegmentThe line segment to find the closest point to. float4 *lineSegmentPt [out]If specified, returns the closest point on the line segment to this polyhedron. This pointer may be null.const float4 &pointThe point to find the closest point to.

See Also

Contains(), ContainsConvex(), ClosestPointConvex(), Distance(), Intersects(), IntersectsConvex().

Work in progress:

Todo: in float4 Polyhedron::ClosestPoint(const LineSegment &lineSegment, float4 *lineSegmentPt) const:
Make lineSegmentPt an out-reference instead of an out-pointer.
Todo: in float4 Polyhedron::ClosestPoint(const LineSegment &lineSegment, float4 *lineSegmentPt) const:
Add ClosestPoint(Line/Ray/Plane/Triangle/Polygon/Circle/Disc/AABB/OBB/Sphere/Capsule/Frustum/Polyhedron).