-
Notifications
You must be signed in to change notification settings - Fork 73
Pointerlocks #37
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
base: main
Are you sure you want to change the base?
Pointerlocks #37
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/svelte/svelte-cubed/3AcXAtpURvg1qvKVPtQKRAexU8QW |
I just took a screenshot of the example and added it to |
Thank you for the hint. I added an image the way you described it. Do I have to recreate the pull request or is it fine this way? |
Nope, the vercel link will redeploy the branch any time you make a commit to this branch. You can check it out by clicking the preview! |
root.invalidate(); | ||
}); | ||
|
||
canvas.addEventListener('click', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove all event listeners onDestroy https://svelte.dev/docs#onDestroy and also reset camera properties if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it's not necessary, because the event listenders should get removed automatically as soon as the component is unmounted, because the object, on which the event listenters have been added to, doesn't exist any more.
If they really stay there I totally agree, that they should be removed.
In what case would you reset the camera properties? Either I am too sleepy or I haven't changed any camera properties in the current pull request?
If you add
I am happy for any other suggestions :) |
This is my first pull request ever, so sorry if I did something wrong here.
I created a basic implementation of the
PointerLockControls
and a corresponding example. It's not exciting, but it works.If time permits I will try to add a function which translates pressed keys to movement of the camera (eg. arrow keys), like in this example
I wasn't sure how to create a proper image for the example, would be happy to be enlightened :D