dart
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
dart::dynamics::CapsuleShape Class Reference

CapsuleShape represents a three-dimensional geometric shape consisting of a cylinder with hemispherical ends. More...

#include <CapsuleShape.hpp>

Inheritance diagram for dart::dynamics::CapsuleShape:
Inheritance graph
[legend]
Collaboration diagram for dart::dynamics::CapsuleShape:
Collaboration graph
[legend]

Public Member Functions

 CapsuleShape (double radius, double height)
 Constructor. More...
 
const std::string & getType () const override
 Returns a string representing the shape type. More...
 
double getRadius () const
 Get the radius of the capsule.
 
void setRadius (double radius)
 Set the radius of the capsule.
 
double getHeight () const
 Get the height of the cylindrical part.
 
void setHeight (double height)
 Set the height of the cylindrical part.
 
Eigen::Matrix3d computeInertia (double mass) const override
 Computes the inertia.
 
- Public Member Functions inherited from dart::dynamics::Shape
 Shape (ShapeType _type)
 Constructor. More...
 
 Shape ()
 Constructor.
 
virtual ~Shape ()
 Destructor.
 
template<typename ShapeT >
bool is () const
 Get true if the types of this Shape and the template parameter (a shape class) are identical. More...
 
const math::BoundingBoxgetBoundingBox () const
 Get the bounding box of the shape in its local coordinate frame. More...
 
Eigen::Matrix3d computeInertiaFromDensity (double density) const
 
Eigen::Matrix3d computeInertiaFromMass (double mass) const
 
double getVolume () const
 Returns volume of this shape. More...
 
std::size_t getID () const
 
ShapeType getShapeType () const
 
void setDataVariance (unsigned int _variance)
 Set the data variance of this shape. More...
 
void addDataVariance (unsigned int _variance)
 Add a type of variance to this shape. More...
 
void removeDataVariance (unsigned int _variance)
 Remove a type of variance from this shape. More...
 
unsigned int getDataVariance () const
 Get the data variance of this shape.
 
bool checkDataVariance (DataVariance type) const
 True iff this Shape has the specified type of DataVariance.
 
virtual void refreshData ()
 Instruct this shape to update its data.
 
virtual void notifyAlphaUpdate (double alpha)
 Notify that the alpha of this shape has updated.
 
virtual void notifyAlphaUpdated (double alpha)
 Notify that the alpha of this shape has updated.
 
virtual void notifyColorUpdate (const Eigen::Vector4d &color)
 Notify that the color (rgba) of this shape has updated.
 
virtual void notifyColorUpdated (const Eigen::Vector4d &color)
 Notify that the color (rgba) of this shape has updated.
 
std::size_t incrementVersion () override final
 Increment the version of this Shape and notify its subscribers.
 
- Public Member Functions inherited from dart::common::Subject
virtual ~Subject ()
 Destructor will notify all Observers that it is destructing.
 
- Public Member Functions inherited from dart::common::VersionCounter
 VersionCounter ()
 Default constructor.
 
virtual std::size_t getVersion () const
 Get the version number of this object.
 

Static Public Member Functions

static const std::string & getStaticType ()
 Get shape type string for this shape.
 
static double computeVolume (double radius, double height)
 Compute volume from given properties. More...
 
static Eigen::Matrix3d computeInertia (double radius, double height, double mass)
 Compute moments of inertia of a capsule. More...
 

Protected Member Functions

void updateBoundingBox () const override
 Updates bounding box.
 
void updateVolume () const override
 Updates volume.
 
- Protected Member Functions inherited from dart::common::Subject
void sendDestructionNotification () const
 Send a destruction notification to all Observers. More...
 
void addObserver (Observer *_observer) const
 Add an Observer to the list of Observers.
 
void removeObserver (Observer *_observer) const
 Remove an Observer from the list of Observers.
 
- Protected Member Functions inherited from dart::common::VersionCounter
void setVersionDependentObject (VersionCounter *dependent)
 

Additional Inherited Members

- Public Types inherited from dart::dynamics::Shape
enum  ShapeType {
  SPHERE, BOX, ELLIPSOID, CYLINDER,
  CAPSULE, CONE, PYRAMID, RECTANGULAR_PYRAMID,
  PLANE, MULTISPHERE, MESH, SOFT_MESH,
  LINE_SEGMENT, HEIGHTMAP, UNSUPPORTED
}
 
enum  DataVariance {
  STATIC = 0, DYNAMIC_TRANSFORM = 1 << 1, DYNAMIC_PRIMITIVE = 1 << 2, DYNAMIC_COLOR = 1 << 3,
  DYNAMIC_VERTICES = 1 << 4, DYNAMIC_ELEMENTS = 1 << 5, DYNAMIC = 0xFF
}
 DataVariance can be used by renderers to determine whether it should expect data for this shape to change during each update. More...
 
using VersionChangedSignal = common::Signal< void(Shape *shape, std::size_t version)>
 
- Public Attributes inherited from dart::dynamics::Shape
common::SlotRegister< VersionChangedSignalonVersionChanged
 Use this to subscribe to version change signals.
 
- Protected Attributes inherited from dart::dynamics::Shape
math::BoundingBox mBoundingBox
 The bounding box (in the local coordinate frame) of the shape.
 
bool mIsBoundingBoxDirty
 Whether bounding box needs update.
 
double mVolume
 Volume enclosed by the geometry.
 
bool mIsVolumeDirty
 Whether volume needs update.
 
const std::size_t mID
 Unique id.
 
unsigned int mVariance
 The DataVariance of this Shape.
 
ShapeType mType
 
- Protected Attributes inherited from dart::common::Subject
std::set< Observer * > mObservers
 List of current Observers.
 
- Protected Attributes inherited from dart::common::VersionCounter
std::size_t mVersion
 
- Static Protected Attributes inherited from dart::dynamics::Shape
static std::atomic_int mCounter {PRIMITIVE_MAGIC_NUMBER}
 

Detailed Description

CapsuleShape represents a three-dimensional geometric shape consisting of a cylinder with hemispherical ends.

Constructor & Destructor Documentation

◆ CapsuleShape()

dart::dynamics::CapsuleShape::CapsuleShape ( double  radius,
double  height 
)

Constructor.

Parameters
[in]radiusRadius of the capsule.
[in]heightHeight of the cylindrical part.

Member Function Documentation

◆ computeInertia()

Eigen::Matrix3d dart::dynamics::CapsuleShape::computeInertia ( double  radius,
double  height,
double  mass 
)
static

Compute moments of inertia of a capsule.

Parameters
[in]radiusRadius of the capsule.
[in]heightHeight of the cylindrical part.
[in]massMass of the capsule.

◆ computeVolume()

double dart::dynamics::CapsuleShape::computeVolume ( double  radius,
double  height 
)
static

Compute volume from given properties.

Parameters
[in]radiusRadius of the capsule.
[in]heightHeight of the cylindrical part.

◆ getType()

const std::string & dart::dynamics::CapsuleShape::getType ( ) const
overridevirtual

Returns a string representing the shape type.

See also
is()

Implements dart::dynamics::Shape.


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