Struct ludomath::vec2d::Transform [] [src]

pub struct Transform {
    pub mat: [[f32; 2]; 2],
    pub vec: Vector,
}

Represents an affine transformation of the plane.

Can represent any linear transformation, plus translation. Equivalent in layout to a GLSL (column-major) 3x2 matrix, where the rightmost column contains the translation vector.

Fields

The 2x2 linear transformation matrix.

Stored in column-major order as a 2D array.

The translation vector.

Methods

impl Transform
[src]

[src]

Constructs a new Transform from translation, rotation and scale.

[src]

Constructs a new Transform from position, rotation and scale.

Rotation is given as an angle in radians.

[src]

Constructs a new Transform from position, rotation and scale.

Rotation is given as an angle in degrees.

[src]

Constructs a Transform from a 2x2 linear tranformation matrix.

The order of the arguments is their order in memory - column-major.

[src]

Constructs a scaling Transform.

[src]

Constructs a rotating Transform from a Rotation.

[src]

Constructs a rotating Transform from an angle in radians.

[src]

Constructs a rotating Transform from an angle in degrees.

[src]

Constructs a translating Transform from an offset.

[src]

Creates a new Transform by translating an existing one.

The offset is relative to the global coordinate system.

[src]

Translates a Transform, mutating it.

The offset is relative to the global coordinate system.

[src]

Creates a new Transform by translating an existing one.

The offset is relative to the local coordinate system defined by the Transform.

[src]

Translates a Transform, mutating it.

The offset is relative to the local coordinate system defined by the Transform.

[src]

Creates a new Transform by rotating an existing one.

[src]

Creates a new Transform by rotating an existing one by an angle in radians.

[src]

Creates a new Transform by rotating an existing one by an angle in degrees.

[src]

Rotates a Transform, mutating it.

[src]

Rotates a Transform by an angle in radians, mutating it.

[src]

Rotates a Transform by an angle in degrees, mutating it.

[src]

Creates a new Transform by scaling an existing one.

[src]

Creates a new Transform by scaling an existing one.

Scales by the same amount in both axes.

[src]

Scales a Transform, mutating it.

[src]

Scales a Transform equally in both axes, mutating it.

[src]

Transforms a list of transformable items into a new Vec.

[src]

Transforms a list of transformable items, mutating them.

[src]

Converts a OpenGL-style mat3x2 to a Transform.

Optimizes into a simple copy, since the types have the same layout.

[src]

Converts a Transform to a OpenGL-style mat3x2.

Optimizes into a simple copy, since the types have the same layout.

[src]

Converts a Transform to a OpenGL-style mat4x4.

The matrix is inserted in the top-left corner, and the translation vector in the top of the rightmost column. The rest of the elements are set to the identity matrix.

[src]

Reinterprets a slice of OpenGL-style mat4x4s as Transforms.

Does not allocate a new array, only changes the type of the pointer.

[src]

Reinterprets a slice of Transforms as OpenGL-style mat4x4s.

Does not allocate a new array, only changes the type of the pointer.

Trait Implementations

impl Clone for Transform
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Transform
[src]

impl PartialEq for Transform
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Debug for Transform
[src]

[src]

Formats the value using the given formatter. Read more

impl MaybeInvertible for Transform
[src]

[src]

Returns true if the object is invertible, false otherwise.

[src]

Returns the inverse of an object. Read more

[src]

Inverts an object, mutating it.

[src]

Attempts to compute the inverse of a transformation. Read more

impl Transformation<Vector> for Transform
[src]

[src]

Returns a transformed copy of an object. Read more

[src]

Transforms an object by the inverse of a transformation. Read more

[src]

Transforms an object, mutating it.

[src]

Transforms an object by the inverse of a transformation. Read more

impl Transformation<Point> for Transform
[src]

[src]

Returns a transformed copy of an object. Read more

[src]

Transforms an object by the inverse of a transformation. Read more

[src]

Transforms an object, mutating it.

[src]

Transforms an object by the inverse of a transformation. Read more

impl Transformation<Transform> for Transform
[src]

[src]

Returns a transformed copy of an object. Read more

[src]

Transforms an object, mutating it.

[src]

Transforms an object by the inverse of a transformation. Read more

[src]

Transforms an object by the inverse of a transformation. Read more

Auto Trait Implementations

impl Send for Transform

impl Sync for Transform