I've got a sphere and a triangle mesh.
When the sphere hits the triangle mesh, I want to obtain a list of the triangles that were hit. Is this possible? Do I do this in a custom narrowphase callback? If so, how? I already have the narrowphase callback working, I just need to know how to get the triangles.
List of hit triangles
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: List of hit triangles
It would be great if bullet could provide/generate a list of clipped triangles for a convex cast. In this way geometric decals could be generated with Bullet.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: List of hit triangles
You can use the btConcaveShape::processAllTriangles method, and pass in a triangle callback and a axis aligned bounding box (AABB). The triangle callback will be called for each triangle of the mesh that has AABB overlap.Spaddlewit wrote:I've got a sphere and a triangle mesh.
When the sphere hits the triangle mesh, I want to obtain a list of the triangles that were hit. Is this possible?
Hope this helps,
Erwin
Good idea. Please file a feature request in the issue tracker, before it gets lost deep in the forum.It would be great if bullet could provide/generate a list of clipped triangles for a convex cast. In this way geometric decals could be generated with Bullet.
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: List of hit triangles
Hi Erwin,
feature request has been added:
http://code.google.com/p/bullet/issues/detail?id=272
Thanks for taking care!
feature request has been added:
http://code.google.com/p/bullet/issues/detail?id=272
Thanks for taking care!