Add three art pilots and derive chassis envelopes from final models (#115 #114)

Keep authored JSON separate from generated output. Export rotated model bounds for SDK-free navigation and check grazing voxel corners. Include unretouched in-game before/after captures and explicit art/performance limits; pilots are an intermediate pass, not completion of the full asset set.

Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
2026-11-02 21:33:59 +03:00
parent 4a3500fdc0
commit 5620347ffe
39 changed files with 41310 additions and 3737 deletions
+99
View File
@@ -0,0 +1,99 @@
// Generated by tools/gen_models.py from the final staged models; do not edit.
pub fn bounds(id: &str) -> Option<([f64; 3], [f64; 3])> {
Some(match id {
"airdef:amraam_missile" => ([0.97, 0.97, -16.0], [15.03, 15.03, 25.9]),
"airdef:barge" => ([-16.0, 0.0, -16.0], [32.0, 6.5, 32.0]),
"airdef:beam" => ([6.5, 6.5, -16.0], [9.5, 9.5, 32.0]),
"airdef:buk_chassis" => ([-14.5, 0.0, -16.0], [30.5, 17.4, 32.0]),
"airdef:buk_chassis_burnt" => ([-14.5, 0.0, -16.0], [30.5, 17.4, 32.0]),
"airdef:buk_rails" => ([-12.0, 0.0, -16.0], [28.0, 7.5, 27.0]),
"airdef:buk_rails_burnt" => ([-12.0, 0.0, -16.0], [28.0, 7.5, 27.0]),
"airdef:buk_turret" => ([-4.0, 0.0, -10.0], [20.0, 14.0, 20.0]),
"airdef:buk_turret_burnt" => ([-4.0, 0.0, -10.0], [20.0, 14.0, 20.0]),
"airdef:debris" => ([2.0, 6.0, 3.0], [14.0, 9.0, 13.0]),
"airdef:depot" => ([-14.0, 0.0, -14.0], [30.0, 17.0, 30.0]),
"airdef:depot_burnt" => ([-14.0, 0.0, -14.0], [30.0, 17.0, 30.0]),
"airdef:ew_truck" => ([-9.0, -1.379664, -16.0], [25.0, 32.0, 33.379664]),
"airdef:ew_truck_burnt" => ([-9.0, -1.379664, -16.0], [25.0, 22.0, 33.379664]),
"airdef:fireball" => ([0.0, 0.0, 0.0], [16.0, 16.0, 16.0]),
"airdef:flame" => ([5.625, 5.625, -8.0], [10.375, 10.375, 26.0]),
"airdef:flare" => ([6.5, 6.5, 6.5], [9.5, 16.0, 9.5]),
"airdef:flash" => ([-4.0, -4.0, -4.0], [20.0, 20.0, 20.0]),
"airdef:gepard_dish" => ([-4.0, 0.0, 6.0], [20.0, 14.0, 8.0]),
"airdef:gepard_guns" => ([-9.0, 3.5, -16.0], [25.0, 9.0, 14.0]),
"airdef:gepard_guns_burnt" => ([-9.0, 3.5, -16.0], [25.0, 9.0, 14.0]),
"airdef:gepard_hull" => ([-14.5, 0.0, -15.0], [30.5, 17.2, 31.0]),
"airdef:gepard_hull_burnt" => ([-14.5, 0.0, -15.0], [30.5, 17.2, 31.0]),
"airdef:gepard_turret" => ([-5.745184, 0.0, -10.0], [21.745184, 18.0, 16.0]),
"airdef:gepard_turret_burnt" => ([-5.745184, 0.0, -10.0], [21.745184, 18.0, 16.0]),
"airdef:geran3" => ([-10.0, 4.341543, -16.0], [26.0, 17.005161, 29.9]),
"airdef:geran3_flame" => ([6.15, 6.15, 6.0], [9.85, 9.85, 24.0]),
"airdef:gerbera" => ([-9.0, 3.0, -15.0], [25.0, 13.0, 24.5]),
"airdef:irist_chassis" => ([-10.5, -1.379664, -16.379664], [26.5, 22.0, 32.0]),
"airdef:irist_chassis_burnt" => ([-10.5, -1.379664, -16.379664], [26.5, 22.0, 32.0]),
"airdef:irist_missile" => ([1.47, 1.47, -16.0], [14.53, 14.53, 23.9]),
"airdef:irist_tubes" => ([-2.5, 0.0, -16.0], [18.5, 9.0, 32.0]),
"airdef:irist_tubes_burnt" => ([-2.5, 0.0, -16.0], [18.5, 9.0, 32.0]),
"airdef:iskander" => ([-1.74, -1.74, -16.0], [17.74, 17.74, 29.9]),
"airdef:kalibr" => ([-6.0, 1.52, -16.0], [22.0, 14.48, 29.9]),
"airdef:kh101" => ([-12.5, 3.2, -16.0], [28.5, 16.0, 28.4]),
"airdef:kh22" => ([-10.0, -1.2, -16.0], [26.0, 17.2, 29.9]),
"airdef:kinzhal" => ([-3.06, -3.06, -16.0], [19.06, 19.06, 29.9]),
"airdef:lancet" => ([-1.40452, -1.40452, -16.0], [17.40452, 17.40452, 24.5]),
"airdef:launch_ramp" => ([1.0, 0.0, -12.708033], [15.0, 19.342915, 32.0]),
"airdef:launcher_truck" => ([-10.5, -1.379664, -16.379664], [26.5, 31.288582, 32.0]),
"airdef:m48n6" => ([0.09, 0.09, -16.0], [15.91, 15.91, 27.9]),
"airdef:m57e6" => ([1.47, 1.47, -16.0], [14.53, 14.53, 26.9]),
"airdef:m77n6" => ([0.82, 0.82, -16.0], [15.18, 15.18, 29.9]),
"airdef:nasams_launcher" => ([0.0, 0.0, -16.0], [16.0, 9.0, 32.0]),
"airdef:nasams_launcher_burnt" => ([0.0, 0.0, -16.0], [16.0, 9.0, 32.0]),
"airdef:nasams_trailer" => ([-9.0, -1.379664, -16.0], [25.0, 13.0, 26.0]),
"airdef:nasams_trailer_burnt" => ([-9.0, -1.379664, -16.0], [25.0, 13.0, 26.0]),
"airdef:p1sun" => ([-0.5, -0.5, -14.0], [16.5, 16.5, 10.0]),
"airdef:p1sun_launcher" => ([-0.5, 0.0, -16.0], [16.5, 7.0, 32.0]),
"airdef:p1sun_launcher_burnt" => ([-0.5, 0.0, -16.0], [16.5, 7.0, 32.0]),
"airdef:pac3" => ([1.47, 1.47, -16.0], [14.53, 14.53, 25.9]),
"airdef:pantsir_dish" => ([-6.5, -8.0, 7.0], [22.5, 16.5, 10.0]),
"airdef:pantsir_pack" => ([-11.0, 2.0, -16.0], [27.0, 15.0, 12.0]),
"airdef:pantsir_pack_burnt" => ([-11.0, 2.0, -16.0], [27.0, 15.0, 12.0]),
"airdef:pantsir_truck" => ([-10.5, -1.379664, -16.0], [26.5, 21.0, 33.379664]),
"airdef:pantsir_truck_burnt" => ([-10.5, -1.379664, -16.0], [26.5, 21.0, 33.379664]),
"airdef:pantsir_turret" => ([-2.12, 0.0, -11.0], [18.12, 17.0, 16.0]),
"airdef:pantsir_turret_burnt" => ([-2.12, 0.0, -11.0], [18.0, 17.0, 16.0]),
"airdef:patriot_launcher" => ([-8.0, 0.0, -14.0], [24.0, 19.0, 30.0]),
"airdef:patriot_launcher_burnt" => ([-8.0, 0.0, -14.0], [24.0, 19.0, 30.0]),
"airdef:patriot_radar" => ([-9.0, -1.410323, -10.0], [25.0, 30.0, 26.0]),
"airdef:patriot_trailer" => ([-10.0, -1.410323, -16.0], [26.0, 16.0, 33.010323]),
"airdef:patriot_trailer_burnt" => ([-10.0, -1.410323, -16.0], [26.0, 16.0, 33.010323]),
"airdef:patriot_truck" => ([-9.0, -1.410323, -16.0], [25.0, 25.0, 33.010323]),
"airdef:radar_panel" => ([-10.5, -6.0, 7.0], [26.5, 26.5, 12.0]),
"airdef:radar_trailer" => ([-9.0, -1.379664, -12.0], [25.0, 18.0, 26.379664]),
"airdef:radar_truck" => ([-10.5, -1.379664, -16.379664], [26.5, 22.0, 32.0]),
"airdef:radar_truck_burnt" => ([-10.5, -1.379664, -16.379664], [26.5, 22.0, 32.0]),
"airdef:reentry" => ([6.5, 6.5, -16.0], [9.5, 9.5, 32.0]),
"airdef:s400_chassis" => ([-10.5, 0.0, -16.460181], [26.5, 22.0, 32.0]),
"airdef:s400_chassis_burnt" => ([-10.5, 0.0, -16.460181], [26.5, 19.5, 32.0]),
"airdef:s400_tubes" => ([-0.5, 0.0, -16.0], [16.5, 15.0, 32.0]),
"airdef:s400_tubes_burnt" => ([-0.5, 0.0, -16.0], [16.5, 15.0, 32.0]),
"airdef:s500_chassis" => ([-10.5, -1.379664, -16.379664], [26.5, 22.0, 32.0]),
"airdef:s500_chassis_burnt" => ([-10.5, -1.379664, -16.379664], [26.5, 22.0, 32.0]),
"airdef:s500_tubes" => ([-3.0, 0.0, -16.0], [19.0, 9.5, 32.0]),
"airdef:s500_tubes_burnt" => ([-3.0, 0.0, -16.0], [19.0, 9.5, 32.0]),
"airdef:searchlight" => ([2.0, 0.0, 2.0], [14.0, 12.0, 14.0]),
"airdef:searchlight_burnt" => ([2.0, 0.0, 2.0], [14.0, 12.0, 14.0]),
"airdef:searchlight_head" => ([3.0, 3.0, -2.5], [13.0, 13.0, 14.0]),
"airdef:searchlight_head_burnt" => ([3.0, 3.0, -2.5], [13.0, 13.0, 14.0]),
"airdef:shahed" => ([-13.0, 4.73352, -16.0], [29.0, 13.2, 28.0]),
"airdef:shahed_prop" => ([-4.0, -4.0, 7.0], [20.0, 20.0, 9.5]),
"airdef:target" => ([2.0, -8.0, 2.0], [14.0, 24.0, 14.0]),
"airdef:tor_chassis" => ([-14.5, 0.0, -16.0], [30.5, 17.4, 32.0]),
"airdef:tor_chassis_burnt" => ([-14.5, 0.0, -16.0], [30.5, 17.4, 32.0]),
"airdef:tor_turret" => ([-4.0, 0.0, -11.0], [20.0, 17.5, 22.0]),
"airdef:tor_turret_burnt" => ([-4.0, 0.0, -11.0], [20.0, 17.5, 22.0]),
"airdef:tracer" => ([7.3, 7.3, -16.0], [8.7, 8.7, 32.0]),
"airdef:tzm_truck" => ([-9.0, -1.379664, -16.0], [25.0, 26.0, 33.379664]),
"airdef:tzm_truck_burnt" => ([-9.0, -1.379664, -16.0], [25.0, 26.0, 33.379664]),
"airdef:zircon" => ([0.16, 0.16, -16.0], [15.84, 15.84, 29.9]),
_ => return None,
})
}
+1
View File
@@ -10,6 +10,7 @@ use glam::{DQuat, DVec3};
use std::collections::HashMap;
pub mod catalog;
mod generated_bounds;
mod damage;
pub mod doctrine;
pub mod fires;
+33 -3
View File
@@ -81,7 +81,7 @@ struct Chassis {
impl Chassis {
fn for_kind(kind: SamKind) -> Self {
let (radius, height) = match kind.spec().family {
let (radius, height): (f64, f64) = match kind.spec().family {
Family::Trainable => (2.25, 3.0),
Family::Gun => (1.75, 3.0),
Family::Turret => (2.0, 3.25),
@@ -90,14 +90,27 @@ impl Chassis {
Family::Truck => (1.75, 2.75),
Family::Light => (1.25, 2.5),
};
// Rendered geometry may extend past the nominal family envelope (rotated wheels too).
// Read the generated bounds of the exact body rather than letting art silently shrink clearance.
let (radius, height) = match super::generated_bounds::bounds(kind.spec().parts.body) {
Some((lo, hi)) => {
let scale = kind.spec().scale / 16.0;
let half_x = (lo[0] - 8.0).abs().max((hi[0] - 8.0).abs()) * scale;
let half_z = (lo[2] - 8.0).abs().max((hi[2] - 8.0).abs()) * scale;
(radius.max(half_x.hypot(half_z) + 0.125), height.max(hi[1] * scale))
}
None => (radius, height), // Content validation rejects missing models before packaging.
};
Self { radius, height }
}
/// Integer voxel sample points inside the conservative footprint.
/// Every voxel whose square intersects the conservative footprint, including grazing corners.
fn samples(self) -> Vec<(i32, i32)> {
let r = self.radius.ceil() as i32;
(-r..=r).flat_map(|x| (-r..=r).filter_map(move |z| {
((x * x + z * z) as f64 <= self.radius * self.radius + 0.5).then_some((x, z))
let dx = (f64::from(x.abs()) - 0.5).max(0.0);
let dz = (f64::from(z.abs()) - 0.5).max(0.0);
(dx * dx + dz * dz <= self.radius * self.radius).then_some((x, z))
})).collect()
}
}
@@ -569,6 +582,23 @@ impl SamKind {
mod tests {
use super::*;
#[test]
fn gun_chassis_cannot_use_the_old_one_point_seven_five_block_radius() {
// The rendered Gepard hull alone is wider/longer than that nominal family circle.
assert!(Chassis::for_kind(SamKind::Gepard).radius > 2.5);
for kind in SamKind::ALL {
assert!(super::super::generated_bounds::bounds(kind.spec().parts.body).is_some(), "{kind:?}");
}
}
#[test]
fn footprint_checks_voxels_grazed_between_their_centres() {
let cells = Chassis { radius: 2.75, height: 3.0 }.samples();
assert!(cells.contains(&(3, 1)), "the body reaches the near corner of this voxel");
assert!(cells.contains(&(-3, -1)));
assert!(!cells.contains(&(3, 3)));
}
/// The land as the game would tell it: the height map, and under it the blocks that are solid.
struct Src<H: Fn(i32, i32) -> i32, B: Fn(i32, i32) -> i32> {
height: H,