Skip to content

Commit 5a63ca9

Browse files
authored
Merge pull request #195 from wmpowell8/patch-1
Add more constructor overloads for RayCollision
2 parents 9defb79 + 8f7552f commit 5a63ca9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

include/RayCollision.hpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ class RayCollision : public ::RayCollision {
1919
// Nothing.
2020
}
2121

22+
/**
23+
* Get collision info between ray and bounding box
24+
*/
25+
RayCollision(const ::Ray& ray, const ::BoundingBox& box) {
26+
set(::GetRayCollisionBox(ray, box));
27+
}
28+
2229
/**
2330
* Get collision info between ray and mesh
2431
*/
@@ -33,6 +40,20 @@ class RayCollision : public ::RayCollision {
3340
set(::GetRayCollisionModel(ray, model));
3441
}
3542

43+
/**
44+
* Get collision info between ray and quad
45+
*/
46+
RayCollision(const ::Ray& ray, ::Vector3 p1, ::Vector3 p2, ::Vector3 p3, ::Vector3 p4) {
47+
set(::GetRayCollisionQuad(ray, p1, p2, p3, p4));
48+
}
49+
50+
/**
51+
* Get collision info between ray and sphere
52+
*/
53+
RayCollision(const ::Ray& ray, ::Vector3 center, float radius) {
54+
set(::GetRayCollisionSphere(ray, center, radius));
55+
}
56+
3657
/**
3758
* Get collision info between ray and triangle
3859
*/

0 commit comments

Comments
 (0)