raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
raylib::Ray Class Reference

Ray type (useful for raycast) More...

Public Member Functions

 Ray (::Vector2 mousePosition, const ::Camera &camera)
 
 Ray (::Vector3 position={0.0f, 0.0f, 0.0f}, ::Vector3 direction={0.0f, 0.0f, 0.0f})
 
 Ray (const ::Ray &ray)
 
void Draw (::Color color) const
 Draw a ray line.
 
RayCollision GetCollision (::Vector3 center, float radius) const
 Get collision information between ray and sphere.
 
RayCollision GetCollision (::Vector3 p1, ::Vector3 p2, ::Vector3 p3) const
 Get collision info between ray and triangle.
 
RayCollision GetCollision (::Vector3 p1, ::Vector3 p2, ::Vector3 p3, ::Vector3 p4) const
 Get collision info between ray and quad.
 
RayCollision GetCollision (const ::BoundingBox &box) const
 Detect collision between ray and box.
 
RayCollision GetCollision (const ::Mesh &mesh, const ::Matrix &transform) const
 Get collision information between ray and mesh.
 
::Vector3 GetDirection () const
 Retrieves the direction value for the object. More...
 
::Vector3 GetPosition () const
 Retrieves the position value for the object. More...
 
Rayoperator= (const ::Ray &ray)
 
void SetDirection (::Vector3 value)
 Sets the direction value for the object. More...
 
void SetPosition (::Vector3 value)
 Sets the position value for the object. More...
 

Static Public Member Functions

static Ray GetMouse (::Vector2 mousePosition, const ::Camera &camera)
 Get a ray trace from mouse position.
 
static Ray GetMouse (const ::Camera &camera)
 Get a ray trace from mouse position.
 

Protected Member Functions

void set (const ::Ray &ray)
 

Detailed Description

Ray type (useful for raycast)

Definition at line 12 of file Ray.hpp.

Member Function Documentation

◆ GetDirection()

::Vector3 raylib::Ray::GetDirection ( ) const
inline

Retrieves the direction value for the object.

Returns
The direction value of the object.

Definition at line 29 of file Ray.hpp.

◆ GetPosition()

::Vector3 raylib::Ray::GetPosition ( ) const
inline

Retrieves the position value for the object.

Returns
The position value of the object.

Definition at line 28 of file Ray.hpp.

◆ SetDirection()

void raylib::Ray::SetDirection ( ::Vector3  value)
inline

Sets the direction value for the object.

Parameters
valueThe value of which to set direction to.

Definition at line 29 of file Ray.hpp.

◆ SetPosition()

void raylib::Ray::SetPosition ( ::Vector3  value)
inline

Sets the position value for the object.

Parameters
valueThe value of which to set position to.

Definition at line 28 of file Ray.hpp.