Page 1 of 1

A question about the world and object bounds

Posted: Mon Dec 13, 2010 8:09 am
by Danthekilla
Hey norbo I am wondering what the best way would be to get the space that all objects are contained in but with a large margin...

So something like a hull surounding all of the bounding boxes put together with a margin of like 10 or something...

Basicly i want to be able to have a fast way to check wether a light is near any physics objects in the engine...

Any ideas?

Give me a yell if i didnt explain it well enough, it is a pretty bad explination...

Re: A question about the world and object bounds

Posted: Mon Dec 13, 2010 4:07 pm
by Norbo
A GetEntities broadphase query with a BoundingSphere representing the light's volume could do the trick.

It's basically equivalent to checking if the light's position is contained within a margin-expanded area of physics objects, except a lot easier to manage :)

Re: A question about the world and object bounds

Posted: Tue Dec 14, 2010 3:19 am
by Danthekilla
Works great :)

I was also suprised with the performance... Doing 64,000,000 checks against my entire (large) world takes only 4 seconds and reduces the abient occlution render time to less than a tenth of a percent of what it used to take.

Thanks.