From aa1b27bc7b058d5c461b19d977c4dd264b16e6dd Mon Sep 17 00:00:00 2001 From: winterflyt <36+winterflyt@noreply.skidsolutions.xyz> Date: Mon, 30 Nov 2026 06:06:52 +0200 Subject: [PATCH] Upload files to "src/openonyx/protocol/internal/internal/internal/internal" --- .../internal/AccelerationSmoothingPart4.java | 16 +++++++ .../internal/internal/LinearSmoothing.java | 27 +++++++++++ .../internal/internal/SigmoidSmoothing.java | 45 +++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 src/openonyx/protocol/internal/internal/internal/internal/AccelerationSmoothingPart4.java create mode 100644 src/openonyx/protocol/internal/internal/internal/internal/LinearSmoothing.java create mode 100644 src/openonyx/protocol/internal/internal/internal/internal/SigmoidSmoothing.java diff --git a/src/openonyx/protocol/internal/internal/internal/internal/AccelerationSmoothingPart4.java b/src/openonyx/protocol/internal/internal/internal/internal/AccelerationSmoothingPart4.java new file mode 100644 index 0000000..f57f28f --- /dev/null +++ b/src/openonyx/protocol/internal/internal/internal/internal/AccelerationSmoothingPart4.java @@ -0,0 +1,16 @@ +package openonyx.protocol.internal.internal.internal.internal; + +import openonyx.history.SettingSection; +import openonyx.history.internal.NumberSetting; +import openonyx.history.internal.RangeSetting; + +class AccelerationSmoothingPart4 extends SettingSection { + private final NumberSetting distanceFactor = new NumberSetting("Distance factor", -1.393, -2.0, 2.0, 0.001) + .describe("How much the distance to the target scales the acceleration below"); + private final RangeSetting t = RangeSetting.of("Yaw crosshair acceleration", 17.0, 20.0, 1.0, 180.0).withSuffix("°/t²"); + private final RangeSetting t2 = RangeSetting.of("Pitch crosshair acceleration", 17.0, 20.0, 1.0, 180.0).withSuffix("°/t²"); + + AccelerationSmoothingPart4() { + super("Dynamic acceleration", false); + } +} diff --git a/src/openonyx/protocol/internal/internal/internal/internal/LinearSmoothing.java b/src/openonyx/protocol/internal/internal/internal/internal/LinearSmoothing.java new file mode 100644 index 0000000..e75ff59 --- /dev/null +++ b/src/openonyx/protocol/internal/internal/internal/internal/LinearSmoothing.java @@ -0,0 +1,27 @@ +package openonyx.protocol.internal.internal.internal.internal; + +import openonyx.history.internal.RangeSetting; +import openonyx.protocol.RotationRequest; +import openonyx.protocol.group_m.Angles; +import openonyx.protocol.internal.internal.internal.TurnSpeedSmoothing; +import openonyx.protocol.internal.internal.internal.Vec2; + +public class LinearSmoothing extends TurnSpeedSmoothing { + private final RangeSetting t; + private final RangeSetting t2; + + public LinearSmoothing() { + this(180.0F, 180.0F, 180.0F, 180.0F); + } + + @Override + public Vec2 L(RotationRequest rotationRequest, Angles angles, Angles angles1) { + return rotationRequest != null ? new Vec2(this.t.L(), this.t2.L()) : new Vec2(this.t.getLowFloat(), this.t2.getLowFloat()); + } + + public LinearSmoothing(float f, float g, float h, float i) { + super("Linear"); + this.t = RangeSetting.of("Horizontal turn speed", f, g, 0.0, 180.0).withSuffix("°/t"); + this.t2 = RangeSetting.of("Vertical turn speed", h, i, 0.0, 180.0).withSuffix("°/t"); + } +} diff --git a/src/openonyx/protocol/internal/internal/internal/internal/SigmoidSmoothing.java b/src/openonyx/protocol/internal/internal/internal/internal/SigmoidSmoothing.java new file mode 100644 index 0000000..9bfe348 --- /dev/null +++ b/src/openonyx/protocol/internal/internal/internal/internal/SigmoidSmoothing.java @@ -0,0 +1,45 @@ +package openonyx.protocol.internal.internal.internal.internal; + +import openonyx.history.internal.NumberSetting; +import openonyx.history.internal.RangeSetting; +import openonyx.protocol.RotationRequest; +import openonyx.protocol.group_d.RotationAngleMath; +import openonyx.protocol.group_m.Angles; +import openonyx.protocol.internal.internal.internal.TurnSpeedSmoothing; +import openonyx.protocol.internal.internal.internal.Vec2; + +public class SigmoidSmoothing extends TurnSpeedSmoothing { + private final RangeSetting t = RangeSetting.of("Horizontal turn speed", 180.0, 180.0, 0.0, 180.0).withSuffix("°/t"); + private final RangeSetting t2 = RangeSetting.of("Vertical turn speed", 180.0, 180.0, 0.0, 180.0).withSuffix("°/t"); + private final NumberSetting slowdownSharpness = new NumberSetting("Slowdown sharpness", 10.0, 0.0, 20.0, 0.1) + .describe("How abruptly the aim shifts between slow (near the target) and full speed (far from it)"); + private final NumberSetting halfSpeedDistance = new NumberSetting("Half speed distance", 0.3, 0.0, 1.0, 0.01) + .describe("Fraction of a 120° turn left to the target at which the aim moves at half speed"); + + private float L(float f, float g) { + double d = f / 120.0F; + return RotationAngleMath.L( + (float)(1.0 / (1.0 + Math.exp(-this.slowdownSharpness.getValue() * (d - this.halfSpeedDistance.getValue()))) * g), 0.0F, 180.0F + ); + } + + @Override + public Vec2 L(RotationRequest rotationRequest, Angles angles, Angles angles1) { + float f = angles.L(angles1); + float g; + float h; + if (rotationRequest != null) { + g = this.t.L(); + h = this.t2.L(); + } else { + g = this.t.getLowFloat(); + h = this.t2.getLowFloat(); + } + + return new Vec2(this.L(f, g), this.L(f, h)); + } + + public SigmoidSmoothing() { + super("Sigmoid"); + } +}