Auto-sleep behavior

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Auto-sleep behavior

Postby FSA » Mon Dec 13, 2021 12:15 am

The sleep function in the simple box stack demo looks a bit strange. Some bodies won't sleep at all and seem to activate other bodies in contact randomly. This behavior occurred after about a minute without any external force applied by me.

Video: https://youtu.be/aA3xoUBeQdo

Is this expected?
User avatar
FSA
 
Posts: 318
Joined: Wed Dec 21, 2011 9:47 am

Re: Auto-sleep behavior

Postby Julio Jerez » Mon Dec 13, 2021 11:10 am

It is normal that a body active other bodies on contacts, but the video does not look normal.
I now have some changes on fly, they do not address that issue, but touch the same files.
so sometime today I will check in these changes and I will see what is going on there.
at that point I will ask you to sync and check again.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Auto-sleep behavior

Postby Julio Jerez » Mon Dec 13, 2021 3:43 pm

ok I found the problem.
It was a bad merge from my attend to make the solver island free.
It was trying to set the sleep state from an array that pointed to wrong group of bodies,
in fact, it was reading always island zero.

but remember is normal that a body actually active a body that visually is far away, three reason for the is that joint are arrange in ground by rows, that are all solve together the in parallel
these ground currently are 4, 8 or 16 joints,

it is possible that for example a joint is active body is insulated, but the solver finds that only one or two joints are connected to that body. then what is does is that is find a number of joint to complete the group, since the sort is ordered by body active the body constrained but sleeping, if there are no more active joints, them the last joint on the group will be solved and will active the body until the entire group goes to sleep.

this was no the case in the pass, but when using high with simd vectors, operation on a subset of the vector lane make it far more complex than just padding the vector with extra element.

so you will see stuff for example that one body is active and for some reason another body far away is activated for few frames flashes.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 16 guests