daily update on 20240514 by nitload youmu

This commit is contained in:
YoumuLiu
2024-05-14 15:41:22 +08:00
parent a3506c96a3
commit 2e57126ab7
75 changed files with 3572 additions and 198 deletions
@@ -60,6 +60,7 @@ namespace StgSharp.Geometries
{
movement = motionDelegate;
}
sourceIsStatic = false;
}
public bool IsIncrement
@@ -71,12 +72,15 @@ namespace StgSharp.Geometries
public unsafe void RunMotion(ref vec3d coord, ref float rotation)
{
float rot = 0;
vec3d vec;
if (sourceIsStatic)
{
vec = ((delegate*<TimeSpanProvider, out float, vec3d>)handle)(time, out rot);
}
else
{
vec = movement(time, out rot);
}
vec3d vec = ((delegate*<TimeSpanProvider, out float, vec3d>)handle)(time, out rot);
if (isIncrementMode)
{
@@ -89,6 +93,5 @@ namespace StgSharp.Geometries
rotation = rot;
}
}
}
}//------------------------------- End of Class -------------------------------
}
@@ -93,7 +93,7 @@ namespace StgSharp.Geometries
{
(vec3d coord , float rotation) =(Coord, Rotation);
Motion.RunMotion(ref coord, ref rotation);
(Rotation, Coord) = (rotation, coord);
(Coord,Rotation) = (coord, rotation);
}
}
@@ -31,6 +31,7 @@
using StgSharp.Math;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.Contracts;
@@ -43,7 +44,7 @@ using System.Threading.Tasks;
namespace StgSharp.Geometries
{
public class PlainInstancingBuffer<T> : IDisposable where T : IInstancing<T>
public class PlainInstancingBuffer<T> : IDisposable,IEnumerable<T> where T : IInstancing<T>
{
private CoordinatePlain globalCorrdinnate;
@@ -158,7 +159,7 @@ namespace StgSharp.Geometries
{
foreach (var particle in instanceList)
{
particle.Move();
}
}
@@ -188,5 +189,21 @@ namespace StgSharp.Geometries
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
public IEnumerator<T> GetEnumerator()
{
foreach (var item in instanceList)
{
yield return (T)item;
}
}
IEnumerator IEnumerable.GetEnumerator()
{
foreach (var item in instanceList)
{
yield return (T)item;
}
}
}
}