Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NodeTransform2D

Hierarchy

  • NodeTransform2D

Implements

Index

Constructors

constructor

Properties

_scale

_scale: Vec2

anchor

anchor: Vec2

position

position: Vec2

rotation

rotation: number

Accessors

scale

  • get scale(): Vec2
  • set scale(value: number | Vec2): void

Methods

NodeTransform2D

NodeTransform3D

clone

getMat4

getMatrix

setWithMatrix

  • setWithMatrix(m: Mat3, position?: Vec2, useOldRotation?: boolean): void
  • Sets the transform properties based on the given affine transformation matrix and optional position.

    This function should set the transform based on an input matrix and (optionally) a starting position. Calling T.getMatrix() on the resulting transform should produce the input matrix m. Position should be the point where changes to rotation or scale will rotate and scale around. Meanings of position, rotation, scale, and anchor match those used in Adobe standards (e.g., After Effects). The corresponding matrix is calculated as shown in getMatrix() above: (P)(R)(S)*(-A). Position is specified as a constraint because the two translations in the above equation create a redundancy.

    We recommend familiarizing yourself with the available methods in src/anigraph/amath/Mat3.ts.

    Also familiarize yourself with the available functions in src/anigraph/amath/Precision.ts. These are useful when dealing with floating point inaccuracies and other small numbers.

    Note: do not let the scale factor be less than epsilon.

    Parameters

    • m: Mat3

      the affine transformation matrix

    • Optional position: Vec2

      the starting positon

    • Optional useOldRotation: boolean

    Returns void

Generated using TypeDoc