[−][src]Struct ico_math::FloatVector
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 atan2(self, x: FloatVector) -> FloatVector
[src]
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(&self) -> 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]
fn from(v: FloatVector) -> f32
[src]
impl From<f32> for FloatVector
[src]
fn from(v: f32) -> FloatVector
[src]
impl From<IntVector> for FloatVector
[src]
fn from(v: IntVector) -> FloatVector
[src]
impl From<FloatVector> for IntVector
[src]
fn from(v: FloatVector) -> IntVector
[src]
impl From<FloatVector> for Vector2
[src]
fn from(v: FloatVector) -> Vector2
[src]
impl From<FloatVector> for Vector3
[src]
fn from(v: FloatVector) -> Vector3
[src]
impl From<FloatVector> for Vector4
[src]
fn from(v: FloatVector) -> Vector4
[src]
impl PartialEq<FloatVector> for FloatVector
[src]
fn eq(&self, other: &FloatVector) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<f32> for FloatVector
[src]
fn eq(&self, other: &f32) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<FloatVector> for f32
[src]
fn eq(&self, other: &FloatVector) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.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.
fn div(self, _rhs: T) -> FloatVector
[src]
impl Div<Vector2> for FloatVector
[src]
type Output = Vector2
The resulting type after applying the /
operator.
fn div(self: FloatVector, _rhs: Vector2) -> Vector2
[src]
impl Div<Vector3> for FloatVector
[src]
type Output = Vector3
The resulting type after applying the /
operator.
fn div(self: FloatVector, _rhs: Vector3) -> Vector3
[src]
impl Div<Vector4> for FloatVector
[src]
type Output = Vector4
The resulting type after applying the /
operator.
fn div(self: FloatVector, _rhs: Vector4) -> Vector4
[src]
impl<T: Into<FloatVector>> Add<T> for FloatVector
[src]
type Output = FloatVector
The resulting type after applying the +
operator.
fn add(self, _rhs: T) -> FloatVector
[src]
impl<T: Into<FloatVector>> Sub<T> for FloatVector
[src]
type Output = FloatVector
The resulting type after applying the -
operator.
fn sub(self, _rhs: T) -> FloatVector
[src]
impl<T: Into<FloatVector>> Mul<T> for FloatVector
[src]
type Output = FloatVector
The resulting type after applying the *
operator.
fn mul(self, _rhs: T) -> FloatVector
[src]
impl Mul<Vector2> for FloatVector
[src]
type Output = Vector2
The resulting type after applying the *
operator.
fn mul(self: FloatVector, _rhs: Vector2) -> Vector2
[src]
impl Mul<Vector3> for FloatVector
[src]
type Output = Vector3
The resulting type after applying the *
operator.
fn mul(self: FloatVector, _rhs: Vector3) -> Vector3
[src]
impl Mul<Vector4> for FloatVector
[src]
type Output = Vector4
The resulting type after applying the *
operator.
fn mul(self: FloatVector, _rhs: Vector4) -> Vector4
[src]
impl Neg for FloatVector
[src]
type Output = FloatVector
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<T: Into<FloatVector>> AddAssign<T> for FloatVector
[src]
fn add_assign(&mut self, other: T)
[src]
impl<T: Into<FloatVector>> SubAssign<T> for FloatVector
[src]
fn sub_assign(&mut self, other: T)
[src]
impl<T: Into<FloatVector>> MulAssign<T> for FloatVector
[src]
fn mul_assign(&mut self, _rhs: T)
[src]
impl<T: Into<FloatVector>> DivAssign<T> for FloatVector
[src]
fn div_assign(&mut self, _rhs: T)
[src]
Auto Trait Implementations
impl Sync for FloatVector
impl Send for FloatVector
impl Unpin for FloatVector
impl RefUnwindSafe for FloatVector
impl UnwindSafe for FloatVector
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,