Class DirectionOfAttackAviation

    • Field Detail

      • DEFAULT_NUM_INTERVALS

        public static final int DEFAULT_NUM_INTERVALS
        Default number of intervals used to draw the curve.
        See Also:
        Constant Field Values
      • DEFAULT_BOW_TIE_LENGTH

        public static final double DEFAULT_BOW_TIE_LENGTH
        Default length of the bow tie part of the graphic, as a fraction of the graphic's total length.
        See Also:
        Constant Field Values
      • DEFAULT_BOW_TIE_WIDTH

        public static final double DEFAULT_BOW_TIE_WIDTH
        Default width of the bow tie part of the graphic, as a fraction of the length of the bow tie.
        See Also:
        Constant Field Values
      • DEFAULT_CURVATURE

        public static final Angle DEFAULT_CURVATURE
        Default angle that determines the curvature of the line.
      • intervals

        protected int intervals
        Number of intervals used to draw the curve.
      • bowTieLength

        protected double bowTieLength
        Length of the bow tie part of the graphic, as a fraction of the graphic's total length.
      • bowTieWidth

        protected double bowTieWidth
        Width of the bow tie part of the graphic, as a fraction of the length of the bow tie.
      • curvature

        protected Angle curvature
        Angle that controls the curve of the line. A large angle results in a more pronounced curve. An angle of zero results in a straight line.
    • Constructor Detail

      • DirectionOfAttackAviation

        public DirectionOfAttackAviation​(java.lang.String sidc)
        Create a new arrow graphic.
        Parameters:
        sidc - Symbol code the identifies the graphic.
    • Method Detail

      • getSupportedGraphics

        public static java.util.List<java.lang.String> getSupportedGraphics()
        Indicates the graphics supported by this class.
        Returns:
        List of masked SIDC strings that identify graphics that this class supports.
      • getIntervals

        public int getIntervals()
        Indicates the number of intervals used to draw the curve in this graphic. More intervals results in a smoother curve.
        Returns:
        Intervals used to draw arc.
      • setIntervals

        public void setIntervals​(int intervals)
        Specifies the number of intervals used to draw the curve in this graphic. More intervals will result in a smoother looking curve.
        Parameters:
        intervals - Number of intervals for drawing the curve.
      • getBowTieLength

        public double getBowTieLength()
        Indicates the length of the bow tie part of the graphic, as a fraction of the graphic's total length.
        Returns:
        Length of the bow tie as a fraction of the total length of the graphic.
      • setBowTieLength

        public void setBowTieLength​(double bowTieLength)
        Specifies the length of the bow tie part of the graphic, as a fraction of the graphic's total length.
        Parameters:
        bowTieLength - Length of the bow tie as a fraction of the total length of the graphic.
      • getBowTieWidth

        public double getBowTieWidth()
        Indicates the width of the bow tie part of the graphic, as a fraction of the length of the bow tie.
        Returns:
        Width of the bow tie as a fraction of the length of the bow tie.
      • setBowTieWidth

        public void setBowTieWidth​(double bowTieWidth)
        Specifies the width of the bow tie part of the graphic, as a fraction of the length of the bow tie.
        Parameters:
        bowTieWidth - Width of the bow tie as a fraction of the length of the bow tie.
      • getCurvature

        public Angle getCurvature()
        Indicates the angle that determines the curvature of the line. A large angle results in a more pronounced curve. An angle of zero results in a straight line.
        Returns:
        The angle that determines the curvature of the line.
      • setCurvature

        public void setCurvature​(Angle angle)
        Specifies the angle that determines the curvature of the line. A large angle results in a more pronounced curve. An angle of zero results in a straight line.
        Parameters:
        angle - The angle that determines the curvature of the line.
      • onShapeChanged

        protected void onShapeChanged()
      • createShapes

        protected void createShapes​(DrawContext dc)
        Create the list of positions that describe the arrow.
        Overrides:
        createShapes in class DirectionOfAttack
        Parameters:
        dc - Current draw context.
      • createBowTie

        protected java.util.List<Position> createBowTie​(DrawContext dc,
                                                        Position pos1,
                                                        Position pos2)
        Create positions required to to draw the bow tie part of the graphic.
        Parameters:
        dc - Current draw context.
        pos1 - Position at the center of one side of the bow tie.
        pos2 - Position at the center of the other side of the bow tie.
        Returns:
        Positions that describe the bow tie.
      • hermiteCurve

        protected Vec4 hermiteCurve​(Vec4 pt1,
                                    Vec4 pt2,
                                    Vec4 tangent1,
                                    Vec4 tangent2,
                                    double t)
        Compute a point along a Hermite curve defined by two control point and tangent vectors at those points.

        This function implements the Hermite curve equation from "Mathematics for 3D Game Programming and Computer Graphics, Second Edition" by Eric Lengyel (equation 15.15, pg. 457).

        H(t) = (1 - 3t2 + 2t3)P1 + t2(3 - 2t)P2 + t(t - 1)2T1 + t2(t - 1)T2

        Parameters:
        pt1 - First control point.
        pt2 - Second control point.
        tangent1 - Vector tangent to the curve at the first control point.
        tangent2 - Vector tangent to the curve at the second control point.
        t - Interpolation parameter in the range [0..1].
        Returns:
        A point along the curve.