Page 1 of 1

Visualize Collision Shapes

Posted: Tue Jan 13, 2015 10:22 pm
by x3n
In the past few days I've added a new feature to visualize collision shapes (and potentially also other entities of bullet, our physics engine). This feature can be turned on and off with a console command:

Code: Select all

debugDrawPhysics <bool> [bool=true] [float=0.5]
Param 1: [bool] true = enable visualization, false = disable visualization
Param 2: [bool] true = fill the volumes, false = draw wireframe (optional, default is true)
Param 3: [float] the transparency of the filling (if param 2 is true) with 0 = invisible and 1 = solid (optional, default is 0.5)

Examples:

Code: Select all

debugDrawPhysics true # enable visualization
debugDrawPhysics true false # enable visualization with wireframe
debugDrawPhysics true true 0.95 # enable visualization with almost solid filled volumes
Please note that bullet supports round collision shapes, but ogre of course cannot render completely round surfaces. So the visualization of round shapes is only approximately correct (this is especially noticeable with spheres).

The performance is rather bad, so you better don't use this in a level with lots of objects.

And this is how it looks:
collision_shapes.png
collision_shapes.png (158.55 KiB) Viewed 18106 times

Re: Visualize Collision Shapes

Posted: Fri Jan 16, 2015 4:23 pm
by beni
Wow, this is really cool :D