Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Samples] Misc camera controller fixes #359

Merged
merged 3 commits into from Feb 4, 2019
Merged

Conversation

@Eideren
Copy link
Collaborator

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

This comment has been minimized.

Copy link
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

This comment has been minimized.

Copy link
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 Feb 4, 2019
@xen2 xen2 removed their assignment Feb 4, 2019
@xen2

This comment has been minimized.

Copy link
Member

xen2 commented Feb 4, 2019

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

@xen2

This comment has been minimized.

Copy link
Member

xen2 commented Feb 4, 2019

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

@xen2 xen2 merged commit 8b24b27 into xenko3d:master Feb 4, 2019
2 checks passed
2 checks passed
WIP Legacy commit status override — see details
Details
license/cla Contributor License Agreement is signed.
Details
@xen2

This comment has been minimized.

Copy link
Member

xen2 commented Feb 4, 2019

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

@xen2

This comment has been minimized.

Copy link
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

This comment has been minimized.

Copy link
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

This comment has been minimized.

Copy link
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
Projects
None yet
2 participants
You can’t perform that action at this time.