Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
Raycast.h
Go to the documentation of this file.
1/**
2 * @file Raycast.h
3 * @ingroup mnd_physics
4 * @brief Result struct for PhysicsManager::Raycast.
5 */
6
7#pragma once
8
9#include "Types.h"
10
11namespace mnd
12{
13class GameObject;
14
15/**
16 * @ingroup mnd_physics
17 * @brief Hit information returned by PhysicsManager::Raycast.
18 *
19 * `object` may be null even when the ray hits — only collision objects whose
20 * owning component called CollisionObject::SetOwner expose a back-pointer.
21 */
22struct RayHit
23{
24 vec3 point{0.0F}; ///< World-space hit point.
25 vec3 normal{0.0F}; ///< Surface normal at the hit.
26 GameObject *object = nullptr;
27 float fraction = 1.0F; ///< Fraction along the ray segment in [0, 1].
28};
29} // namespace mnd
Engine-wide primitive type aliases and GLM math imports.
Node in the scene graph: a named transform that owns components and children.
Definition GameObject.h:91
glm::vec3 vec3
3-component float vector (e.g. world position, RGB colour, normals).
Definition Types.h:51
Hit information returned by PhysicsManager::Raycast.
Definition Raycast.h:23
vec3 point
World-space hit point.
Definition Raycast.h:24
vec3 normal
Surface normal at the hit.
Definition Raycast.h:25
float fraction
Fraction along the ray segment in [0, 1].
Definition Raycast.h:27