   });
    } else {
      onupdate = null;

      if (object.skinMesh) {
        object.skinMesh.parent.remove(object.skinMesh);
        object.skinMesh = null;
      }
    }
  };
  object.update = (hmd, gamepads) => {
    onupdate && onupdate(hmd, gamepads);
  };
  object.animate = thetaValue => {
    uniforms.theta.value = thetaValue;
  };
  object.destroy = () => {
    onupdate = null;

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