Skip to content

Commit

Permalink
Merge pull request #195 from wmpowell8/patch-1
Browse files Browse the repository at this point in the history
Add more constructor overloads for RayCollision
  • Loading branch information
RobLoach authored Jun 13, 2022
2 parents 9defb79 + 8f7552f commit 5a63ca9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions include/RayCollision.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down

0 comments on commit 5a63ca9

Please sign in to comment.