forked from Misaki/GhostEngine
feat(bindings): update C# wrappers for meshopt, nvtt, ufbx
Refactor and regenerate native C# bindings for Ghost.MeshOptimizer, Ghost.Nvtt, and Ghost.Ufbx to match updated native APIs and improve usability. - Replace meshoptimizer.dll with newer version. - Move meshoptimizer functions to static methods in partial class; add new meshlet, simplification, quantization features. - Remove enum wrappers in favor of constants; delete meshopt_Allocator.cs. - Regenerate native wrappers with PascalCase naming, XML doc comments, and aggressive inlining. - Implement IDisposable for resource structs; update configs for naming, documentation, and method mapping. - Update user code to use new wrapper classes and method names. - Improve documentation and comments for clarity. BREAKING CHANGE: API surface changes, wrapper class and method names updated, enum wrappers removed, custom allocator deleted.
This commit is contained in:
@@ -2,14 +2,15 @@
|
||||
// This file is generated by Ghost.NativeWrapperGen. Do not edit manually.
|
||||
// </auto-generated>
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Ghost.Ufbx;
|
||||
|
||||
public unsafe partial struct ufbx_anim
|
||||
public unsafe partial struct ufbx_anim : System.IDisposable
|
||||
{
|
||||
// From: ufbx_evaluate_prop_len(ufbx_anim*, ufbx_element*, sbyte*, nuint, double)
|
||||
public ufbx_prop evaluate_prop_len(ufbx_element* element, ReadOnlySpan<byte> name, double time)
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_evaluate_prop_len(ufbx_anim*, ufbx_element*, sbyte*, nuint, double)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_prop EvaluatePropLen(ufbx_element* element, ReadOnlySpan<byte> name, double time)
|
||||
{
|
||||
fixed (byte* pname = name)
|
||||
{
|
||||
@@ -22,8 +23,11 @@ public unsafe partial struct ufbx_anim
|
||||
}
|
||||
}
|
||||
|
||||
// From: ufbx_evaluate_prop(ufbx_anim*, ufbx_element*, sbyte*, double)
|
||||
public ufbx_prop evaluate_prop(ufbx_element* element, sbyte* name, double time)
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_evaluate_prop(ufbx_anim*, ufbx_element*, sbyte*, double)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_prop EvaluateProp(ufbx_element* element, sbyte* name, double time)
|
||||
{
|
||||
return Api.ufbx_evaluate_prop(
|
||||
(ufbx_anim*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -32,8 +36,11 @@ public unsafe partial struct ufbx_anim
|
||||
time);
|
||||
}
|
||||
|
||||
// From: ufbx_evaluate_prop_flags_len(ufbx_anim*, ufbx_element*, sbyte*, nuint, double, uint)
|
||||
public ufbx_prop evaluate_prop_flags_len(ufbx_element* element, ReadOnlySpan<byte> name, double time, uint flags)
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_evaluate_prop_flags_len(ufbx_anim*, ufbx_element*, sbyte*, nuint, double, uint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_prop EvaluatePropFlagsLen(ufbx_element* element, ReadOnlySpan<byte> name, double time, uint flags)
|
||||
{
|
||||
fixed (byte* pname = name)
|
||||
{
|
||||
@@ -47,8 +54,11 @@ public unsafe partial struct ufbx_anim
|
||||
}
|
||||
}
|
||||
|
||||
// From: ufbx_evaluate_prop_flags(ufbx_anim*, ufbx_element*, sbyte*, double, uint)
|
||||
public ufbx_prop evaluate_prop_flags(ufbx_element* element, sbyte* name, double time, uint flags)
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_evaluate_prop_flags(ufbx_anim*, ufbx_element*, sbyte*, double, uint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_prop EvaluatePropFlags(ufbx_element* element, sbyte* name, double time, uint flags)
|
||||
{
|
||||
return Api.ufbx_evaluate_prop_flags(
|
||||
(ufbx_anim*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -58,8 +68,11 @@ public unsafe partial struct ufbx_anim
|
||||
flags);
|
||||
}
|
||||
|
||||
// From: ufbx_evaluate_props(ufbx_anim*, ufbx_element*, double, ufbx_prop*, nuint)
|
||||
public ufbx_props evaluate_props(ufbx_element* element, double time, ufbx_prop* buffer, nuint buffer_size)
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_evaluate_props(ufbx_anim*, ufbx_element*, double, ufbx_prop*, nuint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_props EvaluateProps(ufbx_element* element, double time, ufbx_prop* buffer, nuint buffer_size)
|
||||
{
|
||||
return Api.ufbx_evaluate_props(
|
||||
(ufbx_anim*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -69,8 +82,11 @@ public unsafe partial struct ufbx_anim
|
||||
buffer_size);
|
||||
}
|
||||
|
||||
// From: ufbx_evaluate_props_flags(ufbx_anim*, ufbx_element*, double, ufbx_prop*, nuint, uint)
|
||||
public ufbx_props evaluate_props_flags(ufbx_element* element, double time, ufbx_prop* buffer, nuint buffer_size, uint flags)
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_evaluate_props_flags(ufbx_anim*, ufbx_element*, double, ufbx_prop*, nuint, uint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_props EvaluatePropsFlags(ufbx_element* element, double time, ufbx_prop* buffer, nuint buffer_size, uint flags)
|
||||
{
|
||||
return Api.ufbx_evaluate_props_flags(
|
||||
(ufbx_anim*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -81,8 +97,11 @@ public unsafe partial struct ufbx_anim
|
||||
flags);
|
||||
}
|
||||
|
||||
// From: ufbx_evaluate_transform(ufbx_anim*, ufbx_node*, double)
|
||||
public ufbx_transform evaluate_transform(ufbx_node* node, double time)
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_evaluate_transform(ufbx_anim*, ufbx_node*, double)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_transform EvaluateTransform(ufbx_node* node, double time)
|
||||
{
|
||||
return Api.ufbx_evaluate_transform(
|
||||
(ufbx_anim*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -90,8 +109,11 @@ public unsafe partial struct ufbx_anim
|
||||
time);
|
||||
}
|
||||
|
||||
// From: ufbx_evaluate_transform_flags(ufbx_anim*, ufbx_node*, double, uint)
|
||||
public ufbx_transform evaluate_transform_flags(ufbx_node* node, double time, uint flags)
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_evaluate_transform_flags(ufbx_anim*, ufbx_node*, double, uint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public ufbx_transform EvaluateTransformFlags(ufbx_node* node, double time, uint flags)
|
||||
{
|
||||
return Api.ufbx_evaluate_transform_flags(
|
||||
(ufbx_anim*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -100,8 +122,11 @@ public unsafe partial struct ufbx_anim
|
||||
flags);
|
||||
}
|
||||
|
||||
// From: ufbx_evaluate_blend_weight(ufbx_anim*, ufbx_blend_channel*, double)
|
||||
public float evaluate_blend_weight(ufbx_blend_channel* channel, double time)
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_evaluate_blend_weight(ufbx_anim*, ufbx_blend_channel*, double)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public float EvaluateBlendWeight(ufbx_blend_channel* channel, double time)
|
||||
{
|
||||
return Api.ufbx_evaluate_blend_weight(
|
||||
(ufbx_anim*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -109,8 +134,11 @@ public unsafe partial struct ufbx_anim
|
||||
time);
|
||||
}
|
||||
|
||||
// From: ufbx_evaluate_blend_weight_flags(ufbx_anim*, ufbx_blend_channel*, double, uint)
|
||||
public float evaluate_blend_weight_flags(ufbx_blend_channel* channel, double time, uint flags)
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_evaluate_blend_weight_flags(ufbx_anim*, ufbx_blend_channel*, double, uint)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public float EvaluateBlendWeightFlags(ufbx_blend_channel* channel, double time, uint flags)
|
||||
{
|
||||
return Api.ufbx_evaluate_blend_weight_flags(
|
||||
(ufbx_anim*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
@@ -119,14 +147,20 @@ public unsafe partial struct ufbx_anim
|
||||
flags);
|
||||
}
|
||||
|
||||
// From: ufbx_free_anim(ufbx_anim*)
|
||||
public void free()
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_free_anim(ufbx_anim*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public void Dispose()
|
||||
{
|
||||
Api.ufbx_free_anim((ufbx_anim*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
// From: ufbx_retain_anim(ufbx_anim*)
|
||||
public void retain()
|
||||
/// <summary>
|
||||
/// From: <see cref="Api.ufbx_retain_anim(ufbx_anim*)" />
|
||||
/// </summary>
|
||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||
public void Retain()
|
||||
{
|
||||
Api.ufbx_retain_anim((ufbx_anim*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user