mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Animations now component based
This commit is contained in:
@@ -29,6 +29,9 @@ namespace GlitchyEngine.Renderer.Animation
|
||||
private Skeleton _skeleton ~ _.ReleaseRef();
|
||||
public JointPose[] LocalPose ~ delete _;
|
||||
public Matrix[] GlobalPose ~ delete _;
|
||||
|
||||
public Matrix[] SkinningMatricies ~ delete _;
|
||||
public Matrix3x3[] InvTransSkinningMatricies ~ delete _;
|
||||
|
||||
public Skeleton Skeleton => _skeleton;
|
||||
|
||||
@@ -40,6 +43,9 @@ namespace GlitchyEngine.Renderer.Animation
|
||||
|
||||
LocalPose = new JointPose[jointCount];
|
||||
GlobalPose = new Matrix[jointCount];
|
||||
|
||||
SkinningMatricies = new Matrix[jointCount];
|
||||
InvTransSkinningMatricies = new Matrix3x3[jointCount];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace GlitchyEngine.World
|
||||
{
|
||||
private AnimationClip _animationClip;
|
||||
|
||||
private SkeletonPose _pose;
|
||||
|
||||
public AnimationClip AnimationClip
|
||||
{
|
||||
get => _animationClip;
|
||||
@@ -20,11 +22,20 @@ namespace GlitchyEngine.World
|
||||
}
|
||||
}
|
||||
|
||||
public float TimeIndex;
|
||||
|
||||
public float TimeScale;
|
||||
|
||||
public bool IsPlaying;
|
||||
|
||||
public SkeletonPose Pose => _pose;
|
||||
|
||||
public static void DisposeComponent(void* component)
|
||||
{
|
||||
Self* animationComponent = (Self*)component;
|
||||
|
||||
animationComponent._animationClip?.ReleaseRef();
|
||||
delete animationComponent._pose;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user