- Enclosing class:
- Rotate
private static class Rotate.MatrixCache
extends java.lang.Object
Matrix cache. Computing single transformation matrix elements for
a general rotation is quite expensive. Also each of those partial
computations need some common operations to be made (compute sin
and cos, normalize axis). Therefore with the direct element computations
if all the getters for the elements are called to get the matrix,
the result is slow.
If a matrix element is asked for, we can reasonably anticipate that
some other elements will be asked for as well. So when any element
needs to be computed, we compute the entire matrix, cache it,
and use the stored values until the transform changes.