summaryrefslogtreecommitdiffhomepage
path: root/src/raylib.h
diff options
context:
space:
mode:
authorvictorfisac <[email protected]>2016-01-20 16:01:59 +0100
committervictorfisac <[email protected]>2016-01-20 16:01:59 +0100
commit423a45ac85c64c578e15a6672bff3ae17c2be44a (patch)
treedd1dc073a44e7ed51bafa3ba77cf90f2bb6d76f0 /src/raylib.h
parentdc385ba4ec546b797866c3bde6a2490ad8245696 (diff)
downloadraylib-423a45ac85c64c578e15a6672bff3ae17c2be44a.tar.gz
raylib-423a45ac85c64c578e15a6672bff3ae17c2be44a.zip
Added ray-sphere collision detection
- Added simple ray-sphere collision detection. - Added extra function with extended parameters to obtain collision point vector. - Fixed bounding box calculations init values (were causing compiling errors).
Diffstat (limited to 'src/raylib.h')
-rw-r--r--src/raylib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 16311df8..876d22a9 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -770,6 +770,8 @@ void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vec
bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres
bool CheckCollisionBoxes(Vector3 minBBox1, Vector3 maxBBox1, Vector3 minBBox2, Vector3 maxBBox2); // Detect collision between two boxes
bool CheckCollisionBoxSphere(Vector3 minBBox, Vector3 maxBBox, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere
+bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere
+bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere with extended parameters and collision point detection
bool CheckCollisionRayBox(Ray ray, Vector3 minBBox, Vector3 maxBBox); // Detect collision between ray and box
Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius); // Detect collision of player radius with cubicmap
// NOTE: Return the normal vector of the impacted surface