vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::RayHit Struct Reference

What a query struck: which entity, where, and the surface it hit. More...

#include <query.h>

Public Attributes

EntityId entity = {}
 The body that was struck.
float distance = 0.0f
 Along the ray, in metres.
glm::vec3 point = {0.0f, 0.0f, 0.0f}
 World-space contact point.
glm::vec3 normal = {0.0f, 1.0f, 0.0f}
 Outward surface normal.

Detailed Description

What a query struck: which entity, where, and the surface it hit.

normal points out of the surface, back along the ray. A ray starting inside a body hits it at distance zero; where the shape gives no outward direction (inside a box) the normal points at the caster.


The documentation for this struct was generated from the following file: