Class ShapeBase

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class ShapeBase : public coal::CollisionGeometry

Base class for all basic geometric shapes.

Subclassed by coal::Box, coal::Capsule, coal::Cone, coal::ConvexBase, coal::Cylinder, coal::Ellipsoid, coal::Halfspace, coal::Plane, coal::Sphere, coal::TriangleP, coal::details::LargeConvex, coal::details::SmallConvex

Public Functions

inline ShapeBase()
inline ShapeBase(const ShapeBase &other)

Copy constructor

ShapeBase &operator=(const ShapeBase &other) = default
inline virtual ~ShapeBase()
inline virtual OBJECT_TYPE getObjectType() const

Get object type: a geometric shape.

inline void setSweptSphereRadius(CoalScalar radius)

Set radius of sphere swept around the shape. Must be >= 0.

inline CoalScalar getSweptSphereRadius() const

Get radius of sphere swept around the shape. This radius is always >= 0.

Protected Attributes

CoalScalar m_swept_sphere_radius = {0}

Radius of the sphere swept around the shape. Default value is 0. Note: this property differs from inflated method of certain derived classes (e.g. Box, Sphere, Ellipsoid, Capsule, Cone, Cylinder) in the sense that inflated returns a new shape which can be inflated but also deflated. Also, an inflated shape is not rounded. It simply has a different size. Sweeping a shape with a sphere is a different operation (a Minkowski sum), which rounds the sharp corners of a shape. The swept sphere radius is a property of the shape itself and can be manually updated between collision checks.