This commit is contained in:
Razmoth
2023-09-22 20:31:55 +04:00
parent d594f90fec
commit 6ebeaeee3f
48 changed files with 5886 additions and 81 deletions

View File

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
namespace AssetStudio
{
[StructLayout(LayoutKind.Sequential, Pack = 4)]
public struct Vector3 : IEquatable<Vector3>
public struct Vector3 : IEquatable<Vector3>, IYAMLExportable
{
public float X;
public float Y;
@@ -87,6 +87,16 @@ namespace AssetStudio
return X * X + Y * Y + Z * Z;
}
public YAMLNode ExportYAML(int[] version)
{
var node = new YAMLMappingNode();
node.Style = MappingStyle.Flow;
node.Add("x", X);
node.Add("y", Y);
node.Add("z", Z);
return node;
}
public static Vector3 Zero => new Vector3();
public static Vector3 One => new Vector3(1.0f, 1.0f, 1.0f);