@Override
 public void setPosition(float x, float y, float z) {
   this.x = x;
   this.y = y;
   this.z = z;
   super.setPosition(x, y, z);
 }
  void removeCursorController(GVRBaseController controller) {
    int id = controller.getId();
    controllers.remove(id);

    // stop the thread if no more devices are online
    if (controllers.size() == 0 && threadStarted) {
      Log.d(TAG, "Stopping " + THREAD_NAME);
      thread.quitSafely();
      thread = new EventHandlerThread(THREAD_NAME);
      threadStarted = false;
    }
  }
    private void processMouseEvent(float x, float y, float z, boolean active) {
      GVRScene scene = context.getMainScene();
      if (scene != null) {
        float depth = this.z;
        if (((depth + z) <= getNearDepth()) && ((depth + z) >= getFarDepth())) {
          float frustumWidth, frustumHeight;
          depth = depth + z;

          // calculate the frustum using the aspect ratio and FOV
          // http://docs.unity3d.com/Manual/FrustumSizeAtDistance.html
          float aspectRatio = scene.getMainCameraRig().getCenterCamera().getAspectRatio();
          float fovY = scene.getMainCameraRig().getCenterCamera().getFovY();
          float frustumHeightMultiplier = (float) Math.tan(Math.toRadians(fovY / 2)) * 2.0f;
          frustumHeight = frustumHeightMultiplier * depth;
          frustumWidth = frustumHeight * aspectRatio;

          this.x = frustumWidth * -x;
          this.y = frustumHeight * -y;
          this.z = depth;
        }
        setActive(active);
        super.setPosition(this.x, this.y, this.z);
      }
    }