Drake C++ Documentation
Capsule Class Referencefinal

Detailed Description

Definition of a capsule.

The capsule can be thought of as a cylinder with spherical caps attached. The capsule's length refers to the length of the cylindrical region, and the radius applies to both the cylinder and spherical caps. A capsule with zero length is a sphere of the given radius. And a capsule with zero radius is a line segment with the given length. The capsule is defined in its canonical frame C, centered on the frame origin and with the length of the capsule parallel with the frame's z-axis.

#include <drake/geometry/shape_specification.h>

Public Member Functions

 Capsule (double radius, double length)
 Constructs a capsule with the given radius and length. More...
double radius () const
double length () const
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 Capsule (const Capsule &)=default
Capsuleoperator= (const Capsule &)=default
 Capsule (Capsule &&)=default
Capsuleoperator= (Capsule &&)=default
- Public Member Functions inherited from Shape
virtual ~Shape ()
void Reify (ShapeReifier *reifier, void *user_data=nullptr) const
 Causes this description to be reified in the given reifier. More...
std::unique_ptr< ShapeClone () const
 Creates a unique copy of this shape. More...

Additional Inherited Members

- Protected Member Functions inherited from Shape
template<typename S >
 Shape (ShapeTag< S > tag)
 Constructor available for derived class construction. More...
 Shape (const Shape &)=default
Shapeoperator= (const Shape &)=default
 Shape (Shape &&)=default
Shapeoperator= (Shape &&)=default

Constructor & Destructor Documentation

◆ Capsule() [1/3]

Capsule ( const Capsule )

◆ Capsule() [2/3]

Capsule ( Capsule &&  )

◆ Capsule() [3/3]

Capsule ( double  radius,
double  length 

Constructs a capsule with the given radius and length.

std::exceptionif radius or length are not strictly positive.

Member Function Documentation

◆ length()

double length ( ) const

◆ operator=() [1/2]

Capsule& operator= ( Capsule &&  )

◆ operator=() [2/2]

Capsule& operator= ( const Capsule )

◆ radius()

double radius ( ) const

The documentation for this class was generated from the following file: