daily update on 20230529 by nitload youmu

This commit is contained in:
Nitload
2023-05-29 04:36:01 +08:00
parent 9ca4a69a2a
commit 1874b32fb0
62 changed files with 1142 additions and 1250 deletions
@@ -13,18 +13,31 @@ namespace StgSharp.Geometries
public unsafe class Point : INode<Point>, INullable
{
internal vec3d* positionPtr;
internal readonly bool isVertex;
internal Point(vec3d* ptr)
{
positionPtr = ptr;
}
public Point()
{
IntPtr ptr = Marshal.AllocHGlobal(sizeof(vec3d));
positionPtr = (vec3d*)ptr.ToPointer();
}
public vec3d Position
{
get { return *positionPtr; }
set { *positionPtr = value; }
}
public vec3d* PositionPtr
{
get { return positionPtr; }
set { positionPtr = value; }
}
public float X
{
get { return (*this.positionPtr).X; }
@@ -43,7 +56,6 @@ namespace StgSharp.Geometries
set { (*this.positionPtr).Z = value; }
}
internal readonly bool isVertex;
public bool IsVertex => isVertex;
@@ -1,12 +1,20 @@
using System;
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Geometries
{
/// <summary>
/// A square
/// </summary>
public class Square:Rectangle
{
public sealed override vec3d MovVertex02(uint tick)
{
return this.center.Position * 2 - this.vertex01.Position;
}
}
}
@@ -37,16 +37,23 @@ namespace StgSharp.Geometries
public Triangle()
{
this.vertexArray = internalIO.initTriangleVertex();
this.vertex1 = new Point(vertexArray.vertex1Ptr);
this.vertex2 = new Point(vertexArray.vertex2Ptr);
this.vertex3 = new Point(vertexArray.vertex3Ptr);
this.vertex1 = new Point();
this.vertex2 = new Point();
this.vertex3 = new Point();
this.vertexArray = new triangleVertexArray();
vertexArray.vertex1Ptr = this.vertex1.positionPtr;
vertexArray.vertex2Ptr = this.vertex1.positionPtr;
vertexArray.vertex3Ptr = this.vertex1.positionPtr;
/**/
ProgramTimeLine._currentPool.pointContainer.Add(vertex1);
ProgramTimeLine._currentPool.pointContainer.Add(vertex2);
ProgramTimeLine._currentPool.pointContainer.Add(vertex3);
ProgramTimeLine._currentPool._pointContainer.Add(vertex1);
ProgramTimeLine._currentPool._pointContainer.Add(vertex2);
ProgramTimeLine._currentPool._pointContainer.Add(vertex3);
/**/
}
public Triangle(