Crashy wrote:To explain my experiments, I want to simulate a rope, but in 2D, so if there is any way to constraint it on a plane, it would be great.
You could create a plane constraint and apply it to each body, its submit callback would look like this:
void CustomPlaneConstraint::SubmitConstraints (dFloat timestep, int threadIndex)
{
dMatrix matrix = NewtonBodyGetMatrix...; // get body COM
dVector planePos (0,0,0);
dVector planeNorm (0,1,0);
NewtonUserJointAddLinearRow (m_joint, matrix.m_posit, planePos, planeNorm);
}
Hope it works, i'm out of practice
Edit: Those plane joints should not be part of the skeleton.
Edit2: That's not optimal, maybe you need to constrain orientation as well.
Todo so, you would need to further add an Up Vector constraint aligned with plane normal,
or add this functionality to your plane constraint.
To make it perfect, you could disable 1 row from the ball socket, because it has same function as the up vector. Might improve stability & performance.