Skip to content

The native runtime for three.js: three.js, down to the metal. 45× smaller than Electron, on a Sony PS3, and path-traced at 60 fps on ray-tracing GPUs.

540 B
Raw Blame
//! This module only exists for working around the fact that glam
//! doesn’t allow its `approx` feature to be enabled when targeting spirv.

use crate::math::Vector;
use approx::relative_eq;

/// Checks approximate equality between two vectors, component-wise.
#[inline]
pub fn relative_eq_vector(a: Vector, b: Vector) -> bool {
    #[cfg(feature = "dim2")]
    return relative_eq!(a.x, b.x) && relative_eq!(a.y, b.y);
    #[cfg(feature = "dim3")]
    return relative_eq!(a.x, b.x) && relative_eq!(a.y, b.y) && relative_eq!(a.z, b.z);
}