StaticMesh drawing with BepuPhysicsDrawer

Post and discuss features you'd like to see in the BEPUphysics library.
Post Reply
NetSavant
Posts: 28
Joined: Wed Apr 20, 2011 10:50 pm

StaticMesh drawing with BepuPhysicsDrawer

Post 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...
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: StaticMesh drawing with BepuPhysicsDrawer

Post 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 :)
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: StaticMesh drawing with BepuPhysicsDrawer

Post by Norbo »

The development version now has a case for the StaticMesh: http://bepuphysics.codeplex.com/SourceC ... evelopment
NetSavant
Posts: 28
Joined: Wed Apr 20, 2011 10:50 pm

Re: StaticMesh drawing with BepuPhysicsDrawer

Post 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.
Post Reply