Page 1 of 1
bean bags
Posted: Fri Jul 08, 2011 10:42 pm
by trying
What would be the best way to simulate a bean bag using Bepu... specifically, if one where to throw a small bean bag against a board as in a game such as bean bag toss?
Re: bean bags
Posted: Fri Jul 08, 2011 11:01 pm
by Norbo
The easiest way would probably be to fake it and just make it a single solid object, like a convex hull. It won't deform because entities are rigid bodies.
Another option is to create a lattice of connections between entities which compose the collidable bulk of the object. In the ClothLattice demo in the BEPUphysicsDemos project (downloadable from the main source section on codeplex), it shows how to make a cloth-like simulation using a bunch of spheres and joints.
A fancier implementation of cloth that supports self collision can be found in the development version, the ClothTestDemo. The development version is downloadable here:
http://bepuphysics.codeplex.com/SourceC ... evelopment
A beanbag has volume, so the above approaches need to be modified to form a 3d lattice instead of just 2d. The complexity of the lattice affects performance a lot, so sticking to the simplest acceptable level is advised- especially on the Xbox or WP7.
Technically, something like FEM deformable solids would produce a theoretically more efficient result. I have some internal prototypes of various kinds of deformation and stress simulation, but completing their development for general public use is lower priority relative to other improvements.
Re: bean bags
Posted: Sat Jul 09, 2011 12:05 am
by trying
Awesome info...thank you very much. I'll check out the demos and see what I come up with. Love the engine thus far and appreciate the work and effort being extended to us non physics people!