feat(ufbx): switch to native ufbx_vec/quat/matrix types
Replaces all Misaki.HighPerformance.Mathematics vector, quaternion, and matrix types in Ghost.Ufbx bindings with new native ufbx_vec2, ufbx_vec3, ufbx_vec4, ufbx_quat, and ufbx_matrix structs. Updates all interop code, struct fields, and API signatures accordingly. Adds struct definitions for the new types and provides matrix operations as struct methods. Removes unnecessary math package reference. Also includes minor fixes to system attributes, meshlet LOD logic, and mesh utility. BREAKING CHANGE: All Ufbx-related APIs now use ufbx_* types instead of Misaki.HighPerformance.Mathematics types. Existing code using the old types will require updates.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Misaki.HighPerformance.Mathematics" Version="1.3.1" />
|
||||
<PackageReference Include="Misaki.HighPerformance.Mathematics" Version="1.3.3" />
|
||||
<PackageReference Include="System.IO.Hashing" Version="10.0.5" />
|
||||
<PackageReference Include="TerraFX.Interop.Windows" Version="10.0.26100.6" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -19,9 +19,13 @@ public static class MathUtility
|
||||
{
|
||||
var R = new float3x3(rotation);
|
||||
return new float4x4(
|
||||
R[0][0] * scale.x, R[0][1] * scale.y, R[0][2] * scale.z, position.x,
|
||||
R[1][0] * scale.x, R[1][1] * scale.y, R[1][2] * scale.z, position.y,
|
||||
R[2][0] * scale.x, R[2][1] * scale.y, R[2][2] * scale.z, position.z,
|
||||
// Row 0: Right.x, Up.x, Forward.x, Pos.x
|
||||
R[0][0] * scale.x, R[1][0] * scale.y, R[2][0] * scale.z, position.x,
|
||||
// Row 1: Right.y, Up.y, Forward.y, Pos.y
|
||||
R[0][1] * scale.x, R[1][1] * scale.y, R[2][1] * scale.z, position.y,
|
||||
// Row 2: Right.z, Up.z, Forward.z, Pos.z
|
||||
R[0][2] * scale.x, R[1][2] * scale.y, R[2][2] * scale.z, position.z,
|
||||
// Row 3: 0, 0, 0, 1
|
||||
0f, 0f, 0f, 1f
|
||||
);
|
||||
}
|
||||
|
||||
@@ -113,26 +113,26 @@ public abstract class SystemBase : ISystem
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true)]
|
||||
public class UpdateAfterAttribute : Attribute
|
||||
public abstract class UpdateAfterAttribute : Attribute
|
||||
{
|
||||
public Type SystemType { get; }
|
||||
|
||||
public UpdateAfterAttribute(Type systemType)
|
||||
{
|
||||
SystemType = systemType;
|
||||
public abstract Type SystemType { get; }
|
||||
}
|
||||
|
||||
public abstract class UpdateBeforeAttribute : Attribute
|
||||
{
|
||||
public abstract Type SystemType { get; }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true)]
|
||||
public class UpdateBeforeAttribute : Attribute
|
||||
public class UpdateAfterAttribute<T> : UpdateAfterAttribute
|
||||
{
|
||||
public Type SystemType { get; }
|
||||
|
||||
public UpdateBeforeAttribute(Type systemType)
|
||||
{
|
||||
SystemType = systemType;
|
||||
public override Type SystemType => typeof(T);
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true)]
|
||||
public class UpdateBeforeAttribute<T> : UpdateBeforeAttribute
|
||||
{
|
||||
public override Type SystemType => typeof(T);
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)]
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="TerraFX.Interop.D3D12MemoryAllocator" Version="3.0.1" />
|
||||
<PackageReference Include="TerraFX.Interop.D3D12MemoryAllocator" Version="3.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -15,10 +15,12 @@ namespace Ghost.Graphics.Core;
|
||||
public struct Meshlet
|
||||
{
|
||||
public SphereBounds boundingSphere; // 16 bytes
|
||||
public SphereBounds parentBoundingSphere; // 16 bytes
|
||||
public AABB boundingBox; // 24 bytes
|
||||
public uint vertexOffset; // offset into meshlet vertex index array
|
||||
public uint triangleOffset; // offset into packed triangle array
|
||||
public uint groupIndex; // owning group
|
||||
public float clusterError; // geometric error of this meshlet/cluster
|
||||
public float parentError; // geometric refinement error carried into runtime LOD tests
|
||||
public byte vertexCount; // max 64
|
||||
public byte triangleCount; // max 124
|
||||
@@ -319,13 +321,15 @@ public struct Mesh : IResourceReleasable
|
||||
var meshlet = new Meshlet
|
||||
{
|
||||
boundingSphere = new SphereBounds(cluster.bounds.center, cluster.bounds.radius),
|
||||
parentBoundingSphere = new SphereBounds(group.simplified.center, group.simplified.radius),
|
||||
boundingBox = new AABB(cluster.bounds.center - cluster.bounds.radius, cluster.bounds.center + cluster.bounds.radius),
|
||||
vertexCount = (byte)cluster.vertexCount,
|
||||
triangleCount = (byte)(cluster.localIndexCount / 3),
|
||||
vertexOffset = (uint)data.meshletVertices.Count,
|
||||
triangleOffset = (uint)data.meshletTriangles.Count,
|
||||
groupIndex = (uint)data.groups.Count - 1,
|
||||
parentError = cluster.bounds.error,
|
||||
clusterError = cluster.bounds.error,
|
||||
parentError = group.simplified.error,
|
||||
localMaterialIndex = 0, // TODO: support multiple materials
|
||||
lodLevel = (byte)group.depth,
|
||||
};
|
||||
|
||||
@@ -13,11 +13,13 @@ struct Vertex
|
||||
struct Meshlet
|
||||
{
|
||||
float4 boundingSphere;
|
||||
float4 parentBoundingSphere;
|
||||
float3 boundingBoxMin;
|
||||
float3 boundingBoxMax;
|
||||
uint vertexOffset;
|
||||
uint triangleOffset;
|
||||
uint groupIndex;
|
||||
float clusterError;
|
||||
float parentError;
|
||||
uint packedCounts; // byte vertexCount, byte triangleCount, byte localMaterialIndex, byte lodLevel
|
||||
};
|
||||
|
||||
@@ -46,19 +46,59 @@ shader "MyShader/Standard"
|
||||
|
||||
groupshared ASPayload s_Payload;
|
||||
|
||||
// computes approximate (perspective) projection error of a cluster in screen space
|
||||
float BoundsError(float3 center, float radius, float error, float3 cameraPos, float cameraProj, float cameraZNear)
|
||||
{
|
||||
float d = length(center - cameraPos) - radius;
|
||||
return error / max(d, cameraZNear) * (cameraProj * 0.5f);
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void ASMain(uint3 groupID : SV_GroupID)
|
||||
{
|
||||
InstanceData instanceData = LoadData<InstanceData>(g_PushConstantData.instanceBuffer, g_PushConstantData.instanceIndex);
|
||||
MeshData meshData = LoadData<MeshData>(instanceData.meshBuffer, 0);
|
||||
|
||||
ByteAddressBuffer meshletBuffer = GET_BUFFER(meshData.meshletBuffer);
|
||||
Meshlet meshlet = meshletBuffer.Load<Meshlet>(groupID.x * sizeof(Meshlet));
|
||||
|
||||
uint meshletIndex = groupID.x;
|
||||
s_Payload.meshletIndex = groupID.x;
|
||||
|
||||
ByteAddressBuffer meshletBuffer = GET_BUFFER(meshData.meshletBuffer);
|
||||
Meshlet meshlet = meshletBuffer.Load<Meshlet>(meshletIndex * sizeof(Meshlet));
|
||||
|
||||
ViewData viewData = LoadData<ViewData>(g_PushConstantData.viewBuffer, 0);
|
||||
|
||||
// Assume uniform scale
|
||||
float scale = length(float3(instanceData.localToWorld[0][0], instanceData.localToWorld[1][0], instanceData.localToWorld[2][0]));
|
||||
|
||||
// Nanite projection metric: cot(fovy / 2) -> projectionMatrix[1][1]
|
||||
// Multiply by screenSize.y to get error in pixels.
|
||||
float cameraProj = viewData.projectionMatrix[1][1] * viewData.screenSize.y;
|
||||
|
||||
float threshold = 1.0f;
|
||||
|
||||
// Calculate THIS cluster's error using ITS OWN bounding sphere
|
||||
float3 clusterCenter = mul(instanceData.localToWorld, float4(meshlet.boundingSphere.xyz, 1.0f)).xyz;
|
||||
float clusterRadius = meshlet.boundingSphere.w * scale;
|
||||
float clusterError = meshlet.clusterError * scale;
|
||||
float clusterProjError = BoundsError(clusterCenter, clusterRadius, clusterError, viewData.cameraPosition, cameraProj, viewData.nearClip);
|
||||
|
||||
// Calculate the PARENT'S error using the PARENT'S bounding sphere
|
||||
float3 parentCenter = mul(instanceData.localToWorld, float4(meshlet.parentBoundingSphere.xyz, 1.0f)).xyz;
|
||||
float parentRadius = meshlet.parentBoundingSphere.w * scale;
|
||||
float parentError = meshlet.parentError * scale;
|
||||
float parentProjError = BoundsError(parentCenter, parentRadius, parentError, viewData.cameraPosition, cameraProj, viewData.nearClip);
|
||||
|
||||
bool isRoot = meshlet.parentError >= 3.402823466e+38F; // FLT_MAX
|
||||
uint emitMeshlet = ((parentProjError > threshold || isRoot) && clusterProjError <= threshold) ? 1u : 0u;
|
||||
|
||||
// Failsafe: if we are at the finest LOD (LOD 0) and the error is STILL too high,
|
||||
// we must render it anyway because there is no more detailed geometry to fall back on.
|
||||
uint lodLevel = (meshlet.packedCounts >> 24) & 0xFFu;
|
||||
uint emitMeshlet = lodLevel == 0u ? 1u : 0u;
|
||||
if (lodLevel == 0u && parentProjError > threshold)
|
||||
{
|
||||
emitMeshlet = 1u;
|
||||
}
|
||||
|
||||
DispatchMesh(emitMeshlet, 1u, 1u, s_Payload);
|
||||
}
|
||||
|
||||
@@ -140,6 +180,9 @@ shader "MyShader/Standard"
|
||||
float b = float((hash & 0x0000FFu)) / 255.0;
|
||||
|
||||
return float4(r, g, b, 1.0);
|
||||
|
||||
// InstanceData instanceData = LoadData<InstanceData>(g_PushConstantData.instanceBuffer, g_PushConstantData.instanceIndex);
|
||||
// return mul(instanceData.localToWorld, float4(input.normal, 1.0f));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ public unsafe partial class TestRenderPipeline : IRenderPipeline
|
||||
nearClip = request.view.nearClipPlane,
|
||||
cameraDirection = viewMatrix.c2.xyz, // check if that's correct orientation
|
||||
farClip = request.view.farClipPlane,
|
||||
screenSize = new float4(request.view.sensorSize.x, request.view.sensorSize.y, 1.0f / request.view.sensorSize.x, 1.0f / request.view.sensorSize.y)
|
||||
screenSize = new float4(rtSize.x, rtSize.y, 1.0f / rtSize.x, 1.0f / rtSize.y)
|
||||
};
|
||||
|
||||
ctx.CommandBuffer.Barrier(BarrierDesc.Buffer(viewBufferResource, BarrierSync.Copy, BarrierAccess.CopyDest));
|
||||
|
||||
50
src/Test/Ghost.Graphics.Test/Systems/CameraMovingSystem.cs
Normal file
50
src/Test/Ghost.Graphics.Test/Systems/CameraMovingSystem.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using Ghost.Core;
|
||||
using Ghost.Engine.Components;
|
||||
using Ghost.Engine.Utilities;
|
||||
using Ghost.Entities;
|
||||
using Misaki.HighPerformance.Mathematics;
|
||||
|
||||
namespace Ghost.Graphics.Test.Systems;
|
||||
|
||||
internal class CameraMovingSystem : ISystem
|
||||
{
|
||||
private Identifier<EntityQuery> _cameraQueryID;
|
||||
|
||||
private random _random;
|
||||
private float3 _target;
|
||||
|
||||
public void Initialize(ref readonly SystemAPI systemAPI)
|
||||
{
|
||||
_cameraQueryID = QueryBuilder.Create()
|
||||
.WithAll<Camera, LocalToWorld>()
|
||||
.Build(systemAPI.World, true);
|
||||
|
||||
_random = new random(123456);
|
||||
_target = _random.NextFloat3(-20, 20);
|
||||
}
|
||||
|
||||
public void Update(ref readonly SystemAPI systemAPI)
|
||||
{
|
||||
ref var cameraQuery = ref systemAPI.World.ComponentManager.GetEntityQueryReference(_cameraQueryID);
|
||||
|
||||
foreach (ref var ltw in cameraQuery.GetComponentIterator<LocalToWorld>())
|
||||
{
|
||||
var position = ltw.matrix.c3.xyz;
|
||||
if (math.distance(position, _target) < 0.1f)
|
||||
{
|
||||
_target = _random.NextFloat3(-20, 20);
|
||||
}
|
||||
|
||||
var newPosition = math.lerp(position, _target, 0.025f);
|
||||
var forward = math.normalize(new float3(0f, 0.5f, 0f) - newPosition);
|
||||
|
||||
var rotation = quaternion.LookRotation(forward, math.up());
|
||||
var matrix = float4x4.TRS(newPosition, rotation, float3.one);
|
||||
ltw.matrix = matrix;
|
||||
}
|
||||
}
|
||||
|
||||
public void Cleanup(ref readonly SystemAPI systemAPI)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ using Misaki.HighPerformance.Mathematics;
|
||||
namespace Ghost.Graphics.Test.Systems;
|
||||
|
||||
[RenderPipelineSystem<TestRenderPipelineSettings>]
|
||||
[UpdateAfter<CameraMovingSystem>]
|
||||
public class RenderExtractionSystem : ISystem
|
||||
{
|
||||
private RenderSystem _renderSystem = null!;
|
||||
|
||||
@@ -66,6 +66,7 @@ internal static class MeshUtility
|
||||
|
||||
for (var i = 0u; i < scene.Get()->nodes.count; i++)
|
||||
{
|
||||
var data = scene.Get()->nodes.data;
|
||||
var node = scene.Get()->nodes.data[i];
|
||||
if (node->is_root)
|
||||
{
|
||||
@@ -102,19 +103,27 @@ internal static class MeshUtility
|
||||
var colIdx = pMesh->vertex_color.exists ? pMesh->vertex_color.indices.data[ufbxTopologyIndex] : uint.MaxValue;
|
||||
var btanIdx = pMesh->vertex_bitangent.exists ? pMesh->vertex_bitangent.indices.data[ufbxTopologyIndex] : uint.MaxValue;
|
||||
|
||||
var position = pMesh->vertex_position.values.data[posIdx];
|
||||
var normal = normIdx != uint.MaxValue ? pMesh->vertex_normal.values.data[normIdx] : default;
|
||||
var uv = uvIdx != uint.MaxValue ? pMesh->vertex_uv.values.data[uvIdx] : default;
|
||||
var color = colIdx != uint.MaxValue ? pMesh->vertex_color.values.data[colIdx] : default;
|
||||
|
||||
var vertex = new Vertex
|
||||
{
|
||||
position = pMesh->vertex_position.values.data[posIdx],
|
||||
normal = normIdx != uint.MaxValue ? pMesh->vertex_normal.values.data[normIdx] : default,
|
||||
uv = uvIdx != uint.MaxValue ? pMesh->vertex_uv.values.data[uvIdx] : default,
|
||||
color = colIdx != uint.MaxValue ? new Color128(pMesh->vertex_color.values.data[colIdx]) : default,
|
||||
position = new float3(position.x, position.y, position.z),
|
||||
normal = new float3(normal.x, normal.y, normal.z),
|
||||
uv = new float2(uv.x, uv.y),
|
||||
color = new Color128(color.x, color.y, color.z, color.w)
|
||||
};
|
||||
|
||||
if (tanIdx != uint.MaxValue)
|
||||
{
|
||||
var t = pMesh->vertex_tangent.values.data[tanIdx];
|
||||
var mt = pMesh->vertex_tangent.values.data[tanIdx];
|
||||
var mb = btanIdx != uint.MaxValue ? pMesh->vertex_bitangent.values.data[btanIdx] : default;
|
||||
|
||||
var t = new float3(mt.x, mt.y, mt.z);
|
||||
var n = vertex.normal;
|
||||
var b = btanIdx != uint.MaxValue ? pMesh->vertex_bitangent.values.data[btanIdx] : math.cross(n, t);
|
||||
var b = btanIdx != uint.MaxValue ? new float3(mb.x, mb.y, mb.z) : math.cross(n, t);
|
||||
vertex.tangent = ComputeTangent(t, n, b);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Misaki.HighPerformance.LowLevel.Buffer;
|
||||
using Misaki.HighPerformance.Mathematics;
|
||||
using Windows.Devices.Geolocation;
|
||||
|
||||
namespace Ghost.Graphics.Test.Windows;
|
||||
|
||||
@@ -75,6 +76,7 @@ public sealed partial class GraphicsTestWindow : Window
|
||||
// Add Systems
|
||||
var group = _world.SystemManager.GetSystem<DefaultSystemGroup>();
|
||||
group.AddSystem<RenderExtractionSystem>();
|
||||
group.AddSystem<CameraMovingSystem>();
|
||||
group.SortSystems();
|
||||
|
||||
_world.SystemManager.InitializeAll(default);
|
||||
|
||||
30
src/ThridParty/Ghost.MeshOptimizer/Api.cs
Normal file
30
src/ThridParty/Ghost.MeshOptimizer/Api.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ghost.MeshOptimizer;
|
||||
|
||||
public partial class Api
|
||||
{
|
||||
static Api()
|
||||
{
|
||||
NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), (libraryName, assembly, searchPath) =>
|
||||
{
|
||||
if (libraryName != "meshoptimizer")
|
||||
{
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
||||
var platform = OperatingSystem.IsWindows() ? "win" :
|
||||
OperatingSystem.IsLinux() ? "linux" :
|
||||
OperatingSystem.IsMacOS() ? "osx" : "unknown";
|
||||
var ext = OperatingSystem.IsWindows() ? ".dll" :
|
||||
OperatingSystem.IsLinux() ? ".so" :
|
||||
OperatingSystem.IsMacOS() ? ".dylib" : "";
|
||||
|
||||
var arch = Environment.Is64BitProcess ? "x64" : "x86";
|
||||
var nativeDllDir = Path.Combine("./runtimes", platform + "-" + arch, "native");
|
||||
|
||||
return NativeLibrary.Load(Path.Combine(nativeDllDir, libraryName + ext));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -5,29 +5,6 @@ namespace Ghost.MeshOptimizer
|
||||
{
|
||||
public static unsafe partial class Api
|
||||
{
|
||||
static Api()
|
||||
{
|
||||
NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), (libraryName, assembly, searchPath) =>
|
||||
{
|
||||
if (libraryName != "meshoptimizer")
|
||||
{
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
||||
var platform = OperatingSystem.IsWindows() ? "win" :
|
||||
OperatingSystem.IsLinux() ? "linux" :
|
||||
OperatingSystem.IsMacOS() ? "osx" : "unknown";
|
||||
var ext = OperatingSystem.IsWindows() ? ".dll" :
|
||||
OperatingSystem.IsLinux() ? ".so" :
|
||||
OperatingSystem.IsMacOS() ? ".dylib" : "";
|
||||
|
||||
var arch = Environment.Is64BitProcess ? "x64" : "x86";
|
||||
var nativeDllDir = Path.Combine("./runtimes", platform + "-" + arch, "native");
|
||||
|
||||
return NativeLibrary.Load(Path.Combine(nativeDllDir, libraryName + ext));
|
||||
});
|
||||
}
|
||||
|
||||
[DllImport("meshoptimizer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
public static extern nuint meshopt_generateVertexRemap([NativeTypeName("unsigned int *")] uint* destination, [NativeTypeName("const unsigned int *")] uint* indices, [NativeTypeName("size_t")] nuint index_count, [NativeTypeName("const void *")] void* vertices, [NativeTypeName("size_t")] nuint vertex_count, [NativeTypeName("size_t")] nuint vertex_size);
|
||||
|
||||
30
src/ThridParty/Ghost.Ufbx/Api.cs
Normal file
30
src/ThridParty/Ghost.Ufbx/Api.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ghost.Ufbx;
|
||||
|
||||
public partial class Api
|
||||
{
|
||||
static Api()
|
||||
{
|
||||
NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), (libraryName, assembly, searchPath) =>
|
||||
{
|
||||
if (libraryName != "ufbx")
|
||||
{
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
||||
var platform = OperatingSystem.IsWindows() ? "win" :
|
||||
OperatingSystem.IsLinux() ? "linux" :
|
||||
OperatingSystem.IsMacOS() ? "osx" : "unknown";
|
||||
var ext = OperatingSystem.IsWindows() ? ".dll" :
|
||||
OperatingSystem.IsLinux() ? ".so" :
|
||||
OperatingSystem.IsMacOS() ? ".dylib" : "";
|
||||
|
||||
var arch = Environment.Is64BitProcess ? "x64" : "x86";
|
||||
var nativeDllDir = Path.Combine("./runtimes", platform + "-" + arch, "native");
|
||||
|
||||
return NativeLibrary.Load(Path.Combine(nativeDllDir, libraryName + ext));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using static Ghost.Ufbx.ufbx_aperture_format;
|
||||
using static Ghost.Ufbx.ufbx_aperture_mode;
|
||||
@@ -168,29 +167,6 @@ namespace Ghost.Ufbx
|
||||
|
||||
public const int UFBX_BAKE_STEP_HANDLING_COUNT = (int)(UFBX_BAKE_STEP_HANDLING_IGNORE + 1);
|
||||
|
||||
static Api()
|
||||
{
|
||||
NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), (libraryName, assembly, searchPath) =>
|
||||
{
|
||||
if (libraryName != "ufbx")
|
||||
{
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
||||
var platform = OperatingSystem.IsWindows() ? "win" :
|
||||
OperatingSystem.IsLinux() ? "linux" :
|
||||
OperatingSystem.IsMacOS() ? "osx" : "unknown";
|
||||
var ext = OperatingSystem.IsWindows() ? ".dll" :
|
||||
OperatingSystem.IsLinux() ? ".so" :
|
||||
OperatingSystem.IsMacOS() ? ".dylib" : "";
|
||||
|
||||
var arch = Environment.Is64BitProcess ? "x64" : "x86";
|
||||
var nativeDllDir = Path.Combine("./runtimes", platform + "-" + arch, "native");
|
||||
|
||||
return NativeLibrary.Load(Path.Combine(nativeDllDir, libraryName + ext));
|
||||
});
|
||||
}
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("_Bool")]
|
||||
public static extern bool ufbx_is_thread_safe();
|
||||
@@ -241,12 +217,10 @@ namespace Ghost.Ufbx
|
||||
public static extern float ufbx_find_real([NativeTypeName("const ufbx_props *")] ufbx_props* props, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("ufbx_real")] float def);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_find_vec3_len([NativeTypeName("const ufbx_props *")] ufbx_props* props, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("size_t")] nuint name_len, [NativeTypeName("ufbx_vec3")] Misaki.HighPerformance.Mathematics.float3 def);
|
||||
public static extern ufbx_vec3 ufbx_find_vec3_len([NativeTypeName("const ufbx_props *")] ufbx_props* props, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("size_t")] nuint name_len, ufbx_vec3 def);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_find_vec3([NativeTypeName("const ufbx_props *")] ufbx_props* props, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("ufbx_vec3")] Misaki.HighPerformance.Mathematics.float3 def);
|
||||
public static extern ufbx_vec3 ufbx_find_vec3([NativeTypeName("const ufbx_props *")] ufbx_props* props, [NativeTypeName("const char *")] sbyte* name, ufbx_vec3 def);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("int64_t")]
|
||||
@@ -322,8 +296,7 @@ namespace Ghost.Ufbx
|
||||
public static extern ufbx_anim_prop_list ufbx_find_anim_props([NativeTypeName("const ufbx_anim_layer *")] ufbx_anim_layer* layer, [NativeTypeName("const ufbx_element *")] ufbx_element* element);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_matrix")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3x4 ufbx_get_compatible_matrix_for_normals([NativeTypeName("const ufbx_node *")] ufbx_node* node);
|
||||
public static extern ufbx_matrix ufbx_get_compatible_matrix_for_normals([NativeTypeName("const ufbx_node *")] ufbx_node* node);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ptrdiff_t")]
|
||||
@@ -362,16 +335,14 @@ namespace Ghost.Ufbx
|
||||
public static extern float ufbx_evaluate_anim_value_real([NativeTypeName("const ufbx_anim_value *")] ufbx_anim_value* anim_value, double time);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_evaluate_anim_value_vec3([NativeTypeName("const ufbx_anim_value *")] ufbx_anim_value* anim_value, double time);
|
||||
public static extern ufbx_vec3 ufbx_evaluate_anim_value_vec3([NativeTypeName("const ufbx_anim_value *")] ufbx_anim_value* anim_value, double time);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_real")]
|
||||
public static extern float ufbx_evaluate_anim_value_real_flags([NativeTypeName("const ufbx_anim_value *")] ufbx_anim_value* anim_value, double time, [NativeTypeName("uint32_t")] uint flags);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_evaluate_anim_value_vec3_flags([NativeTypeName("const ufbx_anim_value *")] ufbx_anim_value* anim_value, double time, [NativeTypeName("uint32_t")] uint flags);
|
||||
public static extern ufbx_vec3 ufbx_evaluate_anim_value_vec3_flags([NativeTypeName("const ufbx_anim_value *")] ufbx_anim_value* anim_value, double time, [NativeTypeName("uint32_t")] uint flags);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern ufbx_prop ufbx_evaluate_prop_len([NativeTypeName("const ufbx_anim *")] ufbx_anim* anim, [NativeTypeName("const ufbx_element *")] ufbx_element* element, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("size_t")] nuint name_len, double time);
|
||||
@@ -439,12 +410,10 @@ namespace Ghost.Ufbx
|
||||
public static extern ufbx_baked_element* ufbx_find_baked_element(ufbx_baked_anim* bake, ufbx_element* element);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_evaluate_baked_vec3(ufbx_baked_vec3_list keyframes, double time);
|
||||
public static extern ufbx_vec3 ufbx_evaluate_baked_vec3(ufbx_baked_vec3_list keyframes, double time);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_quat")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.quaternion ufbx_evaluate_baked_quat(ufbx_baked_quat_list keyframes, double time);
|
||||
public static extern ufbx_quat ufbx_evaluate_baked_quat(ufbx_baked_quat_list keyframes, double time);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern ufbx_bone_pose* ufbx_get_bone_pose([NativeTypeName("const ufbx_pose *")] ufbx_pose* pose, [NativeTypeName("const ufbx_node *")] ufbx_node* node);
|
||||
@@ -478,78 +447,62 @@ namespace Ghost.Ufbx
|
||||
public static extern bool ufbx_coordinate_axes_valid(ufbx_coordinate_axes axes);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_vec3_normalize([NativeTypeName("ufbx_vec3")] Misaki.HighPerformance.Mathematics.float3 v);
|
||||
public static extern ufbx_vec3 ufbx_vec3_normalize(ufbx_vec3 v);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_real")]
|
||||
public static extern float ufbx_quat_dot([NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion a, [NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion b);
|
||||
public static extern float ufbx_quat_dot(ufbx_quat a, ufbx_quat b);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_quat")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.quaternion ufbx_quat_mul([NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion a, [NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion b);
|
||||
public static extern ufbx_quat ufbx_quat_mul(ufbx_quat a, ufbx_quat b);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_quat")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.quaternion ufbx_quat_normalize([NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion q);
|
||||
public static extern ufbx_quat ufbx_quat_normalize(ufbx_quat q);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_quat")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.quaternion ufbx_quat_fix_antipodal([NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion q, [NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion reference);
|
||||
public static extern ufbx_quat ufbx_quat_fix_antipodal(ufbx_quat q, ufbx_quat reference);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_quat")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.quaternion ufbx_quat_slerp([NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion a, [NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion b, [NativeTypeName("ufbx_real")] float t);
|
||||
public static extern ufbx_quat ufbx_quat_slerp(ufbx_quat a, ufbx_quat b, [NativeTypeName("ufbx_real")] float t);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_quat_rotate_vec3([NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion q, [NativeTypeName("ufbx_vec3")] Misaki.HighPerformance.Mathematics.float3 v);
|
||||
public static extern ufbx_vec3 ufbx_quat_rotate_vec3(ufbx_quat q, ufbx_vec3 v);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_quat_to_euler([NativeTypeName("ufbx_quat")] Misaki.HighPerformance.Mathematics.quaternion q, ufbx_rotation_order order);
|
||||
public static extern ufbx_vec3 ufbx_quat_to_euler(ufbx_quat q, ufbx_rotation_order order);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_quat")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.quaternion ufbx_euler_to_quat([NativeTypeName("ufbx_vec3")] Misaki.HighPerformance.Mathematics.float3 v, ufbx_rotation_order order);
|
||||
public static extern ufbx_quat ufbx_euler_to_quat(ufbx_vec3 v, ufbx_rotation_order order);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_matrix")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3x4 ufbx_matrix_mul([NativeTypeName("const ufbx_matrix *")] Misaki.HighPerformance.Mathematics.float3x4* a, [NativeTypeName("const ufbx_matrix *")] Misaki.HighPerformance.Mathematics.float3x4* b);
|
||||
public static extern ufbx_matrix ufbx_matrix_mul([NativeTypeName("const ufbx_matrix *")] ufbx_matrix* a, [NativeTypeName("const ufbx_matrix *")] ufbx_matrix* b);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_real")]
|
||||
public static extern float ufbx_matrix_determinant([NativeTypeName("const ufbx_matrix *")] Misaki.HighPerformance.Mathematics.float3x4* m);
|
||||
public static extern float ufbx_matrix_determinant([NativeTypeName("const ufbx_matrix *")] ufbx_matrix* m);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_matrix")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3x4 ufbx_matrix_invert([NativeTypeName("const ufbx_matrix *")] Misaki.HighPerformance.Mathematics.float3x4* m);
|
||||
public static extern ufbx_matrix ufbx_matrix_invert([NativeTypeName("const ufbx_matrix *")] ufbx_matrix* m);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_matrix")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3x4 ufbx_matrix_for_normals([NativeTypeName("const ufbx_matrix *")] Misaki.HighPerformance.Mathematics.float3x4* m);
|
||||
public static extern ufbx_matrix ufbx_matrix_for_normals([NativeTypeName("const ufbx_matrix *")] ufbx_matrix* m);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_transform_position([NativeTypeName("const ufbx_matrix *")] Misaki.HighPerformance.Mathematics.float3x4* m, [NativeTypeName("ufbx_vec3")] Misaki.HighPerformance.Mathematics.float3 v);
|
||||
public static extern ufbx_vec3 ufbx_transform_position([NativeTypeName("const ufbx_matrix *")] ufbx_matrix* m, ufbx_vec3 v);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_transform_direction([NativeTypeName("const ufbx_matrix *")] Misaki.HighPerformance.Mathematics.float3x4* m, [NativeTypeName("ufbx_vec3")] Misaki.HighPerformance.Mathematics.float3 v);
|
||||
public static extern ufbx_vec3 ufbx_transform_direction([NativeTypeName("const ufbx_matrix *")] ufbx_matrix* m, ufbx_vec3 v);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_matrix")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3x4 ufbx_transform_to_matrix([NativeTypeName("const ufbx_transform *")] ufbx_transform* t);
|
||||
public static extern ufbx_matrix ufbx_transform_to_matrix([NativeTypeName("const ufbx_transform *")] ufbx_transform* t);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern ufbx_transform ufbx_matrix_to_transform([NativeTypeName("const ufbx_matrix *")] Misaki.HighPerformance.Mathematics.float3x4* m);
|
||||
public static extern ufbx_transform ufbx_matrix_to_transform([NativeTypeName("const ufbx_matrix *")] ufbx_matrix* m);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_matrix")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3x4 ufbx_catch_get_skin_vertex_matrix(ufbx_panic* panic, [NativeTypeName("const ufbx_skin_deformer *")] ufbx_skin_deformer* skin, [NativeTypeName("size_t")] nuint vertex, [NativeTypeName("const ufbx_matrix *")] Misaki.HighPerformance.Mathematics.float3x4* fallback);
|
||||
public static extern ufbx_matrix ufbx_catch_get_skin_vertex_matrix(ufbx_panic* panic, [NativeTypeName("const ufbx_skin_deformer *")] ufbx_skin_deformer* skin, [NativeTypeName("size_t")] nuint vertex, [NativeTypeName("const ufbx_matrix *")] ufbx_matrix* fallback);
|
||||
|
||||
[return: NativeTypeName("ufbx_matrix")]
|
||||
public static Misaki.HighPerformance.Mathematics.float3x4 ufbx_get_skin_vertex_matrix([NativeTypeName("const ufbx_skin_deformer *")] ufbx_skin_deformer* skin, [NativeTypeName("size_t")] nuint vertex, [NativeTypeName("const ufbx_matrix *")] Misaki.HighPerformance.Mathematics.float3x4* fallback)
|
||||
public static ufbx_matrix ufbx_get_skin_vertex_matrix([NativeTypeName("const ufbx_skin_deformer *")] ufbx_skin_deformer* skin, [NativeTypeName("size_t")] nuint vertex, [NativeTypeName("const ufbx_matrix *")] ufbx_matrix* fallback)
|
||||
{
|
||||
return ufbx_catch_get_skin_vertex_matrix(null, skin, vertex, fallback);
|
||||
}
|
||||
@@ -559,18 +512,16 @@ namespace Ghost.Ufbx
|
||||
public static extern uint ufbx_get_blend_shape_offset_index([NativeTypeName("const ufbx_blend_shape *")] ufbx_blend_shape* shape, [NativeTypeName("size_t")] nuint vertex);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_get_blend_shape_vertex_offset([NativeTypeName("const ufbx_blend_shape *")] ufbx_blend_shape* shape, [NativeTypeName("size_t")] nuint vertex);
|
||||
public static extern ufbx_vec3 ufbx_get_blend_shape_vertex_offset([NativeTypeName("const ufbx_blend_shape *")] ufbx_blend_shape* shape, [NativeTypeName("size_t")] nuint vertex);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_get_blend_vertex_offset([NativeTypeName("const ufbx_blend_deformer *")] ufbx_blend_deformer* blend, [NativeTypeName("size_t")] nuint vertex);
|
||||
public static extern ufbx_vec3 ufbx_get_blend_vertex_offset([NativeTypeName("const ufbx_blend_deformer *")] ufbx_blend_deformer* blend, [NativeTypeName("size_t")] nuint vertex);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern void ufbx_add_blend_shape_vertex_offsets([NativeTypeName("const ufbx_blend_shape *")] ufbx_blend_shape* shape, [NativeTypeName("ufbx_vec3 *")] Misaki.HighPerformance.Mathematics.float3* vertices, [NativeTypeName("size_t")] nuint num_vertices, [NativeTypeName("ufbx_real")] float weight);
|
||||
public static extern void ufbx_add_blend_shape_vertex_offsets([NativeTypeName("const ufbx_blend_shape *")] ufbx_blend_shape* shape, ufbx_vec3* vertices, [NativeTypeName("size_t")] nuint num_vertices, [NativeTypeName("ufbx_real")] float weight);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern void ufbx_add_blend_vertex_offsets([NativeTypeName("const ufbx_blend_deformer *")] ufbx_blend_deformer* blend, [NativeTypeName("ufbx_vec3 *")] Misaki.HighPerformance.Mathematics.float3* vertices, [NativeTypeName("size_t")] nuint num_vertices, [NativeTypeName("ufbx_real")] float weight);
|
||||
public static extern void ufbx_add_blend_vertex_offsets([NativeTypeName("const ufbx_blend_deformer *")] ufbx_blend_deformer* blend, ufbx_vec3* vertices, [NativeTypeName("size_t")] nuint num_vertices, [NativeTypeName("ufbx_real")] float weight);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -629,12 +580,10 @@ namespace Ghost.Ufbx
|
||||
public static extern uint ufbx_topo_prev_vertex_edge([NativeTypeName("const ufbx_topo_edge *")] ufbx_topo_edge* topo, [NativeTypeName("size_t")] nuint num_topo, [NativeTypeName("uint32_t")] uint index);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_catch_get_weighted_face_normal(ufbx_panic* panic, [NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* positions, ufbx_face face);
|
||||
public static extern ufbx_vec3 ufbx_catch_get_weighted_face_normal(ufbx_panic* panic, [NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* positions, ufbx_face face);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_get_weighted_face_normal([NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* positions, ufbx_face face);
|
||||
public static extern ufbx_vec3 ufbx_get_weighted_face_normal([NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* positions, ufbx_face face);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -645,10 +594,10 @@ namespace Ghost.Ufbx
|
||||
public static extern nuint ufbx_generate_normal_mapping([NativeTypeName("const ufbx_mesh *")] ufbx_mesh* mesh, [NativeTypeName("const ufbx_topo_edge *")] ufbx_topo_edge* topo, [NativeTypeName("size_t")] nuint num_topo, [NativeTypeName("uint32_t *")] uint* normal_indices, [NativeTypeName("size_t")] nuint num_normal_indices, [NativeTypeName("_Bool")] bool assume_smooth);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern void ufbx_catch_compute_normals(ufbx_panic* panic, [NativeTypeName("const ufbx_mesh *")] ufbx_mesh* mesh, [NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* positions, [NativeTypeName("const uint32_t *")] uint* normal_indices, [NativeTypeName("size_t")] nuint num_normal_indices, [NativeTypeName("ufbx_vec3 *")] Misaki.HighPerformance.Mathematics.float3* normals, [NativeTypeName("size_t")] nuint num_normals);
|
||||
public static extern void ufbx_catch_compute_normals(ufbx_panic* panic, [NativeTypeName("const ufbx_mesh *")] ufbx_mesh* mesh, [NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* positions, [NativeTypeName("const uint32_t *")] uint* normal_indices, [NativeTypeName("size_t")] nuint num_normal_indices, ufbx_vec3* normals, [NativeTypeName("size_t")] nuint num_normals);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern void ufbx_compute_normals([NativeTypeName("const ufbx_mesh *")] ufbx_mesh* mesh, [NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* positions, [NativeTypeName("const uint32_t *")] uint* normal_indices, [NativeTypeName("size_t")] nuint num_normal_indices, [NativeTypeName("ufbx_vec3 *")] Misaki.HighPerformance.Mathematics.float3* normals, [NativeTypeName("size_t")] nuint num_normals);
|
||||
public static extern void ufbx_compute_normals([NativeTypeName("const ufbx_mesh *")] ufbx_mesh* mesh, [NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* positions, [NativeTypeName("const uint32_t *")] uint* normal_indices, [NativeTypeName("size_t")] nuint num_normal_indices, ufbx_vec3* normals, [NativeTypeName("size_t")] nuint num_normals);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern ufbx_mesh* ufbx_subdivide_mesh([NativeTypeName("const ufbx_mesh *")] ufbx_mesh* mesh, [NativeTypeName("size_t")] nuint level, [NativeTypeName("const ufbx_subdivide_opts *")] ufbx_subdivide_opts* opts, ufbx_error* error);
|
||||
@@ -677,7 +626,7 @@ namespace Ghost.Ufbx
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
public static extern nuint ufbx_read_geometry_cache_vec3([NativeTypeName("const ufbx_cache_frame *")] ufbx_cache_frame* frame, [NativeTypeName("ufbx_vec3 *")] Misaki.HighPerformance.Mathematics.float3* data, [NativeTypeName("size_t")] nuint num_data, [NativeTypeName("const ufbx_geometry_cache_data_opts *")] ufbx_geometry_cache_data_opts* opts);
|
||||
public static extern nuint ufbx_read_geometry_cache_vec3([NativeTypeName("const ufbx_cache_frame *")] ufbx_cache_frame* frame, ufbx_vec3* data, [NativeTypeName("size_t")] nuint num_data, [NativeTypeName("const ufbx_geometry_cache_data_opts *")] ufbx_geometry_cache_data_opts* opts);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -685,7 +634,7 @@ namespace Ghost.Ufbx
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
public static extern nuint ufbx_sample_geometry_cache_vec3([NativeTypeName("const ufbx_cache_channel *")] ufbx_cache_channel* channel, double time, [NativeTypeName("ufbx_vec3 *")] Misaki.HighPerformance.Mathematics.float3* data, [NativeTypeName("size_t")] nuint num_data, [NativeTypeName("const ufbx_geometry_cache_data_opts *")] ufbx_geometry_cache_data_opts* opts);
|
||||
public static extern nuint ufbx_sample_geometry_cache_vec3([NativeTypeName("const ufbx_cache_channel *")] ufbx_cache_channel* channel, double time, ufbx_vec3* data, [NativeTypeName("size_t")] nuint num_data, [NativeTypeName("const ufbx_geometry_cache_data_opts *")] ufbx_geometry_cache_data_opts* opts);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern ufbx_dom_node* ufbx_dom_find_len([NativeTypeName("const ufbx_dom_node *")] ufbx_dom_node* parent, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("size_t")] nuint name_len);
|
||||
@@ -711,16 +660,13 @@ namespace Ghost.Ufbx
|
||||
public static extern float ufbx_catch_get_vertex_real(ufbx_panic* panic, [NativeTypeName("const ufbx_vertex_real *")] ufbx_vertex_real* v, [NativeTypeName("size_t")] nuint index);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec2")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float2 ufbx_catch_get_vertex_vec2(ufbx_panic* panic, [NativeTypeName("const ufbx_vertex_vec2 *")] ufbx_vertex_vec2* v, [NativeTypeName("size_t")] nuint index);
|
||||
public static extern ufbx_vec2 ufbx_catch_get_vertex_vec2(ufbx_panic* panic, [NativeTypeName("const ufbx_vertex_vec2 *")] ufbx_vertex_vec2* v, [NativeTypeName("size_t")] nuint index);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float3 ufbx_catch_get_vertex_vec3(ufbx_panic* panic, [NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* v, [NativeTypeName("size_t")] nuint index);
|
||||
public static extern ufbx_vec3 ufbx_catch_get_vertex_vec3(ufbx_panic* panic, [NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* v, [NativeTypeName("size_t")] nuint index);
|
||||
|
||||
[DllImport("ufbx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("ufbx_vec4")]
|
||||
public static extern Misaki.HighPerformance.Mathematics.float4 ufbx_catch_get_vertex_vec4(ufbx_panic* panic, [NativeTypeName("const ufbx_vertex_vec4 *")] ufbx_vertex_vec4* v, [NativeTypeName("size_t")] nuint index);
|
||||
public static extern ufbx_vec4 ufbx_catch_get_vertex_vec4(ufbx_panic* panic, [NativeTypeName("const ufbx_vertex_vec4 *")] ufbx_vertex_vec4* v, [NativeTypeName("size_t")] nuint index);
|
||||
|
||||
[return: NativeTypeName("ufbx_real")]
|
||||
public static float ufbx_get_vertex_real([NativeTypeName("const ufbx_vertex_real *")] ufbx_vertex_real* v, [NativeTypeName("size_t")] nuint index)
|
||||
@@ -729,22 +675,19 @@ namespace Ghost.Ufbx
|
||||
return v->values.data[(int)(v->indices.data[index])];
|
||||
}
|
||||
|
||||
[return: NativeTypeName("ufbx_vec2")]
|
||||
public static Misaki.HighPerformance.Mathematics.float2 ufbx_get_vertex_vec2([NativeTypeName("const ufbx_vertex_vec2 *")] ufbx_vertex_vec2* v, [NativeTypeName("size_t")] nuint index)
|
||||
public static ufbx_vec2 ufbx_get_vertex_vec2([NativeTypeName("const ufbx_vertex_vec2 *")] ufbx_vertex_vec2* v, [NativeTypeName("size_t")] nuint index)
|
||||
{
|
||||
;
|
||||
return v->values.data[(int)(v->indices.data[index])];
|
||||
}
|
||||
|
||||
[return: NativeTypeName("ufbx_vec3")]
|
||||
public static Misaki.HighPerformance.Mathematics.float3 ufbx_get_vertex_vec3([NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* v, [NativeTypeName("size_t")] nuint index)
|
||||
public static ufbx_vec3 ufbx_get_vertex_vec3([NativeTypeName("const ufbx_vertex_vec3 *")] ufbx_vertex_vec3* v, [NativeTypeName("size_t")] nuint index)
|
||||
{
|
||||
;
|
||||
return v->values.data[(int)(v->indices.data[index])];
|
||||
}
|
||||
|
||||
[return: NativeTypeName("ufbx_vec4")]
|
||||
public static Misaki.HighPerformance.Mathematics.float4 ufbx_get_vertex_vec4([NativeTypeName("const ufbx_vertex_vec4 *")] ufbx_vertex_vec4* v, [NativeTypeName("size_t")] nuint index)
|
||||
public static ufbx_vec4 ufbx_get_vertex_vec4([NativeTypeName("const ufbx_vertex_vec4 *")] ufbx_vertex_vec4* v, [NativeTypeName("size_t")] nuint index)
|
||||
{
|
||||
;
|
||||
return v->values.data[(int)(v->indices.data[index])];
|
||||
|
||||
@@ -8,8 +8,7 @@ namespace Ghost.Ufbx
|
||||
[NativeTypeName("__AnonymousRecord_ufbx_L3136_C2")]
|
||||
public _Anonymous_e__Union Anonymous;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 default_value;
|
||||
public ufbx_vec3 default_value;
|
||||
|
||||
[NativeTypeName("ufbx_anim_curve *[3]")]
|
||||
public _curves_e__FixedBuffer curves;
|
||||
|
||||
@@ -4,8 +4,7 @@ namespace Ghost.Ufbx
|
||||
{
|
||||
public double time;
|
||||
|
||||
[NativeTypeName("ufbx_quat")]
|
||||
public Misaki.HighPerformance.Mathematics.quaternion value;
|
||||
public ufbx_quat value;
|
||||
|
||||
public ufbx_baked_key_flags flags;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@ namespace Ghost.Ufbx
|
||||
{
|
||||
public double time;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 value;
|
||||
public ufbx_vec3 value;
|
||||
|
||||
public ufbx_baked_key_flags flags;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,8 @@ namespace Ghost.Ufbx
|
||||
{
|
||||
public ufbx_node* bone_node;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 bone_to_world;
|
||||
public ufbx_matrix bone_to_world;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 bone_to_parent;
|
||||
public ufbx_matrix bone_to_parent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,23 +13,18 @@ namespace Ghost.Ufbx
|
||||
[NativeTypeName("_Bool")]
|
||||
public bool resolution_is_pixels;
|
||||
|
||||
[NativeTypeName("ufbx_vec2")]
|
||||
public Misaki.HighPerformance.Mathematics.float2 resolution;
|
||||
public ufbx_vec2 resolution;
|
||||
|
||||
[NativeTypeName("ufbx_vec2")]
|
||||
public Misaki.HighPerformance.Mathematics.float2 field_of_view_deg;
|
||||
public ufbx_vec2 field_of_view_deg;
|
||||
|
||||
[NativeTypeName("ufbx_vec2")]
|
||||
public Misaki.HighPerformance.Mathematics.float2 field_of_view_tan;
|
||||
public ufbx_vec2 field_of_view_tan;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float orthographic_extent;
|
||||
|
||||
[NativeTypeName("ufbx_vec2")]
|
||||
public Misaki.HighPerformance.Mathematics.float2 orthographic_size;
|
||||
public ufbx_vec2 orthographic_size;
|
||||
|
||||
[NativeTypeName("ufbx_vec2")]
|
||||
public Misaki.HighPerformance.Mathematics.float2 projection_plane;
|
||||
public ufbx_vec2 projection_plane;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float aspect_ratio;
|
||||
@@ -53,11 +48,9 @@ namespace Ghost.Ufbx
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float focal_length_mm;
|
||||
|
||||
[NativeTypeName("ufbx_vec2")]
|
||||
public Misaki.HighPerformance.Mathematics.float2 film_size_inch;
|
||||
public ufbx_vec2 film_size_inch;
|
||||
|
||||
[NativeTypeName("ufbx_vec2")]
|
||||
public Misaki.HighPerformance.Mathematics.float2 aperture_size_inch;
|
||||
public ufbx_vec2 aperture_size_inch;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float squeeze_ratio;
|
||||
|
||||
@@ -34,22 +34,19 @@ namespace Ghost.Ufbx
|
||||
|
||||
public ufbx_transform transform_offset;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 aim_vector;
|
||||
public ufbx_vec3 aim_vector;
|
||||
|
||||
public ufbx_constraint_aim_up_type aim_up_type;
|
||||
|
||||
public ufbx_node* aim_up_node;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 aim_up_vector;
|
||||
public ufbx_vec3 aim_up_vector;
|
||||
|
||||
public ufbx_node* ik_effector;
|
||||
|
||||
public ufbx_node* ik_end_node;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 ik_pole_vector;
|
||||
public ufbx_vec3 ik_pole_vector;
|
||||
|
||||
[UnscopedRef]
|
||||
public ref ufbx_element element
|
||||
|
||||
@@ -5,10 +5,8 @@ namespace Ghost.Ufbx
|
||||
[NativeTypeName("_Bool")]
|
||||
public bool valid;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 position;
|
||||
public ufbx_vec3 position;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 derivative;
|
||||
public ufbx_vec3 derivative;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,7 @@ namespace Ghost.Ufbx
|
||||
[NativeTypeName("_Bool")]
|
||||
public bool frozen;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 ui_color;
|
||||
public ufbx_vec3 ui_color;
|
||||
|
||||
[UnscopedRef]
|
||||
public ref ufbx_element element
|
||||
|
||||
@@ -8,14 +8,12 @@ namespace Ghost.Ufbx
|
||||
[NativeTypeName("__AnonymousRecord_ufbx_L1421_C2")]
|
||||
public _Anonymous_e__Union Anonymous;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 color;
|
||||
public ufbx_vec3 color;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float intensity;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 local_direction;
|
||||
public ufbx_vec3 local_direction;
|
||||
|
||||
public ufbx_light_type type;
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ namespace Ghost.Ufbx
|
||||
[NativeTypeName("__AnonymousRecord_ufbx_L1671_C2")]
|
||||
public _Anonymous_e__Union Anonymous;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 color;
|
||||
public ufbx_vec3 color;
|
||||
|
||||
public ufbx_vec3_list control_points;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Ghost.Ufbx
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref Misaki.HighPerformance.Mathematics.float2 value_vec2
|
||||
public ref ufbx_vec2 value_vec2
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -44,7 +44,7 @@ namespace Ghost.Ufbx
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref Misaki.HighPerformance.Mathematics.float3 value_vec3
|
||||
public ref ufbx_vec3 value_vec3
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -53,7 +53,7 @@ namespace Ghost.Ufbx
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref Misaki.HighPerformance.Mathematics.float4 value_vec4
|
||||
public ref ufbx_vec4 value_vec4
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -69,16 +69,13 @@ namespace Ghost.Ufbx
|
||||
public float value_real;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_vec2")]
|
||||
public Misaki.HighPerformance.Mathematics.float2 value_vec2;
|
||||
public ufbx_vec2 value_vec2;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 value_vec3;
|
||||
public ufbx_vec3 value_vec3;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_vec4")]
|
||||
public Misaki.HighPerformance.Mathematics.float4 value_vec4;
|
||||
public ufbx_vec4 value_vec4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -118,7 +119,7 @@ namespace Ghost.Ufbx
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public Span<System.Numerics.Vector3> cols
|
||||
public Span<ufbx_vec3> cols
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -192,7 +193,7 @@ namespace Ghost.Ufbx
|
||||
[InlineArray(4)]
|
||||
public partial struct _cols_e__FixedBuffer
|
||||
{
|
||||
public System.Numerics.Vector3 e0;
|
||||
public ufbx_vec3 e0;
|
||||
}
|
||||
|
||||
[InlineArray(12)]
|
||||
|
||||
@@ -111,8 +111,7 @@ namespace Ghost.Ufbx
|
||||
|
||||
public ufbx_mirror_axis handedness_conversion_axis;
|
||||
|
||||
[NativeTypeName("ufbx_quat")]
|
||||
public Misaki.HighPerformance.Mathematics.quaternion root_rotation;
|
||||
public ufbx_quat root_rotation;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float root_scale;
|
||||
|
||||
@@ -38,42 +38,32 @@ namespace Ghost.Ufbx
|
||||
|
||||
public ufbx_transform geometry_transform;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 inherit_scale;
|
||||
public ufbx_vec3 inherit_scale;
|
||||
|
||||
public ufbx_node* inherit_scale_node;
|
||||
|
||||
public ufbx_rotation_order rotation_order;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 euler_rotation;
|
||||
public ufbx_vec3 euler_rotation;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 node_to_parent;
|
||||
public ufbx_matrix node_to_parent;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 node_to_world;
|
||||
public ufbx_matrix node_to_world;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 geometry_to_node;
|
||||
public ufbx_matrix geometry_to_node;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 geometry_to_world;
|
||||
public ufbx_matrix geometry_to_world;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 unscaled_node_to_world;
|
||||
public ufbx_matrix unscaled_node_to_world;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 adjust_pre_translation;
|
||||
public ufbx_vec3 adjust_pre_translation;
|
||||
|
||||
[NativeTypeName("ufbx_quat")]
|
||||
public Misaki.HighPerformance.Mathematics.quaternion adjust_pre_rotation;
|
||||
public ufbx_quat adjust_pre_rotation;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float adjust_pre_scale;
|
||||
|
||||
[NativeTypeName("ufbx_quat")]
|
||||
public Misaki.HighPerformance.Mathematics.quaternion adjust_post_rotation;
|
||||
public ufbx_quat adjust_post_rotation;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float adjust_post_scale;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Ghost.Ufbx
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref Misaki.HighPerformance.Mathematics.float2 value_vec2
|
||||
public ref ufbx_vec2 value_vec2
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -54,7 +54,7 @@ namespace Ghost.Ufbx
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref Misaki.HighPerformance.Mathematics.float3 value_vec3
|
||||
public ref ufbx_vec3 value_vec3
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -63,7 +63,7 @@ namespace Ghost.Ufbx
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref Misaki.HighPerformance.Mathematics.float4 value_vec4
|
||||
public ref ufbx_vec4 value_vec4
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -83,16 +83,13 @@ namespace Ghost.Ufbx
|
||||
public float value_real;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_vec2")]
|
||||
public Misaki.HighPerformance.Mathematics.float2 value_vec2;
|
||||
public ufbx_vec2 value_vec2;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 value_vec3;
|
||||
public ufbx_vec3 value_vec3;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_vec4")]
|
||||
public Misaki.HighPerformance.Mathematics.float4 value_vec4;
|
||||
public ufbx_vec4 value_vec4;
|
||||
|
||||
[InlineArray(4)]
|
||||
public partial struct _value_real_arr_e__FixedBuffer
|
||||
|
||||
@@ -10,8 +10,7 @@ namespace Ghost.Ufbx
|
||||
|
||||
public ufbx_string prop_name;
|
||||
|
||||
[NativeTypeName("ufbx_vec4")]
|
||||
public Misaki.HighPerformance.Mathematics.float4 value;
|
||||
public ufbx_vec4 value;
|
||||
|
||||
public ufbx_string value_str;
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@ namespace Ghost.Ufbx
|
||||
|
||||
public ufbx_string prop_name;
|
||||
|
||||
[NativeTypeName("ufbx_vec4")]
|
||||
public Misaki.HighPerformance.Mathematics.float4 value;
|
||||
public ufbx_vec4 value;
|
||||
|
||||
public ufbx_string value_str;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -11,8 +11,7 @@ namespace Ghost.Ufbx
|
||||
|
||||
public double frames_per_second;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 ambient_color;
|
||||
public ufbx_vec3 ambient_color;
|
||||
|
||||
public ufbx_string default_camera;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Ghost.Ufbx
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref Misaki.HighPerformance.Mathematics.float2 value_vec2
|
||||
public ref ufbx_vec2 value_vec2
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -50,7 +50,7 @@ namespace Ghost.Ufbx
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref Misaki.HighPerformance.Mathematics.float3 value_vec3
|
||||
public ref ufbx_vec3 value_vec3
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace Ghost.Ufbx
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref Misaki.HighPerformance.Mathematics.float4 value_vec4
|
||||
public ref ufbx_vec4 value_vec4
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -75,16 +75,13 @@ namespace Ghost.Ufbx
|
||||
public float value_real;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_vec2")]
|
||||
public Misaki.HighPerformance.Mathematics.float2 value_vec2;
|
||||
public ufbx_vec2 value_vec2;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 value_vec3;
|
||||
public ufbx_vec3 value_vec3;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_vec4")]
|
||||
public Misaki.HighPerformance.Mathematics.float4 value_vec4;
|
||||
public ufbx_vec4 value_vec4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,17 +10,13 @@ namespace Ghost.Ufbx
|
||||
|
||||
public ufbx_node* bone_node;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 geometry_to_bone;
|
||||
public ufbx_matrix geometry_to_bone;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 mesh_node_to_bone;
|
||||
public ufbx_matrix mesh_node_to_bone;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 bind_to_world;
|
||||
public ufbx_matrix bind_to_world;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 geometry_to_world;
|
||||
public ufbx_matrix geometry_to_world;
|
||||
|
||||
public ufbx_transform geometry_to_world_transform;
|
||||
|
||||
|
||||
@@ -5,13 +5,10 @@ namespace Ghost.Ufbx
|
||||
[NativeTypeName("_Bool")]
|
||||
public bool valid;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 position;
|
||||
public ufbx_vec3 position;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 derivative_u;
|
||||
public ufbx_vec3 derivative_u;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 derivative_v;
|
||||
public ufbx_vec3 derivative_v;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +49,9 @@ namespace Ghost.Ufbx
|
||||
|
||||
public ufbx_transform uv_transform;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 texture_to_uv;
|
||||
public ufbx_matrix texture_to_uv;
|
||||
|
||||
[NativeTypeName("ufbx_matrix")]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 uv_to_texture;
|
||||
public ufbx_matrix uv_to_texture;
|
||||
|
||||
[UnscopedRef]
|
||||
public ref ufbx_element element
|
||||
|
||||
@@ -2,13 +2,10 @@ namespace Ghost.Ufbx
|
||||
{
|
||||
public partial struct ufbx_transform
|
||||
{
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 translation;
|
||||
public ufbx_vec3 translation;
|
||||
|
||||
[NativeTypeName("ufbx_quat")]
|
||||
public Misaki.HighPerformance.Mathematics.quaternion rotation;
|
||||
public ufbx_quat rotation;
|
||||
|
||||
[NativeTypeName("ufbx_vec3")]
|
||||
public Misaki.HighPerformance.Mathematics.float3 scale;
|
||||
public ufbx_vec3 scale;
|
||||
}
|
||||
}
|
||||
|
||||
67
src/ThridParty/Ghost.Ufbx/Generated/ufbx_vec2.cs
Normal file
67
src/ThridParty/Ghost.Ufbx/Generated/ufbx_vec2.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ghost.Ufbx
|
||||
{
|
||||
public partial struct ufbx_vec2
|
||||
{
|
||||
[NativeTypeName("__AnonymousRecord_ufbx_L299_C2")]
|
||||
public _Anonymous_e__Union Anonymous;
|
||||
|
||||
[UnscopedRef]
|
||||
public ref float x
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref Anonymous.Anonymous.x;
|
||||
}
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref float y
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref Anonymous.Anonymous.y;
|
||||
}
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public Span<float> v
|
||||
{
|
||||
get
|
||||
{
|
||||
return Anonymous.v;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public partial struct _Anonymous_e__Union
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("__AnonymousRecord_ufbx_L300_C3")]
|
||||
public _Anonymous_e__Struct Anonymous;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_real[2]")]
|
||||
public _v_e__FixedBuffer v;
|
||||
|
||||
public partial struct _Anonymous_e__Struct
|
||||
{
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float x;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float y;
|
||||
}
|
||||
|
||||
[InlineArray(2)]
|
||||
public partial struct _v_e__FixedBuffer
|
||||
{
|
||||
public float e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,7 @@ namespace Ghost.Ufbx
|
||||
{
|
||||
public unsafe partial struct ufbx_vec2_list
|
||||
{
|
||||
[NativeTypeName("ufbx_vec2 *")]
|
||||
public Misaki.HighPerformance.Mathematics.float2* data;
|
||||
public ufbx_vec2* data;
|
||||
|
||||
[NativeTypeName("size_t")]
|
||||
public nuint count;
|
||||
|
||||
79
src/ThridParty/Ghost.Ufbx/Generated/ufbx_vec3.cs
Normal file
79
src/ThridParty/Ghost.Ufbx/Generated/ufbx_vec3.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ghost.Ufbx
|
||||
{
|
||||
public partial struct ufbx_vec3
|
||||
{
|
||||
[NativeTypeName("__AnonymousRecord_ufbx_L309_C2")]
|
||||
public _Anonymous_e__Union Anonymous;
|
||||
|
||||
[UnscopedRef]
|
||||
public ref float x
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref Anonymous.Anonymous.x;
|
||||
}
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref float y
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref Anonymous.Anonymous.y;
|
||||
}
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref float z
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref Anonymous.Anonymous.z;
|
||||
}
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public Span<float> v
|
||||
{
|
||||
get
|
||||
{
|
||||
return Anonymous.v;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public partial struct _Anonymous_e__Union
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("__AnonymousRecord_ufbx_L310_C3")]
|
||||
public _Anonymous_e__Struct Anonymous;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_real[3]")]
|
||||
public _v_e__FixedBuffer v;
|
||||
|
||||
public partial struct _Anonymous_e__Struct
|
||||
{
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float x;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float y;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float z;
|
||||
}
|
||||
|
||||
[InlineArray(3)]
|
||||
public partial struct _v_e__FixedBuffer
|
||||
{
|
||||
public float e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,7 @@ namespace Ghost.Ufbx
|
||||
{
|
||||
public unsafe partial struct ufbx_vec3_list
|
||||
{
|
||||
[NativeTypeName("ufbx_vec3 *")]
|
||||
public Misaki.HighPerformance.Mathematics.float3* data;
|
||||
public ufbx_vec3* data;
|
||||
|
||||
[NativeTypeName("size_t")]
|
||||
public nuint count;
|
||||
|
||||
91
src/ThridParty/Ghost.Ufbx/Generated/ufbx_vec4.cs
Normal file
91
src/ThridParty/Ghost.Ufbx/Generated/ufbx_vec4.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ghost.Ufbx
|
||||
{
|
||||
public partial struct ufbx_vec4
|
||||
{
|
||||
[NativeTypeName("__AnonymousRecord_ufbx_L319_C2")]
|
||||
public _Anonymous_e__Union Anonymous;
|
||||
|
||||
[UnscopedRef]
|
||||
public ref float x
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref Anonymous.Anonymous.x;
|
||||
}
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref float y
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref Anonymous.Anonymous.y;
|
||||
}
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref float z
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref Anonymous.Anonymous.z;
|
||||
}
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public ref float w
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref Anonymous.Anonymous.w;
|
||||
}
|
||||
}
|
||||
|
||||
[UnscopedRef]
|
||||
public Span<float> v
|
||||
{
|
||||
get
|
||||
{
|
||||
return Anonymous.v;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public partial struct _Anonymous_e__Union
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("__AnonymousRecord_ufbx_L320_C3")]
|
||||
public _Anonymous_e__Struct Anonymous;
|
||||
|
||||
[FieldOffset(0)]
|
||||
[NativeTypeName("ufbx_real[4]")]
|
||||
public _v_e__FixedBuffer v;
|
||||
|
||||
public partial struct _Anonymous_e__Struct
|
||||
{
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float x;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float y;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float z;
|
||||
|
||||
[NativeTypeName("ufbx_real")]
|
||||
public float w;
|
||||
}
|
||||
|
||||
[InlineArray(4)]
|
||||
public partial struct _v_e__FixedBuffer
|
||||
{
|
||||
public float e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,7 @@ namespace Ghost.Ufbx
|
||||
{
|
||||
public unsafe partial struct ufbx_vec4_list
|
||||
{
|
||||
[NativeTypeName("ufbx_vec4 *")]
|
||||
public Misaki.HighPerformance.Mathematics.float4* data;
|
||||
public ufbx_vec4* data;
|
||||
|
||||
[NativeTypeName("size_t")]
|
||||
public nuint count;
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
<IsAotCompatible>True</IsAotCompatible>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Misaki.HighPerformance.Mathematics" Version="1.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="runtimes\win-x64\native\ufbx.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
||||
@@ -61,7 +61,7 @@ public unsafe partial struct UfbxApi
|
||||
/// From: <see cref="Api.ufbx_evaluate_baked_vec3(ufbx_baked_vec3_list, double)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.float3 EvaluateBakedVec3(ufbx_baked_vec3_list keyframes, double time)
|
||||
public static ufbx_vec3 EvaluateBakedVec3(ufbx_baked_vec3_list keyframes, double time)
|
||||
{
|
||||
return Api.ufbx_evaluate_baked_vec3(
|
||||
keyframes,
|
||||
@@ -72,7 +72,7 @@ public unsafe partial struct UfbxApi
|
||||
/// From: <see cref="Api.ufbx_evaluate_baked_quat(ufbx_baked_quat_list, double)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.quaternion EvaluateBakedQuat(ufbx_baked_quat_list keyframes, double time)
|
||||
public static ufbx_quat EvaluateBakedQuat(ufbx_baked_quat_list keyframes, double time)
|
||||
{
|
||||
return Api.ufbx_evaluate_baked_quat(
|
||||
keyframes,
|
||||
@@ -89,19 +89,19 @@ public unsafe partial struct UfbxApi
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_vec3_normalize(Misaki.HighPerformance.Mathematics.float3)" />
|
||||
/// From: <see cref="Api.ufbx_vec3_normalize(ufbx_vec3)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.float3 Vec3Normalize(Misaki.HighPerformance.Mathematics.float3 v)
|
||||
public static ufbx_vec3 Vec3Normalize(ufbx_vec3 v)
|
||||
{
|
||||
return Api.ufbx_vec3_normalize(v);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_quat_dot(Misaki.HighPerformance.Mathematics.quaternion, Misaki.HighPerformance.Mathematics.quaternion)" />
|
||||
/// From: <see cref="Api.ufbx_quat_dot(ufbx_quat, ufbx_quat)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static float QuatDot(Misaki.HighPerformance.Mathematics.quaternion a, Misaki.HighPerformance.Mathematics.quaternion b)
|
||||
public static float QuatDot(ufbx_quat a, ufbx_quat b)
|
||||
{
|
||||
return Api.ufbx_quat_dot(
|
||||
a,
|
||||
@@ -109,10 +109,10 @@ public unsafe partial struct UfbxApi
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_quat_mul(Misaki.HighPerformance.Mathematics.quaternion, Misaki.HighPerformance.Mathematics.quaternion)" />
|
||||
/// From: <see cref="Api.ufbx_quat_mul(ufbx_quat, ufbx_quat)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.quaternion QuatMul(Misaki.HighPerformance.Mathematics.quaternion a, Misaki.HighPerformance.Mathematics.quaternion b)
|
||||
public static ufbx_quat QuatMul(ufbx_quat a, ufbx_quat b)
|
||||
{
|
||||
return Api.ufbx_quat_mul(
|
||||
a,
|
||||
@@ -120,19 +120,19 @@ public unsafe partial struct UfbxApi
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_quat_normalize(Misaki.HighPerformance.Mathematics.quaternion)" />
|
||||
/// From: <see cref="Api.ufbx_quat_normalize(ufbx_quat)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.quaternion QuatNormalize(Misaki.HighPerformance.Mathematics.quaternion q)
|
||||
public static ufbx_quat QuatNormalize(ufbx_quat q)
|
||||
{
|
||||
return Api.ufbx_quat_normalize(q);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_quat_fix_antipodal(Misaki.HighPerformance.Mathematics.quaternion, Misaki.HighPerformance.Mathematics.quaternion)" />
|
||||
/// From: <see cref="Api.ufbx_quat_fix_antipodal(ufbx_quat, ufbx_quat)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.quaternion QuatFixAntipodal(Misaki.HighPerformance.Mathematics.quaternion q, Misaki.HighPerformance.Mathematics.quaternion reference)
|
||||
public static ufbx_quat QuatFixAntipodal(ufbx_quat q, ufbx_quat reference)
|
||||
{
|
||||
return Api.ufbx_quat_fix_antipodal(
|
||||
q,
|
||||
@@ -140,10 +140,10 @@ public unsafe partial struct UfbxApi
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_quat_slerp(Misaki.HighPerformance.Mathematics.quaternion, Misaki.HighPerformance.Mathematics.quaternion, float)" />
|
||||
/// From: <see cref="Api.ufbx_quat_slerp(ufbx_quat, ufbx_quat, float)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.quaternion QuatSlerp(Misaki.HighPerformance.Mathematics.quaternion a, Misaki.HighPerformance.Mathematics.quaternion b, float t)
|
||||
public static ufbx_quat QuatSlerp(ufbx_quat a, ufbx_quat b, float t)
|
||||
{
|
||||
return Api.ufbx_quat_slerp(
|
||||
a,
|
||||
@@ -152,10 +152,10 @@ public unsafe partial struct UfbxApi
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_quat_rotate_vec3(Misaki.HighPerformance.Mathematics.quaternion, Misaki.HighPerformance.Mathematics.float3)" />
|
||||
/// From: <see cref="Api.ufbx_quat_rotate_vec3(ufbx_quat, ufbx_vec3)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.float3 QuatRotateVec3(Misaki.HighPerformance.Mathematics.quaternion q, Misaki.HighPerformance.Mathematics.float3 v)
|
||||
public static ufbx_vec3 QuatRotateVec3(ufbx_quat q, ufbx_vec3 v)
|
||||
{
|
||||
return Api.ufbx_quat_rotate_vec3(
|
||||
q,
|
||||
@@ -163,10 +163,10 @@ public unsafe partial struct UfbxApi
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_quat_to_euler(Misaki.HighPerformance.Mathematics.quaternion, ufbx_rotation_order)" />
|
||||
/// From: <see cref="Api.ufbx_quat_to_euler(ufbx_quat, ufbx_rotation_order)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.float3 QuatToEuler(Misaki.HighPerformance.Mathematics.quaternion q, ufbx_rotation_order order)
|
||||
public static ufbx_vec3 QuatToEuler(ufbx_quat q, ufbx_rotation_order order)
|
||||
{
|
||||
return Api.ufbx_quat_to_euler(
|
||||
q,
|
||||
@@ -174,85 +174,16 @@ public unsafe partial struct UfbxApi
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_euler_to_quat(Misaki.HighPerformance.Mathematics.float3, ufbx_rotation_order)" />
|
||||
/// From: <see cref="Api.ufbx_euler_to_quat(ufbx_vec3, ufbx_rotation_order)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.quaternion EulerToQuat(Misaki.HighPerformance.Mathematics.float3 v, ufbx_rotation_order order)
|
||||
public static ufbx_quat EulerToQuat(ufbx_vec3 v, ufbx_rotation_order order)
|
||||
{
|
||||
return Api.ufbx_euler_to_quat(
|
||||
v,
|
||||
order);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_matrix_mul(Misaki.HighPerformance.Mathematics.float3x4*, Misaki.HighPerformance.Mathematics.float3x4*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.float3x4 MatrixMul(Misaki.HighPerformance.Mathematics.float3x4* a, Misaki.HighPerformance.Mathematics.float3x4* b)
|
||||
{
|
||||
return Api.ufbx_matrix_mul(
|
||||
a,
|
||||
b);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_matrix_determinant(Misaki.HighPerformance.Mathematics.float3x4*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static float MatrixDeterminant(Misaki.HighPerformance.Mathematics.float3x4* m)
|
||||
{
|
||||
return Api.ufbx_matrix_determinant(m);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_matrix_invert(Misaki.HighPerformance.Mathematics.float3x4*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.float3x4 MatrixInvert(Misaki.HighPerformance.Mathematics.float3x4* m)
|
||||
{
|
||||
return Api.ufbx_matrix_invert(m);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_matrix_for_normals(Misaki.HighPerformance.Mathematics.float3x4*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.float3x4 MatrixForNormals(Misaki.HighPerformance.Mathematics.float3x4* m)
|
||||
{
|
||||
return Api.ufbx_matrix_for_normals(m);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_transform_position(Misaki.HighPerformance.Mathematics.float3x4*, Misaki.HighPerformance.Mathematics.float3)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.float3 TransformPosition(Misaki.HighPerformance.Mathematics.float3x4* m, Misaki.HighPerformance.Mathematics.float3 v)
|
||||
{
|
||||
return Api.ufbx_transform_position(
|
||||
m,
|
||||
v);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_transform_direction(Misaki.HighPerformance.Mathematics.float3x4*, Misaki.HighPerformance.Mathematics.float3)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static Misaki.HighPerformance.Mathematics.float3 TransformDirection(Misaki.HighPerformance.Mathematics.float3x4* m, Misaki.HighPerformance.Mathematics.float3 v)
|
||||
{
|
||||
return Api.ufbx_transform_direction(
|
||||
m,
|
||||
v);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_matrix_to_transform(Misaki.HighPerformance.Mathematics.float3x4*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public static ufbx_transform MatrixToTransform(Misaki.HighPerformance.Mathematics.float3x4* m)
|
||||
{
|
||||
return Api.ufbx_matrix_to_transform(m);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_triangulate_face(uint*, nuint, ufbx_mesh*, ufbx_face)" />
|
||||
/// </summary>
|
||||
|
||||
@@ -21,7 +21,7 @@ public unsafe partial struct ufbx_anim_value
|
||||
/// From: <see cref="Api.ufbx_evaluate_anim_value_vec3(ufbx_anim_value*, double)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3 EvaluateVec3(double time)
|
||||
public ufbx_vec3 EvaluateVec3(double time)
|
||||
{
|
||||
return Api.ufbx_evaluate_anim_value_vec3(
|
||||
(ufbx_anim_value*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -44,7 +44,7 @@ public unsafe partial struct ufbx_anim_value
|
||||
/// From: <see cref="Api.ufbx_evaluate_anim_value_vec3_flags(ufbx_anim_value*, double, uint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3 EvaluateVec3Flags(double time, uint flags)
|
||||
public ufbx_vec3 EvaluateVec3Flags(double time, uint flags)
|
||||
{
|
||||
return Api.ufbx_evaluate_anim_value_vec3_flags(
|
||||
(ufbx_anim_value*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
|
||||
@@ -10,7 +10,7 @@ public unsafe partial struct ufbx_blend_deformer
|
||||
/// From: <see cref="Api.ufbx_get_blend_vertex_offset(ufbx_blend_deformer*, nuint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3 GetBlendVertexOffset(nuint vertex)
|
||||
public ufbx_vec3 GetBlendVertexOffset(nuint vertex)
|
||||
{
|
||||
return Api.ufbx_get_blend_vertex_offset(
|
||||
(ufbx_blend_deformer*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -18,16 +18,16 @@ public unsafe partial struct ufbx_blend_deformer
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_add_blend_vertex_offsets(ufbx_blend_deformer*, Misaki.HighPerformance.Mathematics.float3*, nuint, float)" />
|
||||
/// From: <see cref="Api.ufbx_add_blend_vertex_offsets(ufbx_blend_deformer*, ufbx_vec3*, nuint, float)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public void AddBlendVertexOffsets(ReadOnlySpan<Misaki.HighPerformance.Mathematics.float3> vertices, float weight)
|
||||
public void AddBlendVertexOffsets(ReadOnlySpan<ufbx_vec3> vertices, float weight)
|
||||
{
|
||||
fixed (Misaki.HighPerformance.Mathematics.float3* pvertices = vertices)
|
||||
fixed (ufbx_vec3* pvertices = vertices)
|
||||
{
|
||||
Api.ufbx_add_blend_vertex_offsets(
|
||||
(ufbx_blend_deformer*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
(Misaki.HighPerformance.Mathematics.float3*)pvertices,
|
||||
(ufbx_vec3*)pvertices,
|
||||
(nuint)vertices.Length,
|
||||
weight);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public unsafe partial struct ufbx_blend_shape
|
||||
/// From: <see cref="Api.ufbx_get_blend_shape_vertex_offset(ufbx_blend_shape*, nuint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3 GetVertexOffset(nuint vertex)
|
||||
public ufbx_vec3 GetVertexOffset(nuint vertex)
|
||||
{
|
||||
return Api.ufbx_get_blend_shape_vertex_offset(
|
||||
(ufbx_blend_shape*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -29,16 +29,16 @@ public unsafe partial struct ufbx_blend_shape
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_add_blend_shape_vertex_offsets(ufbx_blend_shape*, Misaki.HighPerformance.Mathematics.float3*, nuint, float)" />
|
||||
/// From: <see cref="Api.ufbx_add_blend_shape_vertex_offsets(ufbx_blend_shape*, ufbx_vec3*, nuint, float)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public void AddVertexOffsets(ReadOnlySpan<Misaki.HighPerformance.Mathematics.float3> vertices, float weight)
|
||||
public void AddVertexOffsets(ReadOnlySpan<ufbx_vec3> vertices, float weight)
|
||||
{
|
||||
fixed (Misaki.HighPerformance.Mathematics.float3* pvertices = vertices)
|
||||
fixed (ufbx_vec3* pvertices = vertices)
|
||||
{
|
||||
Api.ufbx_add_blend_shape_vertex_offsets(
|
||||
(ufbx_blend_shape*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
(Misaki.HighPerformance.Mathematics.float3*)pvertices,
|
||||
(ufbx_vec3*)pvertices,
|
||||
(nuint)vertices.Length,
|
||||
weight);
|
||||
}
|
||||
|
||||
@@ -24,17 +24,17 @@ public unsafe partial struct ufbx_cache_channel
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_sample_geometry_cache_vec3(ufbx_cache_channel*, double, Misaki.HighPerformance.Mathematics.float3*, nuint, ufbx_geometry_cache_data_opts*)" />
|
||||
/// From: <see cref="Api.ufbx_sample_geometry_cache_vec3(ufbx_cache_channel*, double, ufbx_vec3*, nuint, ufbx_geometry_cache_data_opts*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public nuint SampleGeometryCacheVec3(double time, ReadOnlySpan<Misaki.HighPerformance.Mathematics.float3> data, ufbx_geometry_cache_data_opts* opts)
|
||||
public nuint SampleGeometryCacheVec3(double time, ReadOnlySpan<ufbx_vec3> data, ufbx_geometry_cache_data_opts* opts)
|
||||
{
|
||||
fixed (Misaki.HighPerformance.Mathematics.float3* pdata = data)
|
||||
fixed (ufbx_vec3* pdata = data)
|
||||
{
|
||||
return Api.ufbx_sample_geometry_cache_vec3(
|
||||
(ufbx_cache_channel*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
time,
|
||||
(Misaki.HighPerformance.Mathematics.float3*)pdata,
|
||||
(ufbx_vec3*)pdata,
|
||||
(nuint)data.Length,
|
||||
opts);
|
||||
}
|
||||
|
||||
@@ -23,16 +23,16 @@ public unsafe partial struct ufbx_cache_frame
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_read_geometry_cache_vec3(ufbx_cache_frame*, Misaki.HighPerformance.Mathematics.float3*, nuint, ufbx_geometry_cache_data_opts*)" />
|
||||
/// From: <see cref="Api.ufbx_read_geometry_cache_vec3(ufbx_cache_frame*, ufbx_vec3*, nuint, ufbx_geometry_cache_data_opts*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public nuint ReadGeometryCacheVec3(ReadOnlySpan<Misaki.HighPerformance.Mathematics.float3> data, ufbx_geometry_cache_data_opts* opts)
|
||||
public nuint ReadGeometryCacheVec3(ReadOnlySpan<ufbx_vec3> data, ufbx_geometry_cache_data_opts* opts)
|
||||
{
|
||||
fixed (Misaki.HighPerformance.Mathematics.float3* pdata = data)
|
||||
fixed (ufbx_vec3* pdata = data)
|
||||
{
|
||||
return Api.ufbx_read_geometry_cache_vec3(
|
||||
(ufbx_cache_frame*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
(Misaki.HighPerformance.Mathematics.float3*)pdata,
|
||||
(ufbx_vec3*)pdata,
|
||||
(nuint)data.Length,
|
||||
opts);
|
||||
}
|
||||
|
||||
77
src/ThridParty/Ghost.Ufbx/Wrapper/ufbx_matrix.nativegen.cs
Normal file
77
src/ThridParty/Ghost.Ufbx/Wrapper/ufbx_matrix.nativegen.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
// <auto-generated>
|
||||
// This file is generated by Ghost.NativeWrapperGen. Do not edit manually.
|
||||
// </auto-generated>
|
||||
|
||||
namespace Ghost.Ufbx;
|
||||
|
||||
public unsafe partial struct ufbx_matrix
|
||||
{
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_matrix_mul(ufbx_matrix*, ufbx_matrix*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_matrix Mul(ufbx_matrix* b)
|
||||
{
|
||||
return Api.ufbx_matrix_mul(
|
||||
(ufbx_matrix*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
b);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_matrix_determinant(ufbx_matrix*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public float Determinant()
|
||||
{
|
||||
return Api.ufbx_matrix_determinant((ufbx_matrix*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_matrix_invert(ufbx_matrix*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_matrix Invert()
|
||||
{
|
||||
return Api.ufbx_matrix_invert((ufbx_matrix*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_matrix_for_normals(ufbx_matrix*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_matrix ForNormals()
|
||||
{
|
||||
return Api.ufbx_matrix_for_normals((ufbx_matrix*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_transform_position(ufbx_matrix*, ufbx_vec3)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_vec3 TransformPosition(ufbx_vec3 v)
|
||||
{
|
||||
return Api.ufbx_transform_position(
|
||||
(ufbx_matrix*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
v);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_transform_direction(ufbx_matrix*, ufbx_vec3)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_vec3 TransformDirection(ufbx_vec3 v)
|
||||
{
|
||||
return Api.ufbx_transform_direction(
|
||||
(ufbx_matrix*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
v);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_matrix_to_transform(ufbx_matrix*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_transform ToTransform()
|
||||
{
|
||||
return Api.ufbx_matrix_to_transform((ufbx_matrix*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
||||
}
|
||||
}
|
||||
@@ -54,21 +54,21 @@ public unsafe partial struct ufbx_mesh : System.IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_compute_normals(ufbx_mesh*, ufbx_vertex_vec3*, uint*, nuint, Misaki.HighPerformance.Mathematics.float3*, nuint)" />
|
||||
/// From: <see cref="Api.ufbx_compute_normals(ufbx_mesh*, ufbx_vertex_vec3*, uint*, nuint, ufbx_vec3*, nuint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public void ComputeNormals(ufbx_vertex_vec3* positions, ReadOnlySpan<uint> normal_indices, ReadOnlySpan<Misaki.HighPerformance.Mathematics.float3> normals)
|
||||
public void ComputeNormals(ufbx_vertex_vec3* positions, ReadOnlySpan<uint> normal_indices, ReadOnlySpan<ufbx_vec3> normals)
|
||||
{
|
||||
fixed (uint* pnormal_indices = normal_indices)
|
||||
{
|
||||
fixed (Misaki.HighPerformance.Mathematics.float3* pnormals = normals)
|
||||
fixed (ufbx_vec3* pnormals = normals)
|
||||
{
|
||||
Api.ufbx_compute_normals(
|
||||
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
positions,
|
||||
(uint*)pnormal_indices,
|
||||
(nuint)normal_indices.Length,
|
||||
(Misaki.HighPerformance.Mathematics.float3*)pnormals,
|
||||
(ufbx_vec3*)pnormals,
|
||||
(nuint)normals.Length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public unsafe partial struct ufbx_node
|
||||
/// From: <see cref="Api.ufbx_get_compatible_matrix_for_normals(ufbx_node*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 GetCompatibleMatrixForNormals()
|
||||
public ufbx_matrix GetCompatibleMatrixForNormals()
|
||||
{
|
||||
return Api.ufbx_get_compatible_matrix_for_normals((ufbx_node*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace Ghost.Ufbx;
|
||||
public unsafe partial struct ufbx_panic
|
||||
{
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_catch_get_skin_vertex_matrix(ufbx_panic*, ufbx_skin_deformer*, nuint, Misaki.HighPerformance.Mathematics.float3x4*)" />
|
||||
/// From: <see cref="Api.ufbx_catch_get_skin_vertex_matrix(ufbx_panic*, ufbx_skin_deformer*, nuint, ufbx_matrix*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 CatchGetSkinVertexMatrix(ufbx_skin_deformer* skin, nuint vertex, Misaki.HighPerformance.Mathematics.float3x4* fallback)
|
||||
public ufbx_matrix CatchGetSkinVertexMatrix(ufbx_skin_deformer* skin, nuint vertex, ufbx_matrix* fallback)
|
||||
{
|
||||
return Api.ufbx_catch_get_skin_vertex_matrix(
|
||||
(ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -88,7 +88,7 @@ public unsafe partial struct ufbx_panic
|
||||
/// From: <see cref="Api.ufbx_catch_get_weighted_face_normal(ufbx_panic*, ufbx_vertex_vec3*, ufbx_face)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3 CatchGetWeightedFaceNormal(ufbx_vertex_vec3* positions, ufbx_face face)
|
||||
public ufbx_vec3 CatchGetWeightedFaceNormal(ufbx_vertex_vec3* positions, ufbx_face face)
|
||||
{
|
||||
return Api.ufbx_catch_get_weighted_face_normal(
|
||||
(ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -119,14 +119,14 @@ public unsafe partial struct ufbx_panic
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_catch_compute_normals(ufbx_panic*, ufbx_mesh*, ufbx_vertex_vec3*, uint*, nuint, Misaki.HighPerformance.Mathematics.float3*, nuint)" />
|
||||
/// From: <see cref="Api.ufbx_catch_compute_normals(ufbx_panic*, ufbx_mesh*, ufbx_vertex_vec3*, uint*, nuint, ufbx_vec3*, nuint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public void CatchComputeNormals(ufbx_mesh* mesh, ufbx_vertex_vec3* positions, ReadOnlySpan<uint> normal_indices, ReadOnlySpan<Misaki.HighPerformance.Mathematics.float3> normals)
|
||||
public void CatchComputeNormals(ufbx_mesh* mesh, ufbx_vertex_vec3* positions, ReadOnlySpan<uint> normal_indices, ReadOnlySpan<ufbx_vec3> normals)
|
||||
{
|
||||
fixed (uint* pnormal_indices = normal_indices)
|
||||
{
|
||||
fixed (Misaki.HighPerformance.Mathematics.float3* pnormals = normals)
|
||||
fixed (ufbx_vec3* pnormals = normals)
|
||||
{
|
||||
Api.ufbx_catch_compute_normals(
|
||||
(ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -134,7 +134,7 @@ public unsafe partial struct ufbx_panic
|
||||
positions,
|
||||
(uint*)pnormal_indices,
|
||||
(nuint)normal_indices.Length,
|
||||
(Misaki.HighPerformance.Mathematics.float3*)pnormals,
|
||||
(ufbx_vec3*)pnormals,
|
||||
(nuint)normals.Length);
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public unsafe partial struct ufbx_panic
|
||||
/// From: <see cref="Api.ufbx_catch_get_vertex_vec2(ufbx_panic*, ufbx_vertex_vec2*, nuint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float2 CatchGetVertexVec2(ufbx_vertex_vec2* v, nuint index)
|
||||
public ufbx_vec2 CatchGetVertexVec2(ufbx_vertex_vec2* v, nuint index)
|
||||
{
|
||||
return Api.ufbx_catch_get_vertex_vec2(
|
||||
(ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -168,7 +168,7 @@ public unsafe partial struct ufbx_panic
|
||||
/// From: <see cref="Api.ufbx_catch_get_vertex_vec3(ufbx_panic*, ufbx_vertex_vec3*, nuint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3 CatchGetVertexVec3(ufbx_vertex_vec3* v, nuint index)
|
||||
public ufbx_vec3 CatchGetVertexVec3(ufbx_vertex_vec3* v, nuint index)
|
||||
{
|
||||
return Api.ufbx_catch_get_vertex_vec3(
|
||||
(ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -180,7 +180,7 @@ public unsafe partial struct ufbx_panic
|
||||
/// From: <see cref="Api.ufbx_catch_get_vertex_vec4(ufbx_panic*, ufbx_vertex_vec4*, nuint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float4 CatchGetVertexVec4(ufbx_vertex_vec4* v, nuint index)
|
||||
public ufbx_vec4 CatchGetVertexVec4(ufbx_vertex_vec4* v, nuint index)
|
||||
{
|
||||
return Api.ufbx_catch_get_vertex_vec4(
|
||||
(ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
|
||||
@@ -61,10 +61,10 @@ public unsafe partial struct ufbx_props
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_find_vec3_len(ufbx_props*, sbyte*, nuint, Misaki.HighPerformance.Mathematics.float3)" />
|
||||
/// From: <see cref="Api.ufbx_find_vec3_len(ufbx_props*, sbyte*, nuint, ufbx_vec3)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3 FindVec3Len(ReadOnlySpan<byte> name, Misaki.HighPerformance.Mathematics.float3 def)
|
||||
public ufbx_vec3 FindVec3Len(ReadOnlySpan<byte> name, ufbx_vec3 def)
|
||||
{
|
||||
fixed (byte* pname = name)
|
||||
{
|
||||
@@ -77,10 +77,10 @@ public unsafe partial struct ufbx_props
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_find_vec3(ufbx_props*, sbyte*, Misaki.HighPerformance.Mathematics.float3)" />
|
||||
/// From: <see cref="Api.ufbx_find_vec3(ufbx_props*, sbyte*, ufbx_vec3)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3 FindVec3(sbyte* name, Misaki.HighPerformance.Mathematics.float3 def)
|
||||
public ufbx_vec3 FindVec3(sbyte* name, ufbx_vec3 def)
|
||||
{
|
||||
return Api.ufbx_find_vec3(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
|
||||
@@ -10,7 +10,7 @@ public unsafe partial struct ufbx_transform
|
||||
/// From: <see cref="Api.ufbx_transform_to_matrix(ufbx_transform*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3x4 ToMatrix()
|
||||
public ufbx_matrix ToMatrix()
|
||||
{
|
||||
return Api.ufbx_transform_to_matrix((ufbx_transform*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public unsafe partial struct ufbx_vertex_vec3
|
||||
/// From: <see cref="Api.ufbx_get_weighted_face_normal(ufbx_vertex_vec3*, ufbx_face)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public Misaki.HighPerformance.Mathematics.float3 GetWeightedFaceNormal(ufbx_face face)
|
||||
public ufbx_vec3 GetWeightedFaceNormal(ufbx_face face)
|
||||
{
|
||||
return Api.ufbx_get_weighted_face_normal(
|
||||
(ufbx_vertex_vec3*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
|
||||
Reference in New Issue
Block a user