Package net.storm.api.interact.mouse
Class BezierCurveMouseMovement
java.lang.Object
net.storm.api.interact.mouse.BezierCurveMouseMovement
- All Implemented Interfaces:
MouseMovementStrategy
Mouse movement strategy that uses quadratic Bezier curves to create natural,
human-like mouse movements. The path includes a random control point to add
variation and unpredictability.
Execution speed is determined by the InteractManager based on queue size.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.storm.api.interact.mouse.MouseMovementStrategy
MouseMovementStrategy.MousePath -
Constructor Summary
ConstructorsConstructorDescriptionCreates a Bezier curve with 15 steps and 0.3 deviation (default).BezierCurveMouseMovement(int steps, double controlPointDeviation) Creates a Bezier curve mouse movement strategy. -
Method Summary
Modifier and TypeMethodDescriptiongeneratePath(Point current, Point target) Generates a mouse movement path from the current position to the target position.
-
Constructor Details
-
BezierCurveMouseMovement
public BezierCurveMouseMovement(int steps, double controlPointDeviation) Creates a Bezier curve mouse movement strategy.- Parameters:
steps- Number of points along the curve (higher = smoother path)controlPointDeviation- How far the control point can deviate from straight line (0.0 to 1.0)
-
BezierCurveMouseMovement
public BezierCurveMouseMovement()Creates a Bezier curve with 15 steps and 0.3 deviation (default).
-
-
Method Details
-
generatePath
Description copied from interface:MouseMovementStrategyGenerates a mouse movement path from the current position to the target position.This method must NOT:
- Dispatch any events
- Block the thread
- Determine execution speed (that's the InteractManager's job)
- Specified by:
generatePathin interfaceMouseMovementStrategy- Parameters:
current- The current mouse position (can be null if unknown)target- The target position to move to- Returns:
- A MousePath containing the sequence of points defining the path shape
-