[][src]Struct ico_math::FloatVector

#[repr(C)]
pub struct FloatVector {
    pub data: __m128,
}

Fields

data: __m128

Methods

impl FloatVector[src]

pub fn new(value: f32) -> FloatVector[src]

Returns a new FloatVector

pub fn zero() -> FloatVector[src]

pub fn value(self) -> f32[src]

pub fn add(self, v2: FloatVector) -> FloatVector[src]

Compute the sum of two vectors and return it as a new vector.

pub fn sub(self, v2: FloatVector) -> FloatVector[src]

Subtract a vector and return it as a new vector.

pub fn mul(self, v2: FloatVector) -> FloatVector[src]

Multiply two vectors component-wise, and return it as a new vector.
(x1 * x2, y1 * y2, z1 * z2, w1 * w2)

pub fn div(self, v2: FloatVector) -> FloatVector[src]

Divide two vectors component-wise, and return it as a new vector.
(x1 / x2, y1 / y2, z1 / z2, w1 / w2)

pub fn mul_add(self, v2: FloatVector, v3: FloatVector) -> FloatVector[src]

Fused Multiply Add. Result = (a * b) + c.

pub fn mul_sub(self, v2: FloatVector, v3: FloatVector) -> FloatVector[src]

Fused Multiply Sub. Result = (a * b) - c.

pub fn neg_mul_add(self, v2: FloatVector, v3: FloatVector) -> FloatVector[src]

Negated Fused Multiply Add. Result = -(a * b) + c.

pub fn neg_mul_sub(self, v2: FloatVector, v3: FloatVector) -> FloatVector[src]

Negated Fused Multiply Sub. Result = -(a * b) - c.

pub fn and<T: SIMDVector1>(self, v2: T) -> FloatVector[src]

Compute the bitwise AND of two vectors. This function treats inputs as binary data, and doesn't perform any conversions.

pub fn or<T: SIMDVector1>(self, v2: T) -> FloatVector[src]

Compute the bitwise OR of two vectors. This function treats inputs as binary data, and doesn't perform any conversions.

pub fn andnot<T: SIMDVector1>(self, v2: T) -> FloatVector[src]

Compute the bitwise ANDNOT of two vectors. This function treats inputs as binary data, and doesn't perform any conversions.

pub fn xor<T: SIMDVector1>(self, v2: T) -> FloatVector[src]

Compute the bitwise XOR of two vectors. This function treats inputs as binary data, and doesn't perform any conversions.

pub fn equal(self, v2: FloatVector) -> bool[src]

Equals, computed component-wise. This compares bits, and is exact.

pub fn not_equal(self, v2: FloatVector) -> bool[src]

NotEquals, computed component-wise. This compares bits, and is exact.

pub fn greater_equal(self, v2: FloatVector) -> bool[src]

Greater than or equal to, computed component-wise. This compares bits, and is exact.

pub fn greater(self, v2: FloatVector) -> bool[src]

Greater than, computed component-wise. This compares bits, and is exact.

pub fn less_equal(self, v2: FloatVector) -> bool[src]

Less than or equal to, computed component-wise. This compares bits, and is exact.

pub fn less(self, v2: FloatVector) -> bool[src]

Less than, computed component-wise. This compares bits, and is exact.

pub fn approx_equal(self, v2: FloatVector) -> bool[src]

