using Encompass;
using KavTest.Extensions;
using MoonTools.Curve;

namespace KavTest.Components
{
    public struct MoveAlongCurve3DComponent : IComponent
    {
        public SplineCurve3D Curve { get; }
        public float Time { get; }

        public MoveAlongCurve3DComponent(SplineCurve3D curve)
        {
            Curve = curve;
            Time = 0;
        }

        public MoveAlongCurve3DComponent(SplineCurve3D curve, float currentTime)
        {
            Curve = curve;
            Time = currentTime;
        }
        public Microsoft.Xna.Framework.Vector3 Position
        { 
            get 
            {
                return Curve.Point(Time).ToXNAVector();
            }
        }
    }
}
