diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-26 06:35:54 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-26 06:35:54 +0300 |
| commit | f5f67b58d9b03945d1e22c797dd7f10e6048c4df (patch) | |
| tree | 0055012295b2b7f4998a692f6eedba107983aa32 /crates/fparkan-runtime/src/route_obstacles.rs | |
| parent | f0a92313d0628eda8e163ab0608ce8fcbedaad95 (diff) | |
| download | fparkan-f5f67b58d9b03945d1e22c797dd7f10e6048c4df.tar.xz fparkan-f5f67b58d9b03945d1e22c797dd7f10e6048c4df.zip | |
fix(production): wait for a clear ground release point
Validate stock completions from Single.01 with Vulkan validation and check produced hulls against live occupancy. The licensed long transport scenario still fails at storage unloading with both the previous and the new release point.
Diffstat (limited to 'crates/fparkan-runtime/src/route_obstacles.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/route_obstacles.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/crates/fparkan-runtime/src/route_obstacles.rs b/crates/fparkan-runtime/src/route_obstacles.rs index a5737399..fb029bd2 100644 --- a/crates/fparkan-runtime/src/route_obstacles.rs +++ b/crates/fparkan-runtime/src/route_obstacles.rs @@ -69,6 +69,12 @@ impl BuildingFootprints { .filter_map(|(_, _, footprint)| footprint.map(|bounds| bounds.expanded(radius))) .collect() } + + pub(super) fn for_handle(&self, handle: ObjectHandle) -> Option<Footprint> { + self.entries + .values() + .find_map(|&(owner, _, bounds)| (owner == handle).then_some(bounds).flatten()) + } } fn model_footprint( @@ -161,7 +167,7 @@ impl Footprint { true } - fn corners(self) -> [[f32; 2]; 4] { + pub(super) fn corners(self) -> [[f32; 2]; 4] { let Self { min: [x0, y0], max: [x1, y1], @@ -169,13 +175,17 @@ impl Footprint { [[x0, y0], [x0, y1], [x1, y0], [x1, y1]] } - fn exits(self, p: [f32; 2]) -> [[f32; 2]; 4] { + pub(super) fn exits(self, p: [f32; 2]) -> [[f32; 2]; 4] { let Self { min: [x0, y0], max: [x1, y1], } = self.expanded(CORNER_GAP); [[x0, p[1]], [x1, p[1]], [p[0], y0], [p[0], y1]] } + + pub(super) fn center(self) -> [f32; 2] { + std::array::from_fn(|axis| self.min[axis].midpoint(self.max[axis])) + } } fn distance(a: [f32; 2], b: [f32; 2]) -> f32 { |
