generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
Tweak Mouse Sensitivity | ||
Why? | ||
As the DPI of mice continues to increase, the original mouse sensitivity settings do not perform well at high DPIs, such as 20000. This modification does one simple thing: it multiplies the original mouse sensitivity by itself during processing. | ||
# Tweak Mouse Sensitivity | ||
|
||
Code | ||
Original code: | ||
## Why? | ||
|
||
java | ||
Double value = that.client.options.getMouseSensitivity().getValue(); | ||
double d = value * 0.6F + 0.2F; | ||
double e = d * d * d; | ||
double f = e * 8.0; | ||
i = that.cursorDeltaX * f; | ||
j = that.cursorDeltaY * f; | ||
Modified code: | ||
the dpi provided by the mouse is going higher and higher, the origin mouse sensitivity procedure is not working cool when u set dpi like 20000. | ||
this mod only do one simple thing: multiply the origin mouse sensitivity by itself when processing | ||
like this: | ||
origin: Double value = that.client.options.getMouseSensitivity().getValue(); | ||
double d = value * 0.6F + 0.2F; | ||
double e = d * d * d; | ||
double f = e * 8.0; | ||
i = that.cursorDeltaX * f; | ||
j = that.cursorDeltaY * f; | ||
...... | ||
|
||
java | ||
Double value = that.client.options.getMouseSensitivity().getValue(); | ||
double d = value * 0.6F + 0.2F; | ||
double e = d * d * d * value; // Multiply e by mouse sensitivity | ||
double f = e * 8.0; | ||
i = that.cursorDeltaX * f; | ||
j = that.cursorDeltaY * f; | ||
The variables i and j will be added to your look direction. Variable f is used for non-spyglass view, and variable e is used for spyglass view. | ||
now: Double value = that.client.options.getMouseSensitivity().getValue(); | ||
double d = value * 0.6F + 0.2F; | ||
double e = d * d * d * value;//times e by mouseSensitivity | ||
double f = e * 8.0; | ||
i = that.cursorDeltaX * f; | ||
j = that.cursorDeltaY * f; | ||
...... | ||
|
||
i,j would be finnaly add to your look direction. | ||
f is there for non spyglass view to use, e for spyglass | ||
|
||
|
||
License | ||
This template is available under the CC0 license. Feel free to learn from it and incorporate it into your own projects. | ||
## License | ||
|
||
This template is available under the CC0 license. Feel free to learn from it and incorporate it in your own projects. |