Compound + ConvexCast = problem

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Compound + ConvexCast = problem

Postby Executor » Sat Sep 05, 2009 6:10 pm

Ok, i create another complex example tomorrow. It will show that compound collide fine, but convex cast not be work.
Executor
 
Posts: 25
Joined: Fri Sep 04, 2009 7:01 am

Re: Compound + ConvexCast = problem

Postby Julio Jerez » Sat Sep 05, 2009 7:45 pm

Ok, i see now. It looks like there is a bug, but I can not figure out what it is.
you are right if I make the compound with just one box teh convex cast fail, I do not know why teh collision do no fail.
I iwll invertigate more.

I am guessing it is because som how teh matrix on teh compound shape is no updated atteh tiem of the convex cast call, but It doe no look lihe that
anyway I will find out and let you know.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound + ConvexCast = problem

Postby Julio Jerez » Sat Sep 05, 2009 10:09 pm

Wow you discovered the biggest bug I can think off in the engine.
for what i can see this bug was there since I added the mutithreaded code.
This will cause a lot of collision problem on amost any collison shape with a rotation matrix that was no identity.
not only that in sone case rare case it will generate bad collision.
This happen because when I added the mutithreade code, I collect all of the collion pair in a list.
then I divide them in groups of more or less equal size and each group is solved independetly in a thread.

however this can cause a problems, say that a body is collidon with another body and that pair is in one group, but the same bopdy is also colliding with another body and it is in another group.
if this is the case, when the collision is solved the global matrix of the collision shape must be calculted, and I caculate them in the body.
here is the Bug, if a shape is a compound then matrix will be mutiply by the offset and it willcshage value in one thread.
to solve that, I use a proxi body that copy the values that are used in the collision from the body before calling teh contact solver, then those valuse can be modifired at will.
however In the contact solver, I still was reading the matrix from the body and not from the proxi.
In this case the code was reading the matrix of the parent shape and not from the child shape, even though the matrix of the child shape is correct in the proxi.

I fixed but I need to test it well before I release this.
Because I still do not beleive that such huge bug was there and no body notices.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound + ConvexCast = problem

Postby Executor » Sun Sep 06, 2009 2:41 am

A new example is canceled. :)
I am glad that we found a reason of the problem.
Waiting for a solution in next releases... :)
Thanks.

P.S. There is a problem with raycast too, but I still dont know about Newton already had this bug or I did it. I will announce later until I understand.
Executor
 
Posts: 25
Joined: Fri Sep 04, 2009 7:01 am

Re: Compound + ConvexCast = problem

Postby Julio Jerez » Sun Sep 06, 2009 9:04 am

No this do not affect ray cast.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound + ConvexCast = problem

Postby Executor » Thu Sep 10, 2009 1:45 pm

In 2.09 all ok! Cool! :)
Thanks.
Executor
 
Posts: 25
Joined: Fri Sep 04, 2009 7:01 am

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

cron