Class CapsuleGeometry#

Inheritance Relationships#

Base Type#

Class Documentation#

class CapsuleGeometry : public Karana::Scene::AbstractStaticGeometry#

Geometry class for a cylinder capped with hemispheres.

See Scene layer for more discussion on the scene layer.

Public Functions

CapsuleGeometry(float radius, float height)#

Constructor from a radius and height. The constructor is not meant to be called directly. Please use the corresponding create(…) method instead to create an instance.

Parameters:
  • radius – radius of the capsule

  • height – height of the capsule’s middle section

CapsuleGeometry(const CapsuleGeometry&)#

Copy constructor.

CapsuleGeometry &operator=(const CapsuleGeometry&) = delete#
CapsuleGeometry(CapsuleGeometry&&) = delete#
CapsuleGeometry &operator=(CapsuleGeometry&&) = delete#
virtual Karana::Core::ks_ptr<StaticMeshGeometry> computeMesh() const override#

Convert to a triangular mesh.

Returns:

The converted mesh

virtual Karana::Math::AABB aabb() const override#

Compute the axis-aligned bounding box (AABB).

Returns:

The AABB

Public Members

const float radius#

radius of the capsule

const float height#

height of the capsule’s middle section

Public Static Functions

static Karana::Core::ks_ptr<CapsuleGeometry> create(float radius, float height)#

Create a new instance of CapsuleGeometry from radius and height.

Parameters:
  • radius – radius of the capsule

  • height – height of the capsule’s middle section

Returns:

A pointer to the newly created instance of BoxGeometry.