There seems to be a problem with the offset of collision matrices. I've tested with the Primitive Collision demo and changed two files:
newton-dynamics\applications\demosSandbox\sdkDemos\toolBox\PhysicsUtils.cpp line 669.
Change: pass offset matrix to NewtonCreateBox (was NULL):
- Code: Select all
case _BOX_PRIMITIVE:
{
// create the collision
dMatrix offsetMatrix(dGetIdentityMatrix());
offsetMatrix.m_posit.m_x = 0.5f;
collision = NewtonCreateBox (world, size.m_x, size.m_y, size.m_z, 0, &offsetMatrix[0][0]);
break;
}
newton-dynamics\applications\demosSandbox\sdkDemos\demos\PrimitiveCollision.cpp line 108.
Change: Trying to change the offset matrix with NewtonCollisionSetMatrix.
- Code: Select all
// create the shape and visual mesh as a common data to be re used
NewtonWorld* const world = scene->GetNewton();
NewtonCollision* const collision = CreateConvexCollision (world, dGetIdentityMatrix(), size, type, materialID);
dMatrix offsetMatrix(dGetIdentityMatrix());
offsetMatrix.m_posit.m_x = 0.5f;
NewtonCollisionSetMatrix(collision, &offsetMatrix[0][0]);
I expect the collision mesh to be moved with either change, but they have no effect. I presume the problem is somewhere in dgCollisionInstance, but I'm lost