pub trait IsVector {
type OrthogonalVectors;
// Required methods
fn alt_norm_or_zero(&self) -> Self;
fn signum_or_zero(&self) -> Self;
fn dot2(&self) -> f32;
fn orthonormal_vectors(&self) -> Self::OrthogonalVectors;
}
Expand description
Additional/replacement methods for glam vector types.
These are required because naga
(wgpu
’s translation layer) doesn’t like
certain contstants like f32::INFINITY
or f32::NaN
, which cause errors in
naga’s WGSL output.
See this issue and crate::linkage::test
for more info.
Required Associated Types§
Sourcetype OrthogonalVectors
type OrthogonalVectors
Type returned by the orthogonal_vectors
extension function.
Required Methods§
Sourcefn alt_norm_or_zero(&self) -> Self
fn alt_norm_or_zero(&self) -> Self
Normalize or return zero.
Sourcefn signum_or_zero(&self) -> Self
fn signum_or_zero(&self) -> Self
Return a vector with signum_or_zero
applied to each component.
Sourcefn dot2(&self) -> f32
fn dot2(&self) -> f32
Returns the dot product of a vector with itself (the square of its length).
Sourcefn orthonormal_vectors(&self) -> Self::OrthogonalVectors
fn orthonormal_vectors(&self) -> Self::OrthogonalVectors
Returns normalized orthogonal vectors.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.