Is Billboard in Scene?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
tomhancocks
Posts: 15
Joined: Fri Jan 02, 2009 1:25 pm
Location: Around
Contact:

Is Billboard in Scene?

Post by tomhancocks »

Is there a way built in to irrlicht to determine if a billboard object is visible to the player? (I.e on screne/in scene), or does it require some custom functionality?
CuteAlien
Admin
Posts: 9721
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

I think you will have to code a little to get that.

You can find out what is visible in the scene by checking the view frustum. You get that from your active camera with SViewFrustum * frustum = camera->getViewFrustum ();

For a first check you might compare the boundingboxes of frustum and scenenode - if you only need a fast test to ignore nodes that might be already good enough. Otherwise I think you will have to work your way through the math.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
tomhancocks
Posts: 15
Joined: Fri Jan 02, 2009 1:25 pm
Location: Around
Contact:

Post by tomhancocks »

Hmm, that shouldn't be much of a problem. I just didn't want to start doing something only to find I had reinvented the wheel :lol:
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Maybe it would be wise to give access to the culling method. That way one could check for visibility just as the scene manager does. Another alternative would be a visibility map which can be queried after the render loop.. That's much more expensive, though.
Post Reply