Struct rust_gpu_sdf::signed_distance_field::attributes::position::Position
source · pub struct Position(pub Vec3);
Tuple Fields§
§0: Vec3
Methods from Deref<Target = Vec3>§
pub const ZERO: Vec3 = Self::splat(0.0)
pub const ONE: Vec3 = Self::splat(1.0)
pub const NEG_ONE: Vec3 = Self::splat(-1.0)
pub const NAN: Vec3 = Self::splat(f32::NAN)
pub const X: Vec3 = Self::new(1.0, 0.0, 0.0)
pub const Y: Vec3 = Self::new(0.0, 1.0, 0.0)
pub const Z: Vec3 = Self::new(0.0, 0.0, 1.0)
pub const NEG_X: Vec3 = Self::new(-1.0, 0.0, 0.0)
pub const NEG_Y: Vec3 = Self::new(0.0, -1.0, 0.0)
pub const NEG_Z: Vec3 = Self::new(0.0, 0.0, -1.0)
pub const AXES: [Vec3; 3] = [Self::X, Self::Y, Self::Z]
sourcepub fn any_orthogonal_vector(&self) -> Vec3
pub fn any_orthogonal_vector(&self) -> Vec3
Returns some vector that is orthogonal to the given one.
The input vector must be finite and non-zero.
The output vector is not necessarily unit-length.
For that use Self::any_orthonormal_vector
instead.
sourcepub fn any_orthonormal_vector(&self) -> Vec3
pub fn any_orthonormal_vector(&self) -> Vec3
Returns any unit-length vector that is orthogonal to the given one. The input vector must be finite and non-zero.
Panics
Will panic if self
is not normalized when glam_assert
is enabled.
sourcepub fn any_orthonormal_pair(&self) -> (Vec3, Vec3)
pub fn any_orthonormal_pair(&self) -> (Vec3, Vec3)
Given a unit-length vector return two other vectors that together form an orthonormal basis. That is, all three vectors are orthogonal to each other and are normalized.
Panics
Will panic if self
is not normalized when glam_assert
is enabled.