I'm trying to modify a physics engine for efficiency. Currently, as objects move around the world, their orientation (a quaternion) is updated every frame, by multiplying by the rotation (another quaternion).
newOrientation = orientation*angularVelocity
This is not very efficient when the objects are far apart and the orientation is not required. What I would like to do is remember the time that orientation was last updated, and rotate only once for a given period of time.
This gives the formula:
newOrientation = orientation*(angularVelocity^timeSinceLastUpdate)
angularVelocity is a quaternion, while timeSinceLastUpdate is a scalar/real value.
What would the formula be to take a quaternion to a scalar power n?
The full java class has been posted at: