Skip to main content

concinnity_core/gfx/lines/
mod.rs

1//! The world-space line segment any system can submit for a frame: a trajectory
2//! arc, a tether or beam, a patrol path, the editor's origin axes. Lines are
3//! scene geometry, not overlay, so the depth-tested pass occludes them behind
4//! whatever is in front of them.
5//!
6//! [`build_vertices`] expands each segment into the camera-facing ribbon the
7//! line pass rasterises.
8
9mod expand;
10
11pub use expand::{LineCamera, build_vertices, build_vertices_into};
12
13/// One world-space line to draw this frame. Colour is per endpoint, so a line
14/// that fades out with distance is a single request with a transparent far end.
15#[derive(Copy, Clone, Debug, PartialEq)]
16pub struct Line {
17    /// World-space start point.
18    pub start: [f32; 3],
19    /// World-space end point.
20    pub end: [f32; 3],
21    /// Linear-space RGBA at `start` / `end`, interpolated along the run.
22    pub start_color: [f32; 4],
23    /// Linear-space RGBA at `end`.
24    pub end_color: [f32; 4],
25    /// On-screen thickness in pixels, held constant at any distance.
26    pub width_px: f32,
27}