diff --git a/ZenKit.Test/TestMorphMesh.cs b/ZenKit.Test/TestMorphMesh.cs index 716ab76..6c5f9b5 100644 --- a/ZenKit.Test/TestMorphMesh.cs +++ b/ZenKit.Test/TestMorphMesh.cs @@ -42,7 +42,7 @@ public void TestLoad() Assert.That(ani.BlendOut, Is.EqualTo(-0.0100000007f)); Assert.That(ani.Duration.TotalSeconds, Is.EqualTo(0.4)); Assert.That(ani.Speed, Is.EqualTo(0.0250000004f)); - Assert.That(ani.Flags, Is.EqualTo(0)); + Assert.That(ani.Flags, Is.EqualTo(MorphAnimationFlags.None)); Assert.That(ani.FrameCount, Is.EqualTo(10)); var vertices = ani.Vertices; diff --git a/ZenKit/MorphMesh.cs b/ZenKit/MorphMesh.cs index 99df492..df6858f 100644 --- a/ZenKit/MorphMesh.cs +++ b/ZenKit/MorphMesh.cs @@ -5,6 +5,16 @@ namespace ZenKit { + [Flags] + public enum MorphAnimationFlags + { + None = 0, + Random = 1 << 0, + Loop = 1 << 1, + Shape = 1 << 2, + ShapeReference = 1 << 3, + } + public interface IMorphAnimation : ICacheable { string Name { get; } @@ -13,7 +23,7 @@ public interface IMorphAnimation : ICacheable float BlendOut { get; } TimeSpan Duration { get; } float Speed { get; } - byte Flags { get; } + MorphAnimationFlags Flags { get; } int FrameCount { get; } List Vertices { get; } public int SampleCount { get; } @@ -31,7 +41,7 @@ public class CachedMorphAnimation : IMorphAnimation public float BlendOut { get; set; } public TimeSpan Duration { get; set; } public float Speed { get; set; } - public byte Flags { get; set; } + public MorphAnimationFlags Flags { get; set; } public int FrameCount { get; set; } public List Vertices { get; set; } @@ -72,7 +82,7 @@ internal MorphAnimation(UIntPtr handle) public float BlendOut => Native.ZkMorphAnimation_getBlendOut(_handle); public TimeSpan Duration => TimeSpan.FromMilliseconds(Native.ZkMorphAnimation_getDuration(_handle)); public float Speed => Native.ZkMorphAnimation_getSpeed(_handle); - public byte Flags => Native.ZkMorphAnimation_getFlags(_handle); + public MorphAnimationFlags Flags => (MorphAnimationFlags) Native.ZkMorphAnimation_getFlags(_handle); public int FrameCount => (int)Native.ZkMorphAnimation_getFrameCount(_handle); public List Vertices =>