Is there any way in bullet that allows me to get triangle indices in a triangle mesh contained in a given rectangular box? If not, how can I modify the source to do so.
Thank you in advance.
triangles in a rectangular box
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: triangles in a rectangular box
Yes, you can implement your triangle callback (derived from btTriangleCallback), and call the triangle mesh processAllTriangles. For each triangle that overlaps your box (aabbMin/aabbMax) a callback to processTriangle is performed:
See Bullet/Demos/OpenGL/GL_ShapeDrawer.cpp for an example how to use
Thanks,
Erwin
Code: Select all
virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex)
Thanks,
Erwin