Unstable 6Dof

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Unstable 6Dof

Postby jamesm6162 » Mon Nov 23, 2015 3:27 am

Hi

I have noticed some shaking when connecting bodies with the 6dof constraint.
As a simple test I added two boxes (one static) with the 6dof halfway between them, and all limits locked to zero (pretty much acting as a fixed constraint).
To reproduce, dump this into the StandardJoints Add6Dof function:

Code: Select all
static void Add6DOF (DemoEntityManager* const scene, const dVector& origin)
{
   dVector size (1.0f, 1.0f, 1.0f);
   NewtonBody* const base = CreateBox(scene, origin + dVector (0.0f,  5.0f, 0.0f, 0.0f), size);
   NewtonBody* const box0 = CreateBox(scene, origin + dVector (4.0f,  5.0f, 0.0f, 0.0f), size);
      
   NewtonBodySetMassMatrix(base, 0.0f, 0.0f, 0.0f, 0.0f);
   dMatrix pinMatrix(dGetIdentityMatrix());
   pinMatrix.m_posit = origin + dVector(2.0f, 0, 0, 0);
   
   Custom6DOF* const joint0 = new Custom6DOF (pinMatrix, pinMatrix, box0, base);
   //joint0->SetAngularLimits (dVector (-angle, -angle, -angle, 0.0f), dVector (angle, angle, angle, 0.0f));

#ifdef _USE_HARD_JOINTS
   NewtonSkeletonContainer* const skeleton = NewtonSkeletonContainerCreate(scene->GetNewton(), base, NULL);
   NewtonSkeletonContainerAttachBone(skeleton, box0, base);
   NewtonSkeletonContainerFinalize(skeleton);
#endif
}


Will the current development solve this issue?

Thanks

James
jamesm6162
 
Posts: 49
Joined: Wed Aug 12, 2015 8:50 am

Re: Unstable 6Dof

Postby Julio Jerez » Mon Nov 23, 2015 2:43 pm

I have being experimenting with the 6d0f joint trying to converted on a small angular approximation joint. the work is no completed, and I am not sure if it will work.

In General the 6DOF joint is join a check box feature. these kind of joint do not really work because the euler angles of a joint are not independent of each other.

The idea of treating the euler angle as linear independent values came form the days when engine quality was measured by what features they have.

In reality to make a joint you need develop using the Geometry of the constrains and eulers angles are instantaneously linear independent but when using that property to integrate then what you get is a joint that does not follows the shortest path, and reason is that are you integrate them they order becomes depended.

The engine have almost every possible joint that you need, plus if you need to make a special joint you can make you one by combining the update function of the one that do what you need but do it separate. That is a much better approach that try to use a one fix all solution.


what are you doing? maybe I can give you some suggestions.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Unstable 6Dof

Postby jamesm6162 » Tue Nov 24, 2015 7:19 am

Well I'm currently porting our physics from bullet to newton dynamics, and basically we have 6dof constraints all over the place, mostly due to instability in bullet's hinges (so 6dof imitating a hinge). Strangely enough bullet's 6dof is more stable than a hinge...

I can't see a specific need for a 6dof at the moment, so it's not a big problem, and I will probably end up replacing the usages with proper hinges, as it should be.
jamesm6162
 
Posts: 49
Joined: Wed Aug 12, 2015 8:50 am

Re: Unstable 6Dof

Postby Julio Jerez » Tue Nov 24, 2015 12:24 pm

I know is a pain but believe me in the long run using the proper joint for the proper effect is a much better solution.
in my experience by far most of the joints people use are hinges or some variation of them.
In Newton in particular hinge are very robust and they also have variant for controlling stuff that
make the hard to do with a generalize joint like a 6dof.

plus if you are using Newton 3.14 for some configuration like rag roll and skeleton you can make then use exact joints that work seamlessly with the rest of the scene.

If you are using the for stuff like door opening, level, or game logic controller, which very much the meat and potato of games, you will find that that newton has a vey rich assortment of joint's that a 3dof can't. Stuff like actuators and relational joints, make the mundane thong be natural part of a scene, so much that people play an expect then to work naturally.
here is an example of the level stability you can get from Newton

There are very few real time physics engine that can provide that level of accuracy and stability.
the mundane thong you see on those videos are done with the basic functionality, but guess what when you provide a stable and predictable engine to a designed team, if you have good tools then the sky is the limit you what you can do.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest