Class BezierStrategy
- java.lang.Object
-
- com.kraken.api.input.mouse.strategy.bezier.BezierStrategy
-
- All Implemented Interfaces:
MoveableMouse
public class BezierStrategy extends java.lang.Object implements MoveableMouse
-
-
Constructor Summary
Constructors Constructor Description BezierStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.CanvasgetCanvas()voidmove(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.
-
-
-
Method Detail
-
getCanvas
public java.awt.Canvas getCanvas()
- Specified by:
getCanvasin interfaceMoveableMouse
-
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:
movein interfaceMoveableMouse- Parameters:
target- The target position to which the mouse cursor will move. This is represented as aPoint.
-
-