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
processLineOfSight enhancement #2610
Comments
As mentioned on Discord, this already has a pending PR -> #2032 However yes, an additional argument to supply the elements to check, rather than ignore, would be reasonable. Supplying this argument should cause the |
Hello! |
Which PR are you referring to? He's asking for the opposite feature. Not sure why this has been closed?
|
Yes, you are right, excuse me. |
Okay. |
You could do it currently using Probably the best way to do this on the Lua side would be to keep track of streamed-in elements in a table, then you would have a function to return a copy of that table excluding provided element(s) i.e processLineOfSight(0, 0, 0, 100, 100, 100, ..., getAllElementsExcept(elementToCheck), false)
^ ignoredElements arg If there's a lot of streamed-in elements and you're doing this every frame it could be quite a big hit (you're looping the streamed-in table to remove the provided elements) - plus constantly sending a ton of data from Lua -> C++ Doing this on the C++ side might be more reasonable, would need to try it out. It's basically the inverse functionality of #2032 |
The most common way to hide some of the objects from a raycaster is to use flags(or masks). You can mark objects with setElementViewMask(element, 0xFF00FF) and then processLineOfSight(..., 0xFF00FF) to process only the specified objects or processLineOfSight(..., 0x00FF00) to process all the rest. Fast, powerful, easy-to-use. |
Is your feature request related to a problem? Please describe.
It's not possible to pass multiple values to ignored element
Also, it's not possible to process line that hits only given elements
Describe the solution you'd like
Allow multiple elements for ignoredElements as table
Add new optional argument validElements that accepts element or table
Make processLineOfSight accept table with options (more in additional context)
Describe alternatives you've considered
No response
Additional context
Security Policy
The text was updated successfully, but these errors were encountered: