Browse Source

BREAKING CHANGE: Renamed Camera -> Camera3D

Just added a fallback in the meantime...
raysan5 7 năm trước cách đây
mục cha
commit
198d739256
2 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 1 1
      examples/core/core_3d_mode.c
  2. 4 2
      src/raylib.h

+ 1 - 1
examples/core/core_3d_mode.c

@@ -21,7 +21,7 @@ int main()
     InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d mode");
 
     // Define the camera to look into our 3d world
-    Camera camera;
+    Camera3D camera;
     camera.position = (Vector3){ 0.0f, 10.0f, 10.0f };  // Camera position
     camera.target = (Vector3){ 0.0f, 0.0f, 0.0f };      // Camera looking at point
     camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };          // Camera up vector (rotation towards target)

+ 4 - 2
src/raylib.h

@@ -400,13 +400,15 @@ typedef struct SpriteFont {
 } SpriteFont;
 
 // Camera type, defines a camera position/orientation in 3d space
-typedef struct Camera {
+typedef struct Camera3D {
     Vector3 position;       // Camera position
     Vector3 target;         // Camera target it looks-at
     Vector3 up;             // Camera up vector (rotation over its axis)
     float fovy;             // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
     int type;               // Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
-} Camera;
+} Camera3D;
+
+#define Camera  Camera3D    // Camera type fallback, defaults to Camera3D
 
 // Camera2D type, defines a 2d camera
 typedef struct Camera2D {