Struct geo_nd::FArray2

source ·
pub struct FArray2<F: Float, const D: usize, const D2: usize> { /* private fields */ }
Expand description

The FArray2 is a wrapper around a D2 = D^2` sized array of Floats.

It provides implementations of the traits required for a SqMatrix trait operating on an FArray of dimesion D.

Trait Implementations§

source§

impl<F: Float, const D: usize, const D2: usize> Add<F> for FArray2<F, D, D2>

§

type Output = FArray2<F, D, D2>

The resulting type after applying the + operator.
source§

fn add(self, other: F) -> Self

Performs the + operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> Add<FArray2<F, D, D2>> for FArray2<F, D, D2>

§

type Output = FArray2<F, D, D2>

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> AddAssign<F> for FArray2<F, D, D2>

source§

fn add_assign(&mut self, other: F)

Performs the += operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> AddAssign<FArray2<F, D, D2>> for FArray2<F, D, D2>

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> AsMut<[F]> for FArray2<F, D, D2>

source§

fn as_mut(&mut self) -> &mut [F]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<F: Float, const D: usize, const D2: usize> AsMut<[F; D2]> for FArray2<F, D, D2>

source§

fn as_mut(&mut self) -> &mut [F; D2]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<F: Float, const D: usize, const D2: usize> AsRef<[F]> for FArray2<F, D, D2>

source§

fn as_ref(&self) -> &[F]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<F: Float, const D: usize, const D2: usize> AsRef<[F; D2]> for FArray2<F, D, D2>

source§

fn as_ref(&self) -> &[F; D2]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<F: Clone + Float, const D: usize, const D2: usize> Clone for FArray2<F, D, D2>

source§

fn clone(&self) -> FArray2<F, D, D2>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F: Debug + Float, const D: usize, const D2: usize> Debug for FArray2<F, D, D2>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<F: Float, const D: usize, const D2: usize> Default for FArray2<F, D, D2>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de, F: Float + Deserialize<'de>, const D: usize, const D2: usize> Deserialize<'de> for FArray2<F, D, D2>

source§

fn deserialize<DE>(deserializer: DE) -> Result<Self, DE::Error>where DE: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<F: Float, const D: usize, const D2: usize> Div<F> for FArray2<F, D, D2>

§

type Output = FArray2<F, D, D2>

The resulting type after applying the / operator.
source§

fn div(self, other: F) -> Self

Performs the / operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> DivAssign<F> for FArray2<F, D, D2>

source§

fn div_assign(&mut self, other: F)

Performs the /= operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> From<[F; D2]> for FArray2<F, D, D2>

source§

fn from(data: [F; D2]) -> Self

Converts to this type from the input type.
source§

impl<F: Float, const D: usize, const D2: usize> Index<usize> for FArray2<F, D, D2>

§

type Output = F

The returned type after indexing.
source§

fn index(&self, index: usize) -> &F

Performs the indexing (container[index]) operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> IndexMut<usize> for FArray2<F, D, D2>

source§

fn index_mut(&mut self, index: usize) -> &mut F

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> Mul<F> for FArray2<F, D, D2>

§

type Output = FArray2<F, D, D2>

The resulting type after applying the * operator.
source§

fn mul(self, other: F) -> Self

Performs the * operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> Mul<FArray2<F, D, D2>> for FArray2<F, D, D2>

§

type Output = FArray2<F, D, D2>

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> MulAssign<F> for FArray2<F, D, D2>

source§

fn mul_assign(&mut self, other: F)

Performs the *= operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> MulAssign<FArray2<F, D, D2>> for FArray2<F, D, D2>

source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
source§

impl<F: Float + Serialize, const D: usize, const D2: usize> Serialize for FArray2<F, D, D2>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<F: Float> SqMatrix<FArray<F, 2>, F, 2, 4> for FArray2<F, 2, 4>

source§

fn from_array(data: [F; 4]) -> Self

Create a SqMatrix from an array of Floats
source§

fn into_array(self) -> [F; 4]

Create a vector from an array of Float
source§

fn zero() -> Self

Create a zero SqMatrix
source§

fn identity() -> Self

Create an identity SqMatrix
source§

fn is_zero(&self) -> bool

Return true if the matrix is zer
source§

fn set_zero(&mut self)

Set the matrix to zero
source§

fn transpose(&self) -> Self

Return a transpose matrix
source§

fn determinant(&self) -> F

Calculate the determinant of the matrix
source§

fn inverse(&self) -> Self

Create an inverse matrix
source§

fn transform(&self, v: &FArray<F, 2>) -> FArray<F, 2>

Apply the matrix to a vector to transform it
source§

impl<F: Float> SqMatrix<FArray<F, 3>, F, 3, 9> for FArray2<F, 3, 9>

source§

fn from_array(data: [F; 9]) -> Self

Create a SqMatrix from an array of Floats
source§

fn into_array(self) -> [F; 9]

Create a vector from an array of Float
source§

fn zero() -> Self

Create a zero SqMatrix
source§

fn identity() -> Self

Create an identity SqMatrix
source§

fn is_zero(&self) -> bool

Return true if the matrix is zer
source§

fn set_zero(&mut self)

Set the matrix to zero
source§

fn transpose(&self) -> Self

Return a transpose matrix
source§

fn determinant(&self) -> F

Calculate the determinant of the matrix
source§

fn inverse(&self) -> Self

Create an inverse matrix
source§

fn transform(&self, v: &FArray<F, 3>) -> FArray<F, 3>

Apply the matrix to a vector to transform it
source§

impl<F: Float> SqMatrix<FArray<F, 4>, F, 4, 16> for FArray2<F, 4, 16>

source§

fn from_array(data: [F; 16]) -> Self

Create a SqMatrix from an array of Floats
source§

fn into_array(self) -> [F; 16]

Create a vector from an array of Float
source§

fn zero() -> Self

Create a zero SqMatrix
source§

fn identity() -> Self

Create an identity SqMatrix
source§

fn is_zero(&self) -> bool

Return true if the matrix is zer
source§

fn set_zero(&mut self)

Set the matrix to zero
source§

fn transpose(&self) -> Self

Return a transpose matrix
source§

fn determinant(&self) -> F

Calculate the determinant of the matrix
source§

fn inverse(&self) -> Self

Create an inverse matrix
source§

fn transform(&self, v: &FArray<F, 4>) -> FArray<F, 4>

Apply the matrix to a vector to transform it
source§

impl<F: Float> SqMatrix4<F, FArray<F, 3>, FArray<F, 4>> for FArray2<F, 4, 16>

source§

fn perspective(fov: F, aspect: F, near: F, far: F) -> Self

Generate a perspective matrix
source§

fn look_at(eye: &FArray<F, 3>, center: &FArray<F, 3>, up: &FArray<F, 3>) -> Self

Generate a matrix that represents a ‘look at a vector’
source§

fn translate3(&mut self, by: &FArray<F, 3>)

Translate the matrix by a Vec3
source§

fn translate4(&mut self, by: &FArray<F, 4>)

Translate the matrix by a Vec4
source§

impl<F: Float, const D: usize, const D2: usize> Sub<F> for FArray2<F, D, D2>

§

type Output = FArray2<F, D, D2>

The resulting type after applying the - operator.
source§

fn sub(self, other: F) -> Self

Performs the - operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> Sub<FArray2<F, D, D2>> for FArray2<F, D, D2>

§

type Output = FArray2<F, D, D2>

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> SubAssign<F> for FArray2<F, D, D2>

source§

fn sub_assign(&mut self, other: F)

Performs the -= operation. Read more
source§

impl<F: Float, const D: usize, const D2: usize> SubAssign<FArray2<F, D, D2>> for FArray2<F, D, D2>

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl<F: Float + Serialize> Transform<F, FArray<F, 3>, FArray<F, 4>, FArray2<F, 4, 16>, QArray<F, FArray<F, 3>, FArray<F, 4>>> for FQArrayTrans<F>

source§

fn of_trs(t: FArray<F, 3>, r: QArray<F, FArray<F, 3>, FArray<F, 4>>, s: F) -> Self

Create an FQArrayTrans from a Vector3 translation, Quat rotation and Float scaling

source§

fn scale(&self) -> F

Get the scaling of the transformation

source§

fn translation(&self) -> FArray<F, 3>

Get the translation of the transformation

source§

fn rotation(&self) -> QArray<F, FArray<F, 3>, FArray<F, 4>>

Get the rotation of the transformation

source§

fn inverse(&self) -> Self

Get a transformation that is the inverse of this

source§

fn invert(&mut self)

Invert this transformation

source§

fn as_mat(&self) -> FArray2<F, 4, 16>

Return the matrix

source§

impl<F: Copy + Float, const D: usize, const D2: usize> Copy for FArray2<F, D, D2>

source§

impl<F: Float> SqMatrix3<FArray<F, 3>, F> for FArray2<F, 3, 9>

Auto Trait Implementations§

§

impl<F, const D: usize, const D2: usize> RefUnwindSafe for FArray2<F, D, D2>where F: RefUnwindSafe,

§

impl<F, const D: usize, const D2: usize> Send for FArray2<F, D, D2>where F: Send,

§

impl<F, const D: usize, const D2: usize> Sync for FArray2<F, D, D2>where F: Sync,

§

impl<F, const D: usize, const D2: usize> Unpin for FArray2<F, D, D2>where F: Unpin,

§

impl<F, const D: usize, const D2: usize> UnwindSafe for FArray2<F, D, D2>where F: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,