Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Ult::Ray Class Reference

#include <Ray.h>

Public Member Functions

 Ray ()
 
 Ray (const Vector3D &origin, const Vector3D &dir)
 
bool Intersect (const Vector3D &pos, const float radius, float *dist) const
 
bool Intersect (const Vector3D &p1, const Vector3D &p2, const Vector3D &p3, const bool cull, float *dist) const
 
bool Intersect (const Vector3D &bbMin, const Vector3D &bbMax, Vector3D *intersectPoint) const
 

Public Attributes

Vector3D mOrigin
 
Vector3D mDirection
 

Detailed Description

3d ray with position and direction.

Constructor & Destructor Documentation

◆ Ray() [1/2]

Ult::Ray::Ray ( )

Ray constructor.

◆ Ray() [2/2]

Ult::Ray::Ray ( const Vector3D & origin,
const Vector3D & dir )

Ray constructor with input origin and direction.

Member Function Documentation

◆ Intersect() [1/3]

bool Ult::Ray::Intersect ( const Vector3D & bbMin,
const Vector3D & bbMax,
Vector3D * intersectPoint ) const

Returns true if the input bounding box (bbMin,bbMax) intersects with this ray and optionally stores the intersection point if given.

◆ Intersect() [2/3]

bool Ult::Ray::Intersect ( const Vector3D & p1,
const Vector3D & p2,
const Vector3D & p3,
const bool cull,
float * dist ) const

Returns true if the input triangle (p1,p2,p3) intersects with this ray and stores the distance in 'dist' if given. Can optionally ignore intersection/return false if 'cull' is true and the triangle is back-facing.

◆ Intersect() [3/3]

bool Ult::Ray::Intersect ( const Vector3D & pos,
const float radius,
float * dist ) const

Returns true if the input sphere (pos and radius) intersects with this ray and stores the distance in 'dist' if given.

Member Data Documentation

◆ mDirection

Vector3D Ult::Ray::mDirection

The ray's forward direction.

◆ mOrigin

Vector3D Ult::Ray::mOrigin

The ray's starting position.


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