daily update on 20230516 by nitload youmu, geometry interfaces created between cs and c
This commit is contained in:
@@ -7,8 +7,12 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Triangle :IPlainGeometry
|
||||
|
||||
|
||||
public unsafe class Triangle :IPlainGeometry
|
||||
{
|
||||
public triangleVertexArray vertexArray;
|
||||
|
||||
internal Point vertex1;
|
||||
internal Point vertex2;
|
||||
internal Point vertex3;
|
||||
@@ -16,11 +20,8 @@ namespace StgSharp.Geometries
|
||||
internal GetLocationHandler movVertex02Opearion = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal GetLocationHandler movVertex03Opearion = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
|
||||
|
||||
public override sealed Point RefPoint01=> vertex1;
|
||||
|
||||
public override sealed Point RefPoint01 => vertex1;
|
||||
public override sealed Point RefPoint02 => vertex2;
|
||||
|
||||
public override sealed Point RefPoint03 => vertex3;
|
||||
|
||||
public GetLocationHandler MovVertex01Operation => this.movVertex01Opearion;
|
||||
@@ -33,13 +34,20 @@ namespace StgSharp.Geometries
|
||||
|
||||
public virtual vec3d MovVertex03(uint tick) => movVertex03Opearion.Invoke(tick);
|
||||
|
||||
public Triangle()
|
||||
{
|
||||
this.vertexArray = GeometryIO.initTriangleVertex();
|
||||
this.vertex1.Position = *vertexArray.vertex1Ptr;
|
||||
this.vertex2.Position = *vertexArray.vertex2Ptr;
|
||||
this.vertex3.Position = *vertexArray.vertex3Ptr;
|
||||
}
|
||||
|
||||
internal override sealed void OnRender(uint tick)
|
||||
{
|
||||
tick -= this.bornTick;
|
||||
vertex1._position = RefOrigin._position + MovVertex01(tick);
|
||||
vertex2._position = RefOrigin._position + MovVertex02(tick);
|
||||
vertex3._position = RefOrigin._position + MovVertex03(tick);
|
||||
|
||||
vertex1.Position = RefOrigin.Position + MovVertex01(tick);
|
||||
vertex2.Position = RefOrigin.Position + MovVertex02(tick);
|
||||
vertex3.Position = RefOrigin.Position + MovVertex03(tick);
|
||||
}
|
||||
|
||||
public override Line[] GetAllSides()
|
||||
|
||||
Reference in New Issue
Block a user