Corrected issue with reserved words: near, far
This commit is contained in:
parent
81897e7771
commit
4ec65c0d25
1 changed files with 7 additions and 7 deletions
14
src/core.c
14
src/core.c
|
@ -291,7 +291,7 @@ static void InitTimer(void); // Initialize timer
|
||||||
static double GetTime(void); // Returns time since InitTimer() was run
|
static double GetTime(void); // Returns time since InitTimer() was run
|
||||||
static void Wait(float ms); // Wait for some milliseconds (stop program execution)
|
static void Wait(float ms); // Wait for some milliseconds (stop program execution)
|
||||||
static bool GetKeyStatus(int key); // Returns if a key has been pressed
|
static bool GetKeyStatus(int key); // Returns if a key has been pressed
|
||||||
static bool GetMouseButtonStatus(int button); // Returns if a mouse button has been pressed
|
static bool ButtonStatus(int button); // Returns if a mouse button has been pressed
|
||||||
static void PollInputEvents(void); // Register user events
|
static void PollInputEvents(void); // Register user events
|
||||||
static void SwapBuffers(void); // Copy back buffer to front buffers
|
static void SwapBuffers(void); // Copy back buffer to front buffers
|
||||||
static void LogoAnimation(void); // Plays raylib logo appearing animation
|
static void LogoAnimation(void); // Plays raylib logo appearing animation
|
||||||
|
@ -1129,16 +1129,16 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
|
||||||
MatrixInvert(&matProjView);
|
MatrixInvert(&matProjView);
|
||||||
|
|
||||||
// Calculate far and near points
|
// Calculate far and near points
|
||||||
Quaternion near = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f };
|
Quaternion nearPoint = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f };
|
||||||
Quaternion far = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f };
|
Quaternion farPoint = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f };
|
||||||
|
|
||||||
// Multiply points by unproject matrix
|
// Multiply points by unproject matrix
|
||||||
QuaternionTransform(&near, matProjView);
|
QuaternionTransform(&nearPoint, matProjView);
|
||||||
QuaternionTransform(&far, matProjView);
|
QuaternionTransform(&farPoint, matProjView);
|
||||||
|
|
||||||
// Calculate normalized world points in vectors
|
// Calculate normalized world points in vectors
|
||||||
Vector3 nearPoint = { near.x/near.w, near.y/near.w, near.z/near.w};
|
Vector3 nearPoint = { nearPoint.x/nearPoint.w, nearPoint.y/nearPoint.w, nearPoint.z/nearPoint.w};
|
||||||
Vector3 farPoint = { far.x/far.w, far.y/far.w, far.z/far.w};
|
Vector3 farPoint = { farPoint.x/farPoint.w, farPoint.y/farPoint.w, farPoint.z/farPoint.w};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Calculate normalized direction vector
|
// Calculate normalized direction vector
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue