CSceneManager::isCulled(ISceneNode* node) takes a scene node and returns whether it is culled from the viewpoint of the current active camera.
I think a lot of people would find a use for this, especially for custom scene nodes where certain functions need only be performed if the scene node is actually visible. (In OnAnimate for example, which the scene manager calls whether the scene node is visible or not), and more importantly in cases where the user needs to manually "render()" a scene node, it would be useful to check if they are culled or not first before drawing them.
Please note that checking if a scene node is visible or not via ISceneNode::isVisible or the IsVisible member variable (For custom scene nodes) is completely unrelated to this change, as IsVisible only corresponds to whether the scene node has been set visible/not visible via setVisible, and would return true or false regardless of whether the scene node is actually on screen.
Anyway the purpose of all that jabber is to lead down to my proposal of exposing CSceneManager::isCulled to ISceneManager::isCulled. You pass it a scene node, it returns true or false, you draw it or don't draw it, nobody is hurt, nobody is injured.
I'm also considering changing the function signature to isCulled(ISceneNode* node, ICameraSceneNode* camera = 0), if camera is 0, it would simply use the active camera as usual, so no changes to the existing code base would be necessary, but you also get a more useful function incase you want to check against a camera other than the active camera.
I'm not going to run a poll because I don't think that anyone would really oppose such a functional and non-intrusive change. Think of this as more of a notice or something.
Cheers,
BlindSide
Proposed Irrlicht Change - Exposing CSceneManager::isCulled
Proposed Irrlicht Change - Exposing CSceneManager::isCulled
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
FuzzYspo0N
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact: