Best Practices for converting matrices to transforms

Post Reply
Phong13
Posts: 4
Joined: Tue Apr 12, 2016 7:21 pm

Best Practices for converting matrices to transforms

Post by Phong13 »

By default Bullet appears to store 4x4 matrices and transforms transposed from each other. In conversion.h the BTTRANSFORM_TRANSPOSE macro controls this. Is there a design reason for this? I am tempted to turn it off so everything is stored the same way but I am wondering what I may loose if I do.

Moving rigid bodies works fine with the transposed matrices, but I am finding working with constraints to be very confusing which use the basis of the transposed transform and constraint frame to define the constraint axis.
anthrax11
Posts: 72
Joined: Wed Feb 24, 2010 9:49 pm

Re: Best Practices for converting matrices to transforms

Post by anthrax11 »

In BulletSharp, BTTRANSFORM_TRANSPOSE is used to convert matrices from row-major order to column-major order and vice versa when interfacing with Bullet.

This is necessary only if the Matrix class in the targeted graphics framework has a different arrangement than the btTransform matrix in Bullet. Any graphics framework will use one of the two arrangements and it's usually an arbitrary choice.

This only affects rotation and not translation (movements), so that's where you can see the effect.
Post Reply