WARNING: BREAKING: RENAMED: RayHitInfo to RayCollision #1781
- RENAMED: RayHitInfo to RayCollision - RENAMED/REDESIGNED: Multiple Ray collision functions to be more consistent and return RayCollision data -WIP-
This commit is contained in:
parent
7bcb2ad4f1
commit
1c5de9721a
3 changed files with 85 additions and 103 deletions
19
src/raylib.h
19
src/raylib.h
|
@ -399,12 +399,12 @@ typedef struct Ray {
|
|||
} Ray;
|
||||
|
||||
// RayCollision, ray hit information
|
||||
typedef struct RayHitInfo {
|
||||
typedef struct RayCollision {
|
||||
bool hit; // Did the ray hit something?
|
||||
float distance; // Distance to nearest hit
|
||||
Vector3 position; // Position of nearest hit
|
||||
Vector3 point; // Point of nearest hit
|
||||
Vector3 normal; // Surface normal of hit
|
||||
} RayHitInfo;
|
||||
} RayCollision;
|
||||
|
||||
// BoundingBox
|
||||
typedef struct BoundingBox {
|
||||
|
@ -1445,13 +1445,12 @@ RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source,
|
|||
RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Detect collision between two spheres
|
||||
RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes
|
||||
RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Detect collision between box and sphere
|
||||
RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 center, float radius); // Detect collision between ray and sphere
|
||||
RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 center, float radius, Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point
|
||||
RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box
|
||||
RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh
|
||||
RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model model); // Get collision info between ray and model
|
||||
RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
|
||||
RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane)
|
||||
RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere
|
||||
RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box
|
||||
RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh
|
||||
RLAPI RayCollision GetRayCollisionModel(Ray ray, Model model); // Get collision info between ray and model
|
||||
RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
|
||||
RLAPI RayCollision GetRayCollisionGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane)
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Audio Loading and Playing Functions (Module: audio)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue