Class NavigationBehavior.BranchState

  • All Implemented Interfaces:
    java.lang.Cloneable
    Enclosing class:
    NavigationBehavior

    public class NavigationBehavior.BranchState
    extends java.lang.Object
    implements java.lang.Cloneable
    Branch information.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      float[] m_afBranchPoint
      List of branch points (normalized path distances where one or more branches starts).
      boolean m_bMoveForward
      Current direction.
      protected float m_fDistUnvisitedMax
      Range of normalized path distances that have not been visited.
      protected float m_fDistUnvisitedMin
      Range of normalized path distances that have not been visited.
      float m_fNormalizedPathDist
      Current position along the path.
      float m_fParentBranchPoint
      Normalized distance (in range [0,1]) along parent branch where the specified branch starts.
      int m_iBranchIndex
      Identifies the current curve in the path graph.
      int m_iParentBranchIndex
      Information about the parent branch, if one exists.
      WildMagic.LibFoundation.Curves.Curve3f m_kBranchCurve
      Branch curve
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object clone()
      Clone the current branch state.
      NavigationBehavior.BranchState createCopy()
      Create a copy of this instance.
      NavigationBehavior.BranchState createReverseCopy()
      Create a copy of this instance which has the same information except that the state of the moving forward is inverted.
      int getBranchPointSegment​(float fNormalizedPathDist)
      Return an index which identifies segment the specified normalized path distance belongs.
      WildMagic.LibFoundation.Mathematics.Vector3f getForwardNormalizedPosition​(float fDist)
      Return the position of the curve of the point further down the curve the specified distance in the current heading.
      float getForwardNormalizedTime​(float fForwardDist)
      Return the normalized path distance of a point further down the branch curve in the current heading.
      void start()
      Reset parameters to start at the beginning of the path moving in the forward direction.
      void updateDistUnvisited​(float fNewNormalizedPathDistance)
      Update the range of normalized path distances that have not been visited.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_afBranchPoint

        public float[] m_afBranchPoint
        List of branch points (normalized path distances where one or more branches starts).
      • m_bMoveForward

        public boolean m_bMoveForward
        Current direction. True if forward, false if reverse.
      • m_fNormalizedPathDist

        public float m_fNormalizedPathDist
        Current position along the path.
      • m_fParentBranchPoint

        public float m_fParentBranchPoint
        Normalized distance (in range [0,1]) along parent branch where the specified branch starts.
      • m_iBranchIndex

        public int m_iBranchIndex
        Identifies the current curve in the path graph.
      • m_iParentBranchIndex

        public int m_iParentBranchIndex
        Information about the parent branch, if one exists.
      • m_kBranchCurve

        public WildMagic.LibFoundation.Curves.Curve3f m_kBranchCurve
        Branch curve
      • m_fDistUnvisitedMax

        protected float m_fDistUnvisitedMax
        Range of normalized path distances that have not been visited.
      • m_fDistUnvisitedMin

        protected float m_fDistUnvisitedMin
        Range of normalized path distances that have not been visited.
    • Constructor Detail

      • BranchState

        public BranchState​(int iBranchIndex,
                           FlyPathGraphCurve kFlyPathGraph)
        Constructor.
        Parameters:
        iBranchIndex - int Index which identifies the branch.
        kFlyPathGraph - FlyPathGraphCurve Data structure which contains all of the information about each branch and its connections.
    • Method Detail

      • createCopy

        public NavigationBehavior.BranchState createCopy()
        Create a copy of this instance.
        Returns:
        BranchState New instance which is a copy of this instance.
      • createReverseCopy

        public NavigationBehavior.BranchState createReverseCopy()
        Create a copy of this instance which has the same information except that the state of the moving forward is inverted.
        Returns:
        BranchState New instance which is a copy of this instance except that the moving forward flag is inverted.
      • getBranchPointSegment

        public int getBranchPointSegment​(float fNormalizedPathDist)
        Return an index which identifies segment the specified normalized path distance belongs.
        Parameters:
        fNormalizedPathDist - float Normalized path distance in the range [0,1] along the branch path.
        Returns:
        int An index of zero is returned if the distance is before the first branch point or if there are no branch points. An index of one is returned if the distance is greater than or equal to the first branch point but less than or equal to second branch point.
      • getForwardNormalizedPosition

        public WildMagic.LibFoundation.Mathematics.Vector3f getForwardNormalizedPosition​(float fDist)
        Return the position of the curve of the point further down the curve the specified distance in the current heading.
        Parameters:
        fDist - float Distance further down the branch curve in the current heading. This value can be negative for a point in the reverse heading.
        Returns:
        Point3f Coordinates of the 3D point further down along the curve.
      • getForwardNormalizedTime

        public float getForwardNormalizedTime​(float fForwardDist)
        Return the normalized path distance of a point further down the branch curve in the current heading.
        Parameters:
        fForwardDist - float Distance further down the branch curve in the current heading. This value can be negative for a point in the reverse heading.
        Returns:
        float Normalized path distance in the [0,1] range for the requested point.
      • start

        public void start()
        Reset parameters to start at the beginning of the path moving in the forward direction.
      • updateDistUnvisited

        public void updateDistUnvisited​(float fNewNormalizedPathDistance)
        Update the range of normalized path distances that have not been visited. Call this method before changing the current normalized path distance!
        Parameters:
        fNewNormalizedPathDistance - float Normalized path distance about to be set for this branch.
      • clone

        protected java.lang.Object clone()
        Clone the current branch state. Used by the mouse recording process.
        Overrides:
        clone in class java.lang.Object
        Returns:
        Object
        Throws:
        java.lang.InternalError - DOCUMENT ME!