Visualize Collision Shapes

Contribute models, textures, concepts and sounds here.

Moderator: PPS-Leaders

Post Reply
User avatar
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm

Visualize Collision Shapes

Post by x3n » Tue Jan 13, 2015 10:22 pm

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)


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 (158.55 KiB) Viewed 11943 times
Fabian 'x3n' Landau, Orxonox developer

User avatar
Baron Vladimir Harkonnen
Posts: 949
Joined: Tue Oct 03, 2006 9:15 am
Location: Zurich

Re: Visualize Collision Shapes

Post by beni » Fri Jan 16, 2015 4:23 pm

Wow, this is really cool :D
"I'm Commander Shepard and this is my favorite forum on the internet."

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest