Updated AnimationClip, Model Loader now loads Nodes into ECS

- SandboxApp: Started basic skinned mesh render system
This commit is contained in:
Simon Lübeß
2021-09-11 17:00:11 +02:00
parent 89bb475994
commit 39f5893c7e
3 changed files with 457 additions and 99 deletions
@@ -67,25 +67,24 @@ namespace GlitchyEngine.Renderer.Animation
class AnimationClip : RefCounted
{
private Skeleton _skeleton ~ _.ReleaseRef();
public float FramesPerSecond;
//public float FramesPerSecond;
public JointAnimation[] JointAnimations;
public bool IsLooping;
public float Duration;
public Skeleton Skeleton
{
get => _skeleton;
set
{
if(_skeleton == value)
return;
public Skeleton Skeleton => _skeleton;
_skeleton?.ReleaseRef();
_skeleton = value;
_skeleton?.AddRef();
}
[AllowAppend]
public this(Skeleton skeleton)
{
var jointAnimations = append JointAnimation[skeleton.Joints.Count];
Log.EngineLogger.AssertDebug(skeleton != null);
_skeleton = skeleton..AddRef();
JointAnimations = jointAnimations;
}
// TODO: check
public ~this()
{
@@ -93,8 +92,6 @@ namespace GlitchyEngine.Renderer.Animation
{
jointAnimation.Dispose();
}
delete JointAnimations;
}
}