Added Setter for LocalTransform

This commit is contained in:
Simon Lübeß
2021-09-11 12:49:17 +02:00
parent fc2f1cd7e6
commit f761f87e1d
+11 -2
View File
@@ -9,7 +9,7 @@ namespace GlitchyEngine.World
Vector3 _scale = .One;
Matrix _localTransform = .Identity;
public bool IsDirty = false;;
public bool IsDirty = false;
public Matrix WorldTransform = .Identity;
@@ -19,7 +19,16 @@ namespace GlitchyEngine.World
public Matrix LocalTransform
{
get => _localTransform;
set mut => _localTransform = value;
set mut
{
if(_localTransform == value)
return;
_localTransform = value;
Matrix.Decompose(_localTransform, out _position, out _rotation, out _scale);
IsDirty = true;
}
}
public Vector3 Position