SBlade wrote:I never saw a hinge moving with the attached body
This is what i was talking about proper rendering of the pivot.
I have the impression you have some kind of transform hirarchy or scene graph, but that may be more confusing than helpful for physics, because all data is just in worldspace independent of any joint relationships.
Continueing from my example with the picture, some pseudocode to render the joint would be:
(My example assumes both bodies have an identity matrix for orientation at setup, otherwise my local offsets would be wrong)
vec3 localOffsetP (3,0,0);
vec3 localOffsetC (-3,0,0);
matrix mP = NewtonBodyGetMatrix (parentBody);
vec3 pivotWorldspaceP = mP * localOffsetP; // or mP.position + mP.Rotate(localOffsetP)
DrawLine (mp.position, pivotWorldspaceP);
matrix mC = NewtonBodyGetMatrix (childBody);
vec3 pivotWorldspaceC = mC * localOffsetC;
DrawLine (mC.position, pivotWorldspaceC);
SBlade wrote:As is shown in previous animation gifs my hinges always have fixed point in worldspace so they don't move
They don't move because you render them wrong, you need to transform with current body position and orientation as shown above to reflect what happens inside the physics engine.
If you look at Submit Constraints functions of joints, they do the same transformations to calculate the data given to the solver.
SBlade wrote:Can you point out to any example in newton folder which impleemnts that ? Where hinge moves with body as well.
Any example does this, but unfortunately they do not visualize joint pin and pivot.
SBlade wrote:Unfortunately I couldn't compile ND with vs2015 downloaded from github, it shows approx 20 errors, which I didn't understand , otherwise I totally would skip the pascal part and continue from scratch with c++ to testify the newton dynamics, because I feel like there is some fundamental part or something obvious I'm missing.
This might be a good idea, even if you're new to C++, another language is probably less confusing than this transformations stuff
Should compile out of the box:
File / Open Project Solution: \newton-dynamics-master\applications\demosSandbox\projects\visualStudio_2015/demosSandbox.sln
In Solution Explorer ther are lots of projects (dContainers, dCustomJoints...), right click demosSandbox (set Startup Project if not already, you also build it from there).
Build and run with'Local Windows Debugger' - button with the green triangle.
Edit StandartJoints.cpp to modify and play around (Uncomment AddHinge (scene, dVector (-20.0f, 0.0f, 0.0f)); for a similar setup like your goal)