Avara3D 0.2.0
C++ API reference
SpherePhysicsShape.h
1//
2// SpherePhysicsShape.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_SPHEREPHYSICSSHAPE_H
10#define AVARA3D_PHYSICS_SHAPE_PRIMITIVE_SPHEREPHYSICSSHAPE_H
11
12#include "a3d/physics/shape/PhysicsShape.h"
13
14namespace a3d {
15
18
19 public:
20 // [Public Lifecycle Functions]
21
23 explicit SpherePhysicsShape(float radius);
24
25 // [Public Member Functions]
26
28 float radius() const;
29
30 // [Public PhysicsShape Member Functions]
31
33 Type type() const override;
34
40 void type(Type type) override;
41
42 private:
43 // [Private Member Variables]
44
45 float _radius;
46 };
47
48}
49
50#endif // AVARA3D_PHYSICS_SHAPE_PRIMITIVE_SPHEREPHYSICSSHAPE_H
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
Spherical collision shape centered at the local origin.
void type(Type type) override
Rejects attempts to change the fixed primitive shape type.
SpherePhysicsShape(float radius)
Creates a spherical collision shape with radius.
float radius() const
Returns the configured sphere radius.
Type type() const override
Returns PhysicsShape::Type::Primitive.