file
Integration.hConversion of Bullet math types.
Provides conversion for the following types:
Magnum type | Equivalent Bullet type |
---|---|
Vector3 | btVector3 |
Matrix3x3 | btMatrix3x3 |
Matrix4 | btTransform |
Quaternion | btQuaternion |
All type conversion is done with btScalar as the underlying type. It's typically a float
, but Bullet can be compiled to use double
instead. In that case, the above types are then Vector3d, Quaterniond etc.
Unlike Magnum, Bullet stores matrices in row-major order, so these get transposed during the conversion.
Example usage:
#include <Magnum/BulletIntegration/Integration.h> … btVector3 a{20.0f, 50.0f, -1.0f}; Vector3 b(a); using namespace Math::Literals; auto c = btQuaternion(Quaternion::rotation(15.0_degf, Vector3::xAxis()));