nalgebra/nalgebra-glm/src/ext/quaternion_relational.rs

24 lines
893 B
Rust
Raw Normal View History

2019-03-25 18:21:41 +08:00
use na::{RealField, U4};
2019-03-23 21:29:07 +08:00
use crate::aliases::{Qua, TVec};
2018-09-22 19:21:02 +08:00
/// Component-wise equality comparison between two quaternions.
2019-03-25 18:21:41 +08:00
pub fn quat_equal<N: RealField>(x: &Qua<N>, y: &Qua<N>) -> TVec<bool, U4> {
2019-03-23 21:29:07 +08:00
crate::equal(&x.coords, &y.coords)
}
2018-09-22 19:21:02 +08:00
/// Component-wise approximate equality comparison between two quaternions.
2019-03-25 18:21:41 +08:00
pub fn quat_equal_eps<N: RealField>(x: &Qua<N>, y: &Qua<N>, epsilon: N) -> TVec<bool, U4> {
2019-03-23 21:29:07 +08:00
crate::equal_eps(&x.coords, &y.coords, epsilon)
}
2018-09-22 19:21:02 +08:00
/// Component-wise non-equality comparison between two quaternions.
2019-03-25 18:21:41 +08:00
pub fn quat_not_equal<N: RealField>(x: &Qua<N>, y: &Qua<N>) -> TVec<bool, U4> {
2019-03-23 21:29:07 +08:00
crate::not_equal(&x.coords, &y.coords)
}
2018-09-22 19:21:02 +08:00
/// Component-wise approximate non-equality comparison between two quaternions.
2019-03-25 18:21:41 +08:00
pub fn quat_not_equal_eps<N: RealField>(x: &Qua<N>, y: &Qua<N>, epsilon: N) -> TVec<bool, U4> {
2019-03-23 21:29:07 +08:00
crate::not_equal_eps(&x.coords, &y.coords, epsilon)
}