Assert in CollisionScene

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Assert in CollisionScene

Postby zak » Mon Jan 29, 2018 1:55 pm

There is dgAssert (0) in line 145 of dgCollisionScene.
This is blocking me to try continuos collision between a sphere and a collision scene made by boxes.
zak
 
Posts: 87
Joined: Mon Dec 06, 2004 9:30 am

Re: Assert in CollisionScene

Postby Julio Jerez » Mon Jan 29, 2018 3:26 pm

if you remove the line, does It works?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Assert in CollisionScene

Postby zak » Wed Jan 31, 2018 4:42 am

The dynamic body with a sphere shape ( a ball ) with continuous collision is set to 1 .Others bodies all to 0.
When ball collides with collision scene ( boxes and capsules ) it seems ok. But when the ball collides with a ragdoll made of dynamic bodies with a capsule shape, there are strange behaviors.
I tried to study the problem and i have seen that when the ball collides with a single ragdoll body ( sphere vs capsule ) sometimes i have a single collision callback called ( ok ), but sometimes i have collision callback called 3 times in a single update, each with a single contact with a normal and a point of contact similar but not the same as the other calback. I mean no a single callback with 3 contacts but 3 single call to the same collision callback, with the same bodies pair. When i disable continuous collision, collision callback is always called only once. The strange behavior occurs in 50% of cases.
zak
 
Posts: 87
Joined: Mon Dec 06, 2004 9:30 am

Re: Assert in CollisionScene

Postby zak » Wed Jan 31, 2018 9:24 am

ok, i investigated further. After physics update i apply a series of post correction to bodies using NewtonBodySetMatrix() and NewtonBodySetVelocity(). If i don't apply post correction continuous collision seems to work.
So are NewtonBodySetMatrix() or/and NewtonBodySetVelocity() incompatible with continuous collision?
This would be a big limit for me, because i make large use of post correction for ragdoll legs that move very fast.
In past i had a problem with collisions and post correction, resolved calling NewtonInvalidateCache() before every physics update. But in this case it does not help.
zak
 
Posts: 87
Joined: Mon Dec 06, 2004 9:30 am

Re: Assert in CollisionScene

Postby Julio Jerez » Wed Jan 31, 2018 11:58 am

There are no rule say a callback is to be called once per frame.
multiples calls to contact callback is how continue Collision works.
The algorimt is simple, basically it calculate the shortest amount of time the each collision pair can move until the collision and the simulation advance by that time.
There is call to collision pairs to get a new set of contacts,
the an impulse solve step that does not advance the simulation, only calculate new velocities.
It repeats that loop until the time step is completed or the max number of iteration is completed.

No do not expect callback to be called one per frame, in fact they can be called more than one for other reasons: setting sub samples, the inverse dynamics and some listener features can call any call back as many time as needed.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Assert in CollisionScene

Postby zak » Thu Feb 01, 2018 6:59 am

Julio Jerez wrote:No do no expect callback to be called one per frame

Ok, this is very important to know. Thank you
zak
 
Posts: 87
Joined: Mon Dec 06, 2004 9:30 am


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 4 guests