public Matrix4f getMatrix ( ) { if ( updateMatrix ) { final Matrix4f matrix = Matrix4f . createScaling ( scale . toVector4 ( 1 ) ) . rotate ( rotation ) . translate ( position ) ; if ( parent == null ) { this . matrix = matrix ; } else { childMatrix = matrix ; } updateMatrix = false ; } if ( parent != null ) { final Matrix4f parentMatrix = parent . getMatrix ( ) ; if ( parentMatrix != lastParentMatrix ) { matrix = parentMatrix . mul ( childMatrix ) ; lastParentMatrix = parentMatrix ; } } return matrix ; }
Returns the transformation matrix that represent the model s current scale rotation and position .