Skip to main content

euv_core/game/engine3d/world/
enum.rs

1/// Supported physically based 3D camera controller modes for `World3D`.
2#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
3pub enum CameraMode3D {
4    /// Dynamic third-person chase camera trailing behind the player vehicle.
5    #[default]
6    Chase,
7    /// Low hood/cockpit driving perspective mounted over the front axle.
8    Hood,
9    /// Continuous 360-degree orbital turntable camera around the active subject.
10    Orbit,
11    /// High-altitude aerial overview camera for open-world navigation.
12    Aerial,
13    /// Unrestricted 6-DOF free-fly camera controlled directly by user input.
14    FreeFly,
15    /// Smooth cinematic dolly camera gliding along a sinusoidal showcase arc.
16    CinematicDolly,
17}
18
19/// Selectable sculpted hero supercar bodywork and livery archetype for `World3D`.
20#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
21pub enum HeroVehicleStyle {
22    /// Lamborghini Aventador SVJ V12 stealth-fighter angular wedge supercar.
23    #[default]
24    AventadorV12,
25    /// Ford Mustang Shelby GT500 Cobra fastback muscle supercar with twin Le Mans stripes.
26    ShelbyCobra,
27}
28
29/// Real-time incremental scene mutation received from Blender Live-Link without resetting camera or rebuilding unrelated meshes.
30#[derive(Clone, Debug, PartialEq)]
31pub enum BlenderLiveDelta3D {
32    /// Updates a named scene-graph node's local TRS transform (optionally converting from Blender Z-up).
33    NodeTransform {
34        /// Target scene-graph node name.
35        node_name: String,
36        /// Local translation `[x, y, z]`.
37        translation: [f32; 3],
38        /// Local rotation quaternion `[x, y, z, w]`.
39        rotation: [f32; 4],
40        /// Local non-uniform scale `[sx, sy, sz]`.
41        scale: [f32; 3],
42        /// Whether inputs are in Blender Z-up space requiring basis conversion to Engine Y-up.
43        blender_z_up: bool,
44    },
45    /// Updates Principled BSDF parameters on a named material in place.
46    MaterialParams {
47        /// Target material name inside `World3D::principled_materials`.
48        material_name: String,
49        /// Optional linear base color RGBA override.
50        base_color_factor: Option<[f32; 4]>,
51        /// Optional metallic scalar override.
52        metallic_factor: Option<f32>,
53        /// Optional roughness scalar override.
54        roughness_factor: Option<f32>,
55        /// Optional clearcoat intensity override.
56        clearcoat_factor: Option<f32>,
57        /// Optional clearcoat roughness override.
58        clearcoat_roughness_factor: Option<f32>,
59        /// Optional microfiber sheen RGB tint override.
60        sheen_color_factor: Option<[f32; 3]>,
61        /// Optional microfiber sheen roughness override.
62        sheen_roughness_factor: Option<f32>,
63        /// Optional linear emissive RGB override.
64        emissive_factor: Option<[f32; 3]>,
65        /// Optional HDR emissive luminance strength override.
66        emissive_strength: Option<f32>,
67        /// Optional optical transmission factor override.
68        transmission_factor: Option<f32>,
69        /// Optional dielectric index of refraction override.
70        ior: Option<f32>,
71    },
72    /// Updates shape-key morph weights for a named scene-graph node in place.
73    MorphWeights {
74        /// Target scene-graph node name.
75        node_name: String,
76        /// Replacement per-shape-key weights.
77        weights: Vec<f32>,
78    },
79    /// Updates parameters on an existing point, spot, or area light by index.
80    LightUpdate {
81        /// Target light index.
82        light_index: usize,
83        /// Optional linear RGB emission color.
84        color: Option<[f32; 3]>,
85        /// Optional luminous intensity.
86        intensity: Option<f32>,
87        /// Optional world position.
88        position: Option<[f32; 3]>,
89        /// Optional world emitting direction.
90        direction: Option<[f32; 3]>,
91    },
92    /// Updates the primary viewport camera pose and vertical field of view.
93    CameraUpdate {
94        /// World-space camera position.
95        position: [f32; 3],
96        /// Horizontal yaw in radians.
97        yaw: f32,
98        /// Vertical pitch in radians.
99        pitch: f32,
100        /// Vertical field of view in degrees.
101        fov_deg: f32,
102    },
103    /// Toggles viewport visibility for a named Blender Collection.
104    CollectionVisibility {
105        /// Target collection name inside `SceneGraph3D::collections`.
106        collection_name: String,
107        /// Desired viewport visibility state.
108        visible: bool,
109    },
110    /// Updates IBL environment Y-rotation and global radiance intensity.
111    EnvironmentUpdate {
112        /// World environment rotation around Y axis in radians.
113        rotation_y_rad: f32,
114        /// Global IBL intensity multiplier.
115        intensity: f32,
116    },
117}