JoeJ wrote:In other demos if i pick a body and drag it into floor it might jitter, or go through the floor.
But the big 'debris balls' in Compound collision shape demo behave really wired.
Lets say those balls have a diameter of 4 m.
I lift one up 2m.
oh I now see what the problem is Joe. The new improvement to collision system, calculate contact on a local space the is common to both shape, this trick simply the contact calculation a great deal because mu using a common space, the scaling to not have to be convert form one space not the local space of the other shape, so the collision unify for all scaling types, and is also a lot simple to follow, or so I thought.
here is comes the problem. this is not true for compound collision, each child shape of a compound has his own local space.
that should no be a problem until the code hit the contact discrinmation routine.
compound collision can generate hundreds of contacts, but the solver has a hard limit of 16 contact, so some how the contact has to be reduce , and that the problem each time the contact reduction routine is called is mixes contact that are in daren't spaces. that why the contact look out of place
here is a list of the contact when the ball fall on a flat floor at height 0.
{133.384979, -0.0971130431, 136.648407, 1.00000000}
{133.707428, -0.149250939, 136.056335, 1.00000000}
{133.771210, -0.149250984, 136.519318, 1.00000000}
{133.806702, -0.117204279, 136.190582, 1.00000000
{134.133011, -0.117204309, 135.945206, 1.00000000}
{134.492050, -0.0846464038, 138.480392, 1.00000000}
{134.571793, -0.0846465528, 138.686020, 1.00000000}
{134.583893, -0.00336754322, 134.047974, 1.00000000}
{134.857162, -0.000746428967, 133.958084, 1.00000000}
{135.305237, -0.191960990, 134.790695, 1.00000000}
..
those are contacts produce by different sub shapes, and as you can see they all has different height.
buy since I know the high should be zero because the ground is at 0, that contacts list is made of contact that are on different spaces.
I believe that the bug, and explain the jumping behavior.
I do some more test before making that change,
because I want to keep is unified pile line for all collision routines.
I can fix in tow ways.
1- wrap the compound with a transform matrix the make the shape to be on eh same space.
2-move the contact reduction routines to after al contacts are calculated and the do the contact reduction
both option are valid, and I will probable have to do both.
option one I like because is insulated to the compound only.
option tow I also like it because am planning on a better contact reduction routine, the one I am using is OK but I belibe I can write a better one.