pub struct TransformationUniform<F, Q>{ /* private fields */ }Expand description
A transformation that is a translation . rotation . scaling (i.e. it applies a scaling to an object, then the rotation then translates it)
This supports only a uniform scaling
Trait Implementations§
Source§impl<F, Q> Clone for TransformationUniform<F, Q>
impl<F, Q> Clone for TransformationUniform<F, Q>
Source§fn clone(&self) -> TransformationUniform<F, Q>
fn clone(&self) -> TransformationUniform<F, Q>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<F, Q> Copy for TransformationUniform<F, Q>
Source§impl<F, Q> Debug for TransformationUniform<F, Q>
impl<F, Q> Debug for TransformationUniform<F, Q>
Source§impl<F, Q> Default for TransformationUniform<F, Q>
impl<F, Q> Default for TransformationUniform<F, Q>
Source§impl<'de, F, Q> Deserialize<'de> for TransformationUniform<F, Q>where
F: Float + Deserialize<'de> + Serialize,
Q: Quaternion<F> + Deserialize<'de> + Serialize,
FArray<F, 3>: Vector3<F> + DeserializeOwned + Serialize,
FArray<F, 4>: Vector4<F>,
Available on crate feature serde only.
impl<'de, F, Q> Deserialize<'de> for TransformationUniform<F, Q>where
F: Float + Deserialize<'de> + Serialize,
Q: Quaternion<F> + Deserialize<'de> + Serialize,
FArray<F, 3>: Vector3<F> + DeserializeOwned + Serialize,
FArray<F, 4>: Vector4<F>,
Available on crate feature
serde only.Source§fn deserialize<DE>(deserializer: DE) -> Result<Self, DE::Error>where
DE: Deserializer<'de>,
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, Q> Display for TransformationUniform<F, Q>
impl<F, Q> Display for TransformationUniform<F, Q>
Source§impl<F, Q> Div<F> for TransformationUniform<F, Q>
impl<F, Q> Div<F> for TransformationUniform<F, Q>
Source§impl<F, Q> DivAssign<F> for TransformationUniform<F, Q>
impl<F, Q> DivAssign<F> for TransformationUniform<F, Q>
Source§fn div_assign(&mut self, f: F)
fn div_assign(&mut self, f: F)
Performs the
/= operation. Read moreSource§impl<F, Q> Mul<F> for TransformationUniform<F, Q>
impl<F, Q> Mul<F> for TransformationUniform<F, Q>
Source§impl<F, Q> Mul<FArray<F, 4>> for TransformationUniform<F, Q>
impl<F, Q> Mul<FArray<F, 4>> for TransformationUniform<F, Q>
Source§impl<F, Q> MulAssign<F> for TransformationUniform<F, Q>
impl<F, Q> MulAssign<F> for TransformationUniform<F, Q>
Source§fn mul_assign(&mut self, f: F)
fn mul_assign(&mut self, f: F)
Performs the
*= operation. Read moreSource§impl<F, Q> PartialEq for TransformationUniform<F, Q>
impl<F, Q> PartialEq for TransformationUniform<F, Q>
Source§fn eq(&self, other: &TransformationUniform<F, Q>) -> bool
fn eq(&self, other: &TransformationUniform<F, Q>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<F, Q> Serialize for TransformationUniform<F, Q>where
F: Float + for<'de> Deserialize<'de> + Serialize,
Q: Quaternion<F> + for<'de> Deserialize<'de> + Serialize,
FArray<F, 3>: Vector3<F> + DeserializeOwned + Serialize,
FArray<F, 4>: Vector4<F> + Serialize,
Available on crate feature serde only.
impl<F, Q> Serialize for TransformationUniform<F, Q>where
F: Float + for<'de> Deserialize<'de> + Serialize,
Q: Quaternion<F> + for<'de> Deserialize<'de> + Serialize,
FArray<F, 3>: Vector3<F> + DeserializeOwned + Serialize,
FArray<F, 4>: Vector4<F> + Serialize,
Available on crate feature
serde only.impl<F, Q> StructuralPartialEq for TransformationUniform<F, Q>
Source§impl<F, Q> Transform<F> for TransformationUniform<F, Q>
impl<F, Q> Transform<F> for TransformationUniform<F, Q>
Source§const UNIFORM_SCALING: bool = true
const UNIFORM_SCALING: bool = true
Set to true if the transformation can only perform uniform scaling
Source§type Vec3 = FArray<F, 3>
type Vec3 = FArray<F, 3>
Type of vector comprehended as the translation/scaling for this transform
Source§type Vec4 = FArray<F, 4>
type Vec4 = FArray<F, 4>
Type of vector comprehended as the translation/scaling for this transform
Source§fn of_trs<A: AsRef<[F; 3]>>(t: A, r: Q, s: A) -> Option<Self>
fn of_trs<A: AsRef<[F; 3]>>(t: A, r: Q, s: A) -> Option<Self>
Create a transformation that is a translation, rotation and scaling
Source§fn of_trsu<A: AsRef<[F; 3]>>(t: A, r: Q, s: F) -> Self
fn of_trsu<A: AsRef<[F; 3]>>(t: A, r: Q, s: F) -> Self
Create a transformation that is a translation, rotation and uniform scaling
Source§fn is_uniform_scale(&self) -> bool
fn is_uniform_scale(&self) -> bool
Returns true if the scaling is uniform in each axis
Source§fn uniform_scale(&self) -> Option<F>
fn uniform_scale(&self) -> Option<F>
Get the scale of the transform in each of the axes, if possible
Source§fn translation(&self) -> Self::Vec3
fn translation(&self) -> Self::Vec3
Get a translation by a vector
Source§fn set_identity(&mut self)
fn set_identity(&mut self)
Set to an identity transformation
Source§fn set_scale<A: AsRef<[F; 3]>>(&mut self, scale: A) -> bool
fn set_scale<A: AsRef<[F; 3]>>(&mut self, scale: A) -> bool
Set the scale of the transformation Read more
Source§fn set_uniform_scale(&mut self, scale: F)
fn set_uniform_scale(&mut self, scale: F)
Set the scale of the transformation
Source§fn set_translation<A: AsRef<[F; 3]>>(&mut self, translation: A)
fn set_translation<A: AsRef<[F; 3]>>(&mut self, translation: A)
Set the translation of the transformation
Source§fn set_rotation(&mut self, rotation: Q)
fn set_rotation(&mut self, rotation: Q)
Set the rotation of a transformation
Source§fn scale_uniform_by(&mut self, scale: F)
fn scale_uniform_by(&mut self, scale: F)
Pre-apply a uniform scaling
Source§fn scale_by<A: AsRef<[F; 3]>>(&mut self, scale: A) -> bool
fn scale_by<A: AsRef<[F; 3]>>(&mut self, scale: A) -> bool
Pre-apply a nonuniform scaling Read more
Source§fn translate_by<A: AsRef<[F; 3]>>(&mut self, translation: A, scale: F)
fn translate_by<A: AsRef<[F; 3]>>(&mut self, translation: A, scale: F)
Pre-apply a scaled translation to the transformation
Source§fn transform_by<T: Transform<F, Quat = Self::Quat>>(
&mut self,
transformer: &T,
) -> bool
fn transform_by<T: Transform<F, Quat = Self::Quat>>( &mut self, transformer: &T, ) -> bool
Transform this transformation by another UNIFORM scale transformation;
if is not uniform scaling then return false
Source§fn inverse_transform(&self) -> Option<Self>
fn inverse_transform(&self) -> Option<Self>
Get the inverse transformation Read more
Source§fn apply3_arr(&self, other: &[F; 3]) -> [F; 3]
fn apply3_arr(&self, other: &[F; 3]) -> [F; 3]
Apply the transformation to a [F; 4]
Source§fn apply4_arr(&self, other: &[F; 4]) -> [F; 4]
fn apply4_arr(&self, other: &[F; 4]) -> [F; 4]
Apply the transformation to a [F; 4]
Source§fn set_inverse(&mut self) -> bool
fn set_inverse(&mut self) -> bool
Invert the transformation Read more
Auto Trait Implementations§
impl<F, Q> Freeze for TransformationUniform<F, Q>
impl<F, Q> RefUnwindSafe for TransformationUniform<F, Q>
impl<F, Q> Send for TransformationUniform<F, Q>
impl<F, Q> Sync for TransformationUniform<F, Q>
impl<F, Q> Unpin for TransformationUniform<F, Q>
impl<F, Q> UnsafeUnpin for TransformationUniform<F, Q>
impl<F, Q> UnwindSafe for TransformationUniform<F, Q>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more