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
Add support for AxisAlignedBoxSceneQuery for Light #2355
Comments
that would be the easiest solution. Another interpretation is the light size - i.e. a directional light is infinitely large, while a point light parametrizes a sphere and a spot-light parametrizes a cone. That way the query would also include lights that intersect with the Box, but whose origin is otherwise not inside. Which of these queries are you interested in? |
Currently the first query(position query) is enough for me, i haven't thought of the second case. If you have time to implement second query(volume query), perhaps some cool effects can be achieved, such as querying whether the spot light hits an object, and then applying an effect to the object. But it can't be achieved with AxisAlignedBox, since their volume are spheres and cones, so they maybe could have a LightVolume property for volume query purposes, but it's a bit troublesome. (whisper:I'm an adult, of course I choose both...haha) Thanks! |
this will take more time, as some internal code relies of Lights never being visible. Meanwhile, you could try to use the approach outlined here: |
Yes, the approach of the post is feasible, in addition i can make a small modification in the source code for the purpose, since only the position query is required. Thanks for your help! |
the thing to consider is, when you give lights a bbox, they are included in the scene bbox too. This is then used to e.g. compute the required shadow-map size. However, the bounding sphere of the scene already includes lights (as points), so it is probably safe to do the same with bboxes. |
System Information
Detailled description
I want to query the point light number in a AxisAlignedBox extent, but it not work, because the light.getWorldBoundingBox()(inherited from MovableObject) fuction returns AxisAlignedBox is NULL.
That lead to the query failed:
ogre/OgreMain/include/OgreAxisAlignedBox.h
Line 530 in 05b8dd5
It seems that never compute the extents for Light objects:
ogre/OgreMain/src/OgreLight.cpp
Line 275 in f686bd6
This question post is in here:
https://forums.ogre3d.org/viewtopic.php?f=2&t=96558&sid=0607b0cdeee4a22ff89d85837926b3ea
Thanks a lot!
The text was updated successfully, but these errors were encountered: