Browse Source

Corrected issue with reserved words: near, far

pull/245/head
Ray 8 years ago
committed by GitHub
parent
commit
4ec65c0d25
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      src/core.c

+ 7
- 7
src/core.c View File

@ -291,7 +291,7 @@ static void InitTimer(void); // Initialize timer
static double GetTime(void); // Returns time since InitTimer() was run
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 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 SwapBuffers(void); // Copy back buffer to front buffers
static void LogoAnimation(void); // Plays raylib logo appearing animation
@ -1129,16 +1129,16 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
MatrixInvert(&matProjView);
// Calculate far and near points
Quaternion near = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f };
Quaternion far = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f };
Quaternion nearPoint = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f };
Quaternion farPoint = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f };
// Multiply points by unproject matrix
QuaternionTransform(&near, matProjView);
QuaternionTransform(&far, matProjView);
QuaternionTransform(&nearPoint, matProjView);
QuaternionTransform(&farPoint, matProjView);
// Calculate normalized world points in vectors
Vector3 nearPoint = { near.x/near.w, near.y/near.w, near.z/near.w};
Vector3 farPoint = { far.x/far.w, far.y/far.w, far.z/far.w};
Vector3 nearPoint = { nearPoint.x/nearPoint.w, nearPoint.y/nearPoint.w, nearPoint.z/nearPoint.w};
Vector3 farPoint = { farPoint.x/farPoint.w, farPoint.y/farPoint.w, farPoint.z/farPoint.w};
#endif
// Calculate normalized direction vector

Loading…
Cancel
Save