Page 1 of 1

StaticMesh drawing with BepuPhysicsDrawer

Posted: Fri Jul 08, 2011 8:50 pm
by NetSavant
Just had a thought - I use the BepuPhysicsDrawer a fair bit for debugging physics collision volumes, and noticed StaticMesh / triangle mesh stuff isn't in the drawer's lexicon - would be cool to have that, to not have to set up separate drawing for those. Maybe I'll take a stab at coding that up if I get some time...

Re: StaticMesh drawing with BepuPhysicsDrawer

Posted: Fri Jul 08, 2011 9:05 pm
by Norbo
It actually does support meshes, but StaticMesh in particular has a weird approach. The ModelDrawer can use the TriangleMesh type to draw. So instead of doing ModelDrawer.Add(staticMesh), you can do ModelDrawer.Add(staticMesh.Mesh). Other classes like the InstancedMesh/MobileMesh have explicit cases.

I've occasionally thought about adding the direct StaticMesh case, but never got around to it- it is really simple, so I guess I'll toss it in while I still remember :)

Re: StaticMesh drawing with BepuPhysicsDrawer

Posted: Fri Jul 08, 2011 9:18 pm
by Norbo
The development version now has a case for the StaticMesh: http://bepuphysics.codeplex.com/SourceC ... evelopment

Re: StaticMesh drawing with BepuPhysicsDrawer

Posted: Fri Jul 08, 2011 10:58 pm
by NetSavant
Aha - thanks Norbo, adding the .Mesh property did the trick. I figured some form of that drawing logic was already in there, as ConvexHull's always rendered fine.