#[repr(C)]pub struct Segment3dInstance {
pub a: [f32; 3],
pub b: [f32; 3],
pub color: [f32; 3],
pub width: f32,
pub alpha: f32,
}Expand description
One segment in 3D, drawn through the shared camera (ADR-0257): two world endpoints, an RGB colour, a width in pixels at the camera’s reference depth and an alpha.
Drawn by the seg3d pipeline, which LineRenderer::new_3d builds and
LineRenderer::draw_3d selects — a separate pipeline and instance buffer
rather than a branch in the 2D one, so every 2D line scene keeps its bytes.
Field order is shader-location order, for the reason
SegmentInstance::alpha records: a field inserted anywhere but the end
re-points every attribute after it.
Fields§
§a: [f32; 3]First endpoint, world space, in front of the near plane.
b: [f32; 3]Second endpoint, world space, in front of the near plane.
color: [f32; 3]RGB light (pre-glow; additive blend sums overlaps).
width: f32Full stroke width in pixels of the render target at the camera’s reference depth; each end is scaled by perspective from there.
alpha: f32How much of the stroke is present: its light and its coverage are both multiplied by this, so a fading edge fades out of the frame rather than into a dark line.
Trait Implementations§
Source§impl Clone for Segment3dInstance
impl Clone for Segment3dInstance
Source§fn clone(&self) -> Segment3dInstance
fn clone(&self) -> Segment3dInstance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Segment3dInstance
impl Debug for Segment3dInstance
Source§impl PartialEq for Segment3dInstance
impl PartialEq for Segment3dInstance
Source§fn eq(&self, other: &Segment3dInstance) -> bool
fn eq(&self, other: &Segment3dInstance) -> bool
self and other values to be equal, and is used by ==.impl Copy for Segment3dInstance
impl Pod for Segment3dInstance
impl StructuralPartialEq for Segment3dInstance
Auto Trait Implementations§
impl Freeze for Segment3dInstance
impl RefUnwindSafe for Segment3dInstance
impl Send for Segment3dInstance
impl Sync for Segment3dInstance
impl Unpin for Segment3dInstance
impl UnsafeUnpin for Segment3dInstance
impl UnwindSafe for Segment3dInstance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.