btTransform transform; btQuaternion rotation = btQuaternion(btVector3(0, 1, 0), M_PI); transform.setRotation(rotation);
btTransform transform; btMatrix3x3 rotationMatrix = btMatrix3x3(btQuaternion(btVector3(0,0,1), M_PI_2)); transform.setBasis(rotationMatrix);In this example, we create a new transform and a 3x3 rotation matrix that represents a 90-degree rotation about the z-axis. We then set the transform's basis (linear transformation matrix) to this rotation matrix using setBasis(). Both examples utilize the setRotation() function from the btTransform class in the Bullet Physics Library.