Back to class index

Class Capsule

Summary

A 3D cylinder with spherical ends.

Member Reference

CapsuleA 3D cylinder with spherical ends.
lSpecifies the two inner points of this capsule.
rSpecifies the radius of this capsule.
ctor (+2 overloads)The default constructor does not initialize any members of this class.
SetFrom(s)Constructs a new capsule from a sphere.
SetDegenerate()Sets this Capsule to a degenerate negative-volume state.
IsDegenerate()[const]Tests if this Capsule is degenerate.
LineLength()[const]Computes the distance of the two inner points of this capsule.
Height()[const]Computes the total height of this capsule, i.e. LineLength() + Diameter().
Diameter()[const]Computes the diameter of this capsule.
Bottom()[const]Returns the bottom-most point of this Capsule.
Center()[const]Returns the center point of this Capsule.
Centroid()[const]
AnyPointFast()[const]Quickly returns an arbitrary point inside this Capsule. Used in GJK intersection test.
ExtremePoint(direction)[const] (+1 overload)Computes the extreme point of this Capsule in the given direction.
ProjectToAxis(...)[const]Projects this Capsule onto the given 1D axis direction vector.
Top()[const]Returns the topmost point of this Capsule.
UpDirection()[const]Returns the direction from the bottommost point towards the topmost point of this Capsule.
Volume()[const]Computes the volume of this Capsule.
SurfaceArea()[const]Computes the surface area of this Capsule.
CrossSection(l)[const]Returns the cross-section circle at the given height of this Capsule.
HeightLineSegment()[const]Returns a line segment that spans the far axis of this capsule from bottom to tip.
IsFinite()[const]Tests if this Capsule is finite.
PointInside(l,a,d)[const]Generates a point inside this capsule.
UniformPointPerhapsInside(l,x,y)[const]Generates a point that perhaps lies inside this capsule.
SphereA()[const]Returns the Sphere defining the 'bottom' section of this Capsule (corresponding to the endpoint l.a)
SphereB()[const]Returns the Sphere defining the 'top' section of this Capsule (corresponding to the endpoint l.b)
MinimalEnclosingAABB()[const]Returns the smallest AABB that encloses this capsule.
MinimalEnclosingOBB()[const]Returns the smallest OBB that encloses this capsule.
RandomPointInside(rng)[const]Generates a random point inside this capsule.
RandomPointOnSurface(rng)[const]Generates a random point on the surface of this Capsule.
Translate(offset)Moves this capsule by the given offset vector.
Scale(...)Applies a uniform scale to this Capsule.
Transform(transform) (+3 overloads)Applies a transformation to this capsule.
ClosestPoint(targetPoint)[const]Computes the closest point inside this capsule to the given point.
Distance(point)[const] (+6 overloads)Computes the distance between this capsule and the given object.
Contains(point)[const] (+7 overloads)Tests if the given object is fully contained inside this capsule.
Intersects(ray)[const] (+11 overloads)Tests whether this capsule and the given object intersect.
ToString()[const]Returns a human-readable representation of this Capsule. Most useful for debugging purposes.
SerializeToString()[const]
SerializeToCodeString()[const]Returns a string of C++ code that can be used to construct this object. Useful for generating test cases from badly behaving objects.
Equals(rhs,epsilon)[const]
BitEquals(other)[const]Compares whether this Capsule and the given Capsule are identical bit-by-bit in the underlying representation.
FromString(str,outEndStr)[static] (+1 overload)
Back to class index