//
// This file is generated by Ghost.NativeWrapperGen. Do not edit manually.
//
namespace Ghost.Ufbx;
public unsafe partial struct ufbx_mesh : System.IDisposable
{
///
/// From:
///
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public uint FindFaceIndex(nuint index)
{
return Api.ufbx_find_face_index(
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
index);
}
///
/// From:
///
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public void ComputeTopology(ReadOnlySpan topo)
{
fixed (ufbx_topo_edge* ptopo = topo)
{
Api.ufbx_compute_topology(
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
(ufbx_topo_edge*)ptopo,
(nuint)topo.Length);
}
}
///
/// From:
///
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public nuint GenerateNormalMapping(ReadOnlySpan topo, ReadOnlySpan normal_indices, bool assume_smooth)
{
fixed (ufbx_topo_edge* ptopo = topo)
{
fixed (uint* pnormal_indices = normal_indices)
{
return Api.ufbx_generate_normal_mapping(
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
(ufbx_topo_edge*)ptopo,
(nuint)topo.Length,
(uint*)pnormal_indices,
(nuint)normal_indices.Length,
assume_smooth);
}
}
}
///
/// From:
///
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public void ComputeNormals(ufbx_vertex_vec3* positions, ReadOnlySpan normal_indices, ReadOnlySpan normals)
{
fixed (uint* pnormal_indices = normal_indices)
{
fixed (Misaki.HighPerformance.Mathematics.float3* 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,
(nuint)normals.Length);
}
}
}
///
/// From:
///
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public ufbx_mesh* Subdivide(nuint level, ufbx_subdivide_opts* opts, ufbx_error* error)
{
return Api.ufbx_subdivide_mesh(
(ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
level,
opts,
error);
}
///
/// From:
///
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public void Dispose()
{
Api.ufbx_free_mesh((ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
}
///
/// From:
///
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public void Retain()
{
Api.ufbx_retain_mesh((ufbx_mesh*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this));
}
}