Problem in dgWorldDynamicUpdate::BuildClusters

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Problem in dgWorldDynamicUpdate::BuildClusters

Postby Bird » Tue Nov 13, 2018 1:37 pm

Hi Julio,

I've updated my project to the latest version of Newton and am now hitting a problem while dynamically creating instances while the engine is running.... similar to the Kinematic bodies demo scene. In debug mode, I keep hitting the assert on line 222 of dgWorldDynamicUpdate.cpp.

dgAssert(contact->GetBody0()->m_invMass.m_w > dgFloat32(0.0f));

This doesn't happen in the previous version of Newton I've been using ...which probably a few months old. I think it would be very helpful for both you and us users if you could implement some sort of branching system so there's always stable versions of Newton to fall back on when problems are found. Here's one that I use that seems popular and is pretty easy to handle within Visual Studio
[url]
https://nvie.com/posts/a-successful-git ... ing-model/

[/url]
Bird
 
Posts: 437
Joined: Tue Nov 22, 2011 1:27 am

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Julio Jerez » Tue Nov 13, 2018 3:07 pm

can you do this:
-run the game until the assert happens.
-when the assert happens in the debugget expand dgConstraint* const contact = baseJointArray[i].m_joint;
see if is contact is fact a contact joint.
them expand m_body0 and check what kind of body it is: there are two kind of bodies
1-dynamic
2-kinematic

I am guessing body zero is kinematic and is following a path to generate that contact joint.
this was probable there by the old method some how filtered the joints.

basically what I nee to know is what parameter to check so that the contact joint does not get generated.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Julio Jerez » Tue Nov 13, 2018 5:07 pm

I catch the assert and I think I have fixed now.

I am sorry this happened but I do not have a way to make these changes more safe, I am only one person and I do what I can, the only thing that keeps the engine up is good programming, but with some many possibility the moment I make engineering optimization, these thing will happens and unfortunally I do not have any QA people to check them out for me.

anyway if you sync, I believe is should be fine now.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Bird » Tue Nov 13, 2018 7:16 pm

That fixed it. Thanks!

But now I am hitting another problem when painting instances.

https://www.youtube.com/watch?v=tKIgOc6leL0&feature=youtu.be

The first part of the video is linking to the older newton libs and the second part is linking to the latest version. As you can see the instances are interacting with each other in the second part. I'm basically dragging a kinematic body around and when it doesn't contact any other body then I paint a new instance ... as you can see it works fine in the older version. Any idea what might cause this new behavior?

I am sorry this happened but I do not have a way to make these changes more safe, I am only one person and I do what I can


Hey no worries. It's amazing what you've been able to accomplish by yourself and much appreciated over here!
Bird
 
Posts: 437
Joined: Tue Nov 22, 2011 1:27 am

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Julio Jerez » Tue Nov 13, 2018 9:30 pm

Any idea what might cause this new behavior?
No, but it looks wrong and we can no have that.
can you do this?
let us find out if the cows are settling correctly by themselves and that they are not falling when you place them on the ground. My guess the bug is there because I mess with that lately.

-how are you doing that? I remember there was a special function we worked together for this,
was that the kinematic kinematic placement demo.
I problem changed cancel that time by we can recreate it to do something similar and se what is.
I was long enough I do not remember the detail.

The other question is I assume you copied the functions from the demos and integrated in your code.
In any case I will try to dust off the demo so that we can reproduce similar behavior.

last question, is the cow a simple convex? I assume it is.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Julio Jerez » Wed Nov 14, 2018 3:10 pm

ok I believe I found the reason for the malfunction, I will try to get it fix sometime today.
I committed the solution but I need to fix something else in the low level.


I will actually work for you, you can sync and try, and see if is act as before,
then I will fix the problem with static compound, for now I simply put a comment.

The may be the cause for some other problem too that I never checked because I simply assumed compounds will just work. please see this post.
viewtopic.php?f=12&t=9342&p=63548#p63548
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Bird » Wed Nov 14, 2018 7:12 pm

It's definitely working better now but still not perfect. In this video the cow painting starts out working perfectly ... new instances are created as soon as the Phantom(Kinematic) body is not intersecting anything. But later the instances are acting like they are bouncing off the Kinematic body

https://youtu.be/U6wIRmnfEPM
Bird
 
Posts: 437
Joined: Tue Nov 22, 2011 1:27 am

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Julio Jerez » Wed Nov 14, 2018 7:22 pm

ah I see, I will fix the what I said first and the I will try to use an object like the cow, I believe I have one.
tell me is the cow and the placement a convex? or a compound.

I ask because the bug I mention only apply to compounds, so I can just step that and move to usa a body like the cow.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Bird » Wed Nov 14, 2018 7:37 pm

I'm just using a convex hull collision type for the cow
Bird
 
Posts: 437
Joined: Tue Nov 22, 2011 1:27 am

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Julio Jerez » Wed Nov 14, 2018 8:13 pm

I cleaned up the KinematicBodies.cpp demo, and when I was going to add the cow mesh I try and it is
it is clean what is going on. It seems another bug from the optimization,

basically the collision status of the kinematic object is not being considered, and the place boy is colliding with the kinematic, is weird because it seem random by after I clean the scene leaving only the floor it happen each time,
It should be easy to fix I just need to add a reply so that I can step in debug.
I am fixing it.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Julio Jerez » Thu Nov 15, 2018 9:49 am

ok try again please.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Bird » Thu Nov 15, 2018 12:32 pm

Fixed! Thanks very much for the great support as usual.
Bird
 
Posts: 437
Joined: Tue Nov 22, 2011 1:27 am

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Julio Jerez » Thu Nov 15, 2018 2:11 pm

Ha cool, in the sandbox demo I still have to make a small fix, it does no affect you.
basically when I replace the box for a cow, it just happen the when I click place, the same click is for picking to it grab the same immidially.
I have to modify the pick code so that I pick only when left bottom is down.

then I need to fix the compound and I believe this is close to a clean SDK, in fact is much fate, stable and robust now.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Julio Jerez » Thu Nov 15, 2018 2:21 pm

ok that was easy, now the place is similar expect that you have rotation mine do not, by that's fine.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Problem in dgWorldDynamicUpdate::BuildClusters

Postby Bird » Thu Nov 15, 2018 6:31 pm

then I need to fix the compound and I believe this is close to a clean SDK, in fact is much safe, stable and robust now.


Yes, except for the compounds, which are crashing here, this version seems very stable. Some of the problems I was hitting with the older version of Newton I was using have disappeared now too. Thanks!
Bird
 
Posts: 437
Joined: Tue Nov 22, 2011 1:27 am

Next

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 2 guests