daily update on 20231016 by nitload youmu, vao,vbo,ebo struct added
This commit is contained in:
@@ -3,27 +3,28 @@ using System.Numerics;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Rectangle : Polygon4
|
||||
public class Rectangle : Parallelogram
|
||||
{
|
||||
internal Point center;
|
||||
|
||||
public sealed override Point RefPoint0 => center;
|
||||
|
||||
public sealed override Point RefPoint1 => new Point(vertexMat.transpose.colum0);
|
||||
|
||||
public sealed override Point RefPoint2 => new Point(vertexMat.transpose.colum1);
|
||||
|
||||
public Rectangle(
|
||||
float v0x, float v0y, float v0z,
|
||||
float v1x, float v1y, float v1z,
|
||||
float v2x, float v2y, float v2z,
|
||||
float v3x, float v3y, float v3z
|
||||
)
|
||||
) : base(
|
||||
v0x, v0y, v0z,
|
||||
v1x, v1y, v1z,
|
||||
v2x, v2y, v2z,
|
||||
v3x, v2y, v3z
|
||||
)
|
||||
{
|
||||
vertexMat.mat.colum0 = new Vector4(v0x, v0y, v0z, 0);
|
||||
vertexMat.mat.colum1 = new Vector4(v1x, v1y, v1z, 0);
|
||||
vertexMat.mat.colum2 = new Vector4(v2x, v2y, v2z, 0);
|
||||
vertexMat.mat.colum3 = new Vector4(v3x, v3y, v3z, 0);
|
||||
vec3d side0 = vertexMat.Colum0 - vertexMat.Colum1;
|
||||
vec3d side1 = vertexMat.Colum2 - vertexMat.Colum1;
|
||||
if (side0.Cross(side1) == Vec3d.Zero)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,25 +34,9 @@ namespace StgSharp.Geometries
|
||||
/// </summary>
|
||||
/// <param name="tick">当前游戏刻</param>
|
||||
/// <returns></returns>
|
||||
public virtual Vec3d MovCenter(uint tick) => default(Vec3d);
|
||||
public virtual vec3d MovCenter(uint tick) => default(vec3d);
|
||||
|
||||
public sealed override Vec3d MoveVertex2(uint tick)
|
||||
{
|
||||
return
|
||||
new Vec3d(this.center.position.vec * 2 - vertexMat.mat.colum0);
|
||||
}
|
||||
|
||||
public sealed override Vec3d MoveVertex3(uint tick)
|
||||
{
|
||||
return
|
||||
new Vec3d(this.center.position.vec * 2 - vertexMat.mat.colum1);
|
||||
}
|
||||
|
||||
internal sealed override void OnRender(uint tick)
|
||||
{
|
||||
tick -= bornTick;
|
||||
this.MovCenter(tick);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user