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

Customized cameras and physics backtracking #114

Closed
terrac opened this issue May 29, 2020 · 2 comments
Closed

Customized cameras and physics backtracking #114

terrac opened this issue May 29, 2020 · 2 comments

Comments

@terrac
Copy link
Contributor

terrac commented May 29, 2020

I'm getting a small amount of shakiness when I implement a custom camera

I'm overriding the function at g.camera.updateBeforeEntityRenderSystems
and using
g.ents.setPosition(g.camera.cameraTarget,cameraPos)

I'm thinking that somehow this and physics backtracking don't match. I'm wondering if there is anything obvious I am doing wrong

Thanks

@fenomas
Copy link
Owner

fenomas commented May 29, 2020

Hi, yes that definitely sounds like temporal aliasing due to the physics backtracking not lining up with the camera's motion. If you drive your camera by having it tied to a physics entity (which you move around with forces and impulses), I'd guess that should fix it. But if you want to move the camera arbitrarily by some other logic, you'll need to do your own backtracking similar to this.

@terrac
Copy link
Contributor Author

terrac commented Jun 2, 2020

Attaching a physics entity worked pretty well.

@terrac terrac closed this as completed Jun 2, 2020
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

No branches or pull requests

2 participants