#[repr(C)]pub struct ArcInstance {
pub centre: [f32; 2],
pub radius: f32,
pub angle_start: f32,
pub angle_sweep: f32,
pub color: [f32; 3],
pub width: f32,
}Expand description
One circular arc: a centre and radius in world space, a signed angular
span in radians, an RGB colour and a half-width in NDC-y units — the same
conventions SegmentInstance uses, so the two kinds place geometry in one
coordinate system and stroke it to one profile.
Expanded in the vertex shader to a single bounding quad and shaded by the
per-pixel distance to the arc (ADR-0098) rather than by an
interpolated across-the-stroke coordinate. So a circle is one instance
with no vertices at any resolution, where the segment path needs one
instance and one additive joint per sample.
No extension fields: an arc has no interior joints, which is the whole point of the primitive. Where two arcs in a chain meet they overlap by a half-width as any two strokes do, and the additive composite sums that overlap exactly as it does for segments — the bead is reduced by there being fewer joints, not by a joint doing anything different.
No alpha field either. Every arc producer draws through ADR-0056’s
additive seam, where the coverage a premultiplied fragment carries is the
stroke’s own falloff; the OVER range LineRenderer::draw_split serves is
a MilkDrop waveform, which is segments. A future over-blended arc adds the
field last, for the reason SegmentInstance::alpha records.
Field order is shader-location order, and that is load-bearing for the
same reason it is on SegmentInstance: vertex_attr_array! derives each
attribute’s byte offset from the order of the locations, so a field inserted
anywhere but the end silently re-points every attribute after it.
Fields§
§centre: [f32; 2]Centre of curvature (world space).
radius: f32Radius (world space). The arc’s centreline, not either stroke edge.
angle_start: f32Where the span starts, in radians, measured the usual way from +x.
angle_sweep: f32How far it sweeps, signed. |sweep| may exceed PI, and a full
circle is one instance at sweep = TAU.
color: [f32; 3]RGB colour (pre-brightness; additive blend sums overlaps).
width: f32Half-width in world units — the same quantity, in the same space, as
SegmentInstance::width. Named width to match its sibling; it is a
half-width in both.
There is no StrokeMetric choice here: no arc producer wants the clip
metric, because warp_mesh — the one surface still on it — emits no
ArcInstance at all (ADR-0160).
Trait Implementations§
Source§impl Clone for ArcInstance
impl Clone for ArcInstance
Source§fn clone(&self) -> ArcInstance
fn clone(&self) -> ArcInstance
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 ArcInstance
impl Debug for ArcInstance
Source§impl PartialEq for ArcInstance
impl PartialEq for ArcInstance
Source§fn eq(&self, other: &ArcInstance) -> bool
fn eq(&self, other: &ArcInstance) -> bool
self and other values to be equal, and is used by ==.impl Copy for ArcInstance
impl Pod for ArcInstance
impl StructuralPartialEq for ArcInstance
Auto Trait Implementations§
impl Freeze for ArcInstance
impl RefUnwindSafe for ArcInstance
impl Send for ArcInstance
impl Sync for ArcInstance
impl Unpin for ArcInstance
impl UnsafeUnpin for ArcInstance
impl UnwindSafe for ArcInstance
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.