Proposed Irrlicht Change - Exposing CSceneManager::isCulled

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Proposed Irrlicht Change - Exposing CSceneManager::isCulled

Post by BlindSide »

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
ShadowMapping for Irrlicht!: Get it here
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:

Post by FuzzYspo0N »

Yes please, thats a great feature actually.
Mel
Competition winner
Posts: 2293
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

I was thinking something similar, but not exactly if a scene node was culled, simply, if there was any way to perform an occlusion query in Irrlicht, or how could it be used.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply