Пример #1
0
  /**
   * Setup to fly along the specified path and look around.
   *
   * @param kFlyPathGraph FlyPathGraphCurve contains the information regarding the graph
   *     representation of 3D path segments represented by Curve3 instances
   * @param kAnnotateList FlyPathAnnotateList contains the list of annotation points.
   * @param kTransformPosition TransformGroup contains the Transform3D for the current viewing
   *     position.
   * @param kTransformDirection TransformGroup contains the Transform3D for the current viewing
   *     direction.
   * @param kTransformOrientation TransformGroup contains the Transform3D for the current viewing
   *     orientation.
   * @param _parentScene the parent frame which hold Canvas3D.
   */
  public FlyPathBehavior_WM(
      FlyPathGraphCurve kFlyPathGraph,
      FlyPathAnnotateList_WM kAnnotateList,
      FlyThroughRender _parentScene) {

    // Keep references to these.
    m_kFlyPathGraph = kFlyPathGraph;
    m_kAnnotateList = kAnnotateList;
    parentScene = _parentScene;
    parentScene.GetCanvas().addKeyListener(this);

    // Create array to store the state of each branch.
    int iNumBranches = kFlyPathGraph.getNumBranches();

    m_akBranchState = new BranchState[iNumBranches];

    for (int iBranch = 0; iBranch < iNumBranches; iBranch++) {
      m_akBranchState[iBranch] = new BranchState(iBranch, kFlyPathGraph);
    }

    // Set initial branch, position, and step.
    // Compute the distance increment along the path that each
    // step will take.
    m_fPathStep = 1.0f;
    m_fGazeDist = 10.0f;
    setBranch(0);
  }