mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-29 11:59:27 +01:00
Add decal color, fix some bugs and improve logic and handling somewhat.
This commit is contained in:
parent
6158bcb2f9
commit
5ea779a34c
14 changed files with 351 additions and 174 deletions
47
Glamourer/GameData/CustomizeParameterValue.cs
Normal file
47
Glamourer/GameData/CustomizeParameterValue.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
namespace Glamourer.GameData;
|
||||
|
||||
public readonly struct CustomizeParameterValue
|
||||
{
|
||||
public static readonly CustomizeParameterValue Zero = default;
|
||||
|
||||
private readonly Vector4 _data;
|
||||
|
||||
public CustomizeParameterValue(Vector4 data)
|
||||
=> _data = data;
|
||||
|
||||
public CustomizeParameterValue(Vector3 data, float w = 0)
|
||||
=> _data = new Vector4(data, w);
|
||||
|
||||
public CustomizeParameterValue(FFXIVClientStructs.FFXIV.Common.Math.Vector4 data)
|
||||
=> _data = new Vector4(Root(data.X), Root(data.Y), Root(data.Z), data.W);
|
||||
|
||||
public CustomizeParameterValue(FFXIVClientStructs.FFXIV.Common.Math.Vector3 data)
|
||||
=> _data = new Vector4(Root(data.X), Root(data.Y), Root(data.Z), 0);
|
||||
|
||||
public CustomizeParameterValue(float value, float y = 0, float z = 0, float w = 0)
|
||||
=> _data = new Vector4(value, y, z, w);
|
||||
|
||||
public Vector3 InternalTriple
|
||||
=> new(_data.X, _data.Y, _data.Z);
|
||||
|
||||
public float Single
|
||||
=> _data.X;
|
||||
|
||||
public Vector4 InternalQuadruple
|
||||
=> _data;
|
||||
|
||||
public FFXIVClientStructs.FFXIV.Common.Math.Vector4 XivQuadruple
|
||||
=> new(Square(_data.X), Square(_data.Y), Square(_data.Z), _data.W);
|
||||
|
||||
public FFXIVClientStructs.FFXIV.Common.Math.Vector3 XivTriple
|
||||
=> new(Square(_data.X), Square(_data.Y), Square(_data.Z));
|
||||
|
||||
private static float Square(float x)
|
||||
=> x < 0 ? -x * x : x * x;
|
||||
|
||||
private static float Root(float x)
|
||||
=> x < 0 ? -(float)Math.Sqrt(-x) : x;
|
||||
|
||||
public float this[int idx]
|
||||
=> _data[idx];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue