collision issue with mesh

Post Reply
Brian Beuken
Posts: 21
Joined: Sat Jul 29, 2017 9:19 pm

collision issue with mesh

Post by Brian Beuken » Mon Aug 21, 2017 12:53 pm

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?

teolazza
Posts: 12
Joined: Fri Aug 11, 2017 1:16 pm

Re: collision issue with mesh

Post by teolazza » Tue Aug 22, 2017 7:18 am

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).

Brian Beuken
Posts: 21
Joined: Sat Jul 29, 2017 9:19 pm

Re: collision issue with mesh

Post by Brian Beuken » Tue Aug 22, 2017 10:58 am

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?

teolazza
Posts: 12
Joined: Fri Aug 11, 2017 1:16 pm

Re: collision issue with mesh

Post by teolazza » Tue Aug 22, 2017 1:55 pm

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;
.

Brian Beuken
Posts: 21
Joined: Sat Jul 29, 2017 9:19 pm

Re: collision issue with mesh

Post by Brian Beuken » Tue Aug 22, 2017 7:51 pm

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.

teolazza
Posts: 12
Joined: Fri Aug 11, 2017 1:16 pm

Re: collision issue with mesh

Post by teolazza » Fri Aug 25, 2017 12:36 pm

mmmm my problem is still there. I must move boxes, and a capsule will be an approximation too loose. I must keep boxes.

Brian Beuken
Posts: 21
Joined: Sat Jul 29, 2017 9:19 pm

Re: collision issue with mesh

Post by Brian Beuken » Sat Aug 26, 2017 10:46 am

did you try to fix the normals, as suggested?

teolazza
Posts: 12
Joined: Fri Aug 11, 2017 1:16 pm

Re: collision issue with mesh

Post by teolazza » Mon Aug 28, 2017 7:15 am

yes

Post Reply