Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge 1.19.2 into 1.20.1 #416

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ object EurekaConfig {

// Instability scaled with mass and squared speed
@JsonSchema(description = "Stronger stabilization with higher mass, less at higher speeds.")
var scaledInstability = 1000.0
var scaledInstability = 70.0

// Unscaled linear instability cased by speed
@JsonSchema(description = "Less stabilization at higher speed.")
var unscaledInstability = 0.271828
var unscaledInstability = 0.1

@JsonSchema(description = "How fast a ship will stop and accelerate.")
var linearMassScaling = 0.0002
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ fun stabilize(
)
)

stabilizationTorque.mul(EurekaConfig.SERVER.stabilizationTorqueConstant)
val speed = ship.velocity.length()

stabilizationTorque.mul(EurekaConfig.SERVER.stabilizationTorqueConstant / max(1.0, speed * speed * EurekaConfig.SERVER.scaledInstability / ship.mass + speed * EurekaConfig.SERVER.unscaledInstability))
forces.applyInvariantTorque(stabilizationTorque)

if (linear) {
Expand Down
Loading