#[cfg(feature = "f32")]
mod single;
#[cfg(feature = "f32")]
pub use single::*;
#[cfg(feature = "f64")]
mod double;
#[cfg(feature = "f64")]
pub use double::*;
use bevy_math::{prelude::*, *};
#[cfg(feature = "2d")]
pub(crate) type Ray = Ray2d;
#[cfg(feature = "3d")]
pub(crate) type Ray = Ray3d;
#[cfg(feature = "2d")]
pub(crate) type Dir = Direction2d;
#[cfg(feature = "3d")]
pub(crate) type Dir = Direction3d;
pub trait AdjustPrecision {
type Adjusted;
fn adjust_precision(&self) -> Self::Adjusted;
}
pub trait AsF32 {
type F32;
fn f32(&self) -> Self::F32;
}
impl AsF32 for DVec3 {
type F32 = Vec3;
fn f32(&self) -> Self::F32 {
self.as_vec3()
}
}
impl AsF32 for Vec3 {
type F32 = Self;
fn f32(&self) -> Self::F32 {
*self
}
}
impl AsF32 for DVec2 {
type F32 = Vec2;
fn f32(&self) -> Self::F32 {
self.as_vec2()
}
}
impl AsF32 for Vec2 {
type F32 = Self;
fn f32(&self) -> Self::F32 {
*self
}
}
impl AsF32 for Vec4 {
type F32 = Self;
fn f32(&self) -> Self::F32 {
*self
}
}
impl AsF32 for DQuat {
type F32 = Quat;
fn f32(&self) -> Self::F32 {
self.as_quat()
}
}
impl AsF32 for Quat {
type F32 = Self;
fn f32(&self) -> Self::F32 {
*self
}
}