when I look at teh video, it looks like there are more than one problem
the first one seem to be the puck going over the floor.
the secund seem to be the contact generation been bad.
you can see when the puck is resting on the ground, it jitters. that should not happen.
let us try this to see if we can fix that, I assume you are using function
NewtonSetNumberOfSubsteps on you initialization
like you call NewtonSetNumberOfSubsteps(workd, 2)
please try NewtonSetNumberOfSubsteps(workd, 4)
let us see if it get better, this sould go a long way fixing the puck going over the floor and is probably better than set continue collision.
if the puck still miss collsion then you can set continue collision on the puck
the secudn problem, teh jitter, this I think is becaus ethe default contact threshold, basically this is a feature that when two contact are more some some small distance apart, teh first one is selected and the oeth are discarded. is good for medium size objects, but for a small object teh tow contacts may be needed.
this is a per contact joint funtionality that yo uhave to add to your callback, because is not part opf teh material. the function to controll that are these
- Code: Select all
dFloat NewtonMaterialGetContactPruningTolerance(const NewtonJoint* const contactJoint);
void NewtonMaterialSetContactPruningTolerance(const NewtonJoint* const contactJoint, dFloat tolerance);
you can try something like this
- Code: Select all
dFloat dist = NewtonMaterialGetContactPruningTolerance(contactJoint);
NewtonMaterialSetContactPruningTolerance(contactJoint, dist * 0.25)
this makes the distance 4 time smaller.
do no make it zero, because thet will generate multiple contact at the same location that will be different by the normal direction. for example when hitting the edge of two faces on teh map.
this feature makes the solver work harder and contacts that are close together increase the condition number of the mass matrix. this is why is no set to a very small value by default.
plase try those two thing and I beleive you will be find. few user has had this problem in the pass and that was how was solved.