I am not entirely sure if this is actually a bug or not but I will post incase. I am creating primitives such as cubes, cylinders and capsules with a matrix to offset their positions and rotations.
When I the convert the Newton body primitives to a convex hull, the convex hull isnt rotated, translated or scaled according to the offet I used when I made the NewtonBody. Infact the new convex hull appears as a primitive made with a null matrix offset.
Here is the code I am using:
matrix4 mat;
mat.setScale( vector3df(1.0f, 1.0f, 1.0f)* IrrToNewton );
mat.setTranslation( vector3df(0.0f, 0.0f, 0.0f) * IrrToNewton );
mat.setRotationDegrees( vector3df(45.0f, 0.0f, 0.0f) );
NewtonCollision* collisionFrame = NewtonCreateBox( pNewtonWorld, IrrToNewton*10, IrrToNewton*10, IrrToNewton*10, mat.pointer() );
pNewtonBody = NewtonCreateBody( pNewtonWorld, collisionFrame);
NewtonReleaseCollision( pNewtonWorld, collisionFrame );
//When I convert to a convex hull the offset data is lost and the primitive returns to its default position as if it had a null offset matrix upon creation
NewtonCollision* modifier = NewtonCreateConvexHullModifier( NewtonBodyGetWorld( pNewtonBody ), NewtonBodyGetCollision( pNewtonBody ) );
NewtonBodySetCollision( pNewtonBody, modifier);
NewtonReleaseCollision( pNewtonWorld, modifier);
I am actually trying to use a capsule for a player object in my game. With a universal PhysicsSetTransform callback. Problem is that callback makes the scene node rotation (scale and position) equal to that of the NewtonBody. As a result my character is standing up at rotation (0,0,0) but the capsule primitive is laying flat parralell with the x axis. Hence why I need the matrix offset for my convex hull.