Page 1 of 1
How do I create a body from multiple convex shapes*?
Posted: Thu Mar 31, 2011 11:48 am
by JabberWorx
I'm trying to figure out how I can create a body from several parts ofa mesh which I want to combine together, each part is convex and I was wondering if I added a bunch of convex shapes to the same body if it would be treated concave with some degree of accuracy.
With boxes and such I just do a new BoxShape(), however the ConvexShape() constructor is protected so I can't access it. So how am I supposed to create ConvexShapes?
Thanks for any help!
Re: How do I create a body from multiple convex shapes*?
Posted: Thu Mar 31, 2011 3:32 pm
by Norbo
each part is convex and I was wondering if I added a bunch of convex shapes to the same body if it would be treated concave with some degree of accuracy
A CompoundShape will act concave when it has multiple convexes in it, yes. You can use the prefab entity type CompoundBody to simplify the construction process. Check out the CompoundBodiesDemo for an example of how to set up the elements.
With boxes and such I just do a new BoxShape(), however the ConvexShape() constructor is protected so I can't access it. So how am I supposed to create ConvexShapes?
I think you might be looking for the ConvexHullShape. ConvexShape is the superclass of all convex shapes, including BoxShape and ConvexHullShape.
Re: How do I create a body from multiple convex shapes*?
Posted: Fri Apr 01, 2011 10:13 am
by JabberWorx
Norbo wrote:each part is convex and I was wondering if I added a bunch of convex shapes to the same body if it would be treated concave with some degree of accuracy
A CompoundShape will act concave when it has multiple convexes in it, yes. You can use the prefab entity type CompoundBody to simplify the construction process. Check out the CompoundBodiesDemo for an example of how to set up the elements.
With boxes and such I just do a new BoxShape(), however the ConvexShape() constructor is protected so I can't access it. So how am I supposed to create ConvexShapes?
I think you might be looking for the ConvexHullShape. ConvexShape is the superclass of all convex shapes, including BoxShape and ConvexHullShape.
Oh ok, awesome! I'll look into all of that then
As an aside is there any thorough documentaiton on Bepu?
Re: How do I create a body from multiple convex shapes*?
Posted: Fri Apr 01, 2011 4:26 pm
by Norbo
Apart from the demos that come with the source, there's this documentation:
http://bepuphysics.codeplex.com/documentation