Hi,
Sometimes very little education helps a lot!
There was indeed a bug in the original example that never surfaced because the initial cubes are all axis-aligned.
Exhibit A:
This is supposed to update the physics transform tran from the position of the graphic object. But where it says getOpenGLSubMatrix() we need setFromOpenGLSubMatrix(). We want to update tran from matDump, not the other way round.
That is all. Works perfectly now.
Thank you very much again! I'm happy for now.
Ciao, MM
Sometimes very little education helps a lot!
There was indeed a bug in the original example that never surfaced because the initial cubes are all axis-aligned.
Exhibit A:
Code Select
private void setTransformFromGraphic(Transform tran) {
SimpleVector p = SimpleVector.create();
obj3d.getTransformedCenter(p);
tran.origin.set(p.x, -p.y, -p.z);
Matrix matrixGfx = obj3d.getRotationMatrix();
matrixGfx.fillDump(matDump);
MatrixUtil.getOpenGLSubMatrix(tran.basis, matDump);
}
This is supposed to update the physics transform tran from the position of the graphic object. But where it says getOpenGLSubMatrix() we need setFromOpenGLSubMatrix(). We want to update tran from matDump, not the other way round.
Code Select
private void setTransformFromGraphic(Transform tran) {
SimpleVector p = obj3d.getTransformedCenter();
tran.origin.set(p.x, -p.y, -p.z);
Matrix matrixGfx = obj3d.getRotationMatrix();
matrixGfx.fillDump(matDump);
MatrixUtil.setFromOpenGLSubMatrix(tran.basis, matDump);
}
That is all. Works perfectly now.
Thank you very much again! I'm happy for now.
Ciao, MM