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

Syntax

bool Capsule::Contains(const float4 &point) const; [4 lines of code]
bool Capsule::Contains(const LineSegment &lineSegment) const; [4 lines of code]
bool Capsule::Contains(const Triangle &triangle) const; [4 lines of code]
bool Capsule::Contains(const Polygon &polygon) const; [7 lines of code]
bool Capsule::Contains(const AABB &aabb) const; [8 lines of code]
bool Capsule::Contains(const OBB &obb) const; [8 lines of code]
bool Capsule::Contains(const Frustum &frustum) const; [8 lines of code]
bool Capsule::Contains(const Polyhedron &polyhedron) const; [9 lines of code]

Tests if the given object is fully contained inside this capsule.

This function returns true if the given object lies inside this capsule, and false otherwise.

Note
The comparison is performed using less-or-equal, so the surface of this capsule count as being inside, but due to float inaccuracies, this cannot generally be relied upon.

See Also

Distance(), Intersects(), ClosestPoint().

Work in progress:

Todo: in bool Capsule::Contains(const float4 &point) const:
Add Contains(Circle/Disc/Sphere/Capsule).