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: support ray-casting #30

Open
Gugustinette opened this issue Oct 24, 2024 · 0 comments
Open

feat: support ray-casting #30

Gugustinette opened this issue Oct 24, 2024 · 0 comments

Comments

@Gugustinette
Copy link
Contributor

Gugustinette commented Oct 24, 2024

Ray-casting

Raw ray-casting that tells which components collided with the ray.

  • casting a ray from Point A to Point B
  • casting a ray straight from a given mouse click ?
  • casting a certain amount of rays within a given angle ?

Support both Rapier and Three.js ray-casting ?

https://rapier.rs/docs/user_guides/javascript/scene_queries/#ray-casting
https://threejs.org/docs/#api/en/core/Raycaster
https://threejs.org/manual/#en/picking

Add event handlers on components

We should be able to add events on components directly as below :

const cube = new FCube()
cube.onClick(() => {
  ...
})

This will probably require to cast rays on user click, so it should be explicitly activated (off by default) with something like :

new FScene({
  autoRayCasting: true
})
@Gugustinette Gugustinette converted this from a draft issue Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant