Skip to content

[Samples] Misc camera controller fixes#359

Merged
xen2 merged 3 commits into
stride3d:masterfrom
Eideren:basecam_fix
Feb 4, 2019
Merged

[Samples] Misc camera controller fixes#359
xen2 merged 3 commits into
stride3d:masterfrom
Eideren:basecam_fix

Conversation

@Eideren
Copy link
Copy Markdown
Collaborator

@Eideren Eideren commented Jan 31, 2019

PR Details

Fix BasicCameraController's mouse input, implements gamepad support, explain in detail common pitfalls of camera controller programming and fixes single frame lag on FPS sample's PlayerInput.

Description

Redondant.

Related Issue

None logged on Github.

Motivation and Context

This mostly stemmed from this Discord discussion I had a couple of weeks ago, creating this PR to fix the issue mentioned lower and clarify controller programming. This camera might very well be the first camera that users interact with, knowing that we might as well document thoroughly how it works and what users should do when modifying or creating one.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Notes

  • There still is at least one frame of lag somewhere else inside the engine, it is fairly visible when binding mouse input to a camera and looking at the OS cursor moving a fair amount of time before the in game camera does.
  • I thought about modifying the first person camera to clarify it as well but that one's such a mess that I might as well rewrite it altogether.

@Eideren Eideren changed the title [Samples] Misc camera controller fixes WIP:[Samples] Misc camera controller fixes Feb 2, 2019
@Eideren
Copy link
Copy Markdown
Collaborator Author

Eideren commented Feb 2, 2019

Changed to WIP: working on fixing the editor camera.

@Eideren Eideren changed the title WIP:[Samples] Misc camera controller fixes [Samples] Misc camera controller fixes Feb 2, 2019
@Eideren
Copy link
Copy Markdown
Collaborator Author

Eideren commented Feb 2, 2019

PR ready for review

@xen2 xen2 self-assigned this Feb 4, 2019
@xen2 xen2 self-requested a review February 4, 2019 06:13
@xen2 xen2 removed their assignment Feb 4, 2019
@xen2
Copy link
Copy Markdown
Member

xen2 commented Feb 4, 2019

Thanks! Tested in editor/new game, it seems to be much better than before.

@xen2
Copy link
Copy Markdown
Member

xen2 commented Feb 4, 2019

Merging, thanks for the great work and well commented code!

@xen2 xen2 merged commit 8b24b27 into stride3d:master Feb 4, 2019
@xen2
Copy link
Copy Markdown
Member

xen2 commented Feb 4, 2019

Note: will cherry-pick this if we release a 3.0.0.8

@xen2
Copy link
Copy Markdown
Member

xen2 commented Feb 4, 2019

@Eideren
Except FPS sample, do you know if other samples will need a camera system rewrite?
(No need to fix this right away, it's more to create proper issues)

@Eideren
Copy link
Copy Markdown
Collaborator Author

Eideren commented Feb 4, 2019

@xen2 Well, the third person camera and orbit as well, so all of them sadly.

  • Orbit is fairly straightforward so at least users shouldn't have too much trouble modifying it but the operations it does considers frame rate to stay at a constant 60 while decelerating the camera.
  • Third person is the same as first, doesn't filter between offset and direction based inputs, uses fixed delta time instead of frame outside of physics loop and doesn't use delta time when necessary.
    Do you want me to create an issue about those ?

@xen2
Copy link
Copy Markdown
Member

xen2 commented Feb 4, 2019

@Eideren sure, feel free to create a new issue if you don't mind, thanks.

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.

2 participants