stride3d / stride3d/stride

[Samples] Fix samples' camera controllers

Open
#367 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Input area-Samples enhancement good first issue
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Github

Version: commit onward

Platform(s): Any

Describe the bug
Most controllers do not handle inputs correctly and are written in an overly complex manner:
Here are some example issues that first person has:

  • this function should be simplified and or clarified.
  • Desired* and rotationAdaptation both are pointless, they cannot be modified from an outside source and don't impact the camera in a meaningful way.
  • Offset current entity rotation instead of relying on variables internal to the script, this would allow for multiple scripts to rotate the camera for cut-scenes and the likes.

Same for third person:

Now Orbit / Sidescroller:

There is a general lack of polish

Comments in all of those files aren't straightforward enough, it shouldn't just explain what the line does but also why we have to include it. If even the guy who wrote those files couldn't get them right there's a very big chance that most programmers won't, knowing that we might as well document thoroughly how camera controllers are implemented and what users should do when modifying or creating one to avoid those kind of issues. Again, check the changes that BasicCameraController as gone through for an idea of what we should strive for.

Additional context
PR #359

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the BasicCameraController changes linked in the issue, then inspect FpsCamera.cs, ThirdPersonCamera.cs, OrbitCamera.cs, and SideScrollingCamera.cs at the referenced locations. Compare their input handling, timing, configurable variables, locking behavior, and comments. Done means the sample controllers handle inputs consistently, avoid the listed frame-rate and physics-timing issues, and document why their implementation choices are needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.