Class DefaultNoiseProvider
- java.lang.Object
-
- net.eternalclient.api.internal.mouse.naturalmouse.support.DefaultNoiseProvider
-
- All Implemented Interfaces:
NoiseProvider
public class DefaultNoiseProvider extends java.lang.Object implements NoiseProvider
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_NOISINESS_DIVIDER
-
Constructor Summary
Constructors Constructor Description DefaultNoiseProvider(double noisinessDivider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoublePoint
getNoise(java.util.Random random, double xStepSize, double yStepSize)
Noise is offset from the original trajectory, simulating user and physical errors on mouse movement.
-
-
-
Field Detail
-
DEFAULT_NOISINESS_DIVIDER
public static final double DEFAULT_NOISINESS_DIVIDER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNoise
public DoublePoint getNoise(java.util.Random random, double xStepSize, double yStepSize)
Description copied from interface:NoiseProvider
Noise is offset from the original trajectory, simulating user and physical errors on mouse movement.Noise is accumulating, so on average it should create an equal chance of either positive or negative movement on each axis, otherwise the mouse movement will always be slightly offset to single direction.
Deviation from DeviationProvider is different from the Noise because it works like a mathematical function and is not accumulating.
Not every step needs to add noise, use randomness to only add noise sometimes, otherwise return Point(0, 0).
During the final steps of mouse movement, the effect of noise is gradually reduced, so the mouse would finish on the intended pixel smoothly, thus the implementation of this class can safely ignore and not know the beginning and end of the movement.
- Specified by:
getNoise
in interfaceNoiseProvider
- Parameters:
random
- use this to generate randomness in the offsetxStepSize
- the step size that is taken horizontallyyStepSize
- the step size that is taken vertically- Returns:
- a point which describes how much the mouse offset is increased or decreased this step. This value must not include the parameters xStepSize and yStepSize. For no change in noise just return (0,0).
-
-