Matrix2 class

Represents a 2x2 matrix.

A Note on Row-Major and Column-Major Ordering:

The constructor and {@link Matrix2#set} method take arguments in row-major{@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order} order, while internally they are stored in the {@link Matrix2#elements} array in column-major order. This means that calling:

const m = new THREE.Matrix2();
m.set( 11, 12,
       21, 22 );

will result in the elements array containing:

m.elements = [ 11, 21,
               12, 22 ];

and internally all calculations are performed using column-major ordering. However, as the actual ordering makes no difference mathematically and most people are used to thinking about matrices in row-major order, the three.js documentation shows matrices in row-major order. Just bear in mind that if you are reading the source code, you'll have to take the transpose of any matrices outlined here to make sense of the calculations.

Constructors

Matrix2.identity()
  • Sets this matrix to the 2x2 identity matrix. *
    • @return {Matrix2} A reference to this matrix.
  • Properties

    hashCode int
    The hash code for this object.
    no setterinherited
    runtimeType Type
    A representation of the runtime type of the object.
    no setterinherited
    storage Float32List
    getter/setter pair
    type String
    getter/setter pair

    Methods

    fromArray(List<double> array, [int offset = 0]) Matrix2
    fromNativeArray(NativeArray<num> array, [int offset = 0]) Matrix2
    identity() Matrix2
    Set the current 3x3 matrix as an identity matrix.
    noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    setValues(double n11, double n12, double n21, double n22) Matrix2
    toString() String
    A string representation of this object.
    inherited
    unknown(dynamic array, [int offset = 0]) Matrix2

    Operators

    operator ==(Object other) bool
    The equality operator.
    inherited