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 » Fri Jul 08, 2011 8:50 pm

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: 4558
Joined: Tue Jul 04, 2006 4:45 am

Re: StaticMesh drawing with BepuPhysicsDrawer

Post by Norbo » Fri Jul 08, 2011 9:05 pm

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: 4558
Joined: Tue Jul 04, 2006 4:45 am

Re: StaticMesh drawing with BepuPhysicsDrawer

Post by Norbo » Fri Jul 08, 2011 9:18 pm

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 » Fri Jul 08, 2011 10:58 pm

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

Who is online

Users browsing this forum: No registered users and 1 guest