use super::AdjustPrecision;
use bevy_math::*;
use glam_matrix_extras::*;
pub type Scalar = f64;
pub const FRAC_PI_2: Scalar = core::f64::consts::FRAC_PI_2;
pub const PI: Scalar = core::f64::consts::PI;
pub const TAU: Scalar = core::f64::consts::TAU;
pub const FRAC_1_SQRT_2: Scalar = core::f64::consts::FRAC_1_SQRT_2;
#[cfg(feature = "2d")]
pub type Vector = DVec2;
#[cfg(feature = "3d")]
pub type Vector = DVec3;
pub type Vector2 = DVec2;
pub type Vector3 = DVec3;
#[cfg(feature = "2d")]
pub type Matrix = DMat2;
#[cfg(feature = "3d")]
pub type Matrix = DMat3;
pub type Matrix2 = DMat2;
pub type Matrix3 = DMat3;
#[cfg(feature = "2d")]
pub type SymmetricMatrix = SymmetricDMat2;
#[cfg(feature = "3d")]
pub type SymmetricMatrix = SymmetricDMat3;
pub type SymmetricMatrix2 = SymmetricDMat2;
pub type SymmetricMatrix3 = SymmetricDMat3;
pub type Quaternion = DQuat;
impl AdjustPrecision for f32 {
type Adjusted = Scalar;
fn adjust_precision(&self) -> Self::Adjusted {
*self as Scalar
}
}
impl AdjustPrecision for f64 {
type Adjusted = Scalar;
fn adjust_precision(&self) -> Self::Adjusted {
*self
}
}
impl AdjustPrecision for Vec3 {
type Adjusted = Vector3;
fn adjust_precision(&self) -> Self::Adjusted {
self.as_dvec3()
}
}
impl AdjustPrecision for DVec3 {
type Adjusted = Vector3;
fn adjust_precision(&self) -> Self::Adjusted {
*self
}
}
impl AdjustPrecision for Vec2 {
type Adjusted = Vector2;
fn adjust_precision(&self) -> Self::Adjusted {
self.as_dvec2()
}
}
impl AdjustPrecision for DVec2 {
type Adjusted = Vector2;
fn adjust_precision(&self) -> Self::Adjusted {
*self
}
}
impl AdjustPrecision for Quat {
type Adjusted = Quaternion;
fn adjust_precision(&self) -> Self::Adjusted {
self.as_dquat()
}
}
impl AdjustPrecision for DQuat {
type Adjusted = Quaternion;
fn adjust_precision(&self) -> Self::Adjusted {
*self
}
}
impl AdjustPrecision for Mat3 {
type Adjusted = Matrix3;
fn adjust_precision(&self) -> Self::Adjusted {
self.as_dmat3()
}
}
impl AdjustPrecision for DMat3 {
type Adjusted = Matrix3;
fn adjust_precision(&self) -> Self::Adjusted {
*self
}
}
impl AdjustPrecision for SymmetricMat2 {
type Adjusted = SymmetricMatrix2;
fn adjust_precision(&self) -> Self::Adjusted {
self.as_symmetric_dmat2()
}
}
impl AdjustPrecision for SymmetricDMat2 {
type Adjusted = SymmetricMatrix2;
fn adjust_precision(&self) -> Self::Adjusted {
*self
}
}
impl AdjustPrecision for SymmetricMat3 {
type Adjusted = SymmetricMatrix3;
fn adjust_precision(&self) -> Self::Adjusted {
self.as_symmetric_dmat3()
}
}
impl AdjustPrecision for SymmetricDMat3 {
type Adjusted = SymmetricMatrix3;
fn adjust_precision(&self) -> Self::Adjusted {
*self
}
}