parry3d 0.28.0

3 dimensional collision detection library in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! 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);
}