1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
//! [`GizmoShape`], optional visual override for debug wireframe drawing.
//!
//! # Module location
//!
//! This file lives in `src/debug_render/` but is declared at the crate root
//! (via `#[path]`) **without** the `debug-plugin` feature gate. The reason is
//! that [`crate::plugin::AircraftFdmPlugin`] (the core plugin) calls
//! `.register_type::<GizmoShape>()` unconditionally so that these components
//! remain scene-serializable even in builds where `debug-plugin` is disabled.
//! Users can therefore store `GizmoShape` overrides in scene files and only
//! enable [`crate::debug_render::AircraftFdmDebugPlugin`] in development builds.
//!
//! ## Hybrid visualisation approach
//!
//! Most zones are drawn directly from their [`avian3d::prelude::Collider`]
//! shape, no `GizmoShape` needed. This ensures the debug wireframe always
//! matches what the physics engine sees.
//!
//! Attach `GizmoShape` **only** when the collider shape doesn't represent the
//! desired visual:
//!
//! | Use case | Example | GizmoShape variant |
//! |-----------------------|-------------------|--------------------|
//! | Tapered surface | Vertical fin | `Quad` |
//! | Line-like structure | Wing strut | `Strut` |
//! | Different shape class | Engine cowl | `Cylinder` |
//! | Round instead of box | Wheel | `Sphere` |
//!
//! Aerodynamic surfaces (wings, h-stab, ailerons, elevator) use thin colliders
//! (~ 2 cm) whose cuboid outline naturally looks like a flat panel, they need
//! no `GizmoShape` at all.
//!
//! ## Contour detail
//!
//! [`GizmoContours`] adds arbitrary linestrips to a zone for visual detail
//! beyond what the collider shape shows, curved fuselage profiles, airfoil
//! cross-sections, rounded wingtips. These are purely decorative but are
//! zone-aware: they inherit damage colouring and disappear when the zone is
//! destroyed.
use crate*;
use ;
/// Describes how a zone entity should be drawn in the gizmo debug view.
///
/// This is purely visual, it has no effect on physics or aerodynamics.
/// Multiple shapes can approximate curved surfaces (fuselage cross-sections,
/// rounded wingtips) that the physics collider doesn't need to model.
/// Additional linestrip contours for detailed aircraft outline rendering.
///
/// Each entry is a polyline (sequence of points in zone-local coordinates)
/// drawn as a connected linestrip. Use this to add curved profiles,
/// cross-section rings, airfoil sections, or any detail that the collider
/// shape doesn't capture.
///
/// Contours inherit the zone's damage colour, they fade toward red as
/// health decreases and vanish when the zone is destroyed.
///
/// # Example
/// ```rust
/// # use avian_fdm::components::GizmoContours;
/// # use bevy::prelude::*;
/// // Elliptical fuselage cross-section at x = 0
/// let ring: Vec<Vec3> = (0..=12).map(|i| {
/// let angle = i as f32 * std::f32::consts::TAU / 12.0;
/// Vec3::new(0.0, 0.30 * angle.cos(), 0.35 * angle.sin())
/// }).collect();
/// let contours = GizmoContours { lines: vec![ring] };
/// ```