DebugDrawer, only draw certain meshes?

GavinL
Posts: 5
Joined: Fri Oct 14, 2011 11:23 pm

DebugDrawer, only draw certain meshes?

Post by GavinL »

Hello,

Is there a way to set Bullet's debug drawer to only draw certain meshes? I have a terrain object that uses a height field collision shape, but the mesh is very fine, so the drawer ends up drawing millions of triangles and then lags my entire application. I only want the drawer to draw my small rigid bodies that are moving around a lot. I tried doing a search but I couldn't find anything useful.

Any assistance would be appreciated.

Thanks,
Gavin
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: DebugDrawer, only draw certain meshes?

Post by Flix »

GavinL wrote:I have a terrain object that uses a height field collision shape, but the mesh is very fine, so the drawer ends up drawing millions of triangles and then lags my entire application.
You may try:

Code: Select all

terrainBody->setCollisionFlags(terrainBody->getCollisionFlags()|CF_DISABLE_VISUALIZE_OBJECT);	// Disable debug drawing
GavinL
Posts: 5
Joined: Fri Oct 14, 2011 11:23 pm

Re: DebugDrawer, only draw certain meshes?

Post by GavinL »

Ah thanks :) works like a charm!
Karrok
Posts: 65
Joined: Fri May 13, 2011 1:11 pm

Re: DebugDrawer, only draw certain meshes?

Post by Karrok »

alternatively, if you are bothered by the normals but want to keep the wireframe try the 1st patch in:

http://code.google.com/p/bullet/issues/ ... 9&sort=-id

/selfpromotion ;P

edit: the 3rd patch also shows bounding boxes for child-shapes in compound shapes, neat for both debugging and debug-drawing :)