Merge pull request #195 from wmpowell8/patch-1

Add more constructor overloads for RayCollision
This commit is contained in:
Rob Loach
2022-06-13 17:24:31 -05:00
committed by GitHub

View File

@@ -19,6 +19,13 @@ class RayCollision : public ::RayCollision {
// Nothing.
}
/**
* Get collision info between ray and bounding box
*/
RayCollision(const ::Ray& ray, const ::BoundingBox& box) {
set(::GetRayCollisionBox(ray, box));
}
/**
* Get collision info between ray and mesh
*/
@@ -33,6 +40,20 @@ class RayCollision : public ::RayCollision {
set(::GetRayCollisionModel(ray, model));
}
/**
* Get collision info between ray and quad
*/
RayCollision(const ::Ray& ray, ::Vector3 p1, ::Vector3 p2, ::Vector3 p3, ::Vector3 p4) {
set(::GetRayCollisionQuad(ray, p1, p2, p3, p4));
}
/**
* Get collision info between ray and sphere
*/
RayCollision(const ::Ray& ray, ::Vector3 center, float radius) {
set(::GetRayCollisionSphere(ray, center, radius));
}
/**
* Get collision info between ray and triangle
*/