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

Ray type (useful for raycast) More...

Public Member Functions

 Ray (::Vector2 mousePosition, ::Camera camera)
 
 Ray (::Vector3 Position, ::Vector3 Direction)
 
 Ray (const ::Ray &ray)
 
bool CheckCollision (const ::BoundingBox &box) const
 Detect collision between ray and box.
 
bool CheckCollisionSphere (::Vector3 center, float radius) const
 Detect collision between ray and sphere.
 
bool CheckCollisionSphere (::Vector3 center, float radius, ::Vector3 *collisionPoint) const
 Detect collision between ray and sphere, returns collision point.
 
Ray & Draw (::Color color)
 Draw a ray line.
 
RayHitInfo GetCollision (const ::Model &model) const
 Get collision info between ray and model.
 
RayHitInfo GetCollisionGround (float groundHeight) const
 Get collision info between ray and ground plane (Y-normal plane)
 
RayHitInfo GetCollisionTriangle (::Vector3 p1, ::Vector3 p2, ::Vector3 p3) const
 Get collision info between ray and triangle.
 
::Vector3 GetDirection () const
 Retrieves the direction value for the object. More...
 
::Vector3 GetPosition () const
 Retrieves the position value for the object. More...
 
Ray & operator= (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...
 

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 33 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 32 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 33 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 32 of file Ray.hpp.