mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-11-30 17:19:27 +00:00
54 lines
1.0 KiB
C++
54 lines
1.0 KiB
C++
#ifndef RAYLIB_CPP_RAYHITINFO_HPP_
|
|
#define RAYLIB_CPP_RAYHITINFO_HPP_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"{
|
|
#endif
|
|
#include "raylib.h"
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#include "./raylib-cpp-utils.hpp"
|
|
|
|
namespace raylib {
|
|
class RayHitInfo : public ::RayHitInfo {
|
|
public:
|
|
RayHitInfo(::RayHitInfo ray) {
|
|
set(ray);
|
|
};
|
|
|
|
RayHitInfo(bool Hit, float Distance, ::Vector3 Position, ::Vector3 Normal) {
|
|
hit = Hit;
|
|
distance = Distance;
|
|
position = Position;
|
|
normal = Normal;
|
|
};
|
|
|
|
RayHitInfo& operator=(const ::RayHitInfo& ray) {
|
|
set(ray);
|
|
return *this;
|
|
}
|
|
|
|
RayHitInfo& operator=(const RayHitInfo& ray) {
|
|
set(ray);
|
|
return *this;
|
|
}
|
|
|
|
GETTERSETTER(bool,Hit,hit)
|
|
GETTERSETTER(float,Distance,distance)
|
|
GETTERSETTER(::Vector3,Position,position)
|
|
GETTERSETTER(::Vector3,Normal,normal)
|
|
|
|
protected:
|
|
inline void set(::RayHitInfo ray) {
|
|
hit = ray.hit;
|
|
distance = ray.distance;
|
|
position = ray.position;
|
|
normal = ray.normal;
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif
|