Implement original gadget panel and playable shrink ray
This commit is contained in:
1 parent
0272f7bef7
commit
7b5230ceb8
57 files changed
+3545
-48
No files matched your search
@@ -108,8 +108,12 @@ public readonly record struct MeshPolygonSource(int ShapeId, int PolygonIndex, V
|
||||
public bool TerrainCollision => ShapeName?.StartsWith("nc", StringComparison.OrdinalIgnoreCase) != true;
|
||||
}
|
||||
|
||||
public enum MeshBlend { Opaque, Alpha, Additive }
|
||||
|
||||
public sealed record MeshDraw(uint FirstIndex,uint IndexCount,int TextureId)
|
||||
{
|
||||
public bool Visible { get; set; } = true;
|
||||
public bool ScreenSpace { get; init; }
|
||||
public float Opacity { get; set; } = 1;
|
||||
public MeshBlend Blend { get; set; } = MeshBlend.Opaque;
|
||||
}
|
||||
@@ -10,6 +10,7 @@ public sealed class MorphAnimation
|
||||
public PngImage Texture { get; }
|
||||
public double SampleInterval { get; }
|
||||
public bool HasVertexMotion { get; }
|
||||
public int FrameCount => frames.Length;
|
||||
private readonly Mesh[] frames;
|
||||
|
||||
public MorphAnimation(string manifestPath)
|
||||
@@ -54,15 +55,15 @@ public sealed class MorphAnimation
|
||||
Texture = new PngImage(width, height, rgba);
|
||||
}
|
||||
|
||||
public void Sample(double seconds, Span<MeshVertex> destination, Matrix4x4 model)
|
||||
public void Sample(double seconds, Span<MeshVertex> destination, Matrix4x4 model, bool loop = true)
|
||||
{
|
||||
if (!double.IsFinite(seconds) || seconds < 0) throw new ArgumentOutOfRangeException(nameof(seconds));
|
||||
if (destination.Length != Base.Vertices.Length) throw new ArgumentException("Morph target size differs");
|
||||
// Linear interpolation is recovered from DLL 0x10002F9A. Loop closure
|
||||
// and gameplay-specific speed remain preview policies until recovered.
|
||||
var frame = seconds / SampleInterval;
|
||||
var first = (int)(Math.Floor(frame) % frames.Length);
|
||||
var next = (first + 1) % frames.Length;
|
||||
var first = loop ? (int)(Math.Floor(frame) % frames.Length) : (int)Math.Min(Math.Floor(frame), frames.Length - 1);
|
||||
var next = loop ? (first + 1) % frames.Length : Math.Min(first + 1, frames.Length - 1);
|
||||
var t = (float)(frame - Math.Floor(frame));
|
||||
for (var i = 0; i < destination.Length; i++)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user