Axmol Engine 2.4.0-258ceca
Loading...
Searching...
No Matches
Ray Class Reference

Ray is a line with one end. More...

#include <Ray.h>

Public Member Functions

 Ray ()
 Constructor.
 
 Ray (const Ray &ray)
 Constructor.
 
 Ray (const Vec3 &origin, const Vec3 &direction)
 Constructs a new ray initialized to the specified values.
 
 ~Ray ()
 Destructor.
 
bool intersects (const AABB &aabb, float *distance=nullptr) const
 Check whether this ray intersects with the specified AABB.
 
bool intersects (const OBB &obb, float *distance=nullptr) const
 Check whether this ray intersects with the specified OBB.
 
void set (const Vec3 &origin, const Vec3 &direction)
 Sets this ray to the specified values.
 
void transform (const Mat4 &matrix)
 Transforms this ray by the given transformation matrix.
 

Detailed Description

Ray is a line with one end.

usually use it to check intersects with some object,such as Plane, OBB, AABB @js NA

Constructor & Destructor Documentation

◆ Ray() [1/3]

Ray ( )

Constructor.

@lua new

◆ Ray() [2/3]

Ray ( const Ray & ray)

Constructor.

@lua NA

◆ Ray() [3/3]

Ray ( const Vec3 & origin,
const Vec3 & direction )

Constructs a new ray initialized to the specified values.

Parameters
originThe ray's origin.
directionThe ray's direction. @lua new

◆ ~Ray()

~Ray ( )

Destructor.

@lua NA

Member Function Documentation

◆ set()

void set ( const Vec3 & origin,
const Vec3 & direction )

Sets this ray to the specified values.

Parameters
originThe ray's origin.
directionThe ray's direction.

◆ transform()

void transform ( const Mat4 & matrix)

Transforms this ray by the given transformation matrix.

Parameters
matrixThe transformation matrix to transform by.

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