Avara3D 0.2.0
C++ API reference
CapsulePhysicsShape.h
1//
2// CapsulePhysicsShape.h
3// avara3d
4//
5// Created by Morgan Davis on 11/19/23.
6// Copyright © 2026 Morgan K Davis. All rights reserved.
7//
8
9#ifndef AVARA3D_PHYSICS_SHAPE_PRIMITIVE_CAPSULEPHYSICSSHAPE_H
10#define AVARA3D_PHYSICS_SHAPE_PRIMITIVE_CAPSULEPHYSICSSHAPE_H
11
12#include "a3d/physics/shape/PhysicsShape.h"
13
14namespace a3d {
15
23
24 public:
25 // [Public Lifecycle Functions]
26
29
30 // [Public Member Functions]
31
33 float radius() const;
34
36 float height() const;
37
38 // [Public PhysicsShape Member Functions]
39
41 Type type() const override;
42
48 void type(Type type) override;
49
50 private:
51 // [Private Member Variables]
52
53 float _radius;
54 float _height;
55 };
56
57}
58
59#endif // AVARA3D_PHYSICS_SHAPE_PRIMITIVE_CAPSULEPHYSICSSHAPE_H
Capsule collision shape centered at the local origin and aligned along Y.
void type(Type type) override
Rejects attempts to change the fixed primitive shape type.
Type type() const override
Returns PhysicsShape::Type::Primitive.
float radius() const
Returns the configured capsule radius.
float height() const
Returns the configured distance between the centers of the hemispherical caps.
CapsulePhysicsShape(float radius, float height)
Creates a capsule collision shape with the supplied radius and cylindrical-section height.
Describes collision geometry used by one or more PhysicsBody objects.
Definition: PhysicsShape.h:37
Type
Collision-geometry representation requested for a PhysicsShape.
Definition: PhysicsShape.h:43