generate_tangents_with_threshold

Function generate_tangents_with_threshold 

Source
pub fn generate_tangents_with_threshold<I, O>(
    interface: &mut I,
    threshold: f32,
) -> Result<(), GenerateTangentSpaceError>
where I: Geometry<O>, O: Ops,
Expand description

Generates TangentSpaces for the provided geometry with a provided threshold for vertex grouping.

Note that unlike the original C implementation, which accepted an angular threshold, this function accepts a linear threshold. The angular threshold can be converted into a linear one trivially using cosine.

let angular_threshold = 180_f32;
let linear_threshold = angular_threshold.to_radians().cos();

Appropriate threshold values should be in the range [-1..=1].