[−][src]Struct polyhorn_ui::linalg::Transform3D
Rank 4 row-major transformation matrix for 3D objects.
Fields
columns: [[T; 4]; 4]
This field contains the entries of this matrix in column-major order.
Implementations
impl<T> Transform3D<T>
[src]
pub fn new(columns: [[T; 4]; 4]) -> Transform3D<T>
[src]
Returns a new transformation matrix with the given entries in row-major order. This function does not perform any kind of validation on the given entries. It is the caller's responsibility to ensure that the given entries result in a valid transformation matrix.
pub fn map<F, O>(self, op: F) -> Transform3D<O> where
F: FnMut(T) -> O,
[src]
F: FnMut(T) -> O,
Applies the given transformation to each entry in the transformation matrix individually.
impl<T> Transform3D<T> where
T: Float,
[src]
T: Float,
pub fn identity() -> Transform3D<T>
[src]
Returns a new identity matrix, i.e. a matrix of zeros with ones on the diagonal.
pub fn with_perspective(d: T) -> Transform3D<T>
[src]
Returns a new transformation matrix for a perspective with the given depth.
pub fn with_translation(tx: T, ty: T, tz: T) -> Transform3D<T>
[src]
Returns a new transformation matrix for a translation with the given offsets.
pub fn with_scale(sx: T, sy: T, sz: T) -> Transform3D<T>
[src]
Returns a new transformation matrix for a scale with the given factors.
pub fn with_skew_x(sx: T) -> Transform3D<T>
[src]
Returns a new transformation matrix for a horizontal skew with the given angle radians.
pub fn with_skew_y(sy: T) -> Transform3D<T>
[src]
Returns a new transformation matrix for a vertical skew with the given angle radians.
pub fn with_rotation(q: Quaternion3D<T>) -> Transform3D<T>
[src]
Returns a new transformation matrix for a counter-clockwise rotation with the given angle radians around the given vector. The given vector does not have to be a unit vector. If it is not a unit vector, this function will normalize and and multiply the angle with the original norm.
pub fn translate(self, tx: T, ty: T, tz: T) -> Transform3D<T>
[src]
Translates the given transformation matrix with the given offsets by concatenating the given matrix to a new translation matrix.
pub fn scale(self, sx: T, sy: T, sz: T) -> Transform3D<T>
[src]
Scales the given transformation matrix with the given factors by concatenating the given matrix to a new scale matrix.
pub fn rotate(self, q: Quaternion3D<T>) -> Transform3D<T>
[src]
Rotates the given transformation matrix with the given angle in radians around the given vector. The rotation is counter-clockwise and if the given vector is not unit, it will be normalized and the angle will be multiplied with the length of the original vector.
pub fn concat(self, other: Transform3D<T>) -> Transform3D<T>
[src]
Concatenates the given transformation matrix to the current transformation matrix.
pub fn apply(self, point: Point3D<T>) -> Point3D<T>
[src]
Applies the given transformation matrix to a point.
pub fn multiply_scalar(self, scalar: T) -> Transform3D<T>
[src]
Multiplies every element of this transformation with the given scalar and returns the result.
Trait Implementations
impl<T: Clone> Clone for Transform3D<T>
[src]
pub fn clone(&self) -> Transform3D<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy> Copy for Transform3D<T>
[src]
impl<T: Debug> Debug for Transform3D<T>
[src]
impl<T> Default for Transform3D<T> where
T: Float,
[src]
T: Float,
impl<T> Eq for Transform3D<T> where
T: Float,
[src]
T: Float,
impl<T> PartialEq<Transform3D<T>> for Transform3D<T> where
T: Float,
[src]
T: Float,
Auto Trait Implementations
impl<T> RefUnwindSafe for Transform3D<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Transform3D<T> where
T: Send,
T: Send,
impl<T> Sync for Transform3D<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Transform3D<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Transform3D<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
pub fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
pub fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
pub fn convert_into(self) -> U
[src]
pub fn convert_unclamped_into(self) -> U
[src]
pub fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,