Subject says it all.
Thanks!
How do I get all the objects within a bounding box?
-
- Posts: 4
- Joined: Sun Oct 21, 2007 11:53 am
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: How do I get all the objects within a bounding box?
That is not easy at the moment. I'll add a helper method to the broadphase for this.ET3D wrote:Subject says it all.
Thanks!
Thanks,
Erwin
-
- Posts: 66
- Joined: Fri Oct 12, 2007 6:28 pm
- Location: San Diego
Re: How do I get all the objects within a bounding box?
Hopefully you can do helpers for other bounding volumes besides box.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: How do I get all the objects within a bounding box?
It will only report objects that have axis aligned bounding box (AABB) overlap.
The broadphase only deals with AABBs, this is extremely efficient.
If you need more precise bounding volume, you will need to take the resulting pairs from the broadphase query, and do more culling yourself, using one of the existing narrowphase queries. We can add some wrappers for this functionality.
Thanks,
Erwin
The broadphase only deals with AABBs, this is extremely efficient.
If you need more precise bounding volume, you will need to take the resulting pairs from the broadphase query, and do more culling yourself, using one of the existing narrowphase queries. We can add some wrappers for this functionality.
Thanks,
Erwin
-
- Posts: 66
- Joined: Fri Oct 12, 2007 6:28 pm
- Location: San Diego
Re: How do I get all the objects within a bounding box?
I'm just starting to delve into this stuff and I'm not familiar with everything, so I apologize for asking for something that didn't really make sense in the system. In a couple weeks I'll be much more familiar with it as I work on integrating collision into our project.
Anyway, I know that one thing I we want to be able to do is query for all objects that are inside or touching a given sphere and/or capsule.
Anyway, I know that one thing I we want to be able to do is query for all objects that are inside or touching a given sphere and/or capsule.
-
- Posts: 95
- Joined: Fri Mar 31, 2006 7:13 pm
Re: How do I get all the objects within a bounding box?
So actually you need some kind of Volume sensor that detect all bodies inside convex volume?
I think this would be great if Bullet will get Sensor support.
Volume Sensor, Ray Sensor.
One question is how to get firs object from Bullet word that will be intersected by the ray ???
I think this would be great if Bullet will get Sensor support.
Volume Sensor, Ray Sensor.
One question is how to get firs object from Bullet word that will be intersected by the ray ???
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: How do I get all the objects within a bounding box?
Yes, this will be added for Bullet 2.64. Ageia calls this Sensor, Havok calls this Phantom, Bullet calls it querySingleObject.
You can see the picking code in Bullet/Demos/OpenGL/DemoApplication.cpp, or the Raytracer demo how to use the raytest.
Thanks,
Erwin
You can use world->rayTest, see Bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h. Note that btDynamicsWorld is derived from btCollisionWorld, so you can just use your dynamics world to perform the rayTest:One question is how to get firs object from Bullet word that will be intersected by the ray ???
Code: Select all
/// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback
/// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.
void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback, short int collisionFilterMask=-1);
Thanks,
Erwin
-
- Posts: 66
- Joined: Fri Oct 12, 2007 6:28 pm
- Location: San Diego
Re: How do I get all the objects within a bounding box?
Did this ever get put in?
I'm having issues with querySingleObject not returning any results if the start and end points are the same (or very near each other).
I'm having issues with querySingleObject not returning any results if the start and end points are the same (or very near each other).