示例#1
0
  /**
   * This method is called once per frame to update the positional and rotational data needed to
   * process a Sound Node.
   *
   * @param viewTransform the Transform3D of the current View
   */
  private void update(View view, Point3f listenerPosition) {
    if ((soundDriver != null) && soundDriver.isOnline()) {
      Vector3f facingDirection = Vector3f.fromPool();
      Vector3f upDirection = Vector3f.fromPool();

      soundDriver.setListenerPosition(listenerPosition);

      view.getFacingDirection(facingDirection); // .normalize();
      view.getUpDirection(upDirection); // .normalize();
      soundDriver.setListenerOrientation(facingDirection, upDirection);

      Vector3f.toPool(upDirection);
      Vector3f.toPool(facingDirection);
    }
  }