daily uodate on 20231208 by nitload youmu, preparation for multi thread rendering

This commit is contained in:
Nitload
2023-12-08 05:36:04 +08:00
parent ae804553ce
commit ab85c1a9fe
297 changed files with 157896 additions and 5170 deletions
@@ -11,12 +11,43 @@ namespace StgSharp.Geometries
internal readonly GetLocationHandler moveVertex2Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal readonly GetLocationHandler moveVertex3Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal Matrix3x4 vertexMat;
internal Matrix2x4 vertexMat;
internal Polygon4()
{
}
public Polygon4(PartialPlainCoordinate coordinate,
Vec2d topLeft,
Vec2d topRight,
Vec2d bottomRight,
Vec2d bottomLeft,
bool Orth
)
{
this.coordinate = coordinate;
vertexMat.Colum0 = topLeft;
vertexMat.Colum1 = topRight;
vertexMat.Colum2 = bottomRight;
vertexMat.Colum3 = bottomLeft;
Vector4 maxCoord = vertexMat.mat.colum0;
Vector4 minCoord = vertexMat.mat.colum0;
maxCoord = Vector4.Max(maxCoord, vertexMat.mat.colum1);
maxCoord = Vector4.Max(maxCoord, vertexMat.mat.colum2);
maxCoord = Vector4.Max(maxCoord, vertexMat.mat.colum3);
minCoord = Vector4.Min(minCoord, vertexMat.mat.colum1);
minCoord = Vector4.Min(minCoord, vertexMat.mat.colum2);
minCoord = Vector4.Min(minCoord, vertexMat.mat.colum3);
textureFrame.mat.colum1 = maxCoord;
textureFrame.mat.colum3 = minCoord;
textureFrame.Colum0 = new Vec2d(minCoord.X, maxCoord.Y);
textureFrame.Colum2 = new Vec2d(maxCoord.X, minCoord.Y);
}
public Polygon4(
float v0x, float v0y, float v0z,
float v1x, float v1y, float v1z,
@@ -35,20 +66,7 @@ namespace StgSharp.Geometries
public GetLocationHandler MovVertex2Operaion { get { return moveVertex2Operation; } }
public GetLocationHandler MovVertex3Operaion { get { return moveVertex3Operation; } }
public override Point RefPoint0
{
get { return new Point(vertexMat.mat.colum0); }
}
public override Point RefPoint1
{
get { return new Point(vertexMat.mat.colum1); }
}
public override Point RefPoint2
{
get { return new Point(vertexMat.mat.colum2); }
}
internal sealed override int[] Indices
{
@@ -89,6 +107,7 @@ namespace StgSharp.Geometries
set { vertexMat.mat.colum1 = value.position.vec; }
}
public override Line[] GetAllSides()
{
Line[] sides = new Line[4]
@@ -112,25 +131,22 @@ namespace StgSharp.Geometries
}
public virtual vec3d MoveVertex0(uint tick)
=> moveVertex0Operation.Invoke(tick);
=> moveVertex0Operation(tick);
public virtual vec3d MoveVertex1(uint tick)
=> moveVertex1Operation.Invoke(tick);
=> moveVertex1Operation(tick);
public virtual vec3d MoveVertex2(uint tick)
=> moveVertex2Operation.Invoke(tick);
=> moveVertex2Operation(tick);
public virtual vec3d MoveVertex3(uint tick)
=> moveVertex3Operation.Invoke(tick);
=> moveVertex3Operation(tick);
internal override void OnRender(uint tick)
internal override void UpdateCoordinate(uint tick)
{
uint nowTick = TimeLine.tickCounter._value;
this.vertexMat.Colum0 = RefOrigin.position + moveVertex1Operation(nowTick);
this.vertexMat.Colum1 = RefOrigin.position + moveVertex1Operation(nowTick);
this.vertexMat.Colum2 = RefOrigin.position + moveVertex2Operation(nowTick);
this.vertexMat.Colum3 = RefOrigin.position + moveVertex3Operation(nowTick);
}
}
}