3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Math.Ray Struct Reference

Represents an ray in 3D space, defined by an origin and direction vector. More...

#include <Ray.hpp>

Collaboration diagram for Engine3DRadSpace.Math.Ray:

Public Member Functions

 Ray (Vector3 origin, Vector3 direction)
float Intersects (const BoundingSphere &sph) const
 Checks if this ray intersects with the given bounding sphere.
float Intersects (const Triangle &tri) const
 Checks if this ray intersects the given triangle using the Möller–Trumbore intersection algorithm.
float Intersects (const BoundingBox &box) const
 Checks if this ray intersects with the given bounding box.
float Intersects (const BoundingPlane &plane) const
 Checks if this ray intersects with the given bounding plane.

Public Attributes

Vector3 Origin
 Origin in world space.
Vector3 Direction
 Direction vector. Must be normalized.

Detailed Description

Represents an ray in 3D space, defined by an origin and direction vector.

Constructor & Destructor Documentation

◆ Ray()

Engine3DRadSpace.Math.Ray.Ray ( Vector3 origin,
Vector3 direction )
inline

Member Function Documentation

◆ Intersects() [1/4]

float Ray::Intersects ( const BoundingBox & box) const

Checks if this ray intersects with the given bounding box.

Parameters
boxBounding box to test for intersection.
Returns
Closest intersection point.

◆ Intersects() [2/4]

float Ray::Intersects ( const BoundingPlane & plane) const

Checks if this ray intersects with the given bounding plane.

Parameters
planeBounding plane to test for intersection.
Returns
Closest intersection point.

◆ Intersects() [3/4]

float Ray::Intersects ( const BoundingSphere & sph) const

Checks if this ray intersects with the given bounding sphere.

Parameters
sphBounding sphere.
Returns
Closest intersection point.

this.Direction but must be normalized.

◆ Intersects() [4/4]

float Ray::Intersects ( const Triangle & tri) const

Checks if this ray intersects the given triangle using the Möller–Trumbore intersection algorithm.

Parameters
triTriangle to test for intersection.
Returns
Closest intersection point.

Member Data Documentation

◆ Direction

Vector3 Engine3DRadSpace.Math.Ray.Direction

Direction vector. Must be normalized.

◆ Origin

Vector3 Engine3DRadSpace.Math.Ray.Origin

Origin in world space.


The documentation for this struct was generated from the following files:
  • E:/3DRadSpace/3DRadSpace_CSharp/Math/Ray.cs
  • E:/3DRadSpace/Engine3DRadSpace/Math/Ray.hpp
  • E:/3DRadSpace/Engine3DRadSpace/Math/Ray.cpp