Skip to content

Comments

Add raw Gyro input for additional camera controls#209

Open
BlackJohn07 wants to merge 1 commit intoshiiion:primehack-masterfrom
BlackJohn07:feature/gyro_camera_control
Open

Add raw Gyro input for additional camera controls#209
BlackJohn07 wants to merge 1 commit intoshiiion:primehack-masterfrom
BlackJohn07:feature/gyro_camera_control

Conversation

@BlackJohn07
Copy link

Using controller gyroscope capabilities for PrimeHack's camera (without an external program) is possible only through Dolphin's input expression system. This method however has the following drawbacks:

  • The sensitivity values meant for the camera control stick are applied to gyro movements as well. A weighted sum would solve this but is an additional burden on the user (and makes fine-tuning annoying by having to edit four input slots).
  • Stick output values are clamped to [-1,1] while gyro values are unbounded, meaning that users have to set their maximum comfortable rotation speed as a baseline for relative calculations. This is rather cumbersome and needlessly complicated.
  • Stick output values are calibrated and reshaped by factoring in their euclidian norm. This
    • makes no sense mathematically for gyro values and
    • also reshapes the user's physical motions with potential movement artifacts, depending on the calibration shape.
  • Only a single deadzone setting would be set for both stick and gyro movements, despite their differing ranges for ignoring inputs.

This feature branch proposes to add a new input group, which can be used in conjunction with the camera stick while in "Controller Mode", and is configurable from each of the PrimeHack-controller settings windows. This group makes use of Dolphin's pre-existing IMUGyroscope class, requiring no custom logic for dealing with this type of input. The group is extended with three additional properties:

  • Horizontal Sensitivity setting - direct scaling factor for yaw rotations
  • Vertical Sensitivity setting - direct scaling factor for pitch rotations
  • Activate input slot - definable button that, while held, activates gyro camera control

The group can also be disabled or enabled in its entirety through a new setting in the camera stick's control group.

Note:
For better clarification, the PrimeHack camera stick control group has been internally renamed from Camera Control to PrimeHack CameraStick, as it is now paired with PrimeHack CameraGyro. Switching from the current PrimeHack version, users would have to reconfigure their stick settings or update the existing INI file to import previous stick settings.

Further Note:
While the set of changed files for this feature is kept minimal, most files that are affected where also touched upon with minor fixes and refactors disjointed from the feature (e.g. use of the i18n _trans macro for a variable). In particular, almost every PrimeHack interface in GCPad.h and Wiimote.h now takes in the controller port number as a parameter, so as to be more consistent with the remaining baseline Dolphin code. The UI code has also become observably more concise because of this. Should these disjointed changes impede the decision to merge this branch, a new branch with only feature-related changes can be made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant