07.10.2020
+ Parent, Name and Flags to objects. ~ Improved Matrix calculations
This commit is contained in:
parent
f865496414
commit
2c00dbd31a
21 changed files with 383 additions and 42 deletions
|
|
@ -7,10 +7,34 @@ namespace SM.Base.Scene
|
|||
/// </summary>
|
||||
public abstract class GenericTransformation
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains the current model matrix.
|
||||
/// </summary>
|
||||
protected Matrix4 _modelMatrix { get; private set; }
|
||||
/// <summary>
|
||||
/// Contains the last frame the matrix was calculated.
|
||||
/// </summary>
|
||||
protected ulong _lastFrame { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current model matrix.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Matrix4 GetMatrix()
|
||||
{
|
||||
if (_lastFrame != SMRenderer.CurrentFrame)
|
||||
{
|
||||
_lastFrame = SMRenderer.CurrentFrame;
|
||||
_modelMatrix = RequestMatrix();
|
||||
}
|
||||
|
||||
return _modelMatrix;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the current matrix.
|
||||
/// </summary>
|
||||
/// <returns>The current matrix.</returns>
|
||||
public abstract Matrix4 GetMatrix();
|
||||
protected abstract Matrix4 RequestMatrix();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue