Daily update on 20250618-051714 by Nitload Youmu. Additional Message : Brief support to collection operation in EXPRESS. A collection type added in core lib and compilestack.

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-06-18 05:17:14 +08:00
parent 74c01effe4
commit c624a8ca38
300 changed files with 12227 additions and 4303 deletions
@@ -47,14 +47,11 @@ namespace StgSharp.Geometries
internal Matrix32 axis;
/// <summary>
/// The _origin of this coordinate.
/// The _origin of this coordinate.
/// </summary>
public Vec3 origin;
public PartialPlainCoordinate(
Vec3 origin,
Vec3 horiziontial,
Vec3 vertical )
public PartialPlainCoordinate( Vec3 origin, Vec3 horiziontial, Vec3 vertical )
{
this.origin = origin;
axis = new Matrix32();
@@ -66,12 +63,12 @@ namespace StgSharp.Geometries
}
/// <summary>
/// The horizontial axis of the coordinate. Point to the right direction.
/// The horizontial axis of the coordinate. Point to the right direction.
/// </summary>
public Vec3 axis_H => axis.colum0;
/// <summary>
/// The vertical axis of the coordinate. Point to the top direction.
/// The vertical axis of the coordinate. Point to the top direction.
/// </summary>
public Vec3 axis_V => axis.colum1;
@@ -41,11 +41,7 @@ namespace StgSharp.Geometries
public interface IPlainEntity
{
public Vec2 CenterPosition
{
get;
set;
}
public Vec2 CenterPosition { get; set; }
public bool CollideWith( IPlainEntity entity );
@@ -53,29 +53,13 @@ namespace StgSharp.Geometries
( ( IInstancingBuffer )buffer ).InstanceList.Add( this );
}
public GeometryMotion Motion
{
get;
set;
}
public GeometryMotion Motion { get; set; }
public IInstancingBuffer GlobalBuffer
{
get;
set;
}
public IInstancingBuffer GlobalBuffer { get; set; }
public int BufferId
{
get;
set;
}
public int BufferId { get; set; }
Vec3 IInstancing.CenterPositionGlobal
{
get;
set;
}
Vec3 IInstancing.CenterPositionGlobal { get; set; }
bool IPlainEntity.CollideWith( IPlainEntity entity )
{
@@ -37,7 +37,7 @@ using System.ComponentModel;
namespace StgSharp.Geometries
{
/// <summary>
/// Plain geometry only contains straight sides.
/// Plain geometry only contains straight sides.
/// </summary>
public abstract class PlainGeometry : IGeometry
{
@@ -58,10 +58,7 @@ namespace StgSharp.Geometries
public int VertexCount => this.vertexMat.Length;
public abstract ReadOnlySpan<int> VertexIndices
{
get;
}
public abstract ReadOnlySpan<int> VertexIndices { get; }
#pragma warning disable CA1819
public Vec4[] VertexStream => vertexMat;
@@ -85,12 +85,12 @@ namespace StgSharp.Geometries
{
get
{
if( coordArray.Length != coordList.Capacity ) {
if( coordArray.Length != coordList.Capacity )
{
FieldInfo fieldInfo = typeof( List<Vec4> ).
GetField(
"_items",
BindingFlags.NonPublic | BindingFlags.Instance );
if( fieldInfo == null ) {
GetField( "_items", BindingFlags.NonPublic | BindingFlags.Instance );
if( fieldInfo == null )
{
#pragma warning disable CA1065
#pragma warning disable CA2201
throw new NullReferenceException();
@@ -107,12 +107,12 @@ namespace StgSharp.Geometries
{
get
{
if( scaleArray.Length != coordList.Capacity ) {
if( scaleArray.Length != coordList.Capacity )
{
FieldInfo fieldInfo = typeof( List<float> ).
GetField(
"_items",
BindingFlags.NonPublic | BindingFlags.Instance );
if( fieldInfo == null ) {
GetField( "_items", BindingFlags.NonPublic | BindingFlags.Instance );
if( fieldInfo == null )
{
#pragma warning disable CA1065
#pragma warning disable CA2201
throw new NullReferenceException();
@@ -167,8 +167,7 @@ namespace StgSharp.Geometries
temp.BufferId = instance.BufferId;
coordList[ instance.BufferId ] = coordList[ coordList.Count - 1 ];
scalingList[ instance.BufferId ] = scalingList[
scalingList.Count - 1 ];
scalingList[ instance.BufferId ] = scalingList[ scalingList.Count - 1 ];
instanceList.RemoveAt( instanceList.Count - 1 );
coordList.RemoveAt( coordList.Count - 1 );
@@ -185,7 +184,8 @@ namespace StgSharp.Geometries
protected virtual void Dispose( bool disposing )
{
if( !disposedValue ) {
if( !disposedValue )
{
if( disposing ) {
mutex.Dispose();
}
@@ -204,8 +204,7 @@ namespace StgSharp.Geometries
}
}
IGeometry IInstancingBuffer.TypicalShape => throw new NotImplementedException(
);
IGeometry IInstancingBuffer.TypicalShape => throw new NotImplementedException();
#region field of mem opt
@@ -28,7 +28,6 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Math;
using System;
@@ -44,18 +43,19 @@ namespace StgSharp.Geometries
internal Point center;
public Parallelogram(
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
: base( v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y )
{
#if DEBUG
if( this[ 0 ].Coord + this[ 2 ].Coord != this[ 1 ].Coord + this[ 3 ].Coord ) {
if( this[ 0 ].Coord + this[ 2 ].Coord != this[ 1 ].Coord + this[ 3 ].Coord )
{
InternalIO.InternalWriteLog(
"Init of geometry item failed, because four vertices cannot form a rectangle.",
LogType.Warning );
@@ -64,19 +64,20 @@ namespace StgSharp.Geometries
}
public Parallelogram(
PlainCoordinate coordination,
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
PlainCoordinate coordination,
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
: base( coordination, v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y )
{
#if DEBUG
if( this[ 0 ].Coord + this[ 2 ].Coord != this[ 1 ].Coord + this[ 3 ].Coord ) {
if( this[ 0 ].Coord + this[ 2 ].Coord != this[ 1 ].Coord + this[ 3 ].Coord )
{
InternalIO.InternalWriteLog(
"Init of geometry item failed, because four vertices cannot form a rectangle.",
LogType.Warning );
@@ -28,7 +28,6 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Math;
using System;
@@ -56,11 +55,7 @@ namespace StgSharp.Geometries
vertexMat = rawCoord;
}
public Polygon4(
Point topLeft,
Point topRight,
Point bottomRight,
Point bottomLeft )
public Polygon4( Point topLeft, Point topRight, Point bottomRight, Point bottomLeft )
: base( PlainCoordinate.StandardPlainCoordination )
{
this[ 0 ] = topLeft;
@@ -70,12 +65,12 @@ namespace StgSharp.Geometries
}
public Polygon4(
CoordinationBase coordinate,
PlainCoordinate coordination,
Point topLeft,
Point topRight,
Point bottomRight,
Point bottomLeft )
CoordinationBase coordinate,
PlainCoordinate coordination,
Point topLeft,
Point topRight,
Point bottomRight,
Point bottomLeft )
: base( coordinate )
{
this[ 0 ] = topLeft;
@@ -85,14 +80,14 @@ namespace StgSharp.Geometries
}
public Polygon4(
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
: base( PlainCoordinate.StandardPlainCoordination )
{
vertexMat = new Vec4[4];
@@ -104,15 +99,15 @@ namespace StgSharp.Geometries
}
public Polygon4(
PlainCoordinate coordination,
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
PlainCoordinate coordination,
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
: base( coordination )
{
vertexMat = new Vec4[4];
@@ -28,7 +28,6 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Math;
using System;
@@ -48,16 +47,16 @@ namespace StgSharp.Geometries
}
public Polygon5(
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y,
float v4x,
float v4y )
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y,
float v4x,
float v4y )
: base( PlainCoordinate.StandardPlainCoordination )
{
vertexMat = new Vec4[5];
@@ -69,17 +68,17 @@ namespace StgSharp.Geometries
}
public Polygon5(
PlainCoordinate coordination,
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y,
float v4x,
float v4y )
PlainCoordinate coordination,
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y,
float v4x,
float v4y )
: base( coordination )
{
vertexMat = new Vec4[5];
@@ -28,7 +28,6 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Math;
using System;
@@ -48,14 +47,14 @@ namespace StgSharp.Geometries
}
public Polygon6(
PlainCoordinate coordination,
Vec2 vert0,
Vec2 vert1,
Vec2 vert2,
Vec2 vert3,
Vec2 vert4,
Vec2 vert5,
Vec2 vert6 )
PlainCoordinate coordination,
Vec2 vert0,
Vec2 vert1,
Vec2 vert2,
Vec2 vert3,
Vec2 vert4,
Vec2 vert5,
Vec2 vert6 )
: base( coordination )
{
vertexMat = new Vec4[6];
@@ -39,14 +39,14 @@ namespace StgSharp.Geometries
{
public Rectangle(
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
: base( v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y )
{
#if DEBUG
@@ -59,15 +59,15 @@ namespace StgSharp.Geometries
}
public Rectangle(
PlainCoordinate coordination,
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
PlainCoordinate coordination,
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
: base( coordination, v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y )
{
#if DEBUG
@@ -80,10 +80,14 @@ namespace StgSharp.Geometries
}
/// <summary>
/// Calculate movement to center
/// Calculate movement to center
/// </summary>
/// <param _name="tick"> CurrentBlueprint time tick </param>
/// <returns></returns>
/// <param _label="tick">
/// CurrentPipeline time tick
/// </param>
/// <returns>
///
/// </returns>
public virtual Vec3 MovCenter( uint tick )
{
return default( Vec3 );
@@ -35,20 +35,20 @@ using System.Numerics;
namespace StgSharp.Geometries
{
/// <summary>
/// A square
/// A square
/// </summary>
public class Square : Rectangle
{
public Square(
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y,
float v3x,
float v3y )
: base( v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y )
{
if( true ) { }
@@ -28,7 +28,6 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Graphics;
using StgSharp.Math;
@@ -57,10 +56,10 @@ namespace StgSharp.Geometries
}
public Triangle(
PlainCoordinate coordination,
Point vertex01,
Point vertex02,
Point vertex03 )
PlainCoordinate coordination,
Point vertex01,
Point vertex02,
Point vertex03 )
: base( coordination )
{
this[ 0 ] = vertex01;
@@ -68,13 +67,7 @@ namespace StgSharp.Geometries
this[ 2 ] = vertex03;
}
public Triangle(
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y )
public Triangle( float v0x, float v0y, float v1x, float v1y, float v2x, float v2y )
: base( PlainCoordinate.StandardPlainCoordination )
{
this[ 0 ] = new Point( v0x, v0y, 0 );
@@ -83,13 +76,13 @@ namespace StgSharp.Geometries
}
public Triangle(
PlainCoordinate coordination,
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y )
PlainCoordinate coordination,
float v0x,
float v0y,
float v1x,
float v1y,
float v2x,
float v2y )
: base( coordination )
{
this[ 0 ] = new Point( v0x, v0y, 0 );