Make dashback configurable, fix movement bugs, add double jump forward and back.

This commit is contained in:
2026-09-13 01:00:15 +02:00
parent ad105418be
commit 811578af2f
18 changed files with 774 additions and 154 deletions
+9
View File
@@ -141,6 +141,15 @@ impl FGSegment2d {
None
}
}
/// Returns a value representing the normalized position along the segment.
pub fn project_point_normalized(&self, point: FGVec2) -> FGi32 {
let segment_vector = self.point2 - self.point1;
let offset = point - self.point1;
// The signed projection of `offset` onto `segment_vector`, scaled by the length of the segment.
let projection_scaled = segment_vector.dot(offset);
FGi32::from_num(FGWide::from_num(projection_scaled) / segment_vector.length_squared())
}
}
#[cfg(test)]