ecs and tranforms
added the moonworks ecs library. testing it by setting up a transform and parent system.
This commit is contained in:
6
Nerfed.Runtime/Components/LocalToWorld.cs
Normal file
6
Nerfed.Runtime/Components/LocalToWorld.cs
Normal file
@ -0,0 +1,6 @@
|
||||
using System.Numerics;
|
||||
|
||||
namespace Nerfed.Runtime.Components
|
||||
{
|
||||
public readonly record struct LocalToWorld(Matrix4x4 localToWorldMatrix);
|
||||
}
|
18
Nerfed.Runtime/Components/LocalTransform.cs
Normal file
18
Nerfed.Runtime/Components/LocalTransform.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.Numerics;
|
||||
|
||||
namespace Nerfed.Runtime.Components
|
||||
{
|
||||
public struct LocalTransform
|
||||
{
|
||||
public Vector3 position;
|
||||
public Quaternion rotation;
|
||||
public Vector3 scale;
|
||||
|
||||
public LocalTransform(Vector3 position, Quaternion rotation, Vector3 scale)
|
||||
{
|
||||
this.position = position;
|
||||
this.rotation = rotation;
|
||||
this.scale = scale;
|
||||
}
|
||||
}
|
||||
}
|
8
Nerfed.Runtime/Components/Parent.cs
Normal file
8
Nerfed.Runtime/Components/Parent.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using MoonTools.ECS;
|
||||
|
||||
namespace Nerfed.Runtime.Components
|
||||
{
|
||||
public readonly record struct Parent(Entity parentEntity);
|
||||
public readonly record struct PreviousParent(Entity parentEntity);
|
||||
public readonly record struct ChildRelation;
|
||||
}
|
Reference in New Issue
Block a user