Implement flycam - #19
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR replaces a trackball camera controller with a flycam. The ChangesFlycam Camera Controller
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/camera.rs (1)
69-74: 💤 Low valueConsider reformatting for readability.
The movement logic is correct, but the lines are quite long. Consider breaking them into multiple lines for improved readability.
📝 Optional formatting improvement
- if keyboard.pressed(KeyCode::KeyW) { transform.translation += *forward * speed; } - if keyboard.pressed(KeyCode::KeyS) { transform.translation -= *forward * speed; } - if keyboard.pressed(KeyCode::KeyD) { transform.translation += *right * speed; } - if keyboard.pressed(KeyCode::KeyA) { transform.translation -= *right * speed; } - if keyboard.pressed(KeyCode::KeyE) { transform.translation += up * speed; } - if keyboard.pressed(KeyCode::KeyQ) { transform.translation -= up * speed; } + if keyboard.pressed(KeyCode::KeyW) { + transform.translation += *forward * speed; + } + if keyboard.pressed(KeyCode::KeyS) { + transform.translation -= *forward * speed; + } + if keyboard.pressed(KeyCode::KeyD) { + transform.translation += *right * speed; + } + if keyboard.pressed(KeyCode::KeyA) { + transform.translation -= *right * speed; + } + if keyboard.pressed(KeyCode::KeyE) { + transform.translation += up * speed; + } + if keyboard.pressed(KeyCode::KeyQ) { + transform.translation -= up * speed; + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/camera.rs` around lines 69 - 74, The movement input lines in camera.rs are correct but too long and hurt readability; refactor the repeated single-line statements (those using keyboard.pressed(KeyCode::KeyW/KeyS/KeyD/KeyA/KeyE/KeyQ) and modifying transform.translation with *forward, *right, up and speed) into multi-line, clearer forms—for example, extract the direction and delta into a small local variable (e.g., let delta = direction * speed) or format the if bodies on their own lines so each statement is short and consistent; update the blocks that reference transform.translation, forward, right, up, keyboard.pressed and speed accordingly to keep behavior identical while improving line length and readability.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/camera.rs`:
- Around line 69-74: The movement input lines in camera.rs are correct but too
long and hurt readability; refactor the repeated single-line statements (those
using keyboard.pressed(KeyCode::KeyW/KeyS/KeyD/KeyA/KeyE/KeyQ) and modifying
transform.translation with *forward, *right, up and speed) into multi-line,
clearer forms—for example, extract the direction and delta into a small local
variable (e.g., let delta = direction * speed) or format the if bodies on their
own lines so each statement is short and consistent; update the blocks that
reference transform.translation, forward, right, up, keyboard.pressed and speed
accordingly to keep behavior identical while improving line length and
readability.
nixonyh
left a comment
There was a problem hiding this comment.
We shud add back the orbit functionality, but overall this is a great improvement to what we had.
Swapped out rotating table for a simple WASDQE flycam.
Code should be much easier to look at :)