Static Mesh Missing Collisions

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Static Mesh Missing Collisions

Postby Esharc » Thu May 04, 2023 7:02 am

Good afternoon Julio,

I am busy updating our version of Newton to be inline with the latest on Github. Whilst running through our tests, I noticed that previously the collisions for a static mesh were working fine, but since updating they are being missed on areas of the static mesh where triangles join. Our test involves a simple ndShapeStatic_bvh created using 5 vertices and 4 triangles. I then drop a cube on the mesh, the collisions work fine when dropping the cube on a full triangle, but not where two triangles join. Sometimes the collisions work fine on the join, other times it does not. It seems to be related to the size and starting height of the cube.

If the cube is already on the static mesh and I move it over to the area where the triangles join, then the contacts work fine and it does not fall through the static mesh.

I noticed that in
Code: Select all
ndInt32 ndContactSolver::ConvexContactsDiscrete()
I have a contact count of 7, but after the contacts are pruned, the contact count changes to 0. I investigated further into the
Code: Select all
PruneContacts
function and saw that it calls
Code: Select all
ndInt32 ndContactSolver::Prune3dContacts(const ndMatrix& matrix, ndInt32 count, ndContactPoint* const contactArray, ndInt32 maxCount) const
.

This function has a change in it that was not there in the previous version that we had. The part of the function in the
Code: Select all
#if 0
code block was there and if I change it to
Code: Select all
#if 1
so that that code executes instead of the new code block, then the collisions work fine again.

I tried reproducing this in the sandbox, but it seems to work fine there, which indicates that I may be doing something wrong on my side, but I cannot seem to figure out what it is. Do you perhaps know what I may be doing wrong?
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa

Re: Static Mesh Missing Collisions

Postby Julio Jerez » Fri May 05, 2023 10:05 am

yes I can confirm now that
Prune3dContacts(const ndMatrix& matrix, ndInt32 count, ndContactPoint* const contactArray, ndInt32 maxCount) const

can return 0 in some cases, and that should never be the case.
I modified a while back, but I see some pending work, that should be an easy fix.
the good news is that the two bug are reproduceable and easy to solve.

I will fix that one first.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Static Mesh Missing Collisions

Postby Julio Jerez » Fri May 05, 2023 1:24 pm

alright this one is fixed now.

in fact, this one was the easier of the two, also the one that is most visible and could produce really bad penetrations.

the secund is, more about contact quality, but will takes more work to fix it, so I will fix that over the weekend.

after you sync you will get that fix.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Static Mesh Missing Collisions

Postby Esharc » Sun May 07, 2023 5:52 am

Thank you Julio, I can confirm this bug has been fixed.
Esharc
 
Posts: 120
Joined: Tue Jan 10, 2017 5:23 am
Location: South Africa


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 22 guests