Sleeping Rigibodies in 3.13

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Sleeping Rigibodies in 3.13

Postby Julio Jerez » Fri Feb 13, 2015 11:58 am

there will some differences, but the core solver is more or less the same.
most the changes in that area for newton 3 are related to the collision that in 3.00 is calculate in local space.
has you compared smaller stacks?

in the demo I make pyramid stack of 50 x 50 and the go to sleep even quicker than is 2.xx

did you just change to 3.00?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sleeping Rigibodies in 3.13

Postby Julio Jerez » Fri Feb 13, 2015 2:56 pm

I just pasted that code in the demo, and it goes to sleep right after the pile settled on the floor.
an it runs a 60.
Untitled.png
Untitled.png (586.71 KiB) Viewed 5272 times


I suggest that if you are going to run at 60, and allow up 8 update to be executed if the physic fall back, that why no 120, and only allowed 4 max to fall behind.

the second option yield a much better result and arguable large frame rate.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sleeping Rigibodies in 3.13

Postby Julio Jerez » Fri Feb 13, 2015 5:02 pm

I just set the thread count to 4 and it take longer but is also goes to rest.

It may be that when using multi threading, determinist can break.
this is say the odder on the matrix can be very different and that yield to slightly different result.
when the equilibrium point is well determine then the engine convert, but when is close to unstable of indefinite it may talked a log time to converge.

Basically a physic solver is hill climbing searcher. you can thing the problem and forming a bit mountain, some mountain have aver steep gradient, an dome have very wide skirt with very flat gradients.
The case with many object like that one, make step makes a little progress toward the apex of the hill. It may happen that in each frame the formulation of the matrix introduce numerical error, that outweigh the gain of the previous frame, because set gradient is so small that it make lithe progress.

This is a fact of Numerical solution to diffrerial equation.
Try make one less pile and see if of goes to rest.

if does the it mean that calculation contact I local space while more robust for the contact calculation, in traduce significant uncertainty this is not an actual error.
you can see that time line that that just when is goes to rest it start to socialite teak more of less time until is catch up.

do you really need to do this kind of stuff for production?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sleeping Rigibodies in 3.13

Postby Julio Jerez » Fri Feb 13, 2015 6:09 pm

JackMK wrote:One less pile and the simulation goes to rest just fine.
No, I don´t need this for production. I did this only because I want upgrate from 3.12 to 3.13 and make sure that everything works as expected.


you see, all it mean is that the point at witch newton 3.00 can resolute true numerical error for
is a little lower that in was for newton 2.00
the does no mean it is a bug or an error it means it is a different algorithm.
you can make an analogy to buy for example a Race Car, a Sport Car or a Family luxury car.

for newton 3 I abandoned of being the faster at all cost and a the same time having to explain hack and bogus heretic that you see on many engines.
In return Newton 3.0 provide a rich set of functionality that make off for that small price.
newton 3 is build for comfort.

One example is that you can have access the joint list of any body at any time by using
GetFirstJoint/GetNextJoint see the trigger manager for example.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sleeping Rigibodies in 3.13

Postby Julio Jerez » Fri Feb 13, 2015 7:04 pm

I said Newton 3.xx is more flexible that 2.xx

you can use GetFirstJoint/GetNextJoint to get contact info for a body.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sleeping Rigibodies in 3.13

Postby Julio Jerez » Sat Feb 14, 2015 11:57 am

But what is the different of having a call back for a worker thread and a main thread.
On of the different of newton 3.xx and 2.xx is that 3.xx run on a separate thread already.

so there is not way to make a call to the main threads form a newton update, unless you compile multithread with thread disable.

But assuming that that called is mad for the main thread this implied a huge refarcting of the engine.
for, I would say, zero gain

look at the utility function
void GenericContactProcess (const NewtonJoint* contactJoint, dFloat timestep, int threadIndex)

in file ..\applications\demosSandbox\sdkDemos\toolBox\PhysicsUtils.cpp

it is call from contact calculation itself, you can manipulate the contact anyway you want there
Basically what you ask is that same call being made from a different thread.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Sleeping Rigibodies in 3.13

Postby Julio Jerez » Sat Feb 14, 2015 1:12 pm

You just do it. objects are no active until the go to and update update.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests