Implement Bubble controller, sprite and VR01 body behavior

This commit is contained in:
UnixNight committed 2026-11-02 16:57:54 -05:00
1 parent 9ea578492d
commit 1ae5f4251c
51 files changed
+2811 -54

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
using System.Numerics;
using GamePort.Assets;
namespace GamePort.Game;
/// <summary>Stored current-atlas material state. Source alpha/FC requests and
/// late direct RGBA writes have different owners and must retain their order.</summary>
public sealed class PlayerAppearance
{
public Vector4 Color { get; private set; } = Vector4.One;
public bool BlendEnabled { get; private set; }
public bool Conventional { get; private set; }
public MeshBlend Blend => !BlendEnabled ? MeshBlend.Opaque : Conventional ? MeshBlend.Alpha : MeshBlend.Additive;
public void SetAlpha(float alpha)
{
if (!float.IsFinite(alpha) || alpha > 1) throw new ArgumentOutOfRangeException(nameof(alpha));
BlendEnabled = alpha > 0;
Color = alpha > 0 ? new(1,1,1,alpha) : Vector4.One;
Conventional = alpha <= 0;
}
public void SetBlend(bool conventional) => Conventional = conventional;
public void SetColor(Vector4 color)
{
if (!float.IsFinite(color.X+color.Y+color.Z+color.W)
|| color.X<0 || color.Y<0 || color.Z<0 || color.W<0 || color.W>1)
throw new ArgumentOutOfRangeException(nameof(color));
Color = color;
}
public void Reset() { Color=Vector4.One; BlendEnabled=false; Conventional=false; }
}