Pārlūkot izejas kodu

Make culling distances consistent across raylib

pull/5085/head
Nikolas pirms 3 mēnešiem
vecāks
revīzija
7267c1c8a1
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: E95F679E3CDD9784
3 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. +2
    -2
      src/config.h
  2. +2
    -2
      src/rcamera.h
  3. +1
    -1
      src/rcore.c

+ 2
- 2
src/config.h Parādīt failu

@ -135,8 +135,8 @@
#define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported #define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
#define RL_CULL_DISTANCE_NEAR 0.001 // Default projection matrix near cull distance
#define RL_CULL_DISTANCE_FAR 10000.0 // Default projection matrix far cull distance
#define RL_CULL_DISTANCE_NEAR 0.05 // Default projection matrix near cull distance
#define RL_CULL_DISTANCE_FAR 4000.0 // Default projection matrix far cull distance
// Default shader vertex attribute locations // Default shader vertex attribute locations
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION 0 #define RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION 0

+ 2
- 2
src/rcamera.h Parādīt failu

@ -65,8 +65,8 @@
#endif #endif
#if defined(RCAMERA_STANDALONE) #if defined(RCAMERA_STANDALONE)
#define CAMERA_CULL_DISTANCE_NEAR 0.01
#define CAMERA_CULL_DISTANCE_FAR 1000.0
#define CAMERA_CULL_DISTANCE_NEAR 0.05
#define CAMERA_CULL_DISTANCE_FAR 4000.0
#else #else
#define CAMERA_CULL_DISTANCE_NEAR RL_CULL_DISTANCE_NEAR #define CAMERA_CULL_DISTANCE_NEAR RL_CULL_DISTANCE_NEAR
#define CAMERA_CULL_DISTANCE_FAR RL_CULL_DISTANCE_FAR #define CAMERA_CULL_DISTANCE_FAR RL_CULL_DISTANCE_FAR

+ 1
- 1
src/rcore.c Parādīt failu

@ -1530,7 +1530,7 @@ Ray GetScreenToWorldRayEx(Vector2 position, Camera camera, int width, int height
double right = top*aspect; double right = top*aspect;
// Calculate projection matrix from orthographic // Calculate projection matrix from orthographic
matProj = MatrixOrtho(-right, right, -top, top, mf">0.01, 1000.0);
matProj = MatrixOrtho(-right, right, -top, top, n">rlGetCullDistanceNear(), rlGetCullDistanceFar());
} }
// Unproject far/near points // Unproject far/near points

Notiek ielāde…
Atcelt
Saglabāt