jjfreedman / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

Add DBG flag to enable/disable normals drawn by DebugDrawer #559

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Small enhancement:

Add a DBG_DrawNormals as debug mode.

Currently the normals are simply drawn for each triangle in a wireframe.
For complex high-triangle models this results in a... fuzzball (for lack of 
better wording).

Adding the extra flag would allow users to turn the normals on or off on a 
global level.

Normal drawing located @ btCollisionWorld.cpp in the processTriangle, inside 
the DebugDrawcallback.

Original issue reported on code.google.com by dennis.c...@gmail.com on 18 Oct 2011 at 2:25

GoogleCodeExporter commented 8 years ago
This is a good point, I'll try to add it for next release.

Original comment by erwin.coumans on 18 Oct 2011 at 3:29

GoogleCodeExporter commented 8 years ago
As an alternative (though Bullet is not a graphisc lib), would it be an idea to 
allow the user to easily modify the lenght of the normal? This would still 
allow for normals to be shown in a non-obscuring fashion, instead of removing 
them completely.

Original comment by dennis.c...@gmail.com on 19 Oct 2011 at 3:07

GoogleCodeExporter commented 8 years ago
How about you creating a simple patch and submit it as a proposal? Bullet is 
open source and it should be fairly easy to fix this.

Thanks!

Original comment by erwin.coumans on 20 Oct 2011 at 5:48

GoogleCodeExporter commented 8 years ago
DBG_DrawNormals_switch.patch : 

Adds a DBG_DrawNormals option, works fine for the boxes you shoot and the 
planes etc.
however the demos don't seem to work properly with them yet, so I made two 
patches.
This first is just the core system addition.

DBG_Normals_partial_demo_fix.patch:
"Partial" demo fix. Includes addition of a Draw Normals checkbox in the 
AllBulletDemos, which only works when wireframe mode (intended) and constraints 
(not intended.. ?) are checked as well.

As well the addition of the option in the openGl DemoApplication, 'N' = normals.
Some objects don't show normals at all, but this was already the case for most 
objects.

Original comment by dennis.c...@gmail.com on 21 Oct 2011 at 12:27

Attachments:

GoogleCodeExporter commented 8 years ago
This patch adds drawing of AABB's of child-shapes in a compound shape to 
btCollisionWorld::debugDrawWorld()

Current color is set to green, which might be used by other types of 
debugdrawing, but was just convenient for me.

Original comment by dennis.c...@gmail.com on 5 Dec 2011 at 2:11

Attachments:

GoogleCodeExporter commented 8 years ago
The patches have been applied, except for the compound shape drawing (it is not 
working properly, check the ForkliftDemo. In addition, compounds need to be 
drawn recursively)

http://code.google.com/p/bullet/source/detail?r=2500

Thanks for the help!
Erwin

Original comment by erwin.coumans on 29 Feb 2012 at 4:16