A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by JoeJ » Thu May 10, 2012 3:34 pm
Jo sakra! Des schaut oba net guat aus, ha?
If looking more closely, there IS a multiplication order case:
q = qTarget * qBuf;
change that to
q = qBuq * Targetf;
That should help, if not try:
dQuaternion dTar = dQuaternion::getIdentity(); // or similar syntax
Vector3 angVel = PhysicUtils...
To test if it's working to constrain to a fixed orientation.
-

JoeJ
-
- Posts: 1489
- Joined: Tue Dec 21, 2010 6:18 pm
by FSA » Fri May 11, 2012 1:23 am
Jo sakra! Des schaut oba net guat aus, ha?
German?

I've wrote a little bit to much with big letters... I know that's not good
Thank you i will test it.
-

FSA
-
- Posts: 322
- Joined: Wed Dec 21, 2011 9:47 am
by FSA » Fri May 11, 2012 7:28 am
OK. It works fine without the AngularVelocityToTorque Function

I have test it on a door with hingejoint, but it still jitter... I have set Angular velocity to zero but no diffrent.
HingeJoint-code
- Code: Select all
nJoint = NewtonConstraintCreateHinge(MapHandler->GetPhysicWorld(),Vector3(-46.72f,6.0f,-50.0f),Vector3(0,1,0),NDoor,NULL);
NewtonHingeSetUserCallback(h, LimitCallback);
NewtonJointSetStiffness(h,0.9f);
Callback:
- Code: Select all
unsigned LimitCallback(const NewtonJoint* pHinge, NewtonHingeSliderUpdateDesc* pDesc)
{
float fAngle = NewtonHingeGetJointAngle (pHinge);
//Max limit
if (fAngle > 0.5f * 3.1416f)
{
pDesc->m_accel = NewtonHingeCalculateStopAlpha (pHinge, pDesc, 0.5f * 3.1416f);
pDesc->m_maxFriction =0;
return 1;
}
//Min limit
else if (fAngle < 0.0f)
{
pDesc->m_accel = NewtonHingeCalculateStopAlpha (pHinge, pDesc, 0.0f);
pDesc->m_minFriction =0;
return 1;
}
return 0;
}
Video:
https://www.dropbox.com/s/1ykdb4ytjoswt ... eJoint.aviThank you soo much!!

-

FSA
-
- Posts: 322
- Joined: Wed Dec 21, 2011 9:47 am
by JoeJ » Fri May 11, 2012 2:00 pm
It seems that's no jitter, jitter is some unwanted high frequency but small amplitude distortion.
It's usually caused by a bad method to solve lots of equations at once or floating point precission limits.
Typical for that are ragdolls in current games - they're dead, but still jitter around.
But what i see in the video looks more like a bug, and i have no idea by what it's caused.
Some questions:
You operate on the door only by the force method, no torque or kinematic joint?
It happens only if you try to violate the joint limits?
It stops if you release the door?
Some ideas to test:
1. What if you adjust gravity to bring the door to a limit without any other force / joint user interaction.
2. Replace the biuld-in-hinge with the newer Custom Hinge from the Joint Library, which has limits too, but you don't need a limit callback for that one. You need to do some more setup/linker stuff to get them working, but you get much more joints and possibilities.
3. If nothing welps: Simply ignore it for now, continue to create a world with more bodies, more joints, etc. Maybe you'll get more problems and it will get easier to find a common source for them, there are much possibilities... bad mass properties, bad matrices at creation, NaNs...
-

JoeJ
-
- Posts: 1489
- Joined: Tue Dec 21, 2010 6:18 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 1 guest