Joints fixed to the world

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Joints fixed to the world

Postby zak » Tue Mar 30, 2021 1:57 pm

(Newton 4) What is the best way to connect a joint to the world ( as in Newton 3.14 when body parent is NULL). I tried to connect a dynamic body A to a kinematic body B with a simple hinge. Shape on body B is setted as ndShapeNull but the joint doesn't work. If i set a shape on body B all works but i don't want to set a shape, i want to fix the joint to the world. In the demos i have seen that sentinel body is used. Is this the way? Sentinel body is a dynamic body but acts as Kinematic?
zak
 
Posts: 87
Joined: Mon Dec 06, 2004 9:30 am

Re: Joints fixed to the world

Postby Julio Jerez » Tue Mar 30, 2021 3:32 pm

You can connected to the sentinel body.

In 3.14 when you pass null to a joint, it set that body to a sentinel too.
We just simply exposed that to the end app.

A dynamic body with zero inverse mass is static.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints fixed to the world

Postby zak » Wed Mar 31, 2021 5:11 am

Ok, but about the performances, let's say we have 10 chains each with several bodies linked by hinge joints, and to connect the head of each chain to the sentinel body. We will get 10 separate islands or a single island?
zak
 
Posts: 87
Joined: Mon Dec 06, 2004 9:30 am

Re: Joints fixed to the world

Postby Julio Jerez » Wed Mar 31, 2021 11:05 am

The cost of the iterative solver is linear regardless of the type of joints.

The cost of open loop joints is also linear regardless of the joints.

The const of a articulated structure withe some close loop joint is o(n^3) on the number of row forming kinematic loop.

In general kinematic loops should be minimized or keep small by the design.

I give you an example, say you make a ragdoll with say 24 bones.

From the pelvis to each limb the each node only have a parent, so as long as the rag doll is not touching anything,
The cost of solving it is linear on the number of bones.

Now let us say the doll collide with the floor, each contact point has three rows, assuming each node collides and each node generate two contacts, that will be up to 24 bone time 6 rows = 144 rows, that's a 124× 124 rows to solve.

It is quite expensive, however since the kinematic loop solver has an initial guess solution, this value is determined but the iterative solver that is applied before, so in general even whe each pass is quadratic, it usually terminates in fewer that 10 to 20.

In the joint demo there is an example that shows a roller coster made of 20 solid all conected to the next by a point to point joint and each is conected to the sentinel.
This made the close loop matrix 60 x 60 and is work at a quite resonance speed.

Another example is a vehicle, each tire made one contact, plus ther are few internal close loop, like the motor, the gear box the differentials, the tire axel, all those are kinematic loop.

The matrix for close loop is about 24 x24 for a car with four tires, and is solved without problems. Not as fast as a raycast car would be but accurate and reliable enought to generate emerging natural car behavior by the simple laws of physic and still be practical for used in a simulation. Stuff like realistic rear wheel cars that exhibit vehavior like drift, tire burn out, tail spins are all emerging without having to hack it in.

In you example, the answer is the performance is not affected if the construction of joint is fixable, since a sentinel is a static body, so it will be a kinematic loop the moment there are more that one for a single Skeleton.
You may think that you can cheat and get away with kinematic loops by connecting each body that need to be conected to a the world to a different static body.
My recommendation is that you do not do that, it will result on many small close loops, each with few rows that will be linear combination of some other row, which will have an infinite number of solution.
In newton 3.14 I covered for that by making those connection to be a proxy of the sentinel. With newton 4 I not longer do that, I let the application make the judgment how to design the articulation.

The construction of open loop Skeleton is determined by a spawning graph algorithm that figure out all the Skeletons that are not connected to a static body and form an open loop.
Then for each Skeleton, in another pass it connect all the close loops joints.
These algorithms are use those joints option to figure out how to build the skeletons.
It is to the application to made a sound judgment as to how to form the articulated body.
It is possible to make a case the will bring the engine to its needs, for example a net or an array where each body is linked to every other body. I recently have the case of the connectivity of the debri piece of a template geometry.
Doing that, to me is a mental masturbation that make some one to make bragging point but that accomplished nothing, I leave to the other engines. I am only concerned with what is reasonable.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints fixed to the world

Postby Julio Jerez » Wed Mar 31, 2021 11:13 am

In your specific example you should get as follows.

The first pass will discover ten Skeleton Island.
This is each joint that connect two dynamic body form a separate chain.

The second pass add all the kinematic loop.
For each Skeleton the first joint connected to the Skeleton become the root of the Skeleton, this one is not a loop by definition since is has no parent.
Each subsequent joint of that Skelton that connect a body to a static body, will be a kinematic loop, since the it already has a parent and another one will imply a node with the same parent, so that joint is added to the array of kinematic loops.

So you end up with 10 chains without loops.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
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 4 guests