NewtonUserJoint Assert

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

NewtonUserJoint Assert

Postby jamesm6162 » Mon Oct 26, 2015 10:37 am

Hi Julio

I've run into a debug assert begin hit in NewtonUserJoint::SetLowerFriction, from the Custom6DOF.cpp around line 256.

The setup to reproduce is simple: I replaced the Add6DOF function in StandardJoints demo with the following code:
Code: Select all
   dVector size (1.0f, 1.0f, 1.0f);
   NewtonBody* const parent = CreateBox(scene, origin + dVector(-2,0,0), size );
   NewtonBody* const child = CreateBox(scene, origin + dVector(2,0,0), size );
   NewtonBodySetMassProperties(parent, 0.f, NewtonBodyGetCollision(parent));
   dMatrix pinMatrix(dGetIdentityMatrix());
   pinMatrix.m_posit = origin + dVector (0.f, 0.f, 0.0f, 0.0f);
   Custom6DOF* const joint0 = new Custom6DOF (pinMatrix, pinMatrix, child, parent);
   joint0->SetAngularLimits (dVector (-0.78f,0, 0,  0.0f), dVector (0.78f,0,0,  0.0f));
   joint0->SetLinearLimits (dVector (0, 0, 0, 0.0f), dVector (1.0f, 0, 0,  0.0f));

   NewtonSkeletonContainer* const skeleton = NewtonSkeletonContainerCreate(scene->GetNewton(), parent, NULL);
   NewtonSkeletonContainerAttachBone(skeleton, child, parent);   

You will notice I am only using the x-axis in my offsets and limits.
If I change it to all use the z-axis, the problem disappears.
This setup works:
Code: Select all
   NewtonBody* const parent = CreateBox(scene, origin + dVector(0,0,-2), dVector(1,1,1));
   NewtonBody* const child = CreateBox(scene, origin + dVector(0,0,2), dVector(1,1,1));
   joint0->SetAngularLimits (dVector (0, 0, -0.78f, 0.0f), dVector (0.0f, 0.0f, 0.78f, 0.0f));
   joint0->SetLinearLimits (dVector (0, 0, 0, 0.0f), dVector (0, 0, 1.0f,  0.0f));
Posts: 49
Joined: Wed Aug 12, 2015 8:50 am

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 0 guests