Avara3D 0.2.0
C++ API reference
a3d::CapsulePhysicsShape Class Reference

Capsule collision shape centered at the local origin and aligned along Y. More...

#include <a3d/physics/shape/primitive/CapsulePhysicsShape.h>

Inheritance diagram for a3d::CapsulePhysicsShape:
[legend]

Public Member Functions

 CapsulePhysicsShape (float radius, float height)
 Creates a capsule collision shape with the supplied radius and cylindrical-section height. More...
 
float radius () const
 Returns the configured capsule radius. More...
 
float height () const
 Returns the configured distance between the centers of the hemispherical caps. More...
 
Type type () const override
 Returns PhysicsShape::Type::Primitive. More...
 
void type (Type type) override
 Rejects attempts to change the fixed primitive shape type. More...
 
- Public Member Functions inherited from a3d::PhysicsShape
 PhysicsShape (Type type, const std::shared_ptr< Mesh > &mesh)
 Creates a PhysicsShape of type derived from mesh. More...
 
 PhysicsShape (Type type, const std::shared_ptr< Node > &node)
 Creates a PhysicsShape of type from mesh geometry in the node hierarchy. More...
 
virtual Type type () const
 Returns the collision-geometry type. More...
 
virtual void type (Type type)
 Validates the requested collision-geometry type. More...
 
Source source () const
 Returns the weak Mesh or Node source, or std::monostate for a source-less primitive shape. More...
 

Additional Inherited Members

- Public Types inherited from a3d::PhysicsShape
enum class  Type : uint8_t { Primitive , BoundingBox , ConvexHull , ConcavePolyhedron }
 Collision-geometry representation requested for a PhysicsShape. More...
 
using Source = std::variant< std::monostate, std::weak_ptr< Mesh >, std::weak_ptr< Node > >
 Weak source object used to derive collision geometry, or no source for primitive shapes. More...
 
- Static Public Member Functions inherited from a3d::PhysicsShape
static std::shared_ptr< PhysicsShapeBoundingBoxShape (const std::shared_ptr< Mesh > &mesh)
 Creates a bounding-box collision shape derived from mesh. More...
 
static std::shared_ptr< PhysicsShapeBoundingBoxShape (const std::shared_ptr< Node > &node)
 Creates a bounding-box collision shape from mesh geometry in the node hierarchy. More...
 
static std::shared_ptr< PhysicsShapeConvexHullShape (const std::shared_ptr< Mesh > &mesh)
 Creates a convex-hull collision shape derived from mesh. More...
 
static std::shared_ptr< PhysicsShapeConvexHullShape (const std::shared_ptr< Node > &node)
 Creates a convex-hull collision shape from mesh geometry in the node hierarchy. More...
 
static std::shared_ptr< PhysicsShapeConcavePolyhedronShape (const std::shared_ptr< Mesh > &mesh)
 Creates a concave-polyhedron collision shape derived from mesh. More...
 
static std::shared_ptr< PhysicsShapeConcavePolyhedronShape (const std::shared_ptr< Node > &node)
 Creates a concave-polyhedron collision shape from mesh geometry in the node hierarchy. More...
 

Detailed Description

Capsule collision shape centered at the local origin and aligned along Y.

Height is the distance between the centers of the hemispherical caps, so the total tip-to-tip extent along Y is height + 2 * radius.

Definition at line 22 of file CapsulePhysicsShape.h.

Constructor & Destructor Documentation

◆ CapsulePhysicsShape()

a3d::CapsulePhysicsShape::CapsulePhysicsShape ( float  radius,
float  height 
)

Creates a capsule collision shape with the supplied radius and cylindrical-section height.

Member Function Documentation

◆ height()

float a3d::CapsulePhysicsShape::height ( ) const

Returns the configured distance between the centers of the hemispherical caps.

◆ radius()

float a3d::CapsulePhysicsShape::radius ( ) const

Returns the configured capsule radius.

◆ type() [1/2]

Type a3d::CapsulePhysicsShape::type ( ) const
overridevirtual

Returns PhysicsShape::Type::Primitive.

Reimplemented from a3d::PhysicsShape.

◆ type() [2/2]

void a3d::CapsulePhysicsShape::type ( Type  type)
overridevirtual

Rejects attempts to change the fixed primitive shape type.

Exceptions
std::logic_erroralways; CapsulePhysicsShape has a fixed type.

Reimplemented from a3d::PhysicsShape.


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