bullet for camera culling?

khoowaikeong
Posts: 43
Joined: Fri Jun 15, 2012 7:11 am

bullet for camera culling?

Post by khoowaikeong »

just a thought, if I stick a collision shape that mirrors the camera clip planes, would that return me all the object that is within the camera space? then i can just discard the rest of the object from rendering.
:lol:

the only problem is bullet doesn't organise the collided object, so i have to find the group of object that is hitting the camera and not something else... correct?
:?
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: bullet for camera culling?

Post by Flix »

Already widely discussed (here for example: http://bulletphysics.org/Bullet/phpBB3/ ... um+culling) and implemented (using either the ghost object approach and the btDbvtBroadphase approach: you can find the source code available in some links from the url I've just posted).

Additionally, I've inglobed btDbvtBroadphase frustum culling in a project that is freely available here (http://bulletphysics.org/Bullet/phpBB3/ ... =17&t=7159). The included source code can (rather easily) be used as an extension of the Bullet openGLsupport library, if you can use STL and can modify the code of the demos a bit to make it compatible with it.
P.S. Although to compile the project you need the HACD SVN version, to use it as a replacement of the Bullet openGLsupport library, you don't need it (there's a folder named OpenGLEx inside the zip package: it extends (and depends on) the "official" libOpenGLsupport).