summaryrefslogtreecommitdiffhomepage
path: root/examples/core
diff options
context:
space:
mode:
authorRay <[email protected]>2023-03-12 19:40:43 +0100
committerRay <[email protected]>2023-03-12 19:40:43 +0100
commit8ca32127013be61110b72eddc19dda16520ac704 (patch)
treec439271e50cf8a22b4280911f142a64b81d2506c /examples/core
parentf9c4cc2040aa014292b02fcf10918ca930341e3b (diff)
downloadraylib-8ca32127013be61110b72eddc19dda16520ac704.tar.gz
raylib-8ca32127013be61110b72eddc19dda16520ac704.zip
REVIEWED: `UpdateCameraPro()` to use `Vector3`
Diffstat (limited to 'examples/core')
-rw-r--r--examples/core/core_3d_camera_first_person.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/examples/core/core_3d_camera_first_person.c b/examples/core/core_3d_camera_first_person.c
index de0a43c3..6a2a115a 100644
--- a/examples/core/core_3d_camera_first_person.c
+++ b/examples/core/core_3d_camera_first_person.c
@@ -123,15 +123,19 @@ int main(void)
// 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
+ (Vector3){
+ (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
+ },
+ (Vector3){
+ GetMouseDelta().x*0.05f, // Rotation: yaw
+ GetMouseDelta().y*0.05f, // Rotation: pitch
+ 0.0f // Rotation: roll
+ },
+ GetMouseWheelMove()*2.0f); // Move to target (zoom)
*/
//----------------------------------------------------------------------------------