Custom hinge limits bug

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Custom hinge limits bug

Postby pHySiQuE » Sat Feb 02, 2013 3:57 pm

You can see here when the child goes beyond the hinge limits, its rotation is constrained, but it keeps moving along the same direction going beyond the limits:
http://www.leadwerks.com/post/hingebug.mov

--Edit--
Actually, it appears that all custom joints have a similar problem.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Custom hinge limits bug

Postby pHySiQuE » Thu Feb 21, 2013 10:23 pm

If I use a plain Hinge joint (not the custom version) it just crashes at this line:
Code: Select all
   _ASSERTE (dgAbsf (dgFloat32 (1.0f) - (matrix0.m_front % matrix0.m_front)) < dgFloat32 (1.0e-5f));
   _ASSERTE (dgAbsf (dgFloat32 (1.0f) - (matrix0.m_up % matrix0.m_up)) < dgFloat32 (1.0e-5f));
   _ASSERTE (dgAbsf (dgFloat32 (1.0f) - (matrix0.m_right % matrix0.m_right)) < dgFloat32 (1.0e-5f));


What's going on? Newton is supposed to be super stable.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Custom hinge limits bug

Postby JoeJ » Fri Feb 22, 2013 3:17 am

Have you checked the martices given at setup?
The assert means they are not unit scaled... could explain the troubles you have with custom joints too.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Custom hinge limits bug

Postby pHySiQuE » Fri Feb 22, 2013 4:20 pm

When I use the custom joint, my pin and pivot child frame is this:
Code: Select all
1.000000, 0.000000, 0.000000, 0.000000;
-0.000000, -1.000000, -0.000000, -0.000000;
0.000000, 0.000000, -1.000000, 0.000000;
0.000000, 0.000000, 0.000000, 1.000000;

I'm not going to spend any more time debugging the NewtonJoint, since it lacks constraints.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Custom hinge limits bug

Postby JoeJ » Fri Feb 22, 2013 4:59 pm

I still believe you have some corrupt data somewhere else - joints work very well for me.
Maybe you have scaled matrices for the bodies, bad inertias...

Oh, while the mov is loading in can see you are using mass ratio 1:100000?
Never tried that but i assume this can't work properly.
Note that other engines recommend max 1:10
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Custom hinge limits bug

Postby pHySiQuE » Fri Feb 22, 2013 6:22 pm

True, but it also does this if the parent mass is zero. It is a common need to have a joint parent with mass zero, for swinging and sliding doors. The child body is the door itself, and it's attached to a static body with mass of zero so it stays in place.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Custom hinge limits bug

Postby JoeJ » Fri Feb 22, 2013 7:27 pm

Getting out of Ideas...
I synced to svn to verify the joints still work as expected (i'm at 32 bit).
I used following code. Maybe you can mostly copy paste to bypass your own engines interface functions for a test.

What happens if you use a BallSocket only - without limits?



Code: Select all
   {
      
      Shape *shapeB1 = CreateBoxShape (sVec3 (1, 1, 1)); // Shape == NewtonCollision; calls NewtonCreateBox
      sMat4 transB1;
      transB1.Identity();
      *transB1.Translation() = sVec3 (-1,10,0);
      Body* bodyB1 = CreateRigidBody (1, transB1, shapeB1); // mass = 1
      ReleaseShape (shapeB1); // == NewtonDestroyCollision ();

      Shape *shapeB0 = CreateBoxShape (sVec3 (1, 1, 1));
      sMat4 transB0;
      transB0.Identity();
      *transB0.Translation() = sVec3 (1,10,0);
      Body* bodyB0 = CreateRigidBody (1, transB0, shapeB0);
      ReleaseShape (shapeB0);

      dMatrix pinsAndPivoFrame = GetIdentityMatrix();         
      pinsAndPivoFrame[3] = dVector (0,10,0);

         
      CustomLimitBallAndSocket *ctj = new CustomLimitBallAndSocket (pinsAndPivoFrame, bodyB0, bodyB1);

      ctj->SetTwistAngle (-0.3, 0.3);
      ctj->SetConeAngle (0.3);
   }
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Custom hinge limits bug

Postby pHySiQuE » Sat Feb 23, 2013 1:45 pm

Thanks, I will examine this more closely next month. I can't make any code changes at this point.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Custom hinge limits bug

Postby Julio Jerez » Wed Apr 03, 2013 11:51 am

Oh I did not realize you were using the internal hinge joint, I just fix a parameter the makes was never corrected on the internal joints and it make then more unstable when using the interactive solver.

Please get the later SNV and try again, it should be fine now.
you can try the build dll, or you can rebuild new ones.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
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 7 guests

cron