// <auto-generated>
// This file is generated by Ghost.NativeWrapperGen. Do not edit manually.
// </auto-generated>

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, ufbx_matrix*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    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),
            skin,
            vertex,
            fallback);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_catch_triangulate_face(ufbx_panic*, uint*, nuint, ufbx_mesh*, ufbx_face)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public uint CatchTriangulateFace(ReadOnlySpan<uint> indices, ufbx_mesh* mesh, ufbx_face face)
    {
        fixed (uint* pindices = indices)
        {
            return Api.ufbx_catch_triangulate_face(
                (ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
                (uint*)pindices,
                (nuint)indices.Length,
                mesh,
                face);
        }
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_catch_compute_topology(ufbx_panic*, ufbx_mesh*, ufbx_topo_edge*, nuint)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public void CatchComputeTopology(ufbx_mesh* mesh, ReadOnlySpan<ufbx_topo_edge> topo)
    {
        fixed (ufbx_topo_edge* ptopo = topo)
        {
            Api.ufbx_catch_compute_topology(
                (ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
                mesh,
                (ufbx_topo_edge*)ptopo,
                (nuint)topo.Length);
        }
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_catch_topo_next_vertex_edge(ufbx_panic*, ufbx_topo_edge*, nuint, uint)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public uint CatchTopoNextVertexEdge(ReadOnlySpan<ufbx_topo_edge> topo, uint index)
    {
        fixed (ufbx_topo_edge* ptopo = topo)
        {
            return Api.ufbx_catch_topo_next_vertex_edge(
                (ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
                (ufbx_topo_edge*)ptopo,
                (nuint)topo.Length,
                index);
        }
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_catch_topo_prev_vertex_edge(ufbx_panic*, ufbx_topo_edge*, nuint, uint)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public uint CatchTopoPrevVertexEdge(ReadOnlySpan<ufbx_topo_edge> topo, uint index)
    {
        fixed (ufbx_topo_edge* ptopo = topo)
        {
            return Api.ufbx_catch_topo_prev_vertex_edge(
                (ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
                (ufbx_topo_edge*)ptopo,
                (nuint)topo.Length,
                index);
        }
    }

    /// <summary>
    /// 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 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),
            positions,
            face);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_catch_generate_normal_mapping(ufbx_panic*, ufbx_mesh*, ufbx_topo_edge*, nuint, uint*, nuint, bool)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public nuint CatchGenerateNormalMapping(ufbx_mesh* mesh, ReadOnlySpan<ufbx_topo_edge> topo, ReadOnlySpan<uint> normal_indices, bool assume_smooth)
    {
        fixed (ufbx_topo_edge* ptopo = topo)
        {
            fixed (uint* pnormal_indices = normal_indices)
            {
                return Api.ufbx_catch_generate_normal_mapping(
                    (ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
                    mesh,
                    (ufbx_topo_edge*)ptopo,
                    (nuint)topo.Length,
                    (uint*)pnormal_indices,
                    (nuint)normal_indices.Length,
                    assume_smooth);
            }
        }
    }

    /// <summary>
    /// 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<ufbx_vec3> normals)
    {
        fixed (uint* pnormal_indices = normal_indices)
        {
            fixed (ufbx_vec3* pnormals = normals)
            {
                Api.ufbx_catch_compute_normals(
                    (ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
                    mesh,
                    positions,
                    (uint*)pnormal_indices,
                    (nuint)normal_indices.Length,
                    (ufbx_vec3*)pnormals,
                    (nuint)normals.Length);
            }
        }
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_catch_get_vertex_real(ufbx_panic*, ufbx_vertex_real*, nuint)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public float CatchGetVertexReal(ufbx_vertex_real* v, nuint index)
    {
        return Api.ufbx_catch_get_vertex_real(
            (ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
            v,
            index);
    }

    /// <summary>
    /// 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 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),
            v,
            index);
    }

    /// <summary>
    /// 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 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),
            v,
            index);
    }

    /// <summary>
    /// 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 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),
            v,
            index);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_catch_get_vertex_w_vec3(ufbx_panic*, ufbx_vertex_vec3*, nuint)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public float CatchGetVertexWVec3(ufbx_vertex_vec3* v, nuint index)
    {
        return Api.ufbx_catch_get_vertex_w_vec3(
            (ufbx_panic*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
            v,
            index);
    }
}
