diff options
| author | Ray <[email protected]> | 2023-03-12 19:28:42 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-03-12 19:28:42 +0100 |
| commit | f9c4cc2040aa014292b02fcf10918ca930341e3b (patch) | |
| tree | ea26530c92a3f3f658c6b3507112df960ba7247d /examples | |
| parent | b436c8d7e5346a241b00511a11585936895d959d (diff) | |
| download | raylib-f9c4cc2040aa014292b02fcf10918ca930341e3b.tar.gz raylib-f9c4cc2040aa014292b02fcf10918ca930341e3b.zip | |
ADDED: `UpdateCameraPro()` -Experimental-
REVIEWED: rcamera module formating
REVIEWED: `core_3d_camera_example`
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/core/core_3d_camera_first_person.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/core/core_3d_camera_first_person.c b/examples/core/core_3d_camera_first_person.c index 0fc784fa..de0a43c3 100644 --- a/examples/core/core_3d_camera_first_person.c +++ b/examples/core/core_3d_camera_first_person.c @@ -113,7 +113,26 @@ int main(void) } } + // Update camera computes movement internally depending on the camera mode + // Some default standard keyboard/mouse inputs are hardcoded to simplify use + // For advance camera controls, it's reecommended to compute camera movement manually UpdateCamera(&camera, cameraMode); // Update camera + +/* + // Camera PRO usage example (EXPERIMENTAL) + // This new camera function allows custom movement/rotation values to be directly provided + // as input parameters, with this approach, rcamera module is internally independent of raylib inputs + UpdateCameraPro(&camera, + (IsKeyDown(KEY_W) || IsKeyDown(KEY_UP))*0.1f - // Move forward-backward + (IsKeyDown(KEY_S) || IsKeyDown(KEY_DOWN))*0.1f, + (IsKeyDown(KEY_D) || IsKeyDown(KEY_RIGHT))*0.1f - // Move right-left + (IsKeyDown(KEY_A) || IsKeyDown(KEY_LEFT))*0.1f, + 0.0f, // Move up-down + GetMouseWheelMove()*2.0f, // Move to target (zoom) + GetMouseDelta().x*0.05f, // Rotation: yaw + GetMouseDelta().y*0.05f, // Rotation: pitch + 0.0f); // Rotation: roll +*/ //---------------------------------------------------------------------------------- // Draw |
