Struct ami::Vector[][src]

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

Single-precision 3D vector.

Fields

Methods

impl Vector
[src]

Full constructor.

Zero constructor.

Returns the cross product of two vectors.

Returns the acute angle between two vectors.

Panics

Panics if self is the zero vector.

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.

Trait Implementations

impl Sub<Vector> for BBox
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Add<Vector> for BBox
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Clone for Vector
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Vector
[src]

impl Debug for Vector
[src]

Formats the value using the given formatter. Read more

impl Default for Vector
[src]

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

impl PartialEq for Vector
[src]

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

This method tests for !=.

impl From<f32> for Vector
[src]

Performs the conversion.

impl Display for Vector
[src]

Formats the value using the given formatter. Read more

impl Add<Vector> for Vector
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl AddAssign<Vector> for Vector
[src]

Performs the += operation.

impl Sub<Vector> for Vector
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl SubAssign<Vector> for Vector
[src]

Performs the -= operation.

impl Mul<Vector> for f32
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<f32> for Vector
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl MulAssign<f32> for Vector
[src]

Performs the *= operation.

impl Div<f32> for Vector
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl DivAssign<f32> for Vector
[src]

Performs the /= operation.

impl Neg for Vector
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl AsRef<[f32; 3]> for Vector
[src]

Performs the conversion.

impl From<[f32; 3]> for Vector
[src]

Performs the conversion.

impl Into<[f32; 3]> for Vector
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Vector

impl Sync for Vector