#region usings using OpenTK; #endregion namespace SM.Base.Scene { /// /// Contains methods for using transformations right. /// public abstract class GenericTransformation { /// /// Contains the current model matrix. /// protected Matrix4 _modelMatrix { get; private set; } /// /// Contains the last frame the matrix was calculated. /// protected ulong _lastFrame { get; private set; } /// /// Returns the current model matrix. /// /// public Matrix4 GetMatrix() { if (_lastFrame != SMRenderer.CurrentFrame) { _lastFrame = SMRenderer.CurrentFrame; _modelMatrix = RequestMatrix(); } return _modelMatrix; } /// /// Calculates the current matrix. /// /// The current matrix. protected abstract Matrix4 RequestMatrix(); } }