pub enum CurrentMotion {
Stationary,
Momentum {
velocity: Velocity,
momentum_start: Instant,
},
UserControlled {
anchor: DVec3,
motion_inputs: MotionInputs,
},
}bevy_camera_controller and pan_orbit_camera only.Expand description
The current motion state of the camera.
Variants§
Stationary
The camera is not moving.
Momentum
The camera is in motion, but not being directly controlled by the user. This happens while the camera has momentum.
Fields
UserControlled
The camera is being directly controlled by the user.
Fields
anchor: DVec3The point the camera is rotating about, zooming into, or panning with, in view space (relative to the camera).
- Rotation: the direction of the anchor does not change, it is fixed in screenspace.
- Panning: the depth of the anchor does not change, the camera only moves in x and y.
- Zoom: the direction of the anchor does not change, but the length does.
motion_inputs: MotionInputsPan and orbit are mutually exclusive, however both can be used with zoom.
Implementations§
Source§impl CurrentMotion
impl CurrentMotion
Sourcepub fn is_moving(&self) -> bool
pub fn is_moving(&self) -> bool
Returns true if the camera is moving due to inputs or momentum.
Sourcepub fn is_user_controlled(&self) -> bool
pub fn is_user_controlled(&self) -> bool
Returns true if the camera is moving due to user inputs.
Sourcepub fn inputs(&self) -> Option<&MotionInputs>
pub fn inputs(&self) -> Option<&MotionInputs>
Get the user motion inputs if they exist.
Examples found in repository?
69pub fn custom_camera_inputs(
70 pointers: Query<(&PointerId, &PointerLocation)>,
71 pointer_map: Res<CameraPointerMap>,
72 mut controller: MessageWriter<PanOrbitCameraInputMessage>,
73 mut mouse_wheel: MessageReader<MouseWheel>,
74 mouse_input: Res<ButtonInput<MouseButton>>,
75 cameras: Query<(Entity, &Camera, &RenderTarget, &PanOrbitCamera)>,
76 primary_window: Query<Entity, With<PrimaryWindow>>,
77) {
78 let orbit_start = MouseButton::Right;
79 let pan_start = MouseButton::Left;
80 let zoom_stop = 0.0;
81
82 if let Some(&camera) = pointer_map.get(&PointerId::Mouse) {
83 let camera_query = cameras.get(camera).ok();
84 let is_in_zoom_mode = camera_query
85 .map(|(.., editor_cam)| editor_cam.current_motion.is_zooming_only())
86 .unwrap_or_default();
87 let zoom_amount_abs = camera_query
88 .and_then(|(.., editor_cam)| {
89 editor_cam
90 .current_motion
91 .inputs()
92 .map(|inputs| inputs.zoom_velocity_abs(editor_cam.smoothing.zoom.mul_f32(2.0)))
93 })
94 .unwrap_or(0.0);
95 let should_zoom_end = is_in_zoom_mode && zoom_amount_abs <= zoom_stop;
96
97 if mouse_input.any_just_released([orbit_start, pan_start]) || should_zoom_end {
98 controller.write(PanOrbitCameraInputMessage::End { camera });
99 }
100 }
101
102 for (&pointer, pointer_location) in pointers
103 .iter()
104 .filter_map(|(id, loc)| loc.location().map(|loc| (id, loc)))
105 {
106 match pointer {
107 PointerId::Mouse => {
108 let Some((camera, ..)) = cameras.iter().find(|(_, camera, render_target, _)| {
109 pointer_location.is_in_viewport(camera, render_target, &primary_window)
110 }) else {
111 continue; // Pointer must be in viewport to start a motion.
112 };
113
114 if mouse_input.just_pressed(orbit_start) {
115 controller.write(PanOrbitCameraInputMessage::Start {
116 kind: MotionKind::OrbitZoom,
117 camera,
118 pointer,
119 });
120 } else if mouse_input.just_pressed(pan_start) {
121 controller.write(PanOrbitCameraInputMessage::Start {
122 kind: MotionKind::PanZoom,
123 camera,
124 pointer,
125 });
126 } else if mouse_wheel.read().map(|mw| mw.y.abs()).sum::<f32>() > 0.0 {
127 // Note we can't just check if the mouse wheel inputs are empty, we need to
128 // check if the y value abs greater than zero, otherwise we get a bunch of false
129 // positives, which can cause issues with figuring out what the user is trying
130 // to do.
131 controller.write(PanOrbitCameraInputMessage::Start {
132 kind: MotionKind::Zoom,
133 camera,
134 pointer,
135 });
136 }
137 }
138 PointerId::Touch(_) | PointerId::Custom(_) => continue,
139 }
140 }
141
142 // This must be cleared manually because reading these inputs is conditional - we are not
143 // guaranteed to be flushing the events every frame.
144 mouse_wheel.clear();
145}Sourcepub fn is_orbiting(&self) -> bool
pub fn is_orbiting(&self) -> bool
Returns true if the camera is user controlled and orbiting.
Sourcepub fn is_panning(&self) -> bool
pub fn is_panning(&self) -> bool
Returns true if the camera is user controlled and panning.
Sourcepub fn is_zooming_only(&self) -> bool
pub fn is_zooming_only(&self) -> bool
Returns true if the camera is user controlled and only zooming.
Examples found in repository?
69pub fn custom_camera_inputs(
70 pointers: Query<(&PointerId, &PointerLocation)>,
71 pointer_map: Res<CameraPointerMap>,
72 mut controller: MessageWriter<PanOrbitCameraInputMessage>,
73 mut mouse_wheel: MessageReader<MouseWheel>,
74 mouse_input: Res<ButtonInput<MouseButton>>,
75 cameras: Query<(Entity, &Camera, &RenderTarget, &PanOrbitCamera)>,
76 primary_window: Query<Entity, With<PrimaryWindow>>,
77) {
78 let orbit_start = MouseButton::Right;
79 let pan_start = MouseButton::Left;
80 let zoom_stop = 0.0;
81
82 if let Some(&camera) = pointer_map.get(&PointerId::Mouse) {
83 let camera_query = cameras.get(camera).ok();
84 let is_in_zoom_mode = camera_query
85 .map(|(.., editor_cam)| editor_cam.current_motion.is_zooming_only())
86 .unwrap_or_default();
87 let zoom_amount_abs = camera_query
88 .and_then(|(.., editor_cam)| {
89 editor_cam
90 .current_motion
91 .inputs()
92 .map(|inputs| inputs.zoom_velocity_abs(editor_cam.smoothing.zoom.mul_f32(2.0)))
93 })
94 .unwrap_or(0.0);
95 let should_zoom_end = is_in_zoom_mode && zoom_amount_abs <= zoom_stop;
96
97 if mouse_input.any_just_released([orbit_start, pan_start]) || should_zoom_end {
98 controller.write(PanOrbitCameraInputMessage::End { camera });
99 }
100 }
101
102 for (&pointer, pointer_location) in pointers
103 .iter()
104 .filter_map(|(id, loc)| loc.location().map(|loc| (id, loc)))
105 {
106 match pointer {
107 PointerId::Mouse => {
108 let Some((camera, ..)) = cameras.iter().find(|(_, camera, render_target, _)| {
109 pointer_location.is_in_viewport(camera, render_target, &primary_window)
110 }) else {
111 continue; // Pointer must be in viewport to start a motion.
112 };
113
114 if mouse_input.just_pressed(orbit_start) {
115 controller.write(PanOrbitCameraInputMessage::Start {
116 kind: MotionKind::OrbitZoom,
117 camera,
118 pointer,
119 });
120 } else if mouse_input.just_pressed(pan_start) {
121 controller.write(PanOrbitCameraInputMessage::Start {
122 kind: MotionKind::PanZoom,
123 camera,
124 pointer,
125 });
126 } else if mouse_wheel.read().map(|mw| mw.y.abs()).sum::<f32>() > 0.0 {
127 // Note we can't just check if the mouse wheel inputs are empty, we need to
128 // check if the y value abs greater than zero, otherwise we get a bunch of false
129 // positives, which can cause issues with figuring out what the user is trying
130 // to do.
131 controller.write(PanOrbitCameraInputMessage::Start {
132 kind: MotionKind::Zoom,
133 camera,
134 pointer,
135 });
136 }
137 }
138 PointerId::Touch(_) | PointerId::Custom(_) => continue,
139 }
140 }
141
142 // This must be cleared manually because reading these inputs is conditional - we are not
143 // guaranteed to be flushing the events every frame.
144 mouse_wheel.clear();
145}Sourcepub fn momentum_duration(&self) -> Option<Duration>
pub fn momentum_duration(&self) -> Option<Duration>
How long has the camera been moving with momentum, without user input? This is equivalent to the amount of time since the last input event ended.
Trait Implementations§
Source§impl Clone for CurrentMotion
impl Clone for CurrentMotion
Source§fn clone(&self) -> CurrentMotion
fn clone(&self) -> CurrentMotion
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 CurrentMotion
impl Debug for CurrentMotion
Source§impl Default for CurrentMotion
impl Default for CurrentMotion
Source§fn default() -> CurrentMotion
fn default() -> CurrentMotion
Auto Trait Implementations§
impl Freeze for CurrentMotion
impl RefUnwindSafe for CurrentMotion
impl Send for CurrentMotion
impl Sync for CurrentMotion
impl Unpin for CurrentMotion
impl UnsafeUnpin for CurrentMotion
impl UnwindSafe for CurrentMotion
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<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
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>, which can then be
downcast into Box<dyn 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>, which 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.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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromTemplate for T
impl<T> FromTemplate for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T> HitDataExtra for T
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<G> PatchFromTemplate for Gwhere
G: FromTemplate,
impl<G> PatchFromTemplate for Gwhere
G: FromTemplate,
Source§fn patch<F>(func: F) -> TemplatePatch<F, <G as PatchFromTemplate>::Template>
fn patch<F>(func: F) -> TemplatePatch<F, <G as PatchFromTemplate>::Template>
func, and turns it into a TemplatePatch.Source§impl<T> PatchTemplate for Twhere
T: Template,
impl<T> PatchTemplate for Twhere
T: Template,
Source§fn patch_template<F>(func: F) -> TemplatePatch<F, T>
fn patch_template<F>(func: F) -> TemplatePatch<F, T>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().impl<T> Settings for T
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.Source§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
self.