Relative and absolute epsilon comparison.
Uses machine epsilon as absolute, and 4*machine epsilon for relative. return abs(a - b) <= max(machine_epsilon, (max( abs(a), abs(b) ) * relative_epsilon); Adapted from Knuth.
https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

pub fn definitely_greater(self, v2: FloatVector) -> bool[src]

Adapted from Knuth with an added absolute epsilon return (a - b) > max(machine_epsilon, (max( abs(a), abs(b) ) * relative_epsilon);

pub fn definitely_less(self, v2: FloatVector) -> bool[src]

Adapted from Knuth with an added absolute epsilon return (a - b) > max(machine_epsilon, (max( abs(a), abs(b) ) * relative_epsilon);

pub fn abs(self) -> FloatVector[src]

The absolute value of each component of the vector.

pub fn copysign(self, v2: FloatVector) -> FloatVector[src]

Take the magnitude of the first argument (self), and use the sign of the second argument to produce a new vector

pub fn floor(self) -> FloatVector[src]

Floor function. Returns signed 0 when applicable.

pub fn ceil(self) -> FloatVector[src]

Ceil function. Returns signed 0 when applicable.

pub fn round(self) -> FloatVector[src]

Round to nearest even function. Returns signed 0 when applicable.

pub fn truncate(self) -> FloatVector[src]

Truncate function.

pub fn floor_to_int(self) -> IntVector[src]

Convert to an integer vector using the floor function.

pub fn ceil_to_int(self) -> IntVector[src]

Convert to an integer vector using the ceil function.

pub fn round_to_int(self) -> IntVector[src]

Convert to an integer vector using the round function.

pub fn truncate_to_int(self) -> IntVector[src]

Convert to an integer vector using the truncate function.

pub fn frac(self) -> FloatVector[src]

Compute the fractional component of each component Result = X - Floor(x)

pub fn sqrt(self) -> FloatVector[src]

Compute the square root of each component

pub fn sin(self) -> FloatVector[src]

Compute the approximate sin of each component

pub fn cos(self) -> FloatVector[src]

Compute the approximate cos of each component

pub fn tan(self) -> FloatVector[src]

Compute the approximate tan of each component

pub fn acos(self) -> FloatVector[src]

Compute the approximate acos of each component

pub fn asin(self) -> FloatVector[src]

Compute the approximate asin of each component

pub fn max(self, v2: FloatVector) -> FloatVector[src]

Compute the component-wise max.

pub fn min(self, v2: FloatVector) -> FloatVector[src]

Compute the component-wise min.

pub fn select(self, v2: FloatVector, mask: bool) -> FloatVector[src]

Choose component wise between A and B based on the mask. False = A, True = B.

pub fn lerp<T: Into<FloatVector>>(self, v2: FloatVector, t: T) -> FloatVector[src]

Linear interpolate from a to b based on a float.

Trait Implementations

impl SIMDVector1 for FloatVector[src]

impl SIMDVector2 for FloatVector[src]

impl SIMDVector3 for FloatVector[src]

impl SIMDVector4 for FloatVector[src]

impl Clone for FloatVector[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl From<FloatVector> for f32[src]

impl From<f32> for FloatVector[src]

impl From<IntVector> for FloatVector[src]

impl From<FloatVector> for IntVector[src]

impl From<FloatVector> for Vector2[src]

impl From<FloatVector> for Vector3[src]

impl From<FloatVector> for Vector4[src]

impl PartialEq<FloatVector> for FloatVector[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl PartialEq<f32> for FloatVector[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl PartialEq<FloatVector> for f32[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Copy for FloatVector[src]

impl Debug for FloatVector[src]

impl<T: Into<FloatVector>> Div<T> for FloatVector[src]

type Output = FloatVector

The resulting type after applying the / operator.

impl Div<Vector2> for FloatVector[src]

type Output = Vector2

The resulting type after applying the / operator.

impl Div<Vector3> for FloatVector[src]

type Output = Vector3

The resulting type after applying the / operator.

impl Div<Vector4> for FloatVector[src]

type Output = Vector4

The resulting type after applying the / operator.

impl<T: Into<FloatVector>> Add<T> for FloatVector[src]

type Output = FloatVector

The resulting type after applying the + operator.

impl<T: Into<FloatVector>> Sub<T> for FloatVector[src]

type Output = FloatVector

The resulting type after applying the - operator.

impl<T: Into<FloatVector>> Mul<T> for FloatVector[src]

type Output = FloatVector

The resulting type after applying the * operator.

impl Mul<Vector2> for FloatVector[src]

type Output = Vector2

The resulting type after applying the * operator.

impl Mul<Vector3> for FloatVector[src]

type Output = Vector3

The resulting type after applying the * operator.

impl Mul<Vector4> for FloatVector[src]

type Output = Vector4

The resulting type after applying the * operator.

impl Neg for FloatVector[src]

type Output = FloatVector

The resulting type after applying the - operator.

impl<T: Into<FloatVector>> AddAssign<T> for FloatVector[src]

impl<T: Into<FloatVector>> SubAssign<T> for FloatVector[src]

impl<T: Into<FloatVector>> MulAssign<T> for FloatVector[src]

impl<T: Into<FloatVector>> DivAssign<T> for FloatVector[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]