To use the new quaternion-based rotation matrix, we must add a new method into the Transform . py class like this:
from Quaternion import *
.
def rotate_axis(self, axis: pygame.Vector3, angle,
local=True) :
$\mathrm{q}=$ Quaternion (axis=axis, angle=angle)
$r$ _mat $=q \cdot$ get_matrix ()
if local:
self.MVM $=$ self.MVM@ $r_{\text {_mat }}$
else:
self.MVM $=r$ mat @ self.MVM