Wanted to get some advice on getting a StaticMesh to reliably prevent entities from falling through - I've searched the forums a fair bit and tried some of the suggestions from earlier posts.
You can see the behavior in this test vid:
http://www.youtube.com/watch?v=qvt0i1_DuLk
Main problems are the planks slipping through the StaticMesh without detection, and also the unchecked spinning through the floor when the planks have some angular velocity.
For reference the floor mesh shown is a grid with 1 x 1 unit triangles, and that cube sticking out is 1 x 1 x 1. The doghouse there is composed of 1.0 x 0.25 x 0.05 planks, stuck together with some custom "breakable weld" constraints. I know the 0.05 dimension is pushing my luck a bit - those overall proportions look nice and play well for parts of the game though, so I'd love to be able to get that shape to work.
My basic settings are:
Code: Select all
BEPUphysics.Settings.CollisionDetectionSettings.DefaultMargin = 0f;
BEPUphysics.Settings.CollisionDetectionSettings.AllowedPenetration = 0f;
BEPUphysics.Settings.CollisionResponseSettings.PenetrationRecoveryStiffness = 0.005f;
// ...
space.Space.ForceUpdater.Gravity = new Vector3( 0, -9.81f, 0 );
What I've tried without much success:
* Scale everything by 10x, 20x (so planks are 10 x 2.5 x 0.5, etc.) including gravity
* Different grid spacing (have tried down to 0.1 x 0.1 squares, so smaller relative to the planks)
* Reverting to the default penetration, margin, recovery stiffness, etc. settings (simulation gets less stable)
* Use continuous position update mode (via the static MotionUpdate settings)
In contrast, a very large floor Box entity does a good job - the planks penetrate sometimes, but usually get corrected within a few frames.
Would stacking a few copies of the mesh on top of each other help, maybe using InstancedMesh, so that the floor isn't just a skin but is backed up by some volume?
Any advice / pointers are appreciated!