Skip to main content

Vector

Type Alias Vector 

Source
pub type Vector = Vec3;
Expand description

The vector type.

Aliased Type§

#[repr(C)]
pub struct Vector { pub x: f32, pub y: f32, pub z: f32, }

Fields§

§x: f32§y: f32§z: f32

Trait Implementations§

Source§

impl ComponentMul for Vector

Source§

fn component_mul(&self, other: &Self) -> Self

Element-wise multiplication
Source§

impl CrossProduct<Vec3> for Vector

Available on crate feature dim3 only.
Source§

type Result = Vec3

The result type of the cross product.
Source§

fn gcross(&self, rhs: Vector) -> Self::Result

Computes the generalized cross product of self with rhs.
Source§

impl CrossProductMatrix for Vector

Available on crate feature dim3 only.
Source§

type CrossMat = Mat3

The cross product matrix type.
Source§

type CrossMatTr = Mat3

The transposed cross product matrix type.
Source§

fn gcross_matrix(self) -> Self::CrossMat

Returns the cross product matrix of this vector.
Source§

fn gcross_matrix_tr(self) -> Self::CrossMatTr

Returns the transposed cross product matrix of this vector.
Source§

impl DotProduct<Vec3> for Vector

Source§

type Result = f32

The result type of the dot product.
Source§

fn gdot(&self, rhs: Vector) -> Self::Result

Computes the generalized dot product of self with rhs.
Source§

impl OrthonormalBasis for Vector

Available on crate feature dim3 only.
Source§

type Basis = [Vec3; 2]

The type of the array of orthonormal vectors.
Source§

fn orthonormal_basis(self) -> [Vector; 2]

Computes the vectors which, when combined with self, form an orthonormal basis.
Source§

fn orthonormal_vector(self) -> Vector

Computes a vector orthogonal to self with a unit length (if self has a unit length).
Source§

impl SimdSelect<f32> for Vector

Source§

fn select(self, condition: bool, if_false: Self) -> Self

Select between self and if_false based on condition.