7#include "core/math/bounds.h"
10namespace Vkm::Engine {
25 glm::vec3
point = {0.0f, 0.0f, 0.0f};
26 glm::vec3
normal = {0.0f, 1.0f, 0.0f};
65 const glm::vec3& origin,
66 const glm::vec3& direction,
89 const glm::vec3& origin,
91 const glm::vec3& direction,
94 const QueryFilter& filter = {}
107 QueryParts() =
default;
108 ~QueryParts() =
default;
110 QueryParts(
const QueryParts& other) =
default;
111 QueryParts& operator=(
const QueryParts& other) =
default;
113 QueryParts(QueryParts && other)
noexcept =
default;
114 QueryParts& operator=(QueryParts && other)
noexcept =
default;
135 const glm::vec3& origin,
136 const glm::vec3& direction,
141 bool empty()
const {
return m_parts.empty(); }
148 glm::vec3 center{0.0f};
149 glm::mat3 basis{1.0f};
151 glm::vec3 half{0.0f};
155 std::vector<Placed> m_parts;
void gather(Scene &scene, const QueryFilter &filter, const Math::AABB &around)
Place every part filter lets through whose world bound meets around.
bool raycast(const glm::vec3 &origin, const glm::vec3 &direction, float maxDistance, RayHit &out) const
Cast a ray against the gathered parts, as raycast casts it against the scene.
Central registry managing entities and an open set of component types.
Definition scene.h:29
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
Names one entity of one Scene, for as long as that slot holds it.
Definition entity.h:23
An axis-aligned box.
Definition bounds.h:17
Which bodies a query is allowed to see.
Definition query.h:35
int layerMask
Which layers may be hit, as a mask of the bits collision uses; everything by default.
Definition query.h:44
EntityId ignore
Never hit, nor its Ragdoll's bones; the caster, usually.
Definition query.h:36
bool hitTriggers
Include colliders marked isTrigger.
Definition query.h:37
bool hitStatic
Include Static and Kinematic bodies, by their authored motion.
Definition query.h:38
bool hitDynamic
Include Dynamic bodies, a ragdoll's posed bones among them.
Definition query.h:39
What a query struck: which entity, where, and the surface it hit.
Definition query.h:22
EntityId entity
The body that was struck.
Definition query.h:23
glm::vec3 normal
Outward surface normal.
Definition query.h:26
glm::vec3 point
World-space contact point.
Definition query.h:25
float distance
Along the ray, in metres.
Definition query.h:24