3#include "core/math/bounds.h"
4#include "ecs/component/physics/collider.h"
17 case ColliderShape::Box:
18 return {-part.halfExtents, part.halfExtents};
20 case ColliderShape::Capsule: {
21 const glm::vec3
reach(part.radius, part.halfHeight + part.radius, part.radius);
25 case ColliderShape::Mesh:
26 case ColliderShape::Terrain:
27 if (collider.meshNodes.empty())
return {glm::vec3(0.0f), glm::vec3(0.0f)};
28 return {collider.meshNodes[0].min, collider.meshNodes[0].max};
30 case ColliderShape::Count:
33 return {-part.halfExtents, part.halfExtents};
Region reach(const TerrainAsset &terrain, const Dab &dab)
The grid vertices within dab, clamped to terrain's grid.
One primitive of a collider, in the entity's local frame.
Definition collider.h:44
Collision geometry attached to an entity, evaluated in its Transform frame.
Definition collider.h:84
An axis-aligned box.
Definition bounds.h:17