What is the best way to handle Raycasts with?

Hi everyone

I was planning to write a Service in Angular that would provide me a Raycaster for the Scene but now I’m wondering about the placement of a Raycaster:

Should there only be one raycaster for the whole application or is it too expensive to create multiple raycasters? Like for multiple scenes a seperate raycaster? I was thinking therefore that I could write the service and just pick up the raycaster to use in my whole application, but I’m afraid that I will ride in to a wall with this approach and now I hope to find some enlightenment on the forums.

Kind Regards

Btw. @Mugen87 Thank you again for translating that Lensflare for me to see how such a file looks like. I really learned a lot with it. A heartful thank you <3

Hello, I think a Raycaster is a lightweight object, so you can have one per scene without worries.

2 Likes

Right thanks a lot :slight_smile: