Gizmo improvements

This commit is contained in:
Simon Lübeß
2022-05-15 14:36:07 +02:00
parent 3956080520
commit 62bb5baac9
8 changed files with 108 additions and 38 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ namespace GlitchyEngine.World
public ChildEnumerator EnumerateChildren => .(this);
public bool IsValid => _entity.IsValid;
public bool IsValid => _entity.IsValid && _scene != null;
public Entity? Parent
{
+14
View File
@@ -12,6 +12,20 @@ namespace GlitchyEngine.World
internal EcsWorld _ecsWorld = new .() ~ delete _;
private Dictionary<Type, function void(Entity entity, Type componentType, void* component)> _onComponentAddedHandlers = new .() ~ delete _;
public Entity ActiveCamera => {
Entity cameraEntity = .();
for (var (entity, camera) in _ecsWorld.Enumerate<CameraComponent>())
{
if (camera.Primary && camera.RenderTarget != null)
{
cameraEntity = .(entity, this);
}
}
cameraEntity
};
public this()
{
@@ -43,7 +43,10 @@ namespace GlitchyEngine.World
_localTransform = value;
Matrix.Decompose(_localTransform, out _position, out _rotation, out _scale);
Matrix.Decompose(_localTransform, out _position, let rotation, out _scale);
Rotation = rotation;
IsDirty = true;
}
}