Small World Engine API Reference - v0.46.1
    Preparing search index...

    Class Matrix3

    A class representing a 3x3 matrix. Used for 2D transformations or normal matrices.

    Index

    Constructors

    Properties

    data: Float32Array = ...

    The matrix data in column-major order.

    Methods

    • Calculates the normal matrix (transpose of the inverse of the upper-left 3x3 of a 4x4 matrix). Used for transforming normals correctly when non-uniform scaling is present.

      Parameters

      • m: { data: Float32Array }

        The source 4x4 matrix.

      Returns this

      this

    • Sets the matrix to the identity matrix.

      Returns this

      this

    • Sets the matrix from the upper-left 3x3 part of a 4x4 matrix.

      Parameters

      • m: { data: Float32Array }

        The source 4x4 matrix.

      Returns this

      this