euv-core 0.57.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
use super::*;

/// Local-space wheel hub coordinates and nominal rolling radius for mounting dynamic spinning and steering wheel meshes onto a wheel-less vehicle chassis.
#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
pub struct VehicleWheelLayout3D {
    /// Local-space front-left wheel hub center (`-X`, `-Z`).
    #[get(type(copy))]
    pub(crate) front_left: Vec3,
    /// Local-space front-right wheel hub center (`+X`, `-Z`).
    #[get(type(copy))]
    pub(crate) front_right: Vec3,
    /// Local-space rear-left wheel hub center (`-X`, `+Z`).
    #[get(type(copy))]
    pub(crate) rear_left: Vec3,
    /// Local-space rear-right wheel hub center (`+X`, `+Z`).
    #[get(type(copy))]
    pub(crate) rear_right: Vec3,
    /// Nominal rolling outer tire radius in meters matching ground contact at `y = 0`.
    #[get(type(copy))]
    pub(crate) wheel_radius_m: f32,
}

/// Longitudinal cross-section control station defining curved automotive bodywork along local `Z`.
#[derive(Clone, Copy, Debug, Getter, PartialEq)]
pub(crate) struct BodyStation {
    /// Longitudinal coordinate from front nose (`-Z`) to rear tail (`+Z`).
    #[get(type(copy))]
    pub(crate) z: f32,
    /// Aerodynamic underbody floor elevation.
    #[get(type(copy))]
    pub(crate) y_bottom: f32,
    /// Outer lower rocker sill elevation.
    #[get(type(copy))]
    pub(crate) y_rocker: f32,
    /// Widest beltline and fender shoulder elevation.
    #[get(type(copy))]
    pub(crate) y_belt: f32,
    /// Upper fender crest and deck edge elevation.
    #[get(type(copy))]
    pub(crate) y_deck_edge: f32,
    /// Centerline spine elevation across the hood, cowl, or rear deck.
    #[get(type(copy))]
    pub(crate) y_crown: f32,
    /// Half-width of the flat aerodynamic underbody floor.
    #[get(type(copy))]
    pub(crate) half_w_bottom: f32,
    /// Half-width of the curved lower rocker sill.
    #[get(type(copy))]
    pub(crate) half_w_rocker: f32,
    /// Maximum body half-width at the sculpted fender or door beltline.
    #[get(type(copy))]
    pub(crate) half_w_belt: f32,
    /// Half-width of the upper hood crest or rear deck shoulder.
    #[get(type(copy))]
    pub(crate) half_w_deck: f32,
    /// Centerline hood/deck curvature offset (`> 0` power bulge dome, `< 0` aerodynamic valley crease).
    #[get(type(copy))]
    pub(crate) crown_bulge: f32,
    /// Inward mid-flank side sculpting depth for air intake coves or Coke-bottle door tuck.
    #[get(type(copy))]
    pub(crate) side_scoop_depth: f32,
}

/// Longitudinal cross-section control station defining a curved wrap-around glass canopy and roof dome.
#[derive(Clone, Copy, Debug, Getter, PartialEq)]
pub(crate) struct CanopyStation {
    /// Longitudinal coordinate from windshield cowl (`-Z`) to rear fastback deck (`+Z`).
    #[get(type(copy))]
    pub(crate) z: f32,
    /// Lower glass sill elevation where the canopy merges cleanly into the bodywork.
    #[get(type(copy))]
    pub(crate) y_base: f32,
    /// Upper cantrail elevation where side windows curve smoothly into the roof arch.
    #[get(type(copy))]
    pub(crate) y_cantrail: f32,
    /// Domed centerline roof or glass spine elevation.
    #[get(type(copy))]
    pub(crate) y_crown: f32,
    /// Half-width at the lower canopy beltline sill.
    #[get(type(copy))]
    pub(crate) half_w_base: f32,
    /// Half-width at the tapered upper roof cantrail.
    #[get(type(copy))]
    pub(crate) half_w_cantrail: f32,
    /// Material slot for the upper panel (glass windshield/rear deck or painted/carbon roof).
    #[get(type(copy))]
    pub(crate) top_slot: u16,
    /// Material slot for the side flank panel (side glass or painted C-pillar sail).
    #[get(type(copy))]
    pub(crate) side_slot: u16,
}

/// Wheel axle geometry and sculpted fender-well clearance parameters for one axle pair.
#[derive(Clone, Copy, Debug, Getter, New, PartialEq)]
pub(crate) struct WheelArchSpec {
    /// Positive half-track center distance from vehicle centerline (`X = ±center_x`).
    #[get(type(copy))]
    pub(crate) center_x: f32,
    /// Longitudinal axle coordinate along `Z`.
    #[get(type(copy))]
    pub(crate) center_z: f32,
    /// Outer rubber tire radius (wheel hub center sits at `Y = tire_radius`).
    #[get(type(copy))]
    pub(crate) tire_radius: f32,
    /// Forged alloy rim barrel radius.
    #[get(type(copy))]
    pub(crate) rim_radius: f32,
    /// Total tire section width along `X`.
    #[get(type(copy))]
    pub(crate) tire_width: f32,
    /// Sculpted outward fender lip flare thickness wrapping over the wheel arch.
    #[get(type(copy))]
    pub(crate) arch_flare_width: f32,
    /// Radial clearance gap between the tire outer tread and the curved wheel-well cutout.
    #[get(type(copy))]
    pub(crate) arch_clearance: f32,
}

/// Accumulator for building multi-material smooth-shaded sculpted vehicle meshes with zero runtime allocations after construction.
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub(crate) struct VehicleMeshBuilder {
    /// Accumulated 64-byte aligned vertices with smooth averaged normals and clean `[0, 1]` UVs.
    pub(crate) vertices: Vec<Vertex3D>,
    /// Outward CCW triangle index triplets.
    pub(crate) indices: Vec<[u32; 3]>,
    /// Per-triangle sub-material slot indices (`0` = primary body clearcoat paint).
    pub(crate) tri_materials: Vec<u16>,
}