pub struct LineBatchBuilder<'a, 'ctx>(&'a mut LineDrawableBuilder<'ctx>);
Tuple Fields§
§0: &'a mut LineDrawableBuilder<'ctx>
Implementations§
source§impl<'a, 'ctx> LineBatchBuilder<'a, 'ctx>
impl<'a, 'ctx> LineBatchBuilder<'a, 'ctx>
fn batch_mut(&mut self) -> &mut LineBatchInfo
fn add_vertices( &mut self, points: impl ExactSizeIterator<Item = Vec3>, strip_index: u32 ) -> Result<(), DataTextureSourceWriteError>
sourcefn create_strip_builder(
&mut self,
num_strips_added: usize,
num_vertices_added: usize
) -> LineStripBuilder<'_, 'ctx>
fn create_strip_builder( &mut self, num_strips_added: usize, num_vertices_added: usize ) -> LineStripBuilder<'_, 'ctx>
num_vertices_added
excludes start sentinel.
sourcepub fn world_from_obj(self, world_from_obj: Affine3A) -> Self
pub fn world_from_obj(self, world_from_obj: Affine3A) -> Self
Sets the world_from_obj
matrix for the entire batch.
sourcepub fn outline_mask_ids(self, outline_mask_ids: OutlineMaskPreference) -> Self
pub fn outline_mask_ids(self, outline_mask_ids: OutlineMaskPreference) -> Self
Sets an outline mask for every element in the batch.
sourcepub fn picking_object_id(self, picking_object_id: PickingLayerObjectId) -> Self
pub fn picking_object_id(self, picking_object_id: PickingLayerObjectId) -> Self
Sets the picking object id for every element in the batch.
sourcepub fn depth_offset(self, depth_offset: DepthOffset) -> Self
pub fn depth_offset(self, depth_offset: DepthOffset) -> Self
Sets the depth offset for the entire batch.
sourcepub fn triangle_cap_length_factor(self, triangle_cap_length_factor: f32) -> Self
pub fn triangle_cap_length_factor(self, triangle_cap_length_factor: f32) -> Self
Sets the length factor as multiple of a line’s radius applied to all triangle caps in this batch.
This controls how far the “pointy end” of the triangle/arrow-head extends. (defaults to 4.0)
sourcepub fn triangle_cap_width_factor(self, triangle_cap_width_factor: f32) -> Self
pub fn triangle_cap_width_factor(self, triangle_cap_width_factor: f32) -> Self
Sets the width factor as multiple of a line’s radius applied to all triangle caps in this batch.
This controls how wide the triangle/arrow-head is orthogonal to the line’s direction. (defaults to 2.0)
sourcepub fn add_strip(
&mut self,
points: impl ExactSizeIterator<Item = Vec3>
) -> LineStripBuilder<'_, 'ctx>
pub fn add_strip( &mut self, points: impl ExactSizeIterator<Item = Vec3> ) -> LineStripBuilder<'_, 'ctx>
Adds a 3D series of line connected points.
sourcepub fn add_segment(&mut self, a: Vec3, b: Vec3) -> LineStripBuilder<'_, 'ctx>
pub fn add_segment(&mut self, a: Vec3, b: Vec3) -> LineStripBuilder<'_, 'ctx>
Adds a single 3D line segment connecting two points.
sourcepub fn add_segments(
&mut self,
segments: impl ExactSizeIterator<Item = (Vec3, Vec3)>
) -> LineStripBuilder<'_, 'ctx>
pub fn add_segments( &mut self, segments: impl ExactSizeIterator<Item = (Vec3, Vec3)> ) -> LineStripBuilder<'_, 'ctx>
Adds a series of unconnected 3D line segments.
sourcepub fn add_box_outline_from_transform(
&mut self,
transform: Affine3A
) -> LineStripBuilder<'_, 'ctx>
pub fn add_box_outline_from_transform( &mut self, transform: Affine3A ) -> LineStripBuilder<'_, 'ctx>
Add box outlines from a unit cube transformed by transform
.
Disables color gradient since we don’t support gradients in this setup yet (i.e. enabling them does not look good)
sourcepub fn add_box_outline(
&mut self,
bbox: &BoundingBox
) -> Option<LineStripBuilder<'_, 'ctx>>
pub fn add_box_outline( &mut self, bbox: &BoundingBox ) -> Option<LineStripBuilder<'_, 'ctx>>
Add box outlines.
Internally a single closed line strip. Disables color gradient since we don’t support gradients in this setup yet (i.e. enabling them does not look good)
Returns None for empty and non-finite boxes.
fn add_box_from_corners( &mut self, corners: [Vec3; 8] ) -> LineStripBuilder<'_, 'ctx>
sourcepub fn add_rectangle_outline(
&mut self,
top_left_corner: Vec3,
extent_u: Vec3,
extent_v: Vec3
) -> LineStripBuilder<'_, 'ctx>
pub fn add_rectangle_outline( &mut self, top_left_corner: Vec3, extent_u: Vec3, extent_v: Vec3 ) -> LineStripBuilder<'_, 'ctx>
Add rectangle outlines.
Internally adds a single linestrip with 5 vertices. Disables color gradient since we don’t support gradients in this setup yet (i.e. enabling them does not look good)
sourcepub fn add_strip_2d(
&mut self,
points: impl ExactSizeIterator<Item = Vec2>
) -> LineStripBuilder<'_, 'ctx>
pub fn add_strip_2d( &mut self, points: impl ExactSizeIterator<Item = Vec2> ) -> LineStripBuilder<'_, 'ctx>
Adds a 2D series of line connected points.
Uses autogenerated depth value.
sourcepub fn add_segment_2d(&mut self, a: Vec2, b: Vec2) -> LineStripBuilder<'_, 'ctx>
pub fn add_segment_2d(&mut self, a: Vec2, b: Vec2) -> LineStripBuilder<'_, 'ctx>
Adds a single 2D line segment connecting two points. Uses autogenerated depth value.
sourcepub fn add_segments_2d(
&mut self,
segments: impl ExactSizeIterator<Item = (Vec2, Vec2)>
) -> LineStripBuilder<'_, 'ctx>
pub fn add_segments_2d( &mut self, segments: impl ExactSizeIterator<Item = (Vec2, Vec2)> ) -> LineStripBuilder<'_, 'ctx>
Adds a series of unconnected 2D line segments.
Uses autogenerated depth value, all segments get the same depth value.
sourcepub fn add_rectangle_outline_2d(
&mut self,
top_left_corner: Vec2,
extent_u: Vec2,
extent_v: Vec2
) -> LineStripBuilder<'_, 'ctx>
pub fn add_rectangle_outline_2d( &mut self, top_left_corner: Vec2, extent_u: Vec2, extent_v: Vec2 ) -> LineStripBuilder<'_, 'ctx>
Add 2D rectangle outlines.
Internally adds 4 2D line segments with rounded line heads. Disables color gradient since we don’t support gradients in this setup yet (i.e. enabling them does not look good)
sourcepub fn add_axis_aligned_rectangle_outline_2d(
&mut self,
min: Vec2,
max: Vec2
) -> LineStripBuilder<'_, 'ctx>
pub fn add_axis_aligned_rectangle_outline_2d( &mut self, min: Vec2, max: Vec2 ) -> LineStripBuilder<'_, 'ctx>
Add 2D rectangle outlines with axis along X and Y.
Internally adds 4 2D line segments with rounded line heads. Disables color gradient since we don’t support gradients in this setup yet (i.e. enabling them does not look good)
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'ctx> Freeze for LineBatchBuilder<'a, 'ctx>
impl<'a, 'ctx> !RefUnwindSafe for LineBatchBuilder<'a, 'ctx>
impl<'a, 'ctx> Send for LineBatchBuilder<'a, 'ctx>
impl<'a, 'ctx> Sync for LineBatchBuilder<'a, 'ctx>
impl<'a, 'ctx> Unpin for LineBatchBuilder<'a, 'ctx>
impl<'a, 'ctx> !UnwindSafe for LineBatchBuilder<'a, 'ctx>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more