mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-12 14:28:15 +00:00
Added RaycastGround and ray picking example
This commit is contained in:
15
src/raylib.h
15
src/raylib.h
@@ -97,6 +97,9 @@
|
||||
#define DEG2RAD (PI/180.0f)
|
||||
#define RAD2DEG (180.0f/PI)
|
||||
|
||||
// A small number
|
||||
#define EPSILON 0.000001
|
||||
|
||||
// raylib Config Flags
|
||||
#define FLAG_FULLSCREEN_MODE 1
|
||||
#define FLAG_RESIZABLE_WINDOW 2
|
||||
@@ -491,6 +494,13 @@ typedef struct Ray {
|
||||
Vector3 direction; // Ray direction
|
||||
} Ray;
|
||||
|
||||
// Information returned from a raycast
|
||||
typedef struct RayHitInfo {
|
||||
bool hit; // Did the ray hit something?
|
||||
Vector3 hitPosition; // Position of nearest hit
|
||||
Vector3 hitNormal; // Surface normal of hit
|
||||
} RayHitInfo;
|
||||
|
||||
// Wave type, defines audio wave data
|
||||
typedef struct Wave {
|
||||
unsigned int sampleCount; // Number of samples
|
||||
@@ -910,6 +920,11 @@ RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphe
|
||||
Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point
|
||||
RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Ray Casts
|
||||
//------------------------------------------------------------------------------------
|
||||
RLAPI RayHitInfo RaycastGroundPlane( Ray ray, float groundHeight );
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Shaders System Functions (Module: rlgl)
|
||||
// NOTE: This functions are useless when using OpenGL 1.1
|
||||
|
Reference in New Issue
Block a user