View Frustrum

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Kortyburns
Posts: 20
Joined: Wed Sep 10, 2003 12:31 pm
Location: FRANCE

View Frustrum

Post by Kortyburns »

Hi, :P

I'm looking for a way to know if a bounding box is inside the camera view frustrum.
I've seen in the doc that there's the SViewFrustrum class, but, i don't think i must use it because on each frame irrlicht ALREADY calculates if the bounding box is inside the ViewFrustrum.

Does anyone has a suggestion ? Am i wrong ? What should i do ?

Thanks in advance. :D
Guest

Post by Guest »

Hi,
just do the following:

ICameraSceneNode* camera=SceneManager->getActiveCamera();
const SViewFrustrum* vfr=camera->getViewFrustrum();
if(vfr->getBoundingBox().intersectsWithBox(theBox)){
// do some usefull things
}

this gets the current camera, and checks the viewfrustrums bounding box against your box, I'm not shure if there is also a method which checks if
the box is completely inside? but this should get you startet anyway.
Post Reply