Class FacingAlgorithm

    • Constructor Detail

      • FacingAlgorithm

        public FacingAlgorithm​(AligningMotionAlgorithm aligning)
        Constructor.
        Parameters:
        aligning - the aligning algorithm to delegate to.
    • Method Detail

      • equals

        @Pure
        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • hashCode

        @Pure
        public int hashCode()
        Overrides:
        hashCode in class Object
      • calculate

        public double calculate​(Point2D<?,​?> position,
                                Vector2D<?,​?> orientation,
                                double angularSpeed,
                                double maxAngular,
                                Point2D<?,​?> target)
        Description copied from interface: FacingMotionAlgorithm
        Calculate the rotation for facing the target point.
        Specified by:
        calculate in interface FacingMotionAlgorithm
        Parameters:
        position - is the current position of the entity.
        orientation - is the current orientation of the entity.
        angularSpeed - is the current angular speed of the entity.
        maxAngular - is the maximal angular speed or acceleration of the entity.
        target - is the point to face to.
        Returns:
        the agent motion.