diff options
| author | Ray <raysan5@gmail.com> | 2015-07-28 17:38:37 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2015-07-28 17:38:37 +0200 |
| commit | 8b3a82688e82922819d24494c08e24570c03bdc4 (patch) | |
| tree | 1df1379dfc4948477b664023d2ce0100d83d1783 /src/camera.c | |
| parent | a59433e7a3b22d5ded7505689fb44f1927194077 (diff) | |
| parent | 067b884f395b7b6d4c179cb3d58b0d17a02950ec (diff) | |
| download | raylib-8b3a82688e82922819d24494c08e24570c03bdc4.tar.gz raylib-8b3a82688e82922819d24494c08e24570c03bdc4.zip | |
Merge pull request #24 from raysan5/develop
Integrate Develop branch
Diffstat (limited to 'src/camera.c')
| -rw-r--r-- | src/camera.c | 104 |
1 files changed, 49 insertions, 55 deletions
diff --git a/src/camera.c b/src/camera.c index cb99ba6b..cde118c9 100644 --- a/src/camera.c +++ b/src/camera.c @@ -23,7 +23,8 @@ * **********************************************************************************************/ -#include "raylib.h" +#include "camera.h" + #include <math.h> //---------------------------------------------------------------------------------- @@ -93,15 +94,6 @@ static int cameraMode = CAMERA_CUSTOM; // Module specific Functions Declaration //---------------------------------------------------------------------------------- static void ProcessCamera(Camera *camera, Vector3 *playerPosition); -/* -static void SetCameraControls(int front, int left, int back, right, up, down); -static void SetMouseSensitivity(int sensitivity); -static void SetResetPosition(Vector3 resetPosition); -static void SetResetControl(int resetKey); -static void SetPawnControl(int pawnControlKey); -static void SetFnControl(int fnControlKey); -static void SetSmoothZoomControl(int smoothZoomControlKey); -*/ //---------------------------------------------------------------------------------- // Module Functions Definition @@ -153,6 +145,53 @@ Camera UpdateCamera(Vector3 *position) return internalCamera; } + +void SetCameraControls(int frontKey, int leftKey, int backKey, int rightKey, int upKey, int downKey) +{ + cameraMovementController[0] = frontKey; + cameraMovementController[1] = leftKey; + cameraMovementController[2] = backKey; + cameraMovementController[3] = rightKey; + cameraMovementController[4] = upKey; + cameraMovementController[5] = downKey; +} + +void SetCameraMouseSensitivity(float sensitivity) +{ + mouseSensitivity = (sensitivity / 10000.0); +} + +void SetCameraResetPosition(Vector3 resetPosition) +{ + resetingPosition = resetPosition; +} + +void SetCameraResetControl(int resetKey) +{ + resetingKey = resetKey; +} + +void SetCameraPawnControl(int pawnControlKey) +{ + pawnControllingKey = pawnControlKey; +} + +void SetCameraFnControl(int fnControlKey) +{ + fnControllingKey = fnControlKey; +} + +void SetCameraSmoothZoomControl(int smoothZoomControlKey) +{ + smoothZoomControllingKey = smoothZoomControlKey; +} + +void SetCameraOrbitalTarget(Vector3 target) +{ + internalCamera.target = target; +} + + //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- @@ -408,48 +447,3 @@ static void ProcessCamera(Camera *camera, Vector3 *playerPosition) } #endif } - -void SetCameraControls(int frontKey, int leftKey, int backKey, int rightKey, int upKey, int downKey) -{ - cameraMovementController[0] = frontKey; - cameraMovementController[1] = leftKey; - cameraMovementController[2] = backKey; - cameraMovementController[3] = rightKey; - cameraMovementController[4] = upKey; - cameraMovementController[5] = downKey; -} - -void SetMouseSensitivity(float sensitivity) -{ - mouseSensitivity = (sensitivity / 10000.0); -} - -void SetResetPosition(Vector3 resetPosition) -{ - resetingPosition = resetPosition; -} - -void SetResetControl(int resetKey) -{ - resetingKey = resetKey; -} - -void SetPawnControl(int pawnControlKey) -{ - pawnControllingKey = pawnControlKey; -} - -void SetFnControl(int fnControlKey) -{ - fnControllingKey = fnControlKey; -} - -void SetSmoothZoomControl(int smoothZoomControlKey) -{ - smoothZoomControllingKey = smoothZoomControlKey; -} - -void SetOrbitalTarget(Vector3 target) -{ - internalCamera.target = target; -} |
