Upload files to "src/openonyx/protocol/internal/internal/internal/internal"

This commit is contained in:
winterflyt committed 2026-11-30 06:06:52 +02:00
1 parent cfb35da36f
commit aa1b27bc7b
3 files changed
+88

No files matched your search

@@ -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);
}
}
@@ -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");
}
}
@@ -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");
}
}