Class BezierStrategy

    • Constructor Summary

      Constructors 
      Constructor Description
      BezierStrategy()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Canvas getCanvas()  
      void move​(net.runelite.api.Point start, net.runelite.api.Point target)
      Moves the mouse cursor along a cubic Bezier curve path to the specified target point.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BezierStrategy

        public BezierStrategy()
    • Method Detail

      • move

        public void move​(net.runelite.api.Point start,
                         net.runelite.api.Point target)
        Moves the mouse cursor along a cubic Bezier curve path to the specified target point.

        This method simulates a natural, human-like cursor movement by calculating and following a cubic Bezier curve between the mouse's current position and the target point. The curve includes two intermediate control points for smooth motion and incorporates random variations to add unpredictability. The motion speed and duration are dynamically calculated using Fitts's Law principles and easing functions.

        • The motion begins at the mouse's current position (start).
        • Two random control points (p1, p2) determine the curvature.
        • The motion transitions smoothly to the target position using easing functions.
        Specified by:
        move in interface MoveableMouse
        Parameters:
        target - The target position to which the mouse cursor will move. This is represented as a Point.