globalTransform property

Matrix4 get globalTransform

The transformation matrix representing the node's position, rotation, and scale in world space.

If the node does not have a parent, globalTransform and localTransform share the same transformation matrix instance.

Implementation

Matrix4 get globalTransform {
  final parent = _parent;
  if (parent == null) {
    return localTransform;
  }
  return parent.globalTransform * localTransform;
}
set globalTransform (Matrix4 transform)

Implementation

set globalTransform(Matrix4 transform) {
  final parent = _parent;
  if (parent == null) {
    localTransform = transform;
  } else {
    Matrix4 g = Matrix4.identity();
    parent.globalTransform.copyInverse(g);

    localTransform = transform * parent.globalTransform.invert();
  }
}