diff options
| author | Ray <[email protected]> | 2018-04-01 00:27:20 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-04-01 00:27:20 +0200 |
| commit | 564baa22d65d6cace2b98d370f1716081830af09 (patch) | |
| tree | b3069f737afdb5965038b9d6c8d7363da8a00338 /src/raylib.h | |
| parent | b4e2f5b45c22e560bf785cf412154fc32d995e1e (diff) | |
| parent | 42e64e931b27a27795f471817dc93551f4f752e8 (diff) | |
| download | raylib-564baa22d65d6cace2b98d370f1716081830af09.tar.gz raylib-564baa22d65d6cace2b98d370f1716081830af09.zip | |
Merge pull request #513 from autious/master
Add orthographic 3d rendering mode
Diffstat (limited to 'src/raylib.h')
| -rw-r--r-- | src/raylib.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/raylib.h b/src/raylib.h index c94f4477..f40124e9 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -398,12 +398,19 @@ typedef struct SpriteFont { CharInfo *chars; // Characters info data } SpriteFont; +// Camera projection modes +typedef enum { + CAMERA_PERSPECTIVE = 0, + CAMERA_ORTHOGRAPHIC +} CameraType; + // Camera type, defines a camera position/orientation in 3d space typedef struct Camera { 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) + float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic + CameraType type; // Camera type, controlling projection type, either CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC. } Camera; // Camera2D type, defines a 2d camera @@ -726,7 +733,7 @@ RLAPI void BeginTextureMode(RenderTexture2D target); // Initializes RLAPI void EndTextureMode(void); // Ends drawing to render texture // Screen-space-related functions -RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position +RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) |
