Struct adi_screen::Vec3[]

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

Single-precision 3D vector.

Fields

Methods

impl Vec3

Full constructor.

Zero constructor.

Returns the XY components of the vector.

impl Vec3

Returns the cross product of two vectors.

impl Vec3

Returns the dot product of two vectors.

Returns the length (magnitude) of the vector.

Returns the squared length of the vector.

Scales the vector to unit length.

Panics

Panics if the vector is zero.

impl Vec3

Returns the acute angle between two vectors.

Panics

Panics if self is the zero vector.

Trait Implementations

impl Into<[f32; 3]> for Vec3

Performs the conversion.

impl ApproxEq for Vec3

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

The default relative tolerance for testing values that are far-apart. Read more

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of ApproxEq::relative_eq.

The inverse of ApproxEq::ulps_eq.

impl Add<Vec3> for Vec3

The resulting type after applying the + operator.

Performs the + operation.

impl Sub<Vec3> for Vec3

The resulting type after applying the - operator.

Performs the - operation.

impl Display for Vec3

Formats the value using the given formatter. Read more

impl Clone for Vec3

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl MulAssign<f32> for Vec3

Performs the *= operation.

impl Default for Vec3

Returns the "default value" for a type. Read more

impl Debug for Vec3

Formats the value using the given formatter. Read more

impl SubAssign<Vec3> for Vec3

Performs the -= operation.

impl Mul<f32> for Vec3

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Vec3> for f32

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<Vec3> for &'a Mat3

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Vec3> for Mat3

The resulting type after applying the * operator.

Performs the * operation.

impl DivAssign<f32> for Vec3

Performs the /= operation.

impl Copy for Vec3

impl AsRef<[f32; 3]> for Vec3

Performs the conversion.

impl PartialEq<Vec3> for Vec3

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl AddAssign<Vec3> for Vec3

Performs the += operation.

impl From<f64> for Vec3

Performs the conversion.

impl From<DVec3> for Vec3

Performs the conversion.

impl From<Vec3> for DVec3

Performs the conversion.

impl<T> From<(T, f32)> for Vec3 where
    T: Into<Vec2>, 

Performs the conversion.

impl From<f32> for Vec3

Performs the conversion.

impl From<[f32; 3]> for Vec3

Performs the conversion.

impl Div<f32> for Vec3

The resulting type after applying the / operator.

Performs the / operation.

Auto Trait Implementations

impl Send for Vec3

impl Sync for Vec3