8000 feat: add click events to scene · Issue #16 · toddeTV/zlig · GitHub
[go: up one dir, main page]

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

feat: add click events to scene #16

Closed
4 tasks done
toddeTV opened this issue Jul 8, 2024 · 3 comments · Fixed by #28
Closed
4 tasks done

feat: add click events to scene #16

toddeTV opened this issue Jul 8, 2024 · 3 comments · Fixed by #28
Assignees

Comments

@toddeTV
Copy link
Owner
toddeTV commented Jul 8, 2024
  • click on a model will trigger a function
  • cache the clicked model so that it has a "selected" state for later operations
  • deselecting models should also be possible by clicking on another model or even the background to deselect everything
  • type the event https://docs.tresjs.org/api/events
@toddeTV toddeTV self-assigned this Jul 8, 2024
@fehnomenal
Copy link
Collaborator
fehnomenal commented Jul 16, 2024

Got a bit of progress. It seems to be a ThreeEvent<DomEvent>. From your properties only the ALT_MASK is missing.

In the browser console Event.ALT_MASK works but apparently this is missing from the typescript types...

See #27

@toddeTV
Copy link
Owner Author
toddeTV commented Jul 23, 2024

Got a bit of progress. It seems to be a ThreeEvent<DomEvent>. From your properties only the ALT_MASK is missing.

In the browser console Event.ALT_MASK works but apparently this is missing from the typescript types...

Thanks a lot 😊
For now, I will stick to the typing you suggested. It's not ideal as we do not know what else might be missing in the typing, but it's good enough for now.

import { type DomEvent, type ThreeEvent } from '@tresjs/core'
function onNodeClick(event: ThreeEvent<DomEvent>&Event){ ... }

@toddeTV
Copy link
Owner Author
toddeTV commented Jul 23, 2024

With the TresJS core v4, the Outline Post-Processing is not working.
All we currently can do is going back to TresJS core v3.9.0 and use the Outline effect with this old version.
So this task will now only focus on the logic for clicking and what then will happen - but not the oufline effect when selected and also not the outline effect on hover, therefore issue #32 was created.

I already created part of the needed code for the highlighting. Please do not delete it and let it commented out in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0