updateWorldMatrix method

void updateWorldMatrix(
  1. bool updateParents,
  2. bool updateChildren
)
inherited

Implementation

void updateWorldMatrix(bool updateParents, bool updateChildren) {
  var parent = this.parent;

  if (updateParents == true && parent != null) {
    parent.updateWorldMatrix(true, false);
  }

  if (matrixAutoUpdate) updateMatrix();

  if (this.parent == null) {
    matrixWorld.copy(matrix);
  } else {
    matrixWorld.multiplyMatrices(this.parent!.matrixWorld, matrix);
  }

  // update children

  if (updateChildren == true) {
    var children = this.children;

    for (var i = 0, l = children.length; i < l; i++) {
      children[i].updateWorldMatrix(false, true);
    }
  }
}