pub fn calculate_tangents_vec4(
    positions: &VectorData,
    normals: &VectorData,
    uvs: &VectorData,
    vertex_indices: &[u32],
) -> Result<Vec<[f32; 4]>, Box<dyn Error>> {
    let tangents = geometry_tools::vectors::calculate_tangents(
        &positions.to_glam_vec3a(),
        &normals.to_glam_vec3a(),
        &uvs.to_glam_vec2(),
        vertex_indices,
    )?;

    Ok(tangents.iter().map(|t| t.to_array()).collect())
}
/// Calculates smooth per-vertex tangents by averaging over the vertices in each face.
/// See [geometry_tools::vectors::calculate_tangents](geometry_tools::vectors::calculate_tangents).
Calculates smooth per-vertex tangents by averaging over the vertices in each face.
Calculates smooth per - vertex tangents by averaging over the vertices in each face .
pub fn calculate_tangents_vec4(
    positions: &VectorData,
    normals: &VectorData,
    uvs: &VectorData,
    vertex_indices: &[u32],
) -> Result<Vec<[f32; 4]>, Box<dyn Error>> {
    let tangents = geometry_tools::vectors::calculate_tangents(
        &positions.to_glam_vec3a(),
        &normals.to_glam_vec3a(),
        &uvs.to_glam_vec2(),
        vertex_indices,
    )?;
    Ok(tangents.iter().map(|t| t.to_array()).collect())
}
pub fn calculate_tangents_vec4 ( positions : & VectorData , normals : & VectorData , uvs : & VectorData , vertex_indices : & [ u32 ] , ) -> Result < Vec < [ f32 ; 4 ] > , Box < dyn Error > > { let tangents = geometry_tools :: vectors :: calculate_tangents ( & positions . to_glam_vec3a ( ) , & normals . to_glam_vec3a ( ) , & uvs . to_glam_vec2 ( ) , vertex_indices , ) ? ; Ok ( tangents . iter ( ) . map ( | t | t . to_array ( ) ) . collect ( ) ) }
Calculates smooth per-vertex tangents by averaging over the vertices in each face.
Calculates smooth per - vertex tangents by averaging over the vertices in each face .
positions
&VectorData
normals
&VectorData
uvs
&VectorData
vertex_indices
&[u32]
positions
&VectorData
normals
&VectorData
uvs
&VectorData
vertex_indices
&[u32]