use super::*;
/// Returns the exact local-space positions of the Lamborghini central high-mounted twin hexagonal exhaust pipe tips for millimeter-accurate exhaust flame attachment.
///
/// # Returns
///
/// - `[Vec3; 2]` - Local-space `[left_tip, right_tip]` exhaust pipe exit positions (`-Z` forward, `+Y` up).
#[must_use]
pub fn lamborghini_exhaust_tips_local() -> [Vec3; 2] {
[
Vec3::new(
LAMBORGHINI_EXHAUST_TIPS_XYZ[0][0],
LAMBORGHINI_EXHAUST_TIPS_XYZ[0][1],
LAMBORGHINI_EXHAUST_TIPS_XYZ[0][2],
),
Vec3::new(
LAMBORGHINI_EXHAUST_TIPS_XYZ[1][0],
LAMBORGHINI_EXHAUST_TIPS_XYZ[1][1],
LAMBORGHINI_EXHAUST_TIPS_XYZ[1][2],
),
]
}
/// Returns the exact local-space positions of the 2025/2026 Ford Mustang S650 outboard quad dual-pair exhaust pipe tips for millimeter-accurate exhaust flame attachment.
///
/// # Returns
///
/// - `[Vec3; 4]` - Local-space `[outer_left, inner_left, inner_right, outer_right]` exhaust pipe exit positions (`-Z` forward, `+Y` up).
#[must_use]
pub fn mustang_s650_exhaust_tips_local() -> [Vec3; 4] {
[
Vec3::new(
MUSTANG_S650_EXHAUST_TIPS_XYZ[0][0],
MUSTANG_S650_EXHAUST_TIPS_XYZ[0][1],
MUSTANG_S650_EXHAUST_TIPS_XYZ[0][2],
),
Vec3::new(
MUSTANG_S650_EXHAUST_TIPS_XYZ[1][0],
MUSTANG_S650_EXHAUST_TIPS_XYZ[1][1],
MUSTANG_S650_EXHAUST_TIPS_XYZ[1][2],
),
Vec3::new(
MUSTANG_S650_EXHAUST_TIPS_XYZ[2][0],
MUSTANG_S650_EXHAUST_TIPS_XYZ[2][1],
MUSTANG_S650_EXHAUST_TIPS_XYZ[2][2],
),
Vec3::new(
MUSTANG_S650_EXHAUST_TIPS_XYZ[3][0],
MUSTANG_S650_EXHAUST_TIPS_XYZ[3][1],
MUSTANG_S650_EXHAUST_TIPS_XYZ[3][2],
),
]
}
/// Returns the exact local-space wheel hub coordinates and rolling tire radius for the sculpted Lamborghini chassis.
///
/// # Returns
///
/// - `VehicleWheelLayout3D` - Four local-space wheel hub coordinates and nominal tire radius (`0.35m`).
#[must_use]
pub fn lamborghini_wheel_layout() -> VehicleWheelLayout3D {
VehicleWheelLayout3D::new(
Vec3::new(-0.87, 0.35, -1.39),
Vec3::new(0.87, 0.35, -1.39),
Vec3::new(-0.88, 0.35, 1.39),
Vec3::new(0.88, 0.35, 1.39),
0.35,
)
}
/// Returns the exact local-space wheel hub coordinates and rolling tire radius for the sculpted 2025/2026 Ford Mustang S650 chassis.
///
/// # Returns
///
/// - `VehicleWheelLayout3D` - Four local-space wheel hub coordinates and nominal tire radius (`0.355m`).
#[must_use]
pub fn mustang_s650_wheel_layout() -> VehicleWheelLayout3D {
VehicleWheelLayout3D::new(
Vec3::new(-0.82, 0.355, -1.36),
Vec3::new(0.82, 0.355, -1.36),
Vec3::new(-0.835, 0.355, 1.36),
Vec3::new(0.835, 0.355, 1.36),
0.355,
)
}
/// Returns the exact local-space wheel hub coordinates and rolling tire radius for an NPC (or hero) vehicle archetype.
///
/// # Arguments
///
/// - `SculptedVehicleKind` - Target vehicle silhouette archetype.
///
/// # Returns
///
/// - `VehicleWheelLayout3D` - Four local-space wheel hub coordinates and nominal tire radius.
#[must_use]
pub fn npc_wheel_layout(kind: SculptedVehicleKind) -> VehicleWheelLayout3D {
match kind {
SculptedVehicleKind::LamborghiniRevuelto => lamborghini_wheel_layout(),
SculptedVehicleKind::MustangS650 => mustang_s650_wheel_layout(),
SculptedVehicleKind::NpcSedan => VehicleWheelLayout3D::new(
Vec3::new(-0.80, 0.34, -1.38),
Vec3::new(0.80, 0.34, -1.38),
Vec3::new(-0.80, 0.34, 1.38),
Vec3::new(0.80, 0.34, 1.38),
0.34,
),
SculptedVehicleKind::NpcCoupe => VehicleWheelLayout3D::new(
Vec3::new(-0.815, 0.345, -1.32),
Vec3::new(0.815, 0.345, -1.32),
Vec3::new(-0.815, 0.345, 1.32),
Vec3::new(0.815, 0.345, 1.32),
0.345,
),
SculptedVehicleKind::NpcSuv => VehicleWheelLayout3D::new(
Vec3::new(-0.84, 0.39, -1.43),
Vec3::new(0.84, 0.39, -1.43),
Vec3::new(-0.84, 0.39, 1.43),
Vec3::new(0.84, 0.39, 1.43),
0.39,
),
}
}
/// Dispatches to the complete sculpted curved vehicle mesh builder matching `kind`.
///
/// # Arguments
///
/// - `SculptedVehicleKind` - Target hero supercar or modern NPC vehicle silhouette.
/// - `&str` - Asset name assigned to the generated mesh (falls back to default archetype name when empty).
/// - `PbrMaterial` - Primary exterior metallic clearcoat paint PBR material (`slot 0`).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, multi-material 3D vehicle mesh oriented along `-Z` forward and resting on `y = 0`.
#[must_use]
pub fn build_sculpted_vehicle(
kind: SculptedVehicleKind,
name: &str,
material: PbrMaterial,
) -> Mesh3D {
match kind {
SculptedVehicleKind::LamborghiniRevuelto => {
let resolved: &str = if name.is_empty() {
VEHICLE_DEFAULT_NAME_LAMBORGHINI
} else {
name
};
build_lamborghini_supercar(resolved, material)
}
SculptedVehicleKind::MustangS650 => {
let resolved: &str = if name.is_empty() {
VEHICLE_DEFAULT_NAME_MUSTANG
} else {
name
};
build_mustang_s650_supercar(resolved, material)
}
SculptedVehicleKind::NpcSedan => {
let resolved: &str = if name.is_empty() {
VEHICLE_DEFAULT_NAME_NPC_SEDAN
} else {
name
};
build_npc_sedan(resolved, material)
}
SculptedVehicleKind::NpcCoupe => {
let resolved: &str = if name.is_empty() {
VEHICLE_DEFAULT_NAME_NPC_COUPE
} else {
name
};
build_npc_coupe(resolved, material)
}
SculptedVehicleKind::NpcSuv => {
let resolved: &str = if name.is_empty() {
VEHICLE_DEFAULT_NAME_NPC_SUV
} else {
name
};
build_npc_suv(resolved, material)
}
}
}
/// Builds the PBR sub-material palette for the sculpted Lamborghini V12 supercar.
///
/// # Returns
///
/// - `Vec<PbrMaterial>` - Ten sub-materials aligned to `VEHICLE_SLOT_*` and `LAMBO_SLOT_*`.
#[must_use]
fn lamborghini_sub_materials() -> Vec<PbrMaterial> {
vec![
PbrMaterial::glass(Color::hex(0x0A1220), 0.04),
PbrMaterial::dielectric(Color::hex(0x111419), 0.86),
PbrMaterial::pbr(Color::hex(0x94A3B8), 0.88, 0.18, 0.66),
PbrMaterial::pbr(Color::hex(0x141820), 0.32, 0.28, 0.34),
PbrMaterial::neon(Color::hex(0xFF1744), 4.0),
PbrMaterial::neon(Color::hex(0xF8FCFF), 3.8),
PbrMaterial::dielectric(Color::hex(0x07090D), 0.94),
PbrMaterial::pbr(Color::hex(0xFACC15), 0.20, 0.20, 0.44),
PbrMaterial::metallic(Color::hex(0xD8E0EA), 0.16),
PbrMaterial::pbr(Color::hex(0xDC2626), 0.42, 0.24, 0.38),
]
}
/// Builds the PBR sub-material palette for the sculpted 2025/2026 Ford Mustang S650 supercar.
///
/// # Returns
///
/// - `Vec<PbrMaterial>` - Ten sub-materials aligned to `VEHICLE_SLOT_*` and `MUSTANG_SLOT_*`.
#[must_use]
fn mustang_s650_sub_materials() -> Vec<PbrMaterial> {
vec![
PbrMaterial::glass(Color::hex(0x0C1524), 0.05),
PbrMaterial::dielectric(Color::hex(0x111419), 0.86),
PbrMaterial::metallic(Color::hex(0xD0DCEB), 0.16),
PbrMaterial::pbr(Color::hex(0x131720), 0.28, 0.32, 0.28),
PbrMaterial::neon(Color::hex(0xFF1744), 4.2),
PbrMaterial::neon(Color::hex(0xF8FCFF), 4.0),
PbrMaterial::dielectric(Color::hex(0x07090D), 0.94),
PbrMaterial::pbr(Color::hex(0x090C12), 0.18, 0.08, 0.68),
PbrMaterial::pbr(Color::hex(0xE11D48), 0.24, 0.20, 0.42),
PbrMaterial::metallic(Color::hex(0x94A3B8), 0.14),
]
}
/// Builds the shared PBR sub-material palette for smooth curved modern NPC traffic vehicles.
///
/// # Returns
///
/// - `Vec<PbrMaterial>` - Eight sub-materials aligned to `VEHICLE_SLOT_*` and `NPC_SLOT_CHROME`.
#[must_use]
fn npc_vehicle_sub_materials() -> Vec<PbrMaterial> {
vec![
PbrMaterial::glass(Color::hex(0x0E1828), 0.06),
PbrMaterial::dielectric(Color::hex(0x12161B), 0.88),
PbrMaterial::metallic(Color::hex(0xCBD5E1), 0.20),
PbrMaterial::pbr(Color::hex(0x1C212B), 0.22, 0.40, 0.24),
PbrMaterial::neon(Color::hex(0xFF1F40), 3.2),
PbrMaterial::neon(Color::hex(0xFFF9EC), 3.0),
PbrMaterial::dielectric(Color::hex(0x080A0E), 0.94),
PbrMaterial::metallic(Color::hex(0xE2E8F0), 0.16),
]
}
/// Builds a high-contrast 5-slot standalone rotating wheel sub-material table so tires, metallic spokes, dark barrels, steel rotors, and rotational center-lock accents render crisply regardless of caller `SceneObject3D` primary material.
///
/// # Arguments
///
/// - `PbrMaterial` - Metallic forged alloy spoke and rim lip material.
/// - `PbrMaterial` - High-contrast center-lock cap and rotational marker accent material.
///
/// # Returns
///
/// - `Vec<PbrMaterial>` - Five sub-materials aligned to `WHEEL_STANDALONE_SLOT_*`.
#[must_use]
fn standalone_wheel_sub_materials(
rim_mat: PbrMaterial,
accent_mat: PbrMaterial,
) -> Vec<PbrMaterial> {
vec![
PbrMaterial::dielectric(Color::hex(0x111419), 0.86),
rim_mat,
PbrMaterial::dielectric(Color::hex(0x06080C), 0.92),
PbrMaterial::metallic(Color::hex(0x9AA7B8), 0.24),
accent_mat,
]
}
/// Appends the sculpted Lamborghini front carbon aero splitter, side dive-plane winglets, lower rocker skirts, and side air-intake ducts with curved painted blades.
///
/// # Arguments
///
/// - `&mut VehicleMeshBuilder` - Destination vehicle mesh builder.
fn append_lamborghini_aero_and_intakes(builder: &mut VehicleMeshBuilder) {
let splitter_spine: [Vec3; 5] = [
Vec3::new(-0.96, 0.15, -2.06),
Vec3::new(-0.62, 0.145, -2.38),
Vec3::new(0.0, 0.14, -2.465),
Vec3::new(0.62, 0.145, -2.38),
Vec3::new(0.96, 0.15, -2.06),
];
let splitter_radii: [(f32, f32); 5] = [
(0.055, 0.022),
(0.065, 0.024),
(0.072, 0.024),
(0.065, 0.024),
(0.055, 0.022),
];
builder.push_curved_tube(
&splitter_spine,
&splitter_radii,
Vec3::new(0.0, 1.0, 0.0),
6,
VEHICLE_SLOT_TRIM,
true,
);
let front_intake_spine: [Vec3; 5] = [
Vec3::new(-0.82, 0.26, -2.14),
Vec3::new(-0.46, 0.24, -2.37),
Vec3::new(0.0, 0.23, -2.42),
Vec3::new(0.46, 0.24, -2.37),
Vec3::new(0.82, 0.26, -2.14),
];
let front_intake_radii: [(f32, f32); 5] = [
(0.042, 0.065),
(0.045, 0.070),
(0.040, 0.060),
(0.045, 0.070),
(0.042, 0.065),
];
builder.push_curved_tube(
&front_intake_spine,
&front_intake_radii,
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_UNDERBODY,
true,
);
for side in [-1.0_f32, 1.0_f32] {
let winglet_spine: [Vec3; 3] = [
Vec3::new(side * 0.94, 0.16, -2.10),
Vec3::new(side * 1.01, 0.24, -1.96),
Vec3::new(side * 1.02, 0.34, -1.86),
];
builder.push_curved_tube(
&winglet_spine,
&[(0.018, 0.036), (0.016, 0.044), (0.014, 0.028)],
Vec3::new(side, 0.0, 0.0),
5,
VEHICLE_SLOT_TRIM,
true,
);
let skirt_spine: [Vec3; 4] = [
Vec3::new(side * 0.96, 0.16, -0.96),
Vec3::new(side * 0.95, 0.155, -0.25),
Vec3::new(side * 0.97, 0.165, 0.42),
Vec3::new(side * 1.01, 0.185, 0.94),
];
builder.push_curved_tube(
&skirt_spine,
&[
(0.048, 0.024),
(0.052, 0.024),
(0.056, 0.026),
(0.052, 0.030),
],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TRIM,
true,
);
let scoop_cavity: [Vec3; 3] = [
Vec3::new(side * 0.85, 0.48, 0.26),
Vec3::new(side * 0.87, 0.56, 0.58),
Vec3::new(side * 0.91, 0.62, 0.92),
];
builder.push_curved_tube(
&scoop_cavity,
&[(0.06, 0.15), (0.08, 0.19), (0.06, 0.14)],
Vec3::new(0.0, 1.0, 0.0),
6,
VEHICLE_SLOT_UNDERBODY,
true,
);
let intake_blade: [Vec3; 3] = [
Vec3::new(side * 0.92, 0.34, 0.28),
Vec3::new(side * 0.98, 0.56, 0.56),
Vec3::new(side * 0.99, 0.78, 0.86),
];
builder.push_curved_tube(
&intake_blade,
&[(0.026, 0.042), (0.028, 0.048), (0.022, 0.036)],
Vec3::new(side, 0.0, 0.0),
5,
VEHICLE_SLOT_BODY,
true,
);
}
}
/// Appends the sculpted Lamborghini signature Y-shaped emissive white LED DRL headlights, Y-shaped crimson LED taillights, exposed V12 engine bay plenums/valve covers, active swan-neck curved GT wing, multi-fin rear diffuser, and central twin hexagonal brushed-titanium exhaust tips.
///
/// # Arguments
///
/// - `&mut VehicleMeshBuilder` - Destination vehicle mesh builder.
fn append_lamborghini_lights_v12_and_rear(builder: &mut VehicleMeshBuilder) {
for side in [-1.0_f32, 1.0_f32] {
let housing_spine: [Vec3; 3] = [
Vec3::new(side * 0.50, 0.47, -2.23),
Vec3::new(side * 0.74, 0.55, -2.06),
Vec3::new(side * 0.90, 0.62, -1.84),
];
builder.push_curved_tube(
&housing_spine,
&[(0.045, 0.042), (0.056, 0.052), (0.040, 0.036)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TRIM,
true,
);
let y_hub: Vec3 = Vec3::new(side * 0.73, 0.565, -2.085);
let y_stem_outer: Vec3 = Vec3::new(side * 0.91, 0.645, -1.845);
let y_upper_arm: Vec3 = Vec3::new(side * 0.51, 0.505, -2.245);
let y_lower_arm: Vec3 = Vec3::new(side * 0.61, 0.445, -2.240);
builder.push_curved_tube(
&[y_stem_outer, y_hub],
&[(0.014, 0.015), (0.016, 0.017)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_HEADLIGHT,
true,
);
builder.push_curved_tube(
&[y_hub, y_upper_arm],
&[(0.016, 0.017), (0.013, 0.014)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_HEADLIGHT,
true,
);
builder.push_curved_tube(
&[y_hub, y_lower_arm],
&[(0.015, 0.016), (0.012, 0.013)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_HEADLIGHT,
true,
);
let tail_hub: Vec3 = Vec3::new(side * 0.64, 0.755, 2.415);
let tail_in: Vec3 = Vec3::new(side * 0.40, 0.755, 2.435);
let tail_up_out: Vec3 = Vec3::new(side * 0.85, 0.815, 2.385);
let tail_dn_out: Vec3 = Vec3::new(side * 0.85, 0.695, 2.385);
builder.push_curved_tube(
&[tail_in, tail_hub],
&[(0.016, 0.018), (0.018, 0.020)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TAILLIGHT,
true,
);
builder.push_curved_tube(
&[tail_hub, tail_up_out],
&[(0.017, 0.018), (0.014, 0.015)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TAILLIGHT,
true,
);
builder.push_curved_tube(
&[tail_hub, tail_dn_out],
&[(0.017, 0.018), (0.014, 0.015)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TAILLIGHT,
true,
);
let v12_plenum: [Vec3; 3] = [
Vec3::new(side * 0.16, 0.99, 0.92),
Vec3::new(side * 0.16, 0.96, 1.38),
Vec3::new(side * 0.15, 0.92, 1.82),
];
builder.push_curved_tube(
&v12_plenum,
&[(0.068, 0.042), (0.072, 0.046), (0.062, 0.038)],
Vec3::new(0.0, 1.0, 0.0),
6,
LAMBO_SLOT_TITANIUM,
true,
);
let v12_valve: [Vec3; 3] = [
Vec3::new(side * 0.30, 0.965, 0.96),
Vec3::new(side * 0.30, 0.935, 1.38),
Vec3::new(side * 0.28, 0.895, 1.78),
];
builder.push_curved_tube(
&v12_valve,
&[(0.045, 0.030), (0.048, 0.032), (0.042, 0.028)],
Vec3::new(0.0, 1.0, 0.0),
5,
LAMBO_SLOT_ENGINE_RED,
true,
);
}
for (lz, ly, lw) in [
(0.96_f32, 1.045_f32, 0.38_f32),
(1.30_f32, 1.005_f32, 0.40_f32),
(1.64_f32, 0.965_f32, 0.39_f32),
] {
let louver_spine: [Vec3; 3] = [
Vec3::new(-lw, ly - 0.015, lz),
Vec3::new(0.0, ly + 0.012, lz - 0.02),
Vec3::new(lw, ly - 0.015, lz),
];
builder.push_curved_tube(
&louver_spine,
&[(0.032, 0.012), (0.036, 0.014), (0.032, 0.012)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TRIM,
true,
);
}
let rear_grille_spine: [Vec3; 3] = [
Vec3::new(-0.84, 0.72, 2.39),
Vec3::new(0.0, 0.73, 2.41),
Vec3::new(0.84, 0.72, 2.39),
];
builder.push_curved_tube(
&rear_grille_spine,
&[(0.045, 0.11), (0.055, 0.12), (0.045, 0.11)],
Vec3::new(0.0, 1.0, 0.0),
6,
VEHICLE_SLOT_UNDERBODY,
true,
);
let exhaust_bezel: [Vec3; 3] = [
Vec3::new(-0.34, 0.56, 2.39),
Vec3::new(0.0, 0.56, 2.41),
Vec3::new(0.34, 0.56, 2.39),
];
builder.push_curved_tube(
&exhaust_bezel,
&[(0.048, 0.095), (0.056, 0.102), (0.048, 0.095)],
Vec3::new(0.0, 1.0, 0.0),
6,
VEHICLE_SLOT_TRIM,
true,
);
let tips: [Vec3; 2] = lamborghini_exhaust_tips_local();
for tip in tips.into_iter() {
builder.push_exhaust_pipe_tip(
tip,
0.16,
(0.092, 0.070),
6,
(LAMBO_SLOT_TITANIUM, VEHICLE_SLOT_UNDERBODY),
);
}
let diffuser_spine: [Vec3; 5] = [
Vec3::new(-0.84, 0.27, 2.28),
Vec3::new(-0.46, 0.24, 2.38),
Vec3::new(0.0, 0.23, 2.41),
Vec3::new(0.46, 0.24, 2.38),
Vec3::new(0.84, 0.27, 2.28),
];
builder.push_curved_tube(
&diffuser_spine,
&[
(0.07, 0.085),
(0.08, 0.095),
(0.085, 0.10),
(0.08, 0.095),
(0.07, 0.085),
],
Vec3::new(0.0, 1.0, 0.0),
6,
VEHICLE_SLOT_TRIM,
true,
);
for fin_x in [-0.58_f32, -0.22_f32, 0.22_f32, 0.58_f32] {
let fin_spine: [Vec3; 3] = [
Vec3::new(fin_x, 0.17, 2.16),
Vec3::new(fin_x, 0.22, 2.34),
Vec3::new(fin_x, 0.30, 2.44),
];
builder.push_curved_tube(
&fin_spine,
&[(0.015, 0.060), (0.016, 0.075), (0.012, 0.055)],
Vec3::new(0.0, 1.0, 0.0),
4,
VEHICLE_SLOT_TRIM,
true,
);
}
let wing_spine: [Vec3; 5] = [
Vec3::new(-0.98, 1.135, 2.22),
Vec3::new(-0.50, 1.168, 2.20),
Vec3::new(0.0, 1.182, 2.19),
Vec3::new(0.50, 1.168, 2.20),
Vec3::new(0.98, 1.135, 2.22),
];
builder.push_curved_tube(
&wing_spine,
&[
(0.135, 0.020),
(0.155, 0.023),
(0.165, 0.025),
(0.155, 0.023),
(0.135, 0.020),
],
Vec3::new(0.0, 1.0, 0.0),
6,
VEHICLE_SLOT_TRIM,
true,
);
for side in [-1.0_f32, 1.0_f32] {
let pylon_spine: [Vec3; 4] = [
Vec3::new(side * 0.42, 0.91, 1.94),
Vec3::new(side * 0.44, 1.05, 2.04),
Vec3::new(side * 0.45, 1.19, 2.12),
Vec3::new(side * 0.45, 1.17, 2.20),
];
builder.push_curved_tube(
&pylon_spine,
&[
(0.022, 0.042),
(0.020, 0.044),
(0.018, 0.036),
(0.018, 0.032),
],
Vec3::new(side, 0.0, 0.0),
5,
VEHICLE_SLOT_TRIM,
true,
);
let endplate_spine: [Vec3; 3] = [
Vec3::new(side * 0.99, 1.05, 2.12),
Vec3::new(side * 1.00, 1.14, 2.22),
Vec3::new(side * 0.99, 1.21, 2.30),
];
builder.push_curved_tube(
&endplate_spine,
&[(0.014, 0.065), (0.016, 0.085), (0.012, 0.055)],
Vec3::new(side, 0.0, 0.0),
5,
VEHICLE_SLOT_TRIM,
true,
);
}
}
/// Populates a `VehicleMeshBuilder` with the sculpted Lamborghini chassis bodywork, canopy, V12 bay, lights, aero, exhausts, mirrors, and curved fender arches, optionally baking static wheels or stationary brake calipers.
///
/// # Arguments
///
/// - `&mut VehicleMeshBuilder` - Destination mesh builder.
/// - `bool` - When `true`, bakes all four static wheels into the mesh; when `false`, leaves carved wheel arches open with stationary brake calipers for dynamic rotating/steering wheel objects.
fn populate_lamborghini_chassis(builder: &mut VehicleMeshBuilder, include_wheels: bool) {
let front_wheel: WheelArchSpec =
WheelArchSpec::new(0.87, -1.39, 0.35, 0.25, 0.30, 0.055, 0.046);
let rear_wheel: WheelArchSpec = WheelArchSpec::new(0.88, 1.39, 0.35, 0.25, 0.36, 0.075, 0.050);
let body_controls: [BodyStation; 9] = [
BodyStation::from_profile(
-2.40,
[0.14, 0.19, 0.33, 0.39, 0.38],
[0.48, 0.66, 0.72, 0.58],
(-0.015, 0.0),
),
BodyStation::from_profile(
-2.02,
[0.13, 0.20, 0.52, 0.58, 0.56],
[0.76, 0.90, 0.95, 0.80],
(-0.025, 0.0),
),
BodyStation::from_profile(
-1.39,
[0.12, 0.20, 0.74, 0.79, 0.72],
[0.84, 0.94, 0.96, 0.84],
(-0.030, 0.0),
),
BodyStation::from_profile(
-0.78,
[0.12, 0.20, 0.73, 0.78, 0.76],
[0.84, 0.93, 0.94, 0.83],
(-0.015, 0.04),
),
BodyStation::from_profile(
-0.10,
[0.12, 0.20, 0.76, 0.82, 0.80],
[0.84, 0.93, 0.93, 0.82],
(0.0, 0.09),
),
BodyStation::from_profile(
0.58,
[0.13, 0.22, 0.83, 0.89, 0.87],
[0.86, 0.95, 0.98, 0.86],
(0.0, 0.15),
),
BodyStation::from_profile(
1.39,
[0.15, 0.25, 0.87, 0.94, 0.90],
[0.86, 0.96, 0.98, 0.88],
(-0.015, 0.03),
),
BodyStation::from_profile(
2.02,
[0.21, 0.31, 0.86, 0.92, 0.88],
[0.82, 0.92, 0.97, 0.84],
(-0.015, 0.0),
),
BodyStation::from_profile(
2.39,
[0.32, 0.40, 0.82, 0.87, 0.85],
[0.72, 0.84, 0.90, 0.76],
(-0.010, 0.0),
),
];
builder.push_curved_body_shell(
&body_controls,
2,
(front_wheel, rear_wheel),
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_UNDERBODY, VEHICLE_SLOT_TRIM),
true,
);
let canopy_controls: [CanopyStation; 6] = [
CanopyStation::from_profile(
-0.96,
[0.71, 0.75, 0.77],
[0.75, 0.62],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
-0.34,
[0.75, 1.08, 1.13],
[0.78, 0.56],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
0.12,
[0.78, 1.11, 1.16],
[0.78, 0.55],
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
0.58,
[0.82, 1.08, 1.13],
[0.76, 0.50],
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
1.36,
[0.86, 0.99, 1.03],
[0.66, 0.44],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_BODY),
),
CanopyStation::from_profile(
2.10,
[0.85, 0.91, 0.93],
[0.54, 0.36],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_BODY),
),
];
builder.push_curved_canopy(&canopy_controls, 2, VEHICLE_SLOT_UNDERBODY);
append_lamborghini_aero_and_intakes(builder);
append_lamborghini_lights_v12_and_rear(builder);
builder.push_aerodynamic_mirrors((0.86, 0.80, -0.44), (VEHICLE_SLOT_BODY, VEHICLE_SLOT_TRIM));
for side in [-1.0_f32, 1.0_f32] {
builder.push_curved_fender_arch(
front_wheel,
side,
VEHICLE_HERO_ARCH_SEGS,
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_UNDERBODY),
);
builder.push_curved_fender_arch(
rear_wheel,
side,
VEHICLE_HERO_ARCH_SEGS,
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_UNDERBODY),
);
let front_hub: Vec3 = Vec3::new(
side * front_wheel.get_center_x(),
front_wheel.get_tire_radius(),
front_wheel.get_center_z(),
);
let rear_hub: Vec3 = Vec3::new(
side * rear_wheel.get_center_x(),
rear_wheel.get_tire_radius(),
rear_wheel.get_center_z(),
);
if include_wheels {
builder.push_sculpted_wheel(
front_hub,
(
front_wheel.get_tire_radius(),
front_wheel.get_rim_radius(),
front_wheel.get_tire_width(),
),
VEHICLE_HERO_WHEEL_SEGS,
(
VEHICLE_SLOT_TIRE,
VEHICLE_SLOT_RIM,
LAMBO_SLOT_TITANIUM,
LAMBO_SLOT_CALIPER,
),
WheelSpokePattern::LamborghiniY10,
);
builder.push_sculpted_wheel(
rear_hub,
(
rear_wheel.get_tire_radius(),
rear_wheel.get_rim_radius(),
rear_wheel.get_tire_width(),
),
VEHICLE_HERO_WHEEL_SEGS,
(
VEHICLE_SLOT_TIRE,
VEHICLE_SLOT_RIM,
LAMBO_SLOT_TITANIUM,
LAMBO_SLOT_CALIPER,
),
WheelSpokePattern::LamborghiniY10,
);
} else {
builder.push_static_brake_caliper(
front_hub,
(front_wheel.get_rim_radius(), front_wheel.get_tire_width()),
LAMBO_SLOT_CALIPER,
);
builder.push_static_brake_caliper(
rear_hub,
(rear_wheel.get_rim_radius(), rear_wheel.get_tire_width()),
LAMBO_SLOT_CALIPER,
);
}
}
}
/// Builds an ultra-sculpted authentic Lamborghini (Revuelto / Aventador SVJ V12 DNA) complete supercar mesh (`~4.95m x 2.06m x 1.16m`, wheelbase `2.78m`) with continuous Catmull-Rom lofted bodywork, smooth vertex normals, carved wheel arches, teardrop canopy, exposed V12 engine bay, signature Y-shaped LED headlights and taillights, swan-neck curved GT wing, multi-fin carbon diffuser, central twin hexagonal brushed-titanium exhaust tips, and concave 10-spoke Y-pattern wheels.
///
/// # Arguments
///
/// - `&str` - Human-readable mesh name.
/// - `PbrMaterial` - Primary metallic clearcoat paint PBR material (`slot 0`).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, multi-material Lamborghini supercar mesh.
#[must_use]
pub fn build_lamborghini_supercar(name: &str, material: PbrMaterial) -> Mesh3D {
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(2800, 4200);
populate_lamborghini_chassis(&mut builder, true);
builder.finish(name, material, lamborghini_sub_materials())
}
/// Builds the wheel-less sculpted Lamborghini chassis mesh with open carved wheel arches and stationary yellow 6-piston brake calipers, ready to pair with four dynamic rotating/steering `build_lamborghini_wheel_mesh` instances placed at `lamborghini_wheel_layout()`.
///
/// # Arguments
///
/// - `&str` - Human-readable chassis mesh name.
/// - `PbrMaterial` - Primary metallic clearcoat paint PBR material (`slot 0`).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, wheel-less Lamborghini chassis mesh.
#[must_use]
pub fn build_lamborghini_chassis_mesh(name: &str, material: PbrMaterial) -> Mesh3D {
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(2000, 2900);
populate_lamborghini_chassis(&mut builder, false);
builder.finish(name, material, lamborghini_sub_materials())
}
/// Builds a standalone high-contrast Lamborghini 10-spoke Y-pattern forged wheel mesh centered at `(0, 0, 0)` with axle along local `X` (`radius = 0.35m`), bilateral concave rims, drilled brake rotors, and Giallo center-lock rotation accent for unmistakably crisp spinning and steering on all four corners.
///
/// # Arguments
///
/// - `&str` - Human-readable wheel mesh name (falls back to default Lamborghini wheel name when empty).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, standalone Lamborghini rotating wheel mesh.
#[must_use]
pub fn build_lamborghini_wheel_mesh(name: &str) -> Mesh3D {
let resolved: &str = if name.is_empty() {
VEHICLE_DEFAULT_WHEEL_LAMBORGHINI
} else {
name
};
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(520, 760);
builder.push_standalone_rotating_wheel(
(0.35, 0.25, 0.33),
VEHICLE_HERO_WHEEL_SEGS,
(
WHEEL_STANDALONE_SLOT_TIRE,
WHEEL_STANDALONE_SLOT_RIM,
WHEEL_STANDALONE_SLOT_BARREL,
WHEEL_STANDALONE_SLOT_ROTOR,
WHEEL_STANDALONE_SLOT_ACCENT,
),
WheelSpokePattern::LamborghiniY10,
);
let sub_mats: Vec<PbrMaterial> = standalone_wheel_sub_materials(
PbrMaterial::metallic(Color::hex(0xD8E2EE), 0.16),
PbrMaterial::pbr(Color::hex(0xFACC15), 0.20, 0.20, 0.44),
);
builder.finish(
resolved,
PbrMaterial::dielectric(Color::hex(0x111419), 0.86),
sub_mats,
)
}
/// Appends the authentic 2025/2026 Ford Mustang S650 trapezoidal dark-mesh front grille, lower aero brake ducts, chin splitter, domed hood heat extractor vent, and signature tri-bar LED DRL brow + triple-projector headlamps.
///
/// # Arguments
///
/// - `&mut VehicleMeshBuilder` - Destination vehicle mesh builder.
fn append_mustang_s650_front_and_hood(builder: &mut VehicleMeshBuilder) {
let chin_spine: [Vec3; 5] = [
Vec3::new(-0.88, 0.175, -2.14),
Vec3::new(-0.56, 0.170, -2.35),
Vec3::new(0.0, 0.165, -2.40),
Vec3::new(0.56, 0.170, -2.35),
Vec3::new(0.88, 0.175, -2.14),
];
builder.push_curved_tube(
&chin_spine,
&[
(0.048, 0.022),
(0.056, 0.024),
(0.062, 0.024),
(0.056, 0.024),
(0.048, 0.022),
],
Vec3::new(0.0, 1.0, 0.0),
6,
VEHICLE_SLOT_TRIM,
true,
);
let grille_frame_top: [Vec3; 3] = [
Vec3::new(-0.54, 0.67, -2.36),
Vec3::new(0.0, 0.69, -2.40),
Vec3::new(0.54, 0.67, -2.36),
];
let grille_frame_bot: [Vec3; 3] = [
Vec3::new(-0.46, 0.43, -2.37),
Vec3::new(0.0, 0.42, -2.40),
Vec3::new(0.46, 0.43, -2.37),
];
let grille_core: [Vec3; 3] = [
Vec3::new(-0.49, 0.55, -2.355),
Vec3::new(0.0, 0.555, -2.388),
Vec3::new(0.49, 0.55, -2.355),
];
builder.push_curved_tube(
&grille_core,
&[(0.042, 0.12), (0.048, 0.135), (0.042, 0.12)],
Vec3::new(0.0, 1.0, 0.0),
6,
VEHICLE_SLOT_UNDERBODY,
true,
);
builder.push_curved_tube(
&grille_frame_top,
&[(0.024, 0.020), (0.026, 0.022), (0.024, 0.020)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TRIM,
true,
);
builder.push_curved_tube(
&grille_frame_bot,
&[(0.024, 0.020), (0.026, 0.022), (0.024, 0.020)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TRIM,
true,
);
let pony_bar: [Vec3; 3] = [
Vec3::new(-0.11, 0.56, -2.405),
Vec3::new(0.0, 0.565, -2.418),
Vec3::new(0.11, 0.56, -2.405),
];
builder.push_curved_tube(
&pony_bar,
&[(0.012, 0.018), (0.015, 0.026), (0.012, 0.018)],
Vec3::new(0.0, 1.0, 0.0),
5,
MUSTANG_SLOT_DARK_CHROME,
true,
);
let hood_vent_frame: [Vec3; 3] = [
Vec3::new(-0.24, 0.985, -1.28),
Vec3::new(0.0, 1.002, -1.32),
Vec3::new(0.24, 0.985, -1.28),
];
builder.push_curved_tube(
&hood_vent_frame,
&[(0.18, 0.022), (0.21, 0.024), (0.18, 0.022)],
Vec3::new(0.0, 1.0, 0.0),
6,
VEHICLE_SLOT_TRIM,
true,
);
for louver_z in [-1.42_f32, -1.28_f32, -1.14_f32] {
let vent_slat: [Vec3; 3] = [
Vec3::new(-0.21, 0.996, louver_z),
Vec3::new(0.0, 1.012, louver_z - 0.01),
Vec3::new(0.21, 0.996, louver_z),
];
builder.push_curved_tube(
&vent_slat,
&[(0.022, 0.012), (0.024, 0.013), (0.022, 0.012)],
Vec3::new(0.0, 1.0, 0.0),
4,
VEHICLE_SLOT_UNDERBODY,
true,
);
}
for side in [-1.0_f32, 1.0_f32] {
let lower_duct: [Vec3; 2] = [
Vec3::new(side * 0.56, 0.35, -2.34),
Vec3::new(side * 0.79, 0.38, -2.23),
];
builder.push_curved_tube(
&lower_duct,
&[(0.040, 0.075), (0.036, 0.068)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_UNDERBODY,
true,
);
let lamp_bezel: [Vec3; 3] = [
Vec3::new(side * 0.56, 0.685, -2.35),
Vec3::new(side * 0.72, 0.705, -2.27),
Vec3::new(side * 0.85, 0.720, -2.14),
];
builder.push_curved_tube(
&lamp_bezel,
&[(0.042, 0.048), (0.048, 0.052), (0.036, 0.040)],
Vec3::new(0.0, 1.0, 0.0),
5,
MUSTANG_SLOT_GLOSS_BLACK,
true,
);
let drl_brow: [Vec3; 3] = [
Vec3::new(side * 0.57, 0.715, -2.372),
Vec3::new(side * 0.72, 0.730, -2.295),
Vec3::new(side * 0.84, 0.738, -2.175),
];
builder.push_curved_tube(
&drl_brow,
&[(0.012, 0.014), (0.013, 0.015), (0.011, 0.012)],
Vec3::new(0.0, 1.0, 0.0),
4,
VEHICLE_SLOT_HEADLIGHT,
true,
);
for bar_i in 0..3usize {
let frac: f32 = (bar_i as f32) / 2.0;
let bx: f32 = side * (0.58 + frac * 0.18);
let bz: f32 = -2.368 + frac * 0.115;
let bar_spine: [Vec3; 2] = [
Vec3::new(bx, 0.655, bz),
Vec3::new(bx + side * 0.02, 0.712, bz - 0.008),
];
builder.push_curved_tube(
&bar_spine,
&[(0.013, 0.016), (0.013, 0.016)],
Vec3::new(0.0, 0.0, -1.0),
4,
VEHICLE_SLOT_HEADLIGHT,
true,
);
}
}
}
/// Appends the authentic 2025/2026 Ford Mustang S650 recessed gloss-black concave rear decklid panel, signature 3-blade glowing crimson tri-bar taillights per side, sculpted multi-fin rear diffuser, quad outboard dark-chrome exhaust tips, and curved Dark Horse performance decklid spoiler.
///
/// # Arguments
///
/// - `&mut VehicleMeshBuilder` - Destination vehicle mesh builder.
fn append_mustang_s650_rear_and_exhaust(builder: &mut VehicleMeshBuilder) {
let decklid_panel: [Vec3; 5] = [
Vec3::new(-0.84, 0.79, 2.34),
Vec3::new(-0.44, 0.79, 2.355),
Vec3::new(0.0, 0.79, 2.325),
Vec3::new(0.44, 0.79, 2.355),
Vec3::new(0.84, 0.79, 2.34),
];
builder.push_curved_tube(
&decklid_panel,
&[
(0.036, 0.105),
(0.042, 0.115),
(0.040, 0.110),
(0.042, 0.115),
(0.036, 0.105),
],
Vec3::new(0.0, 1.0, 0.0),
6,
MUSTANG_SLOT_GLOSS_BLACK,
true,
);
for side in [-1.0_f32, 1.0_f32] {
for bar_i in 0..3usize {
let bx: f32 = side * (0.48 + (bar_i as f32) * 0.15);
let bz: f32 = 2.378 - (bar_i as f32) * 0.010;
let tri_bar: [Vec3; 3] = [
Vec3::new(bx - side * 0.015, 0.70, bz + 0.012),
Vec3::new(bx, 0.79, bz - 0.012),
Vec3::new(bx + side * 0.015, 0.88, bz + 0.014),
];
builder.push_curved_tube(
&tri_bar,
&[(0.022, 0.016), (0.024, 0.018), (0.022, 0.016)],
Vec3::new(0.0, 0.0, 1.0),
5,
VEHICLE_SLOT_TAILLIGHT,
true,
);
}
}
let diffuser_spine: [Vec3; 5] = [
Vec3::new(-0.82, 0.29, 2.29),
Vec3::new(-0.46, 0.28, 2.35),
Vec3::new(0.0, 0.27, 2.37),
Vec3::new(0.46, 0.28, 2.35),
Vec3::new(0.82, 0.29, 2.29),
];
builder.push_curved_tube(
&diffuser_spine,
&[
(0.055, 0.085),
(0.065, 0.092),
(0.070, 0.095),
(0.065, 0.092),
(0.055, 0.085),
],
Vec3::new(0.0, 1.0, 0.0),
6,
VEHICLE_SLOT_TRIM,
true,
);
for fin_x in [-0.24_f32, -0.08_f32, 0.08_f32, 0.24_f32] {
let fin_spine: [Vec3; 2] = [Vec3::new(fin_x, 0.21, 2.24), Vec3::new(fin_x, 0.29, 2.40)];
builder.push_curved_tube(
&fin_spine,
&[(0.014, 0.055), (0.012, 0.050)],
Vec3::new(0.0, 1.0, 0.0),
4,
VEHICLE_SLOT_TRIM,
true,
);
}
let quad_tips: [Vec3; 4] = mustang_s650_exhaust_tips_local();
for tip in quad_tips.into_iter() {
builder.push_exhaust_pipe_tip(
tip,
0.16,
(0.056, 0.056),
10,
(MUSTANG_SLOT_DARK_CHROME, VEHICLE_SLOT_UNDERBODY),
);
}
let spoiler_spine: [Vec3; 5] = [
Vec3::new(-0.84, 1.015, 2.25),
Vec3::new(-0.44, 1.040, 2.24),
Vec3::new(0.0, 1.050, 2.235),
Vec3::new(0.44, 1.040, 2.24),
Vec3::new(0.84, 1.015, 2.25),
];
builder.push_curved_tube(
&spoiler_spine,
&[
(0.095, 0.018),
(0.115, 0.022),
(0.120, 0.024),
(0.115, 0.022),
(0.095, 0.018),
],
Vec3::new(0.0, 1.0, 0.0),
6,
MUSTANG_SLOT_GLOSS_BLACK,
true,
);
for side in [-1.0_f32, 1.0_f32] {
let post_spine: [Vec3; 2] = [
Vec3::new(side * 0.58, 0.945, 2.20),
Vec3::new(side * 0.58, 1.032, 2.24),
];
builder.push_curved_tube(
&post_spine,
&[(0.026, 0.048), (0.022, 0.042)],
Vec3::new(side, 0.0, 0.0),
5,
MUSTANG_SLOT_GLOSS_BLACK,
true,
);
}
}
/// Populates a `VehicleMeshBuilder` with the sculpted 2025/2026 Ford Mustang S650 chassis bodywork, fastback canopy, front grille/hood vent, concave rear decklid/tri-bar lights, quad exhausts, spoiler, mirrors, and curved fender arches, optionally baking static wheels or stationary red Brembo brake calipers.
///
/// # Arguments
///
/// - `&mut VehicleMeshBuilder` - Destination mesh builder.
/// - `bool` - When `true`, bakes all four static wheels into the mesh; when `false`, leaves carved wheel arches open with stationary red Brembo calipers for dynamic rotating/steering wheel objects.
fn populate_mustang_s650_chassis(builder: &mut VehicleMeshBuilder, include_wheels: bool) {
let front_wheel: WheelArchSpec =
WheelArchSpec::new(0.82, -1.36, 0.355, 0.25, 0.28, 0.046, 0.046);
let rear_wheel: WheelArchSpec =
WheelArchSpec::new(0.835, 1.36, 0.355, 0.25, 0.31, 0.068, 0.048);
let body_controls: [BodyStation; 9] = [
BodyStation::from_profile(
-2.35,
[0.17, 0.22, 0.66, 0.77, 0.79],
[0.64, 0.78, 0.83, 0.74],
(0.025, 0.0),
),
BodyStation::from_profile(
-1.96,
[0.16, 0.22, 0.74, 0.86, 0.88],
[0.76, 0.86, 0.90, 0.80],
(0.045, 0.0),
),
BodyStation::from_profile(
-1.36,
[0.16, 0.22, 0.79, 0.91, 0.93],
[0.80, 0.88, 0.90, 0.82],
(0.058, 0.0),
),
BodyStation::from_profile(
-0.58,
[0.16, 0.22, 0.82, 0.94, 0.96],
[0.80, 0.88, 0.90, 0.82],
(0.035, 0.02),
),
BodyStation::from_profile(
0.18,
[0.16, 0.22, 0.84, 0.95, 0.95],
[0.80, 0.87, 0.89, 0.81],
(0.0, 0.055),
),
BodyStation::from_profile(
0.86,
[0.17, 0.23, 0.89, 0.99, 0.98],
[0.81, 0.89, 0.93, 0.84],
(0.0, 0.02),
),
BodyStation::from_profile(
1.36,
[0.18, 0.26, 0.92, 1.01, 0.99],
[0.81, 0.90, 0.92, 0.84],
(0.010, 0.0),
),
BodyStation::from_profile(
1.96,
[0.22, 0.31, 0.90, 0.98, 0.97],
[0.78, 0.87, 0.92, 0.82],
(0.010, 0.0),
),
BodyStation::from_profile(
2.34,
[0.26, 0.34, 0.84, 0.94, 0.94],
[0.72, 0.82, 0.88, 0.78],
(0.0, 0.0),
),
];
builder.push_curved_body_shell(
&body_controls,
2,
(front_wheel, rear_wheel),
(
VEHICLE_SLOT_BODY,
VEHICLE_SLOT_UNDERBODY,
MUSTANG_SLOT_GLOSS_BLACK,
),
true,
);
let canopy_controls: [CanopyStation; 6] = [
CanopyStation::from_profile(
-0.68,
[0.91, 0.96, 0.98],
[0.76, 0.66],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
-0.06,
[0.93, 1.31, 1.36],
[0.77, 0.58],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
0.44,
[0.94, 1.34, 1.39],
[0.77, 0.58],
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
0.98,
[0.96, 1.27, 1.32],
[0.75, 0.56],
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
1.64,
[0.96, 1.10, 1.13],
[0.72, 0.54],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_BODY),
),
CanopyStation::from_profile(
2.16,
[0.93, 0.96, 0.98],
[0.68, 0.52],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_BODY),
),
];
builder.push_curved_canopy(&canopy_controls, 2, VEHICLE_SLOT_UNDERBODY);
append_mustang_s650_front_and_hood(builder);
append_mustang_s650_rear_and_exhaust(builder);
builder.push_aerodynamic_mirrors((0.84, 0.94, -0.32), (VEHICLE_SLOT_BODY, VEHICLE_SLOT_TRIM));
for side in [-1.0_f32, 1.0_f32] {
builder.push_curved_fender_arch(
front_wheel,
side,
VEHICLE_HERO_ARCH_SEGS,
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_UNDERBODY),
);
builder.push_curved_fender_arch(
rear_wheel,
side,
VEHICLE_HERO_ARCH_SEGS,
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_UNDERBODY),
);
let front_hub: Vec3 = Vec3::new(
side * front_wheel.get_center_x(),
front_wheel.get_tire_radius(),
front_wheel.get_center_z(),
);
let rear_hub: Vec3 = Vec3::new(
side * rear_wheel.get_center_x(),
rear_wheel.get_tire_radius(),
rear_wheel.get_center_z(),
);
if include_wheels {
builder.push_sculpted_wheel(
front_hub,
(
front_wheel.get_tire_radius(),
front_wheel.get_rim_radius(),
front_wheel.get_tire_width(),
),
VEHICLE_HERO_WHEEL_SEGS,
(
VEHICLE_SLOT_TIRE,
VEHICLE_SLOT_RIM,
MUSTANG_SLOT_DARK_CHROME,
MUSTANG_SLOT_CALIPER,
),
WheelSpokePattern::MustangSplit5,
);
builder.push_sculpted_wheel(
rear_hub,
(
rear_wheel.get_tire_radius(),
rear_wheel.get_rim_radius(),
rear_wheel.get_tire_width(),
),
VEHICLE_HERO_WHEEL_SEGS,
(
VEHICLE_SLOT_TIRE,
VEHICLE_SLOT_RIM,
MUSTANG_SLOT_DARK_CHROME,
MUSTANG_SLOT_CALIPER,
),
WheelSpokePattern::MustangSplit5,
);
} else {
builder.push_static_brake_caliper(
front_hub,
(front_wheel.get_rim_radius(), front_wheel.get_tire_width()),
MUSTANG_SLOT_CALIPER,
);
builder.push_static_brake_caliper(
rear_hub,
(rear_wheel.get_rim_radius(), rear_wheel.get_tire_width()),
MUSTANG_SLOT_CALIPER,
);
}
}
}
/// Builds an ultra-sculpted authentic 2025/2026 Ford Mustang S650 (Dark Horse / GT Fastback DNA) complete supercar mesh (`~4.81m x 1.92m x 1.39m`, wheelbase `2.72m`) with continuous Catmull-Rom lofted Coke-bottle fastback bodywork, domed power-bulge hood with heat extractor vent, trapezoidal S650 hex grille, tri-bar DRL brow + triple-projector LED headlamps, sweeping fastback roofline, concave gloss-black rear decklid framing glowing tri-bar red LED taillights, sculpted diffuser with quad outboard dark-chrome exhaust tips, curved Dark Horse spoiler, and split-5-spoke forged wheels with crimson Brembo calipers.
///
/// # Arguments
///
/// - `&str` - Human-readable mesh name.
/// - `PbrMaterial` - Primary metallic muscle-car paint PBR material (`slot 0`).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, multi-material 2025/2026 Ford Mustang S650 mesh.
#[must_use]
pub fn build_mustang_s650_supercar(name: &str, material: PbrMaterial) -> Mesh3D {
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(2800, 4200);
populate_mustang_s650_chassis(&mut builder, true);
builder.finish(name, material, mustang_s650_sub_materials())
}
/// Builds the wheel-less sculpted 2025/2026 Ford Mustang S650 chassis mesh with open carved wheel arches and stationary crimson Brembo brake calipers, ready to pair with four dynamic rotating/steering `build_mustang_s650_wheel_mesh` instances placed at `mustang_s650_wheel_layout()`.
///
/// # Arguments
///
/// - `&str` - Human-readable chassis mesh name.
/// - `PbrMaterial` - Primary metallic muscle-car paint PBR material (`slot 0`).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, wheel-less Ford Mustang S650 chassis mesh.
#[must_use]
pub fn build_mustang_s650_chassis_mesh(name: &str, material: PbrMaterial) -> Mesh3D {
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(2000, 2900);
populate_mustang_s650_chassis(&mut builder, false);
builder.finish(name, material, mustang_s650_sub_materials())
}
/// Builds a standalone high-contrast 2025/2026 Ford Mustang S650 split-5-spoke forged wheel mesh centered at `(0, 0, 0)` with axle along local `X` (`radius = 0.355m`), bilateral concave machined rims, ventilated brake rotors, and crimson Brembo center-cap rotation accent for unmistakably crisp spinning and steering on all four corners.
///
/// # Arguments
///
/// - `&str` - Human-readable wheel mesh name (falls back to default Mustang wheel name when empty).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, standalone Mustang S650 rotating wheel mesh.
#[must_use]
pub fn build_mustang_s650_wheel_mesh(name: &str) -> Mesh3D {
let resolved: &str = if name.is_empty() {
VEHICLE_DEFAULT_WHEEL_MUSTANG
} else {
name
};
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(500, 720);
builder.push_standalone_rotating_wheel(
(0.355, 0.25, 0.30),
VEHICLE_HERO_WHEEL_SEGS,
(
WHEEL_STANDALONE_SLOT_TIRE,
WHEEL_STANDALONE_SLOT_RIM,
WHEEL_STANDALONE_SLOT_BARREL,
WHEEL_STANDALONE_SLOT_ROTOR,
WHEEL_STANDALONE_SLOT_ACCENT,
),
WheelSpokePattern::MustangSplit5,
);
let sub_mats: Vec<PbrMaterial> = standalone_wheel_sub_materials(
PbrMaterial::metallic(Color::hex(0xDCE6F4), 0.14),
PbrMaterial::pbr(Color::hex(0xE11D48), 0.24, 0.20, 0.42),
);
builder.finish(
resolved,
PbrMaterial::dielectric(Color::hex(0x111419), 0.86),
sub_mats,
)
}
/// Appends flush curved LED headlights, front grille, full-width red LED taillight bar, mirrors, curved wheel arches, and optionally four smooth toroidal NPC wheels onto `builder`.
///
/// # Arguments
///
/// - `&mut VehicleMeshBuilder` - Destination NPC vehicle mesh builder.
/// - `(WheelArchSpec, WheelArchSpec)` - `(front_wheel, rear_wheel)` axle specs.
/// - `(f32, f32, f32)` - `(front_z, rear_z, light_y)` fascia geometry anchor values.
/// - `(f32, f32, f32)` - `(half_w_front, half_w_rear, mirror_y)` lateral sizing values.
/// - `(u16, bool)` - `(arch_slot, include_wheels)` arch lip material slot and static-wheel toggle.
fn append_npc_common_trim_and_wheels(
builder: &mut VehicleMeshBuilder,
wheels: (WheelArchSpec, WheelArchSpec),
z_and_y: (f32, f32, f32),
widths_and_mirror: (f32, f32, f32),
arch_and_wheels: (u16, bool),
) {
let (front_wheel, rear_wheel): (WheelArchSpec, WheelArchSpec) = wheels;
let (front_z, rear_z, light_y): (f32, f32, f32) = z_and_y;
let (hw_front, hw_rear, mirror_y): (f32, f32, f32) = widths_and_mirror;
let (arch_slot, include_wheels): (u16, bool) = arch_and_wheels;
let grille_spine: [Vec3; 3] = [
Vec3::new(-hw_front * 0.56, light_y - 0.14, front_z + 0.03),
Vec3::new(0.0, light_y - 0.13, front_z - 0.01),
Vec3::new(hw_front * 0.56, light_y - 0.14, front_z + 0.03),
];
builder.push_curved_tube(
&grille_spine,
&[(0.034, 0.088), (0.040, 0.095), (0.034, 0.088)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TRIM,
true,
);
let tailbar_spine: [Vec3; 5] = [
Vec3::new(-hw_rear * 0.88, light_y + 0.06, rear_z - 0.04),
Vec3::new(-hw_rear * 0.44, light_y + 0.07, rear_z + 0.015),
Vec3::new(0.0, light_y + 0.07, rear_z + 0.025),
Vec3::new(hw_rear * 0.44, light_y + 0.07, rear_z + 0.015),
Vec3::new(hw_rear * 0.88, light_y + 0.06, rear_z - 0.04),
];
builder.push_curved_tube(
&tailbar_spine,
&[
(0.026, 0.040),
(0.024, 0.032),
(0.020, 0.024),
(0.024, 0.032),
(0.026, 0.040),
],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TAILLIGHT,
true,
);
for side in [-1.0_f32, 1.0_f32] {
let head_spine: [Vec3; 3] = [
Vec3::new(side * hw_front * 0.58, light_y, front_z + 0.01),
Vec3::new(side * hw_front * 0.78, light_y + 0.02, front_z + 0.07),
Vec3::new(side * hw_front * 0.91, light_y + 0.04, front_z + 0.16),
];
builder.push_curved_tube(
&head_spine,
&[(0.028, 0.036), (0.030, 0.038), (0.022, 0.028)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_HEADLIGHT,
true,
);
builder.push_curved_fender_arch(
front_wheel,
side,
VEHICLE_NPC_ARCH_SEGS,
(arch_slot, VEHICLE_SLOT_UNDERBODY),
);
builder.push_curved_fender_arch(
rear_wheel,
side,
VEHICLE_NPC_ARCH_SEGS,
(arch_slot, VEHICLE_SLOT_UNDERBODY),
);
if include_wheels {
builder.push_sculpted_wheel(
Vec3::new(
side * front_wheel.get_center_x(),
front_wheel.get_tire_radius(),
front_wheel.get_center_z(),
),
(
front_wheel.get_tire_radius(),
front_wheel.get_rim_radius(),
front_wheel.get_tire_width(),
),
VEHICLE_NPC_WHEEL_SEGS,
(
VEHICLE_SLOT_TIRE,
VEHICLE_SLOT_RIM,
NPC_SLOT_CHROME,
VEHICLE_SLOT_TRIM,
),
WheelSpokePattern::ModernMultiSpoke,
);
builder.push_sculpted_wheel(
Vec3::new(
side * rear_wheel.get_center_x(),
rear_wheel.get_tire_radius(),
rear_wheel.get_center_z(),
),
(
rear_wheel.get_tire_radius(),
rear_wheel.get_rim_radius(),
rear_wheel.get_tire_width(),
),
VEHICLE_NPC_WHEEL_SEGS,
(
VEHICLE_SLOT_TIRE,
VEHICLE_SLOT_RIM,
NPC_SLOT_CHROME,
VEHICLE_SLOT_TRIM,
),
WheelSpokePattern::ModernMultiSpoke,
);
}
}
builder.push_aerodynamic_mirrors(
(hw_front * 0.94, mirror_y, -0.42),
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_TRIM),
);
}
/// Populates a `VehicleMeshBuilder` with the smooth curved modern executive NPC sedan chassis, optionally baking static wheels.
///
/// # Arguments
///
/// - `&mut VehicleMeshBuilder` - Destination mesh builder.
/// - `bool` - Whether to include static baked wheels.
fn populate_npc_sedan(builder: &mut VehicleMeshBuilder, include_wheels: bool) {
let front_wheel: WheelArchSpec =
WheelArchSpec::new(0.80, -1.38, 0.34, 0.23, 0.24, 0.036, 0.044);
let rear_wheel: WheelArchSpec = WheelArchSpec::new(0.80, 1.38, 0.34, 0.23, 0.24, 0.038, 0.044);
let body_controls: [BodyStation; 7] = [
BodyStation::from_profile(
-2.30,
[0.17, 0.22, 0.62, 0.72, 0.74],
[0.60, 0.74, 0.80, 0.70],
(0.015, 0.0),
),
BodyStation::from_profile(
-1.38,
[0.16, 0.22, 0.77, 0.88, 0.90],
[0.76, 0.85, 0.88, 0.79],
(0.024, 0.0),
),
BodyStation::from_profile(
-0.62,
[0.16, 0.22, 0.82, 0.92, 0.94],
[0.77, 0.86, 0.89, 0.80],
(0.012, 0.018),
),
BodyStation::from_profile(
0.24,
[0.16, 0.22, 0.84, 0.93, 0.94],
[0.77, 0.86, 0.89, 0.80],
(0.0, 0.022),
),
BodyStation::from_profile(
1.38,
[0.18, 0.24, 0.88, 0.97, 0.97],
[0.77, 0.86, 0.89, 0.80],
(0.008, 0.0),
),
BodyStation::from_profile(
1.98,
[0.22, 0.28, 0.87, 0.96, 0.97],
[0.74, 0.83, 0.86, 0.77],
(0.008, 0.0),
),
BodyStation::from_profile(
2.31,
[0.26, 0.33, 0.82, 0.91, 0.92],
[0.66, 0.76, 0.81, 0.72],
(0.0, 0.0),
),
];
builder.push_curved_body_shell(
&body_controls,
1,
(front_wheel, rear_wheel),
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_UNDERBODY, VEHICLE_SLOT_BODY),
false,
);
let canopy_controls: [CanopyStation; 5] = [
CanopyStation::from_profile(
-0.74,
[0.90, 0.95, 0.97],
[0.76, 0.66],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
-0.14,
[0.92, 1.36, 1.41],
[0.76, 0.60],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
0.46,
[0.93, 1.39, 1.44],
[0.76, 0.60],
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
1.08,
[0.95, 1.34, 1.39],
[0.74, 0.58],
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
1.76,
[0.95, 0.99, 1.01],
[0.71, 0.56],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_BODY),
),
];
builder.push_curved_canopy(&canopy_controls, 1, VEHICLE_SLOT_UNDERBODY);
append_npc_common_trim_and_wheels(
builder,
(front_wheel, rear_wheel),
(-2.32, 2.32, 0.67),
(0.84, 0.82, 0.93),
(VEHICLE_SLOT_BODY, include_wheels),
);
}
/// Populates a `VehicleMeshBuilder` with the smooth curved modern grand-tourer NPC sport coupe chassis, optionally baking static wheels.
///
/// # Arguments
///
/// - `&mut VehicleMeshBuilder` - Destination mesh builder.
/// - `bool` - Whether to include static baked wheels.
fn populate_npc_coupe(builder: &mut VehicleMeshBuilder, include_wheels: bool) {
let front_wheel: WheelArchSpec =
WheelArchSpec::new(0.815, -1.32, 0.345, 0.24, 0.26, 0.044, 0.044);
let rear_wheel: WheelArchSpec =
WheelArchSpec::new(0.815, 1.32, 0.345, 0.24, 0.28, 0.058, 0.046);
let body_controls: [BodyStation; 7] = [
BodyStation::from_profile(
-2.22,
[0.15, 0.20, 0.56, 0.64, 0.65],
[0.58, 0.72, 0.79, 0.68],
(0.015, 0.0),
),
BodyStation::from_profile(
-1.32,
[0.14, 0.20, 0.73, 0.82, 0.83],
[0.77, 0.86, 0.89, 0.79],
(0.025, 0.0),
),
BodyStation::from_profile(
-0.56,
[0.14, 0.20, 0.78, 0.87, 0.88],
[0.78, 0.86, 0.88, 0.79],
(0.010, 0.035),
),
BodyStation::from_profile(
0.24,
[0.14, 0.20, 0.81, 0.89, 0.89],
[0.78, 0.86, 0.88, 0.79],
(0.0, 0.045),
),
BodyStation::from_profile(
1.32,
[0.16, 0.23, 0.87, 0.94, 0.93],
[0.79, 0.88, 0.90, 0.81],
(0.008, 0.0),
),
BodyStation::from_profile(
1.90,
[0.20, 0.28, 0.86, 0.93, 0.93],
[0.75, 0.84, 0.88, 0.78],
(0.010, 0.0),
),
BodyStation::from_profile(
2.22,
[0.25, 0.33, 0.80, 0.88, 0.89],
[0.66, 0.77, 0.82, 0.72],
(0.0, 0.0),
),
];
builder.push_curved_body_shell(
&body_controls,
1,
(front_wheel, rear_wheel),
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_UNDERBODY, VEHICLE_SLOT_TRIM),
false,
);
let canopy_controls: [CanopyStation; 5] = [
CanopyStation::from_profile(
-0.70,
[0.84, 0.89, 0.91],
[0.75, 0.64],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
-0.08,
[0.86, 1.23, 1.28],
[0.76, 0.57],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
0.46,
[0.88, 1.25, 1.30],
[0.75, 0.56],
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
1.14,
[0.90, 1.14, 1.18],
[0.72, 0.53],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_BODY),
),
CanopyStation::from_profile(
1.88,
[0.90, 0.94, 0.96],
[0.67, 0.50],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_BODY),
),
];
builder.push_curved_canopy(&canopy_controls, 1, VEHICLE_SLOT_UNDERBODY);
append_npc_common_trim_and_wheels(
builder,
(front_wheel, rear_wheel),
(-2.24, 2.23, 0.62),
(0.84, 0.83, 0.88),
(VEHICLE_SLOT_BODY, include_wheels),
);
for ex_x in [-0.46_f32, 0.46_f32] {
builder.push_exhaust_pipe_tip(
Vec3::new(ex_x, 0.28, 2.26),
0.12,
(0.048, 0.048),
8,
(NPC_SLOT_CHROME, VEHICLE_SLOT_UNDERBODY),
);
}
}
/// Populates a `VehicleMeshBuilder` with the smooth curved modern luxury crossover NPC SUV chassis, optionally baking static wheels.
///
/// # Arguments
///
/// - `&mut VehicleMeshBuilder` - Destination mesh builder.
/// - `bool` - Whether to include static baked wheels.
fn populate_npc_suv(builder: &mut VehicleMeshBuilder, include_wheels: bool) {
let front_wheel: WheelArchSpec =
WheelArchSpec::new(0.84, -1.43, 0.39, 0.26, 0.27, 0.042, 0.056);
let rear_wheel: WheelArchSpec = WheelArchSpec::new(0.84, 1.43, 0.39, 0.26, 0.27, 0.042, 0.056);
let body_controls: [BodyStation; 7] = [
BodyStation::from_profile(
-2.38,
[0.24, 0.30, 0.78, 0.90, 0.92],
[0.66, 0.80, 0.86, 0.76],
(0.020, 0.0),
),
BodyStation::from_profile(
-1.43,
[0.23, 0.29, 0.92, 1.04, 1.07],
[0.82, 0.91, 0.94, 0.84],
(0.026, 0.0),
),
BodyStation::from_profile(
-0.62,
[0.23, 0.29, 0.97, 1.08, 1.10],
[0.83, 0.92, 0.95, 0.85],
(0.012, 0.015),
),
BodyStation::from_profile(
0.32,
[0.23, 0.29, 0.99, 1.10, 1.11],
[0.83, 0.92, 0.95, 0.85],
(0.0, 0.015),
),
BodyStation::from_profile(
1.43,
[0.24, 0.31, 1.01, 1.12, 1.12],
[0.83, 0.92, 0.95, 0.85],
(0.008, 0.0),
),
BodyStation::from_profile(
2.06,
[0.28, 0.35, 1.00, 1.10, 1.11],
[0.80, 0.89, 0.92, 0.83],
(0.008, 0.0),
),
BodyStation::from_profile(
2.39,
[0.32, 0.40, 0.96, 1.06, 1.07],
[0.72, 0.82, 0.87, 0.78],
(0.0, 0.0),
),
];
builder.push_curved_body_shell(
&body_controls,
1,
(front_wheel, rear_wheel),
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_UNDERBODY, VEHICLE_SLOT_BODY),
false,
);
let canopy_controls: [CanopyStation; 5] = [
CanopyStation::from_profile(
-0.78,
[1.06, 1.11, 1.13],
[0.82, 0.73],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
-0.16,
[1.08, 1.64, 1.69],
[0.82, 0.68],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
0.72,
[1.10, 1.67, 1.72],
[0.82, 0.68],
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
1.76,
[1.10, 1.62, 1.67],
[0.80, 0.65],
(VEHICLE_SLOT_BODY, VEHICLE_SLOT_GLASS),
),
CanopyStation::from_profile(
2.26,
[1.06, 1.12, 1.14],
[0.76, 0.62],
(VEHICLE_SLOT_GLASS, VEHICLE_SLOT_BODY),
),
];
builder.push_curved_canopy(&canopy_controls, 1, VEHICLE_SLOT_UNDERBODY);
for side in [-1.0_f32, 1.0_f32] {
let rail_spine: [Vec3; 3] = [
Vec3::new(side * 0.62, 1.69, -0.06),
Vec3::new(side * 0.62, 1.72, 0.82),
Vec3::new(side * 0.60, 1.67, 1.72),
];
builder.push_curved_tube(
&rail_spine,
&[(0.020, 0.022), (0.020, 0.024), (0.020, 0.020)],
Vec3::new(0.0, 1.0, 0.0),
5,
NPC_SLOT_CHROME,
true,
);
}
let visor_spine: [Vec3; 3] = [
Vec3::new(-0.66, 1.63, 1.94),
Vec3::new(0.0, 1.67, 1.98),
Vec3::new(0.66, 1.63, 1.94),
];
builder.push_curved_tube(
&visor_spine,
&[(0.075, 0.022), (0.085, 0.024), (0.075, 0.022)],
Vec3::new(0.0, 1.0, 0.0),
5,
VEHICLE_SLOT_TRIM,
true,
);
append_npc_common_trim_and_wheels(
builder,
(front_wheel, rear_wheel),
(-2.40, 2.40, 0.86),
(0.90, 0.88, 1.11),
(VEHICLE_SLOT_TRIM, include_wheels),
);
}
/// Builds a smooth curved modern four-door executive NPC sedan mesh (`~4.68m x 1.84m x 1.44m`, wheelbase `2.76m`).
///
/// # Arguments
///
/// - `&str` - Human-readable mesh name.
/// - `PbrMaterial` - Primary exterior metallic paint PBR material (`slot 0`).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, multi-material modern NPC sedan mesh.
#[must_use]
pub fn build_npc_sedan(name: &str, material: PbrMaterial) -> Mesh3D {
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(1400, 1900);
populate_npc_sedan(&mut builder, true);
builder.finish(name, material, npc_vehicle_sub_materials())
}
/// Builds a smooth curved modern grand-tourer NPC sport coupe mesh (`~4.52m x 1.88m x 1.30m`, wheelbase `2.64m`).
///
/// # Arguments
///
/// - `&str` - Human-readable mesh name.
/// - `PbrMaterial` - Primary exterior metallic paint PBR material (`slot 0`).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, multi-material modern NPC sport coupe mesh.
#[must_use]
pub fn build_npc_coupe(name: &str, material: PbrMaterial) -> Mesh3D {
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(1400, 1900);
populate_npc_coupe(&mut builder, true);
builder.finish(name, material, npc_vehicle_sub_materials())
}
/// Builds a smooth curved modern luxury crossover NPC SUV mesh (`~4.84m x 1.96m x 1.72m`, wheelbase `2.86m`).
///
/// # Arguments
///
/// - `&str` - Human-readable mesh name.
/// - `PbrMaterial` - Primary exterior metallic paint PBR material (`slot 0`).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, multi-material modern NPC luxury SUV mesh.
#[must_use]
pub fn build_npc_suv(name: &str, material: PbrMaterial) -> Mesh3D {
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(1500, 2100);
populate_npc_suv(&mut builder, true);
builder.finish(name, material, npc_vehicle_sub_materials())
}
/// Builds a wheel-less sculpted NPC (or hero) chassis mesh matching `kind` with carved circular wheel arches ready for four dynamic rotating/steering `build_npc_wheel_mesh` instances placed at `npc_wheel_layout(kind)`.
///
/// # Arguments
///
/// - `SculptedVehicleKind` - Target NPC (or hero) silhouette archetype.
/// - `&str` - Human-readable chassis mesh name.
/// - `PbrMaterial` - Primary exterior metallic paint PBR material (`slot 0`).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, wheel-less vehicle chassis mesh.
#[must_use]
pub fn build_npc_chassis_mesh(
kind: SculptedVehicleKind,
name: &str,
material: PbrMaterial,
) -> Mesh3D {
match kind {
SculptedVehicleKind::LamborghiniRevuelto => build_lamborghini_chassis_mesh(name, material),
SculptedVehicleKind::MustangS650 => build_mustang_s650_chassis_mesh(name, material),
SculptedVehicleKind::NpcSedan => {
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(1000, 1400);
populate_npc_sedan(&mut builder, false);
builder.finish(name, material, npc_vehicle_sub_materials())
}
SculptedVehicleKind::NpcCoupe => {
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(1000, 1400);
populate_npc_coupe(&mut builder, false);
builder.finish(name, material, npc_vehicle_sub_materials())
}
SculptedVehicleKind::NpcSuv => {
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(1100, 1500);
populate_npc_suv(&mut builder, false);
builder.finish(name, material, npc_vehicle_sub_materials())
}
}
}
/// Builds a standalone high-contrast multi-spoke rotating wheel mesh matching `kind`, centered at `(0, 0, 0)` with axle along local `X`, ready for dynamic spinning and steering on all four corners.
///
/// # Arguments
///
/// - `SculptedVehicleKind` - Target NPC (or hero) vehicle archetype determining wheel radius, width, and spoke pattern.
/// - `&str` - Human-readable wheel mesh name (falls back to default wheel name when empty).
///
/// # Returns
///
/// - `Mesh3D` - Closed, smooth-shaded, standalone rotating wheel mesh.
#[must_use]
pub fn build_npc_wheel_mesh(kind: SculptedVehicleKind, name: &str) -> Mesh3D {
match kind {
SculptedVehicleKind::LamborghiniRevuelto => build_lamborghini_wheel_mesh(name),
SculptedVehicleKind::MustangS650 => build_mustang_s650_wheel_mesh(name),
SculptedVehicleKind::NpcSedan
| SculptedVehicleKind::NpcCoupe
| SculptedVehicleKind::NpcSuv => {
let resolved: &str = if name.is_empty() {
VEHICLE_DEFAULT_WHEEL_NPC
} else {
name
};
let dims: (f32, f32, f32) = match kind {
SculptedVehicleKind::NpcSedan => (0.34, 0.23, 0.24),
SculptedVehicleKind::NpcCoupe => (0.345, 0.24, 0.26),
_ => (0.39, 0.26, 0.27),
};
let mut builder: VehicleMeshBuilder = VehicleMeshBuilder::with_capacity(340, 480);
builder.push_standalone_rotating_wheel(
dims,
VEHICLE_NPC_WHEEL_SEGS,
(
WHEEL_STANDALONE_SLOT_TIRE,
WHEEL_STANDALONE_SLOT_RIM,
WHEEL_STANDALONE_SLOT_BARREL,
WHEEL_STANDALONE_SLOT_ROTOR,
WHEEL_STANDALONE_SLOT_ACCENT,
),
WheelSpokePattern::ModernMultiSpoke,
);
let sub_mats: Vec<PbrMaterial> = standalone_wheel_sub_materials(
PbrMaterial::metallic(Color::hex(0xE2E8F0), 0.16),
PbrMaterial::metallic(Color::hex(0xF8FAFC), 0.12),
);
builder.finish(
resolved,
PbrMaterial::dielectric(Color::hex(0x12161B), 0.88),
sub_mats,
)
}
}
}