56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using StgSharp.Graphics;
|
|
using StgSharp.Math;
|
|
|
|
namespace StgSharp.Geometries
|
|
{
|
|
|
|
/// <summary>
|
|
/// 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
|
|
/// </summary>
|
|
public abstract class PlainGeometry
|
|
{
|
|
protected FrameTimer time;
|
|
|
|
internal PartialPlainCoordinate coordinate;
|
|
internal Matrix2x4 textureFrame;
|
|
|
|
public PartialPlainCoordinate ReferenceCoordinate
|
|
{
|
|
get => this.coordinate;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tick time this geometry eas crested
|
|
/// </summary>
|
|
public uint BornTime => time;
|
|
|
|
internal abstract int[] Indices { get; }
|
|
|
|
public PlainGeometry(Form form)
|
|
{
|
|
time = new FrameTimer(form);
|
|
}
|
|
|
|
public PlainGeometry() { }
|
|
|
|
internal abstract void UpdateCoordinate(uint tick);
|
|
|
|
/// <summary>
|
|
/// Get all sides of this <see cref="PlainGeometry"/>.
|
|
/// </summary>
|
|
/// <returns>A array contains all straight <see cref="Line"/>s of current geometry item.</returns>
|
|
public abstract Line[] GetAllSides();
|
|
|
|
/// <summary>
|
|
/// Get a flat <see cref="Plain"/> cincide with current geometry.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public abstract Plain GetPlain();
|
|
|
|
//public abstract Rectangle GetRenderFrame();
|
|
|
|
}
|
|
|
|
|
|
}
|