Page 1 of 1

collision issue with mesh

Posted: Mon Aug 21, 2017 12:53 pm
by Brian Beuken
Another odd little issue, I can frig a solution by clamping to the height of the model off the floor, and testing to allow gravity to occur, but wonder if there's an inbuilt solution i am missing.

My environment is a btTriangleMesh and I have a btCylinderShape moving around using linearvelocity, though allowing y velocity to be dictated by the step system, so I can have gravity do its thing, and also allow friciton to stop when I don't provide velocity.

It works well enough but I am noticing a small dip and bounce as my model moves over from one collision Mesh Polygon to another, very rarely also being stuck. I assume gravity is allowing it to drop between the gap, then restoring it back up, creating the bounce.

Whats the best way to stop this?

Re: collision issue with mesh

Posted: Tue Aug 22, 2017 7:18 am
by teolazza
Hi,

look here
http://www.bulletphysics.org/Bullet/php ... 2&start=30
In short: fix the normals and call setContactProcessingThreshold(0) on the object (I don't know if both the ground and the moving object).

Re: collision issue with mesh

Posted: Tue Aug 22, 2017 10:58 am
by Brian Beuken
Interesting topic, thanks, I will see if I can impliment the fix. Though there is some suggestion in thread that it was going to be fixed in later versions of bullet? Since its an old thead was this not done?

Re: collision issue with mesh

Posted: Tue Aug 22, 2017 1:55 pm
by teolazza
Sorry, I don't know: maybe the btInternalEdgeUtility could solve the problem, but not in my case.
http://www.bulletphysics.org/Bullet/php ... f=9&t=4603

I can just warn you that

Code: Select all

cp.m_lateralFrictionInitialized = true
has changed in

Code: Select all

cp.m_contactPointFlags |= BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED;
.

Re: collision issue with mesh

Posted: Tue Aug 22, 2017 7:51 pm
by Brian Beuken
Before I could get to this, I decided to try making my player a capsule rather than a cylinder, as suggested in the thread, and the result is spectacular. No separation events and no dips and jumps, the character is moving along and crossing boundaries between polygons perfectly.
I will try to implement the normal correction idea at some point, when I must have cylinders and boxes, but for now this does all I need so will work with a capsule type object from now on.

Re: collision issue with mesh

Posted: Fri Aug 25, 2017 12:36 pm
by teolazza
mmmm my problem is still there. I must move boxes, and a capsule will be an approximation too loose. I must keep boxes.

Re: collision issue with mesh

Posted: Sat Aug 26, 2017 10:46 am
by Brian Beuken
did you try to fix the normals, as suggested?

Re: collision issue with mesh

Posted: Mon Aug 28, 2017 7:15 am
by teolazza
yes