Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
BlamRay Struct Reference

#include <types.h>

Public Member Functions

bool TestRayOBB (BlamOBB *obb, BlamRaycastHit *hit_result)
 Tests a ray against an oriented bounding box and returns a hit result. More...
 
std::vector< BlamRaycastHitCast (bool sort_by_distance, uint16_t max_results, uint32_t query_flags)
 Casts a ray against all registered world objects and returns a list of hits. More...
 
BlamVector3 GetPointAtDistance (float distance)
 Returns the world-space point along the ray at the given distance from the origin. More...
 

Public Attributes

BlamVector3 origin
 
BlamVector3 direction
 

Member Function Documentation

◆ Cast()

std::vector< BlamRaycastHit > BlamRay::Cast ( bool  sort_by_distance,
uint16_t  max_results,
uint32_t  query_flags 
)

Casts a ray against all registered world objects and returns a list of hits.

Tests the ray against each world object's bounding volume. Results can optionally be sorted by distance from the ray origin. Objects are filtered by query flags.

This function is equivalent to Ogre's RaySceneQuery and is intended to be called from the render thread. For off-thread usage, queue a pending raycast and process it on the render thread, following the same pattern as the previous Ogre implementation.

Parameters
rayPointer to the world-space ray to cast.
sort_by_distanceWhether to sort results nearest-first.
max_resultsMaximum number of results to return.
query_flagsBitmask to filter which objects are considered.
Returns
A list of BlamRaycastHit entries for each object the ray intersected.
Author
Claude (claude-sonnet-4-6)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPointAtDistance()

BlamVector3 BlamRay::GetPointAtDistance ( float  distance)

Returns the world-space point along the ray at the given distance from the origin.

Parameters
distanceDistance from the ray origin along the ray direction.
Returns
The world-space position at that distance.
Author
Claude (claude-sonnet-4-6)
+ Here is the caller graph for this function:

◆ TestRayOBB()

bool BlamRay::TestRayOBB ( BlamOBB obb,
BlamRaycastHit hit_result 
)

Tests a ray against an oriented bounding box and returns a hit result.

Transforms the ray into the OBB's local coordinate space and performs a standard slab-method AABB intersection test. Returns a hit result with distance and world-space hit point if the ray intersects the box.

Parameters
rayPointer to the ray to test.
obbPointer to the oriented bounding box to test against.
hit_resultPointer to the result struct to populate if a hit occurs.
Returns
True if the ray intersects the OBB, false otherwise.
Author
Claude (claude-sonnet-4-6)
+ Here is the caller graph for this function:

Member Data Documentation

◆ direction

BlamVector3 BlamRay::direction

◆ origin

BlamVector3 BlamRay::origin

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