setObject3D(type, obj) {
    var oldObj;
    var self = this;
    if (!(obj instanceof three__WEBPACK_IMPORTED_MODULE_3__.Object3D)) {
      throw new Error('`Entity.setObject3D` was called with an object that was not an instance of ' + 'THREE.Object3D.');
    }

    // Remove existing object of the type.
    oldObj = this.getObject3D(type);
    if (oldObj) {
      this.object3D.remove(oldObj);
    }

    // Set references to A-Frame entity.
    obj.el = this;
    if (obj.children.length) {
      obj.traverse(function bindEl(child) {
        child.el = self;
      });
    }

    // Add.
    this.object3D.add(obj);
    this.object3DMap[type] = obj;
    this.emit('object3dset', {
      object: obj,
      type: type
    });
  }
Set a THREE.Object3D into the map.

@param {string} type - Developer-set name of the type of object, will be unique per type.
@param {THREE.Object3D} obj - A THREE.Object3D.