public Matrix4f getViewMatrix ( ) { if ( updateViewMatrix ) { rotationMatrixInverse = Matrix4f . createRotation ( rotation ) ; final Matrix4f rotationMatrix = Matrix4f . createRotation ( rotation . invert ( ) ) ; final Matrix4f positionMatrix = Matrix4f . createTranslation ( position . negate ( ) ) ; viewMatrix = rotationMatrix . mul ( positionMatrix ) ; updateViewMatrix = false ; } return viewMatrix ; }
Returns the view matrix which is the transformation matrix for the position and rotation .