HPC_Voxel_Engine 0.2.0
High-Performance C++ Voxel Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Core::Ray Struct Reference

Represents a ray in 3D space defined by an origin and a direction. Used for raycasting and picking. More...

#include <src/core/Ray.h>

Collaboration diagram for Core::Ray:
Collaboration graph

Public Member Functions

 Ray (const Vec3 &orig, const Vec3 &dir)
 Constructs a ray.
 
Vec3 at (float t) const noexcept
 Calculates a point along the ray at distance t.
 

Public Attributes

Vec3 m_objPtOrigin
 
Vec3 m_objDirection
 

Detailed Description

Represents a ray in 3D space defined by an origin and a direction. Used for raycasting and picking.

Constructor & Destructor Documentation

◆ Ray()

Core::Ray::Ray ( const Vec3 orig,
const Vec3 dir 
)
inline

Constructs a ray.

Parameters
origThe starting point of the ray.
dirThe direction vector (automatically normalized).

Member Function Documentation

◆ at()

Vec3 Core::Ray::at ( float  t) const
inlinenoexcept

Calculates a point along the ray at distance t.

Parameters
tDistance from origin.
Returns
Point = Origin + (Direction * t)
Here is the caller graph for this function:

Member Data Documentation

◆ m_objDirection

Vec3 Core::Ray::m_objDirection

◆ m_objPtOrigin

Vec3 Core::Ray::m_objPtOrigin

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