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

namespace Ghost.Ufbx;

public unsafe partial struct UfbxApi
{
    /// <summary>
    /// From: <see cref="Api.ufbx_is_thread_safe()" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool IsThreadSafe()
    {
        return Api.ufbx_is_thread_safe();
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_format_error(sbyte*, nuint, ufbx_error*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static nuint FormatError(sbyte* dst, nuint dst_size, ufbx_error* error)
    {
        return Api.ufbx_format_error(
            dst,
            dst_size,
            error);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_inflate(void*, nuint, ufbx_inflate_input*, ufbx_inflate_retain*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static nint Inflate(void* dst, nuint dst_size, ufbx_inflate_input* input, ufbx_inflate_retain* retain)
    {
        return Api.ufbx_inflate(
            dst,
            dst_size,
            input,
            retain);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_default_open_file(void*, ufbx_stream*, sbyte*, nuint, ufbx_open_file_info*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool DefaultOpenFile(void* user, ufbx_stream* stream, ReadOnlySpan<byte> path, ufbx_open_file_info* info)
    {
        fixed (byte* ppath = path)
        {
            return Api.ufbx_default_open_file(
                user,
                stream,
                (sbyte*)ppath,
                (nuint)path.Length,
                info);
        }
    }

    /// <summary>
    /// 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 ufbx_vec3 EvaluateBakedVec3(ufbx_baked_vec3_list keyframes, double time)
    {
        return Api.ufbx_evaluate_baked_vec3(
            keyframes,
            time);
    }

    /// <summary>
    /// 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 ufbx_quat EvaluateBakedQuat(ufbx_baked_quat_list keyframes, double time)
    {
        return Api.ufbx_evaluate_baked_quat(
            keyframes,
            time);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_coordinate_axes_valid(ufbx_coordinate_axes)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool CoordinateAxesValid(ufbx_coordinate_axes axes)
    {
        return Api.ufbx_coordinate_axes_valid(axes);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_vec3_normalize(ufbx_vec3)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static ufbx_vec3 Vec3Normalize(ufbx_vec3 v)
    {
        return Api.ufbx_vec3_normalize(v);
    }

    /// <summary>
    /// 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(ufbx_quat a, ufbx_quat b)
    {
        return Api.ufbx_quat_dot(
            a,
            b);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_quat_mul(ufbx_quat, ufbx_quat)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static ufbx_quat QuatMul(ufbx_quat a, ufbx_quat b)
    {
        return Api.ufbx_quat_mul(
            a,
            b);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_quat_normalize(ufbx_quat)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static ufbx_quat QuatNormalize(ufbx_quat q)
    {
        return Api.ufbx_quat_normalize(q);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_quat_fix_antipodal(ufbx_quat, ufbx_quat)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static ufbx_quat QuatFixAntipodal(ufbx_quat q, ufbx_quat reference)
    {
        return Api.ufbx_quat_fix_antipodal(
            q,
            reference);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_quat_slerp(ufbx_quat, ufbx_quat, float)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static ufbx_quat QuatSlerp(ufbx_quat a, ufbx_quat b, float t)
    {
        return Api.ufbx_quat_slerp(
            a,
            b,
            t);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_quat_rotate_vec3(ufbx_quat, ufbx_vec3)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static ufbx_vec3 QuatRotateVec3(ufbx_quat q, ufbx_vec3 v)
    {
        return Api.ufbx_quat_rotate_vec3(
            q,
            v);
    }

    /// <summary>
    /// 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 ufbx_vec3 QuatToEuler(ufbx_quat q, ufbx_rotation_order order)
    {
        return Api.ufbx_quat_to_euler(
            q,
            order);
    }

    /// <summary>
    /// 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 ufbx_quat EulerToQuat(ufbx_vec3 v, ufbx_rotation_order order)
    {
        return Api.ufbx_euler_to_quat(
            v,
            order);
    }

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

    /// <summary>
    /// From: <see cref="Api.ufbx_topo_next_vertex_edge(ufbx_topo_edge*, nuint, uint)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static uint TopoNextVertexEdge(ReadOnlySpan<ufbx_topo_edge> topo, uint index)
    {
        fixed (ufbx_topo_edge* ptopo = topo)
        {
            return Api.ufbx_topo_next_vertex_edge(
                (ufbx_topo_edge*)ptopo,
                (nuint)topo.Length,
                index);
        }
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_topo_prev_vertex_edge(ufbx_topo_edge*, nuint, uint)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static uint TopoPrevVertexEdge(ReadOnlySpan<ufbx_topo_edge> topo, uint index)
    {
        fixed (ufbx_topo_edge* ptopo = topo)
        {
            return Api.ufbx_topo_prev_vertex_edge(
                (ufbx_topo_edge*)ptopo,
                (nuint)topo.Length,
                index);
        }
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_generate_indices(ufbx_vertex_stream*, nuint, uint*, nuint, ufbx_allocator_opts*, ufbx_error*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static nuint GenerateIndices(ReadOnlySpan<ufbx_vertex_stream> streams, ReadOnlySpan<uint> indices, ufbx_allocator_opts* allocator, ufbx_error* error)
    {
        fixed (ufbx_vertex_stream* pstreams = streams)
        {
            fixed (uint* pindices = indices)
            {
                return Api.ufbx_generate_indices(
                    (ufbx_vertex_stream*)pstreams,
                    (nuint)streams.Length,
                    (uint*)pindices,
                    (nuint)indices.Length,
                    allocator,
                    error);
            }
        }
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_thread_pool_run_task(nuint, uint)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static void ThreadPoolRunTask(nuint ctx, uint index)
    {
        Api.ufbx_thread_pool_run_task(
            ctx,
            index);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_thread_pool_set_user_ptr(nuint, void*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static void ThreadPoolSetUserPtr(nuint ctx, void* user_ptr)
    {
        Api.ufbx_thread_pool_set_user_ptr(
            ctx,
            user_ptr);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_thread_pool_get_user_ptr(nuint)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static void* ThreadPoolGetUserPtr(nuint ctx)
    {
        return Api.ufbx_thread_pool_get_user_ptr(ctx);
    }
}
