9 #include "imstkAnalyticalGeometry.h" 10 #include "imstkMacros.h" 24 Capsule(
const Vec3d& pos = Vec3d(0.0, 0.0, 0.0),
const double radius = 0.5,
25 const double length = 1.0,
const Quatd orientation = Quatd::Identity()) :
40 void print()
const override;
53 void setRadius(
const double r);
60 void setLength(
const double l);
82 std::unique_ptr<Capsule>
clone()
84 return std::unique_ptr<Capsule>(cloneImplementation());
96 Capsule* cloneImplementation()
const void print() const override
Print the capsule info.
double getLength(DataType type=DataType::PostTransform)
Get/Set the length of the capsule.
Base class for any analytical geometrical representation.
double getFunctionValue(const Vec3d &x) const override
Returns the signed distance to the capsule.
void applyTransform(const Mat4d &m) override
Apply a user transform directly to (pre-transformed) parameters producing new parameters.
double m_radius
Radius of the hemispheres at the end of the capsule.
std::unique_ptr< Capsule > clone()
Polymorphic clone, hides the declaration in superclass return own type.
double m_length
Length between the centers of two hemispheres.
void setPosition(const Vec3d p)
Set the local position.
void setOrientation(const Quatd r)
Set the local orientation.
double getVolume() override
Returns the volume of the capsule.
void computeBoundingBox(Vec3d &min, Vec3d &max, const double paddingPercent)
Get the min, max of the AABB around the capsule.
double getRadius(DataType type=DataType::PostTransform)
Get/Set the radius of the capsule.
double m_radiusPostTransform
Radius after transform.
void updatePostTransformData() const override
Update the Capsule parameters applying the latest transform.
Capsule geometry, default configuration is centered at origin with length running up and down the y a...
DataType
Enumeration for the data to retrieve PreTransform for data where transform matrix is not applied Po...
double m_lengthPostTransform
Length after transform.