using System.Runtime.InteropServices; namespace Cthangover.Live2D.Cubism.Framework { /// /// Specifies which part of the model a motion curve affects. /// public enum CubismMotionCurveTarget { Model, Parameter, PartOpacity } /// /// Segment interpolation type within a motion curve. /// /// — straight line between two points /// — cubic bezier (4 control points per segment) /// — hold previous value until the segment ends /// — jump to next value at segment start /// /// public enum CubismMotionSegmentType { Linear = 0, Bezier = 1, Stepped = 2, InverseStepped = 3 } /// /// A time-value pair representing a keyframe or control point on a motion curve. /// [StructLayout(LayoutKind.Sequential)] public struct CubismMotionPoint { /// Time in seconds from the start of the motion. public float Time; /// Value at this point. For bezier control points, this is an intermediate value. public float Value; } /// /// Describes a single curve within a motion. Contains the target type, /// parameter/part ID, segment count, offset into the flat segment data, /// and per-curve fade timing. /// public struct CubismMotionCurve { public CubismMotionCurveTarget Type; public string Id; public int SegmentCount; public int BaseSegmentIndex; public float FadeInTime; public float FadeOutTime; } /// /// A named event that fires at a specific time during motion playback. /// Events are defined in the UserData section of the .motion3.json. /// Accessed via . /// public struct CubismMotionEvent { /// Time offset in seconds when this event triggers. public float FireTime; /// String value associated with the event. public string Value; } }