raylib-cpp
C++ object-oriented wrapper library for raylib.
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
raylib::RayCollision Class Reference

Raycast hit information. More...

#include <RayCollision.hpp>

Public Member Functions

 RayCollision (bool hit, float distance, ::Vector3 point, ::Vector3 normal)
 
 RayCollision (const ::Ray &ray, ::Vector3 center, float radius)
 Get collision info between ray and sphere. More...
 
 RayCollision (const ::Ray &ray, ::Vector3 p1, ::Vector3 p2, ::Vector3 p3)
 Get collision info between ray and triangle. More...
 
 RayCollision (const ::Ray &ray, ::Vector3 p1, ::Vector3 p2, ::Vector3 p3, ::Vector3 p4)
 Get collision info between ray and quad. More...
 
 RayCollision (const ::Ray &ray, const ::BoundingBox &box)
 Get collision info between ray and bounding box. More...
 
 RayCollision (const ::Ray &ray, const ::Mesh &mesh, const ::Matrix &transform)
 Get collision info between ray and mesh. More...
 
 RayCollision (const ::RayCollision &ray)
 
float GetDistance () const
 Retrieves the distance value for the object. More...
 
bool GetHit () const
 Retrieves the hit value for the object. More...
 
::Vector3 GetNormal () const
 Retrieves the normal value for the object. More...
 
::Vector3 GetPosition () const
 Retrieves the point value for the object. More...
 
RayCollisionoperator= (const ::RayCollision &ray)
 
void SetDistance (float value)
 Sets the distance value for the object. More...
 
void SetHit (bool value)
 Sets the hit value for the object. More...
 
void SetNormal (::Vector3 value)
 Sets the normal value for the object. More...
 
void SetPosition (::Vector3 value)
 Sets the point value for the object. More...
 

Protected Member Functions

void set (const ::RayCollision &ray)
 

Detailed Description

Raycast hit information.

Definition at line 11 of file RayCollision.hpp.

Constructor & Destructor Documentation

◆ RayCollision() [1/7]

raylib::RayCollision::RayCollision ( const ::RayCollision &  ray)
inline

Definition at line 13 of file RayCollision.hpp.

◆ RayCollision() [2/7]

raylib::RayCollision::RayCollision ( bool  hit,
float  distance,
::Vector3  point,
::Vector3  normal 
)
inline

Definition at line 17 of file RayCollision.hpp.

◆ RayCollision() [3/7]

raylib::RayCollision::RayCollision ( const ::Ray &  ray,
const ::BoundingBox &  box 
)
inline

Get collision info between ray and bounding box.

Definition at line 25 of file RayCollision.hpp.

◆ RayCollision() [4/7]

raylib::RayCollision::RayCollision ( const ::Ray &  ray,
const ::Mesh &  mesh,
const ::Matrix &  transform 
)
inline

Get collision info between ray and mesh.

Definition at line 32 of file RayCollision.hpp.

◆ RayCollision() [5/7]

raylib::RayCollision::RayCollision ( const ::Ray &  ray,
::Vector3  p1,
::Vector3  p2,
::Vector3  p3,
::Vector3  p4 
)
inline

Get collision info between ray and quad.

Definition at line 39 of file RayCollision.hpp.

◆ RayCollision() [6/7]

raylib::RayCollision::RayCollision ( const ::Ray &  ray,
::Vector3  center,
float  radius 
)
inline

Get collision info between ray and sphere.

Definition at line 46 of file RayCollision.hpp.

◆ RayCollision() [7/7]

raylib::RayCollision::RayCollision ( const ::Ray &  ray,
::Vector3  p1,
::Vector3  p2,
::Vector3  p3 
)
inline

Get collision info between ray and triangle.

Definition at line 53 of file RayCollision.hpp.

Member Function Documentation

◆ GetDistance()

float raylib::RayCollision::GetDistance ( ) const
inline

Retrieves the distance value for the object.

Returns
The distance value of the object.

Definition at line 63 of file RayCollision.hpp.

◆ GetHit()

bool raylib::RayCollision::GetHit ( ) const
inline

Retrieves the hit value for the object.

Returns
The hit value of the object.

Definition at line 62 of file RayCollision.hpp.

◆ GetNormal()

::Vector3 raylib::RayCollision::GetNormal ( ) const
inline

Retrieves the normal value for the object.

Returns
The normal value of the object.

Definition at line 65 of file RayCollision.hpp.

◆ GetPosition()

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

Retrieves the point value for the object.

Returns
The point value of the object.

Definition at line 64 of file RayCollision.hpp.

◆ operator=()

RayCollision & raylib::RayCollision::operator= ( const ::RayCollision &  ray)
inline

Definition at line 57 of file RayCollision.hpp.

◆ set()

void raylib::RayCollision::set ( const ::RayCollision &  ray)
inlineprotected

Definition at line 68 of file RayCollision.hpp.

◆ SetDistance()

void raylib::RayCollision::SetDistance ( float  value)
inline

Sets the distance value for the object.

Parameters
valueThe value of which to set distance to.

Definition at line 63 of file RayCollision.hpp.

◆ SetHit()

void raylib::RayCollision::SetHit ( bool  value)
inline

Sets the hit value for the object.

Parameters
valueThe value of which to set hit to.

Definition at line 62 of file RayCollision.hpp.

◆ SetNormal()

void raylib::RayCollision::SetNormal ( ::Vector3  value)
inline

Sets the normal value for the object.

Parameters
valueThe value of which to set normal to.

Definition at line 65 of file RayCollision.hpp.

◆ SetPosition()

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

Sets the point value for the object.

Parameters
valueThe value of which to set point to.

Definition at line 64 of file RayCollision.hpp.