pub struct Gizmos<'w, 's, T = DefaultGizmoConfigGroup>where
T: GizmoConfigGroup,{
pub config: &'w GizmoConfig,
pub config_ext: &'w T,
/* private fields */
}
Expand description
A SystemParam
for drawing gizmos.
They are drawn in immediate mode, which means they will be rendered only for
the frames in which they are spawned.
Gizmos should be spawned before the Last
schedule to ensure they are drawn.
Fields§
§config: &'w GizmoConfig
The currently used GizmoConfig
config_ext: &'w T
The currently used GizmoConfigGroup
Implementations§
source§impl<'w, 's, T> Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
sourcepub fn arc_2d(
&mut self,
position: Vec2,
direction_angle: f32,
arc_angle: f32,
radius: f32,
color: Color
) -> Arc2dBuilder<'_, 'w, 's, T>
pub fn arc_2d( &mut self, position: Vec2, direction_angle: f32, arc_angle: f32, radius: f32, color: Color ) -> Arc2dBuilder<'_, 'w, 's, T>
Draw an arc, which is a part of the circumference of a circle, in 2D.
This should be called for each frame the arc needs to be rendered.
Arguments
position
sets the center of this circle.radius
controls the distance fromposition
to this arc, and thus its curvature.direction_angle
sets the clockwise angle in radians betweenVec2::Y
and the vector fromposition
to the midpoint of the arc.arc_angle
sets the length of this arc, in radians.
Example
fn system(mut gizmos: Gizmos) {
gizmos.arc_2d(Vec2::ZERO, 0., PI / 4., 1., Color::GREEN);
// Arcs have 32 line-segments by default.
// You may want to increase this for larger arcs.
gizmos
.arc_2d(Vec2::ZERO, 0., PI / 4., 5., Color::RED)
.segments(64);
}
source§impl<'w, 's, T> Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
sourcepub fn arc_3d(
&mut self,
angle: f32,
radius: f32,
position: Vec3,
rotation: Quat,
color: Color
) -> Arc3dBuilder<'_, 'w, 's, T>
pub fn arc_3d( &mut self, angle: f32, radius: f32, position: Vec3, rotation: Quat, color: Color ) -> Arc3dBuilder<'_, 'w, 's, T>
Draw an arc, which is a part of the circumference of a circle, in 3D. For default values this is drawing a standard arc. A standard arc is defined as
- an arc with a center at
Vec3::ZERO
- starting at
Vec3::X
- embedded in the XZ plane
- rotates counterclockwise
This should be called for each frame the arc needs to be rendered.
Arguments
angle
: sets how much of a circle circumference is passed, e.g. PI is half a circle. This value should be in the range (-2 * PI..=2 * PI)radius
: distance between the arc and it’s center pointposition
: position of the arcs center pointrotation
: defines orientation of the arc, by default we assume the arc is contained in a plane parallel to the XZ plane and the default starting point is (position + Vec3::X
)color
: color of the arc
Builder methods
The number of segments of the arc (i.e. the level of detail) can be adjusted with the
.segments(...)
method.
Example
fn system(mut gizmos: Gizmos) {
// rotation rotates normal to point in the direction of `Vec3::NEG_ONE`
let rotation = Quat::from_rotation_arc(Vec3::Y, Vec3::NEG_ONE.normalize());
gizmos
.arc_3d(
270.0_f32.to_radians(),
0.25,
Vec3::ONE,
rotation,
Color::ORANGE
)
.segments(100);
}
sourcepub fn short_arc_3d_between(
&mut self,
center: Vec3,
from: Vec3,
to: Vec3,
color: Color
) -> Arc3dBuilder<'_, 'w, 's, T>
pub fn short_arc_3d_between( &mut self, center: Vec3, from: Vec3, to: Vec3, color: Color ) -> Arc3dBuilder<'_, 'w, 's, T>
Draws the shortest arc between two points (from
and to
) relative to a specified center
point.
Arguments
center
: The center point around which the arc is drawn.from
: The starting point of the arc.to
: The ending point of the arc.color
: color of the arc
Builder methods
The number of segments of the arc (i.e. the level of detail) can be adjusted with the
.segments(...)
method.
Examples
fn system(mut gizmos: Gizmos) {
gizmos.short_arc_3d_between(
Vec3::ONE,
Vec3::ONE + Vec3::NEG_ONE,
Vec3::ZERO,
Color::ORANGE
)
.segments(100);
}
Notes
- This method assumes that the points
from
andto
are distinct fromcenter
. If one of the points is coincident withcenter
, nothing is rendered. - The arc is drawn as a portion of a circle with a radius equal to the distance from the
center
tofrom
. If the distance fromcenter
toto
is not equal to the radius, then the results will behave as if this were the case
sourcepub fn long_arc_3d_between(
&mut self,
center: Vec3,
from: Vec3,
to: Vec3,
color: Color
) -> Arc3dBuilder<'_, 'w, 's, T>
pub fn long_arc_3d_between( &mut self, center: Vec3, from: Vec3, to: Vec3, color: Color ) -> Arc3dBuilder<'_, 'w, 's, T>
Draws the longest arc between two points (from
and to
) relative to a specified center
point.
Arguments
center
: The center point around which the arc is drawn.from
: The starting point of the arc.to
: The ending point of the arc.color
: color of the arc
Builder methods
The number of segments of the arc (i.e. the level of detail) can be adjusted with the
.segments(...)
method.
Examples
fn system(mut gizmos: Gizmos) {
gizmos.long_arc_3d_between(
Vec3::ONE,
Vec3::ONE + Vec3::NEG_ONE,
Vec3::ZERO,
Color::ORANGE
)
.segments(100);
}
Notes
- This method assumes that the points
from
andto
are distinct fromcenter
. If one of the points is coincident withcenter
, nothing is rendered. - The arc is drawn as a portion of a circle with a radius equal to the distance from the
center
tofrom
. If the distance fromcenter
toto
is not equal to the radius, then the results will behave as if this were the case.
source§impl<'w, 's, T> Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
sourcepub fn arrow(
&mut self,
start: Vec3,
end: Vec3,
color: Color
) -> ArrowBuilder<'_, 'w, 's, T>
pub fn arrow( &mut self, start: Vec3, end: Vec3, color: Color ) -> ArrowBuilder<'_, 'w, 's, T>
Draw an arrow in 3D, from start
to end
. Has four tips for convenient viewing from any direction.
This should be called for each frame the arrow needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.arrow(Vec3::ZERO, Vec3::ONE, Color::GREEN);
}
sourcepub fn arrow_2d(
&mut self,
start: Vec2,
end: Vec2,
color: Color
) -> ArrowBuilder<'_, 'w, 's, T>
pub fn arrow_2d( &mut self, start: Vec2, end: Vec2, color: Color ) -> ArrowBuilder<'_, 'w, 's, T>
Draw an arrow in 2D (on the xy plane), from start
to end
.
This should be called for each frame the arrow needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.arrow_2d(Vec2::ZERO, Vec2::X, Color::GREEN);
}
source§impl<'w, 's, T> Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
sourcepub fn ellipse(
&mut self,
position: Vec3,
rotation: Quat,
half_size: Vec2,
color: Color
) -> EllipseBuilder<'_, 'w, 's, T>
pub fn ellipse( &mut self, position: Vec3, rotation: Quat, half_size: Vec2, color: Color ) -> EllipseBuilder<'_, 'w, 's, T>
Draw an ellipse in 3D at position
with the flat side facing normal
.
This should be called for each frame the ellipse needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.ellipse(Vec3::ZERO, Quat::IDENTITY, Vec2::new(1., 2.), Color::GREEN);
// Ellipses have 32 line-segments by default.
// You may want to increase this for larger ellipses.
gizmos
.ellipse(Vec3::ZERO, Quat::IDENTITY, Vec2::new(5., 1.), Color::RED)
.segments(64);
}
sourcepub fn ellipse_2d(
&mut self,
position: Vec2,
angle: f32,
half_size: Vec2,
color: Color
) -> Ellipse2dBuilder<'_, 'w, 's, T>
pub fn ellipse_2d( &mut self, position: Vec2, angle: f32, half_size: Vec2, color: Color ) -> Ellipse2dBuilder<'_, 'w, 's, T>
Draw an ellipse in 2D.
This should be called for each frame the ellipse needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.ellipse_2d(Vec2::ZERO, 180.0_f32.to_radians(), Vec2::new(2., 1.), Color::GREEN);
// Ellipses have 32 line-segments by default.
// You may want to increase this for larger ellipses.
gizmos
.ellipse_2d(Vec2::ZERO, 180.0_f32.to_radians(), Vec2::new(5., 1.), Color::RED)
.segments(64);
}
sourcepub fn circle(
&mut self,
position: Vec3,
normal: Direction3d,
radius: f32,
color: Color
) -> EllipseBuilder<'_, 'w, 's, T>
pub fn circle( &mut self, position: Vec3, normal: Direction3d, radius: f32, color: Color ) -> EllipseBuilder<'_, 'w, 's, T>
Draw a circle in 3D at position
with the flat side facing normal
.
This should be called for each frame the circle needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.circle(Vec3::ZERO, Direction3d::Z, 1., Color::GREEN);
// Circles have 32 line-segments by default.
// You may want to increase this for larger circles.
gizmos
.circle(Vec3::ZERO, Direction3d::Z, 5., Color::RED)
.segments(64);
}
sourcepub fn circle_2d(
&mut self,
position: Vec2,
radius: f32,
color: Color
) -> Ellipse2dBuilder<'_, 'w, 's, T>
pub fn circle_2d( &mut self, position: Vec2, radius: f32, color: Color ) -> Ellipse2dBuilder<'_, 'w, 's, T>
Draw a circle in 2D.
This should be called for each frame the circle needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.circle_2d(Vec2::ZERO, 1., Color::GREEN);
// Circles have 32 line-segments by default.
// You may want to increase this for larger circles.
gizmos
.circle_2d(Vec2::ZERO, 5., Color::RED)
.segments(64);
}
source§impl<'w, 's, T> Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
sourcepub fn line(&mut self, start: Vec3, end: Vec3, color: Color)
pub fn line(&mut self, start: Vec3, end: Vec3, color: Color)
Draw a line in 3D from start
to end
.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.line(Vec3::ZERO, Vec3::X, Color::GREEN);
}
sourcepub fn line_gradient(
&mut self,
start: Vec3,
end: Vec3,
start_color: Color,
end_color: Color
)
pub fn line_gradient( &mut self, start: Vec3, end: Vec3, start_color: Color, end_color: Color )
Draw a line in 3D with a color gradient from start
to end
.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.line_gradient(Vec3::ZERO, Vec3::X, Color::GREEN, Color::RED);
}
sourcepub fn ray(&mut self, start: Vec3, vector: Vec3, color: Color)
pub fn ray(&mut self, start: Vec3, vector: Vec3, color: Color)
Draw a line in 3D from start
to start + vector
.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.ray(Vec3::Y, Vec3::X, Color::GREEN);
}
sourcepub fn ray_gradient(
&mut self,
start: Vec3,
vector: Vec3,
start_color: Color,
end_color: Color
)
pub fn ray_gradient( &mut self, start: Vec3, vector: Vec3, start_color: Color, end_color: Color )
Draw a line in 3D with a color gradient from start
to start + vector
.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.ray_gradient(Vec3::Y, Vec3::X, Color::GREEN, Color::RED);
}
sourcepub fn linestrip(
&mut self,
positions: impl IntoIterator<Item = Vec3>,
color: Color
)
pub fn linestrip( &mut self, positions: impl IntoIterator<Item = Vec3>, color: Color )
Draw a line in 3D made of straight segments between the points.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.linestrip([Vec3::ZERO, Vec3::X, Vec3::Y], Color::GREEN);
}
sourcepub fn linestrip_gradient(
&mut self,
points: impl IntoIterator<Item = (Vec3, Color)>
)
pub fn linestrip_gradient( &mut self, points: impl IntoIterator<Item = (Vec3, Color)> )
Draw a line in 3D made of straight segments between the points, with a color gradient.
This should be called for each frame the lines need to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.linestrip_gradient([
(Vec3::ZERO, Color::GREEN),
(Vec3::X, Color::RED),
(Vec3::Y, Color::BLUE)
]);
}
sourcepub fn sphere(
&mut self,
position: Vec3,
rotation: Quat,
radius: f32,
color: Color
) -> SphereBuilder<'_, 'w, 's, T>
pub fn sphere( &mut self, position: Vec3, rotation: Quat, radius: f32, color: Color ) -> SphereBuilder<'_, 'w, 's, T>
Draw a wireframe sphere in 3D made out of 3 circles around the axes.
This should be called for each frame the sphere needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.sphere(Vec3::ZERO, Quat::IDENTITY, 1., Color::BLACK);
// Each circle has 32 line-segments by default.
// You may want to increase this for larger spheres.
gizmos
.sphere(Vec3::ZERO, Quat::IDENTITY, 5., Color::BLACK)
.circle_segments(64);
}
sourcepub fn rect(&mut self, position: Vec3, rotation: Quat, size: Vec2, color: Color)
pub fn rect(&mut self, position: Vec3, rotation: Quat, size: Vec2, color: Color)
Draw a wireframe rectangle in 3D.
This should be called for each frame the rectangle needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.rect(Vec3::ZERO, Quat::IDENTITY, Vec2::ONE, Color::GREEN);
}
sourcepub fn cuboid(&mut self, transform: impl TransformPoint, color: Color)
pub fn cuboid(&mut self, transform: impl TransformPoint, color: Color)
Draw a wireframe cube in 3D.
This should be called for each frame the cube needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.cuboid(Transform::IDENTITY, Color::GREEN);
}
sourcepub fn line_2d(&mut self, start: Vec2, end: Vec2, color: Color)
pub fn line_2d(&mut self, start: Vec2, end: Vec2, color: Color)
Draw a line in 2D from start
to end
.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.line_2d(Vec2::ZERO, Vec2::X, Color::GREEN);
}
sourcepub fn line_gradient_2d(
&mut self,
start: Vec2,
end: Vec2,
start_color: Color,
end_color: Color
)
pub fn line_gradient_2d( &mut self, start: Vec2, end: Vec2, start_color: Color, end_color: Color )
Draw a line in 2D with a color gradient from start
to end
.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.line_gradient_2d(Vec2::ZERO, Vec2::X, Color::GREEN, Color::RED);
}
sourcepub fn linestrip_2d(
&mut self,
positions: impl IntoIterator<Item = Vec2>,
color: Color
)
pub fn linestrip_2d( &mut self, positions: impl IntoIterator<Item = Vec2>, color: Color )
Draw a line in 2D made of straight segments between the points.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.linestrip_2d([Vec2::ZERO, Vec2::X, Vec2::Y], Color::GREEN);
}
sourcepub fn linestrip_gradient_2d(
&mut self,
positions: impl IntoIterator<Item = (Vec2, Color)>
)
pub fn linestrip_gradient_2d( &mut self, positions: impl IntoIterator<Item = (Vec2, Color)> )
Draw a line in 2D made of straight segments between the points, with a color gradient.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.linestrip_gradient_2d([
(Vec2::ZERO, Color::GREEN),
(Vec2::X, Color::RED),
(Vec2::Y, Color::BLUE)
]);
}
sourcepub fn ray_2d(&mut self, start: Vec2, vector: Vec2, color: Color)
pub fn ray_2d(&mut self, start: Vec2, vector: Vec2, color: Color)
Draw a line in 2D from start
to start + vector
.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.ray_2d(Vec2::Y, Vec2::X, Color::GREEN);
}
sourcepub fn ray_gradient_2d(
&mut self,
start: Vec2,
vector: Vec2,
start_color: Color,
end_color: Color
)
pub fn ray_gradient_2d( &mut self, start: Vec2, vector: Vec2, start_color: Color, end_color: Color )
Draw a line in 2D with a color gradient from start
to start + vector
.
This should be called for each frame the line needs to be rendered.
Example
fn system(mut gizmos: Gizmos) {
gizmos.line_gradient(Vec3::Y, Vec3::X, Color::GREEN, Color::RED);
}
Trait Implementations§
source§impl<'w, 's, T> GizmoPrimitive2d<BoxedPolygon> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<BoxedPolygon> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = ()
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = () where Gizmos<'w, 's, T>: 'a
primitive_2d
. This is a builder to set non-default values.source§fn primitive_2d(
&mut self,
primitive: BoxedPolygon,
position: Vec2,
angle: f32,
color: Color
) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<BoxedPolygon>>::Output<'_>
fn primitive_2d( &mut self, primitive: BoxedPolygon, position: Vec2, angle: f32, color: Color ) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<BoxedPolygon>>::Output<'_>
source§impl<'w, 's, T> GizmoPrimitive2d<BoxedPolyline2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<BoxedPolyline2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = ()
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = () where Gizmos<'w, 's, T>: 'a
primitive_2d
. This is a builder to set non-default values.source§fn primitive_2d(
&mut self,
primitive: BoxedPolyline2d,
position: Vec2,
angle: f32,
color: Color
) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<BoxedPolyline2d>>::Output<'_>
fn primitive_2d( &mut self, primitive: BoxedPolyline2d, position: Vec2, angle: f32, color: Color ) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<BoxedPolyline2d>>::Output<'_>
source§impl<'w, 's, T> GizmoPrimitive2d<Capsule2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<Capsule2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
source§impl<'w, 's, T> GizmoPrimitive2d<Circle> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<Circle> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
source§impl<'w, 's, T> GizmoPrimitive2d<Direction2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<Direction2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = ()
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = () where Gizmos<'w, 's, T>: 'a
primitive_2d
. This is a builder to set non-default values.source§fn primitive_2d(
&mut self,
primitive: Direction2d,
position: Vec2,
angle: f32,
color: Color
) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<Direction2d>>::Output<'_>
fn primitive_2d( &mut self, primitive: Direction2d, position: Vec2, angle: f32, color: Color ) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<Direction2d>>::Output<'_>
source§impl<'w, 's, T> GizmoPrimitive2d<Ellipse> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<Ellipse> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
source§impl<'w, 's, T> GizmoPrimitive2d<Line2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<Line2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = Line2dBuilder<'a, 'w, 's, T>
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = Line2dBuilder<'a, 'w, 's, T> where Gizmos<'w, 's, T>: 'a
primitive_2d
. This is a builder to set non-default values.source§impl<'w, 's, T> GizmoPrimitive2d<Plane2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<Plane2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
source§impl<'w, 's, const N: usize, T> GizmoPrimitive2d<Polygon<N>> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, const N: usize, T> GizmoPrimitive2d<Polygon<N>> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
source§impl<'w, 's, const N: usize, T> GizmoPrimitive2d<Polyline2d<N>> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, const N: usize, T> GizmoPrimitive2d<Polyline2d<N>> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = ()
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = () where Gizmos<'w, 's, T>: 'a
primitive_2d
. This is a builder to set non-default values.source§fn primitive_2d(
&mut self,
primitive: Polyline2d<N>,
position: Vec2,
angle: f32,
color: Color
) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<Polyline2d<N>>>::Output<'_>
fn primitive_2d( &mut self, primitive: Polyline2d<N>, position: Vec2, angle: f32, color: Color ) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<Polyline2d<N>>>::Output<'_>
source§impl<'w, 's, T> GizmoPrimitive2d<Rectangle> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<Rectangle> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
source§impl<'w, 's, T> GizmoPrimitive2d<RegularPolygon> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<RegularPolygon> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = ()
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = () where Gizmos<'w, 's, T>: 'a
primitive_2d
. This is a builder to set non-default values.source§fn primitive_2d(
&mut self,
primitive: RegularPolygon,
position: Vec2,
angle: f32,
color: Color
) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<RegularPolygon>>::Output<'_>
fn primitive_2d( &mut self, primitive: RegularPolygon, position: Vec2, angle: f32, color: Color ) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<RegularPolygon>>::Output<'_>
source§impl<'w, 's, T> GizmoPrimitive2d<Segment2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<Segment2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = Segment2dBuilder<'a, 'w, 's, T>
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = Segment2dBuilder<'a, 'w, 's, T> where Gizmos<'w, 's, T>: 'a
primitive_2d
. This is a builder to set non-default values.source§impl<'w, 's, T> GizmoPrimitive2d<Triangle2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive2d<Triangle2d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = ()
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = () where Gizmos<'w, 's, T>: 'a
primitive_2d
. This is a builder to set non-default values.source§fn primitive_2d(
&mut self,
primitive: Triangle2d,
position: Vec2,
angle: f32,
color: Color
) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<Triangle2d>>::Output<'_>
fn primitive_2d( &mut self, primitive: Triangle2d, position: Vec2, angle: f32, color: Color ) -> <Gizmos<'w, 's, T> as GizmoPrimitive2d<Triangle2d>>::Output<'_>
source§impl<'w, 's, T> GizmoPrimitive3d<BoxedPolyline3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<BoxedPolyline3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = ()
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = () where Gizmos<'w, 's, T>: 'a
primitive_3d
. This is a builder to set non-default values.source§fn primitive_3d(
&mut self,
primitive: BoxedPolyline3d,
position: Vec3,
rotation: Quat,
color: Color
) -> <Gizmos<'w, 's, T> as GizmoPrimitive3d<BoxedPolyline3d>>::Output<'_>
fn primitive_3d( &mut self, primitive: BoxedPolyline3d, position: Vec3, rotation: Quat, color: Color ) -> <Gizmos<'w, 's, T> as GizmoPrimitive3d<BoxedPolyline3d>>::Output<'_>
source§impl<'w, 's, T> GizmoPrimitive3d<Capsule3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<Capsule3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = Capsule3dBuilder<'a, 'w, 's, T>
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = Capsule3dBuilder<'a, 'w, 's, T> where Gizmos<'w, 's, T>: 'a
primitive_3d
. This is a builder to set non-default values.source§impl<'w, 's, T> GizmoPrimitive3d<Cone> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<Cone> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = Cone3dBuilder<'a, 'w, 's, T>
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = Cone3dBuilder<'a, 'w, 's, T> where Gizmos<'w, 's, T>: 'a
primitive_3d
. This is a builder to set non-default values.source§impl<'w, 's, T> GizmoPrimitive3d<ConicalFrustum> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<ConicalFrustum> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = ConicalFrustum3dBuilder<'a, 'w, 's, T>
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = ConicalFrustum3dBuilder<'a, 'w, 's, T> where Gizmos<'w, 's, T>: 'a
primitive_3d
. This is a builder to set non-default values.source§fn primitive_3d(
&mut self,
primitive: ConicalFrustum,
position: Vec3,
rotation: Quat,
color: Color
) -> <Gizmos<'w, 's, T> as GizmoPrimitive3d<ConicalFrustum>>::Output<'_>
fn primitive_3d( &mut self, primitive: ConicalFrustum, position: Vec3, rotation: Quat, color: Color ) -> <Gizmos<'w, 's, T> as GizmoPrimitive3d<ConicalFrustum>>::Output<'_>
source§impl<'w, 's, T> GizmoPrimitive3d<Cuboid> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<Cuboid> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
source§impl<'w, 's, T> GizmoPrimitive3d<Cylinder> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<Cylinder> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = Cylinder3dBuilder<'a, 'w, 's, T>
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = Cylinder3dBuilder<'a, 'w, 's, T> where Gizmos<'w, 's, T>: 'a
primitive_3d
. This is a builder to set non-default values.source§impl<'w, 's, T> GizmoPrimitive3d<Direction3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<Direction3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = ()
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = () where Gizmos<'w, 's, T>: 'a
primitive_3d
. This is a builder to set non-default values.source§fn primitive_3d(
&mut self,
primitive: Direction3d,
position: Vec3,
rotation: Quat,
color: Color
) -> <Gizmos<'w, 's, T> as GizmoPrimitive3d<Direction3d>>::Output<'_>
fn primitive_3d( &mut self, primitive: Direction3d, position: Vec3, rotation: Quat, color: Color ) -> <Gizmos<'w, 's, T> as GizmoPrimitive3d<Direction3d>>::Output<'_>
source§impl<'w, 's, T> GizmoPrimitive3d<Line3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<Line3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
source§impl<'w, 's, T> GizmoPrimitive3d<Plane3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<Plane3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = Plane3dBuilder<'a, 'w, 's, T>
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = Plane3dBuilder<'a, 'w, 's, T> where Gizmos<'w, 's, T>: 'a
primitive_3d
. This is a builder to set non-default values.source§impl<'w, 's, const N: usize, T> GizmoPrimitive3d<Polyline3d<N>> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, const N: usize, T> GizmoPrimitive3d<Polyline3d<N>> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = ()
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = () where Gizmos<'w, 's, T>: 'a
primitive_3d
. This is a builder to set non-default values.source§fn primitive_3d(
&mut self,
primitive: Polyline3d<N>,
position: Vec3,
rotation: Quat,
color: Color
) -> <Gizmos<'w, 's, T> as GizmoPrimitive3d<Polyline3d<N>>>::Output<'_>
fn primitive_3d( &mut self, primitive: Polyline3d<N>, position: Vec3, rotation: Quat, color: Color ) -> <Gizmos<'w, 's, T> as GizmoPrimitive3d<Polyline3d<N>>>::Output<'_>
source§impl<'w, 's, T> GizmoPrimitive3d<Segment3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<Segment3d> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
source§impl<'w, 's, T> GizmoPrimitive3d<Sphere> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<Sphere> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = SphereBuilder<'a, 'w, 's, T>
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = SphereBuilder<'a, 'w, 's, T> where Gizmos<'w, 's, T>: 'a
primitive_3d
. This is a builder to set non-default values.source§impl<'w, 's, T> GizmoPrimitive3d<Torus> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
impl<'w, 's, T> GizmoPrimitive3d<Torus> for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
§type Output<'a> = Torus3dBuilder<'a, 'w, 's, T>
where
Gizmos<'w, 's, T>: 'a
type Output<'a> = Torus3dBuilder<'a, 'w, 's, T> where Gizmos<'w, 's, T>: 'a
primitive_3d
. This is a builder to set non-default values.source§impl<T> SystemParam for Gizmos<'_, '_, T>where
T: GizmoConfigGroup,
impl<T> SystemParam for Gizmos<'_, '_, T>where
T: GizmoConfigGroup,
§type Item<'w, 's> = Gizmos<'w, 's, T>
type Item<'w, 's> = Gizmos<'w, 's, T>
Self
, instantiated with new lifetimes. Read moresource§fn init_state(
world: &mut World,
system_meta: &mut SystemMeta
) -> <Gizmos<'_, '_, T> as SystemParam>::State
fn init_state( world: &mut World, system_meta: &mut SystemMeta ) -> <Gizmos<'_, '_, T> as SystemParam>::State
World
access used by this SystemParam
and creates a new instance of this param’s State
.source§fn new_archetype(
state: &mut <Gizmos<'_, '_, T> as SystemParam>::State,
archetype: &Archetype,
system_meta: &mut SystemMeta
)
fn new_archetype( state: &mut <Gizmos<'_, '_, T> as SystemParam>::State, archetype: &Archetype, system_meta: &mut SystemMeta )
Archetype
, registers the components accessed by this SystemParam
(if applicable).source§fn apply(
state: &mut <Gizmos<'_, '_, T> as SystemParam>::State,
system_meta: &SystemMeta,
world: &mut World
)
fn apply( state: &mut <Gizmos<'_, '_, T> as SystemParam>::State, system_meta: &SystemMeta, world: &mut World )
SystemParam
’s state.
This is used to apply Commands
during apply_deferred
.source§unsafe fn get_param<'w, 's>(
state: &'s mut <Gizmos<'_, '_, T> as SystemParam>::State,
system_meta: &SystemMeta,
world: UnsafeWorldCell<'w>,
change_tick: Tick
) -> <Gizmos<'_, '_, T> as SystemParam>::Item<'w, 's>
unsafe fn get_param<'w, 's>( state: &'s mut <Gizmos<'_, '_, T> as SystemParam>::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'w>, change_tick: Tick ) -> <Gizmos<'_, '_, T> as SystemParam>::Item<'w, 's>
SystemParamFunction
. Read moreimpl<'w, 's, T> ReadOnlySystemParam for Gizmos<'w, 's, T>where
T: GizmoConfigGroup,
Deferred<'s, GizmoBuffer<T>>: ReadOnlySystemParam,
Res<'w, GizmoConfigStore>: ReadOnlySystemParam,
Auto Trait Implementations§
impl<'w, 's, T> RefUnwindSafe for Gizmos<'w, 's, T>where
T: RefUnwindSafe,
impl<'w, 's, T> Send for Gizmos<'w, 's, T>
impl<'w, 's, T> Sync for Gizmos<'w, 's, T>
impl<'w, 's, T> Unpin for Gizmos<'w, 's, T>
impl<'w, 's, T = DefaultGizmoConfigGroup> !UnwindSafe for Gizmos<'w, 's, T>
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§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
.source§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
.source§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.source§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.