Trait IsVector

Source
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§

Source

type OrthogonalVectors

Type returned by the orthogonal_vectors extension function.

Required Methods§

Source

fn alt_norm_or_zero(&self) -> Self

Normalize or return zero.

Source

fn signum_or_zero(&self) -> Self

Return a vector with signum_or_zero applied to each component.

Source

fn dot2(&self) -> f32

Returns the dot product of a vector with itself (the square of its length).

Source

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.

Implementations on Foreign Types§

Source§

impl IsVector for Vec2

Source§

impl IsVector for Vec3

Implementors§