pub trait Scalar: PodValue + PartialOrd + ToRaw<Raw = Self> + FromRaw + AsRaw + Display + Unit<Scalar = Self> + NumOps + NumCast + AbsDiffEq<Epsilon = Self> + From<bool> {
type Vec2: Vector2<Scalar = Self>;
type Vec3: Vector3<Scalar = Self>;
type Vec4: Vector4<Scalar = Self>;
const ZERO: Self;
const ONE: Self;
// Provided method
fn try_cast<T2: Scalar>(self) -> Option<T2> { ... }
}
Expand description
All types that can serve as components of a SIMD type in glam
.
This is implemented for f32
, f64
, i32
, u32
, i16
, u16
, i64
, and u64
.
Required Associated Types§
sourcetype Vec2: Vector2<Scalar = Self>
type Vec2: Vector2<Scalar = Self>
The underlying 2D vector type for this scalar (glam::Vec2
,
glam::DVec2
, glam::IVec2
, or glam::UVec2
).
sourcetype Vec3: Vector3<Scalar = Self>
type Vec3: Vector3<Scalar = Self>
The underlying 3D vector type for this scalar (glam::Vec3
,
glam::DVec3
, glam::IVec3
, or glam::UVec3
).
sourcetype Vec4: Vector4<Scalar = Self>
type Vec4: Vector4<Scalar = Self>
The underlying 4D vector type for this scalar (glam::Vec4
,
glam::DVec4
, glam::IVec4
, or glam::UVec4
).
Required Associated Constants§
Provided Methods§
Object Safety§
This trait is not object safe.