diff --git a/GlitchyEngine/src/Content/ModelLoader.bf b/GlitchyEngine/src/Content/ModelLoader.bf index 7641c86..3cb6e96 100644 --- a/GlitchyEngine/src/Content/ModelLoader.bf +++ b/GlitchyEngine/src/Content/ModelLoader.bf @@ -71,6 +71,11 @@ namespace GlitchyEngine.Content { Entity entity = world.NewEntity(); +#if DEBUG + var nameComponent = world.AssignComponent(entity); + nameComponent.SetName(StringView(node.Name)); +#endif + if(parentEntity.HasValue) { var childParent = world.AssignComponent(entity); @@ -101,6 +106,7 @@ namespace GlitchyEngine.Content childTransform.Scale = .(1, 1, 1); } + // Invert the Z-Axis of the root Node to convert the coordinate system from right-handed to left-handed if(parentEntity == null) childTransform.Scale *= .(1, 1, -1); diff --git a/GlitchyEngine/src/World/DebugNameComponent.bf b/GlitchyEngine/src/World/DebugNameComponent.bf new file mode 100644 index 0000000..3559100 --- /dev/null +++ b/GlitchyEngine/src/World/DebugNameComponent.bf @@ -0,0 +1,28 @@ +using System; +namespace GlitchyEngine.World +{ + struct DebugNameComponent : IDisposableComponent + { + private String _debugName; + + public String DebugName + { + get => _debugName; + set mut => SetName(value); + } + + public void SetName(StringView name) mut + { + delete _debugName; + + _debugName = new String(name); + } + + public static void DisposeComponent(void* component) + { + Self* self = (Self*)component; + + DeleteAndNullify!(self._debugName); + } + } +} diff --git a/Sandbox/src/SandboxApp.bf b/Sandbox/src/SandboxApp.bf index edfa4f3..48dbcd1 100644 --- a/Sandbox/src/SandboxApp.bf +++ b/Sandbox/src/SandboxApp.bf @@ -307,6 +307,7 @@ namespace Sandbox void InitEcs() { + _world.Register(); _world.Register(); _world.Register(); _world.Register();