logo
pub struct Conformal3 { /* private fields */ }
Expand description

Represents a transform with translation + rotation + uniform scale. Preserves local angles. Scale and rotation will be applied first, then translation.

Implementations

The identity transform: doesn’t transform at all. Like multiplying with 1.

A transform that first rotates and scales around the origin and then moves all points by a set amount.

Equivalent to Conformal3::from_translation(translation) * (Conformal3::from_scale(rotation) * Conformal3::from_quat(scale)).

The given rotation should be normalized.

A transform that first rotates around the origin and then moves all points by a set amount.

Equivalent to Conformal3::from_translation(translation) * Conformal3::from_quat(rotation).

The given rotation should be normalized.

A pure translation without any rotation or scale.

Returns this transform decomposed into scale, rotation, translation

A pure rotation without any translation or scale.

A pure scale without any translation or rotation.

Returns the inverse of this transform. my_transform * my_transform.inverse() = Conformal3::IDENITTY

Will attempt to create a Conformal3 from an Affine3A. Assumes no shearing and uniform scaling. If the affine transform contains shearing or non-uniform scaling it will be lost.

Returns this transform as an Affine3A

Returns this transform as a Mat4

Transform a Vec3 using translation, rotation, scale.

Transform a Vec3 using only rotation and scale.

Returns the rotation

Sets the rotation

Returns the translation

Returns the translation and scale as a Vec4

Sets the translation

Returns the scale

Sets the scale

Builds a Conformal3 from an IsoTransform (rotation, translation).

Creates a right-handed view transform using a camera position, a point to look at, and an up direction.

The result transforms from world coordinates to view coordinates.

For a view coordinate system with +X=right, +Y=up and +Z=back.

Will return None if any argument is zero, non-finite, or if forward and up are colinear.

Returns true if, and only if, all components are finite.

If any component is either NaN, positive or negative infinity, this will return false.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Identity transform

Identity transform

Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.