Start of AnimationSystem

This commit is contained in:
Simon Lübeß
2021-08-27 22:37:59 +02:00
parent eafdc2f17f
commit ce03f7c600
8 changed files with 707 additions and 29 deletions
@@ -0,0 +1,42 @@
using GlitchyEngine.Math;
namespace GlitchyEngine.Renderer.Animation
{
public class Skeleton
{
public Joint[] Joints ~ delete _;
public Joint? GetParent(Joint joint)
{
if(joint.ParentID == uint8.MaxValue)
return null;
return Joints[joint.ParentID];
}
public ~this()
{
for(var joint in Joints)
{
delete joint.Name;
}
}
}
public class SkeletonPose
{
public Skeleton Skeleton;
public JointPose[] LocalPose ~ delete _;
public Matrix[] GlobalPose ~ delete _;
public this(Skeleton skeleton)
{
Skeleton = skeleton;
int jointCount = Skeleton.Joints.Count;
LocalPose = new JointPose[jointCount];
GlobalPose = new Matrix[jointCount];
}
}
}