rapid-render
    Preparing search index...

    Class MatrixStack

    Hierarchy

    • DynamicArrayBuffer
      • MatrixStack
    Index

    Constructors

    • Returns MatrixStack

    Properties

    bytePerElem: number
    maxElemNum: number
    typedArray: Uint16Array | Uint32Array | Float32Array
    usedElemNum: number

    Accessors

    • get length(): number

      length of the array

      Returns number

    Methods

    • Transforms a point by applying the current matrix stack.

      Parameters

      • x: number | Vec2
      • Optionaly: number

      Returns number[] | Vec2

      The transformed point as an array [newX, newY].

    • Apply the transform to the current matrix

      Parameters

      • transform: ITransformOptions

        The transform to apply

      • width: number = 0
      • height: number = 0

      Returns { offsetX: number; offsetY: number }

      offset position

    • Returns void

    • get the array

      Parameters

      • begin: number = 0
      • Optionalend: number

      Returns Uint16Array | Uint32Array | Float32Array

    • Parameters

      • arrayType: ArrayType

      Returns Uint16ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor

    • Get the global position in world space

      Returns Vec2

      The current matrix position in world space

    • Get the global rotation angle

      Returns number

      The current matrix rotation angle in radians

    • Get the global scale

      Returns Vec2

      The current matrix scale values

    • Obtain the inverse matrix of the current matrix

      Returns Float32Array

      inverse matrix

    • Get a copy of the current transformation matrix

      Returns Float32Array

      matrix

    • Parameters

      Returns Vec2

    • Reset the current matrix to identity matrix

      Returns void

    • Parameters

      Returns Vec2

    • pop a element

      Parameters

      • num: number

      Returns void

    • pop a matrix from the stack

      Returns void

    • Parameters

      • value: number

      Returns void

    • push a matrix and indentiy it

      Returns void

    • push a matrix to the stack

      Returns void

    • Parameters

      • value: number

      Returns void

    • Parameters

      • value: number

      Returns void

    • resize the array

      Parameters

      • size: number = 0

      Returns void

    • Rotates the current matrix by the specified angle.

      Parameters

      • angle: number

        The angle, in radians, to rotate the matrix by.

      Returns void

    • Multiplies the current matrix on the top of the stack by a scaling transformation.

      Parameters

      • x: number | Vec2

        The amount to scale the matrix horizontally.

      • Optionaly: number

        The amount to scale the matrix vertically. If not specified, x is used for both horizontal and vertical scaling.

      Returns void

    • Set the global position in world space

      Parameters

      • x: number | Vec2

        x coordinate or Vec2 object

      • Optionaly: number

        y coordinate (ignored if first parameter is Vec2)

      Returns void

    • Set the global rotation angle

      Parameters

      • angle: number

        rotation angle in radians

      Returns void

    • Set the global scale

      Parameters

      • x: number | Vec2

        x scale or Vec2 object

      • Optionaly: number

        y scale (ignored if first parameter is Vec2)

      Returns void

    • Parameters

      • size: number = ...

      Returns void

    • Set the current transformation matrix

      Parameters

      • array: number[] | Float32Array

      Returns void

    • Convert the current matrix to a CSS transform string

      Returns string

      CSS transform string representation of the matrix

    • Translates the current matrix by the specified x and y values.

      Parameters

      • x: number | Vec2

        The amount to translate horizontally.

      • Optionaly: number

        The amount to translate vertically.

      Returns void

    • Returns void