|
group2 0.1.0
CSE 125 Group 2
|
Collision shape attached to an entity. More...
#include <CollisionShape.hpp>
Public Member Functions | |
| float | minkowskiExtent (const glm::vec3 &n) const noexcept |
| Minkowski extent of the shape along a unit direction n. | |
Public Attributes | |
| CollisionShapeType | type = CollisionShapeType::AABB |
| Which kind of shape this is — selects the runtime collision path. | |
| glm::vec3 | halfExtents {16.0f, 36.0f, 16.0f} |
| AABB half-dimensions. | |
| float | radius = 16.0f |
| Capsule cylinder radius. Unused when type == AABB. | |
| float | halfHeight = 20.0f |
| Capsule cylinder half-height (excludes spherical caps). | |
Collision shape attached to an entity.
The shape is positioned at the entity's Position component. For an AABB the full extent spans [pos - halfExtents, pos + halfExtents]. For a capsule, the segment endpoints are pos ± (0, halfHeight, 0) and the radius r wraps around the segment.
Default is a standing-player AABB in Quake-ish units:
|
inlinenodiscardnoexcept |
Minkowski extent of the shape along a unit direction n.
Used by every Minkowski-sum-based collision query (plane sweep, box slab, triangle plane). Returns the half-width of the shape's projection on n.
| glm::vec3 CollisionShape::halfExtents {16.0f, 36.0f, 16.0f} |
| float CollisionShape::halfHeight = 20.0f |
Capsule cylinder half-height (excludes spherical caps).
Total visual height = 2 * (halfHeight + radius). Unused when type == AABB.
| float CollisionShape::radius = 16.0f |
Capsule cylinder radius. Unused when type == AABB.
| CollisionShapeType CollisionShape::type = CollisionShapeType::AABB |
Which kind of shape this is — selects the runtime collision path.