add method

Object3D add(
  1. Object3D object
)
inherited

Implementation

Object3D add(Object3D object) {
  if (object == this) {
    print('three.Object3D.add: object can\'t be added as a child of itself. $object');
    return this;
  }

  if (object.parent != null) {
    object.parent!.remove(object);
  }

  object.parent = this;
  children.add(object);

  object.dispatchEvent(_addedEvent);

  return this;
}