Back to class index
Capsule[Class Summary]
l
r
ctor (+2 overloads)
SetFrom(s)
SetDegenerate()
IsDegenerate()[const]
LineLength()[const]
Height()[const]
Diameter()[const]
Bottom()[const]
Center()[const]
Centroid()[const]
AnyPointFast()[const]
ExtremePoint(direction)[const] (+1 overload)
ProjectToAxis(...)[const]
Top()[const]
UpDirection()[const]
Volume()[const]
SurfaceArea()[const]
CrossSection(l)[const]
HeightLineSegment()[const]
IsFinite()[const]
PointInside(l,a,d)[const]
UniformPointPerhapsInside(l,x,y)[const]
SphereA()[const]
SphereB()[const]
MinimalEnclosingAABB()[const]
MinimalEnclosingOBB()[const]
RandomPointInside(rng)[const]
RandomPointOnSurface(rng)[const]
Translate(offset)
Scale(...)
Transform(transform) (+3 overloads)
ClosestPoint(targetPoint)[const]
Distance(point)[const] (+6 overloads)
Contains(point)[const] (+7 overloads)
Intersects(ray)[const] (+11 overloads)
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
Equals(rhs,epsilon)[const]
BitEquals(other)[const]
FromString(str,outEndStr)[static] (+1 overload)

Capsule::Distance

Syntax

float Capsule::Distance(const float4 &point) const; [4 lines of code]
float Capsule::Distance(const Plane &plane) const; [4 lines of code]
float Capsule::Distance(const Sphere &sphere) const; [4 lines of code]
float Capsule::Distance(const Ray &ray) const; [4 lines of code]
float Capsule::Distance(const Line &line) const; [4 lines of code]
float Capsule::Distance(const LineSegment &lineSegment) const; [4 lines of code]
float Capsule::Distance(const Capsule &capsule) const; [4 lines of code]

Computes the distance between this capsule and the given object.

This function finds the nearest pair of points on this and the given object, and computes their distance. If the two objects intersect, or one object is contained inside the other, the returned distance is zero.

See Also

Contains(), Intersects(), ClosestPoint().

Work in progress:

Todo: in float Capsule::Distance(const float4 &point) const:
Add Distance(Triangle/Polygon/Circle/Disc/Capsule).