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

Teleport Player if Out of Bounds in games_fps #22877

Merged
merged 4 commits into from Nov 25, 2021
Merged

Teleport Player if Out of Bounds in games_fps #22877

merged 4 commits into from Nov 25, 2021

Conversation

ghost
Copy link

@ghost ghost commented Nov 24, 2021

Description

Hello, this PR affects examples/games_fps.html. If the player jumps out of bounds (which is possible with jump velocity of 15), then the player capsule and player camera will be teleported back to their original vectors.

Please let me know if there's anything else I can add :)

EDIT: Adding a Githack link: https://rawcdn.githack.com/Uueuuuuu/three.js/8ee5d09c58ef88c2a95d18ad6800ce8c966fa8ef/examples/games_fps.html

EDIT no.2 : Should I not hardcode the vectors on line 427 and 428? They are referenced from the original on line 102.

@ghost ghost mentioned this pull request Nov 24, 2021
examples/games_fps.html Outdated Show resolved Hide resolved
@mrdoob mrdoob added this to the r136 milestone Nov 24, 2021
@mrdoob
Copy link
Owner

mrdoob commented Nov 24, 2021

Could you reset the orientation too?

@ghost
Copy link
Author

ghost commented Nov 24, 2021

@mrdoob Sure thing, I will do this shortly.

@mrdoob mrdoob modified the milestones: r136, r135 Nov 24, 2021
@ghost
Copy link
Author

ghost commented Nov 24, 2021

@mrdoob I've tested the code I just pushed and confirmed that these values are the correct ones. The view is familiar :)

camera.rotation.set( 0, 0, 0 );

@mrdoob mrdoob merged commit e26fd3b into mrdoob:dev Nov 25, 2021
@mrdoob
Copy link
Owner

mrdoob commented Nov 25, 2021

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