A question about the world and object bounds

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Danthekilla
Posts: 136
Joined: Sun Jan 17, 2010 11:35 am

A question about the world and object bounds

Post 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...
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: A question about the world and object bounds

Post 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 :)
Danthekilla
Posts: 136
Joined: Sun Jan 17, 2010 11:35 am

Re: A question about the world and object bounds

Post 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.
Post Reply