using StgSharp.Math; using System; using System.Numerics; namespace StgSharp.Geometries { public class Line : PlainGeometry { internal Point basePoint; internal Point beginPoint; internal Point endPoint; internal GetLocationHandler movBegin; internal GetLocationHandler movEnd; internal override int[] Indices { get { throw new Exception(); } } public Line(Point begin, Point end) { this.beginPoint = begin; this.endPoint = end; } internal Line(Vector4 begin, Vector4 end) { beginPoint = new Point(begin); endPoint = new Point(end); } public Line() { } /// /// Move begin side of a line. /// It is recommended to override this function rather than /// loading an with same function. /// /// Time passed since current line was created. public virtual vec3d MoveBeginPoint(uint tick) => movBegin.Invoke(time); /// /// Move end side of a line. /// It is recommended to override this function rather than /// loading an with same function. /// /// Time passed since current line was created. /// public virtual vec3d MoveEndPoint(uint tick) => movEnd.Invoke(time); internal override void UpdateCoordinate(uint tick) { beginPoint.Position = coordinate.origin + MoveBeginPoint(time); endPoint.Position = coordinate.origin + MoveEndPoint(time); } public override Line[] GetAllSides() { throw new NotImplementedException(); } public override Plain GetPlain() { throw new ToUpperDimensionException(); } } }