forge-camera-and-input

Create a first-person camera with quaternion orientation and keyboard/mouse input for SDL3 GPU scenes.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-camera-and-input
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-camera-and-input
Source: https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317/tree/main/.claude/skills/forge-camera-and-input
Command: npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-camera-and-input

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables interactive navigation in 3D scenes by providing a first-person camera with quaternion orientation, WASD movement, and mouse-look controls, all in an SDL3 GPU context.

Core Features & Use Cases

  • First-person camera: orientation derived from yaw/pitch using quaternions and a view matrix built from position and orientation.
  • Input handling: keyboard state for smooth movement and relative mouse mode for camera control.
  • Delta-time movement: frame-rate independent updates with clamped dt to prevent jerky motion.
  • Reusability: integrates with depth-and-3d and common math utilities to enable quick scene exploration and prototyping.

Quick Start

Initialize the camera state, capture the mouse for FPS look, and update the position using delta time each frame.

Frequently Asked Questions about forge-camera-and-input

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a first-person camera with WASD movement to an SDL3 GPU scene?

To add a first-person camera to an SDL3 GPU scene, you need quaternion orientation and keyboard state handling for WASD movement. This approach uses relative mouse mode for look control, enabling interactive real-time navigation in 3D environments.

How does quaternion orientation handle mouse look for an FPS camera?

Quaternion orientation handles FPS mouse look by deriving yaw and pitch rotations to calculate the view matrix. This provides smooth, gimbal-lock-free camera control when integrated with per-frame delta-time updates for movement.

Can I use delta-time movement to make SDL3 camera navigation frame-rate independent?

Yes, you can use delta-time movement to make SDL3 camera navigation frame-rate independent. The implementation clamps delta-time per frame to prevent jerky motion during sudden frame drops, ensuring smooth real-time 3D exploration.

Do I need depth-and-3d and math utilities to build a view matrix for an SDL3 GPU camera?

Yes, you need the depth-and-3d MVP pipeline and quaternion math utilities like quat_from_euler and quat_forward to build a view matrix. These dependencies provide the necessary 3D projection and vector extraction for the camera.

What is the best way to capture mouse input for 3D scene exploration in SDL3?

The best way to capture mouse input for 3D scene exploration in SDL3 is using relative mouse mode. This captures mouse motion deltas directly for camera look control without moving the cursor on screen, paired with keyboard state for movement.

Why does my FPS camera stutter when moving through 3D environments?

Your FPS camera stutters because movement updates lack delta-time clamping or quaternion-based orientation. Applying a clamped per-frame delta-time to position updates ensures frame-rate independent motion, preventing jerky navigation during 3D exploration.