Struct fyrox::scene::animation::AnimationPlayer
source · pub struct AnimationPlayer { /* private fields */ }
Expand description
Animation player is a node that contains multiple animations. It updates and plays all the animations.
The node could be a source of animations for animation blending state machines. To learn more about
animations, see Animation
docs.
§Examples
Always prefer using animation editor to create animation player nodes. It has rich functionality and an ability to preview the result of animations. If you need to create an animation procedurally, the next code snippet is for you.
fn create_bounce_animation(animated_node: Handle<Node>) -> Animation {
let mut frames_container = TrackDataContainer::new(TrackValueKind::Vector3);
// We'll animate only Y coordinate (at index 1).
frames_container.curves_mut()[1] = Curve::from(vec![
CurveKey::new(0.1, 1.0, CurveKeyKind::Linear),
CurveKey::new(0.2, 0.0, CurveKeyKind::Linear),
CurveKey::new(0.3, 0.75, CurveKeyKind::Linear),
CurveKey::new(0.4, 0.0, CurveKeyKind::Linear),
CurveKey::new(0.5, 0.25, CurveKeyKind::Linear),
CurveKey::new(0.6, 0.0, CurveKeyKind::Linear),
]);
// Create a track that will animated the node using the curve above.
let mut track = Track::new(frames_container, ValueBinding::Position);
track.set_target(animated_node);
// Finally create an animation and set its time slice and turn it on.
let mut animation = Animation::default();
animation.add_track(track);
animation.set_time_slice(0.0..0.6);
animation.set_enabled(true);
animation
}
fn create_bounce_animation_player(
animated_node: Handle<Node>,
graph: &mut Graph,
) -> Handle<Node> {
let mut animations = AnimationContainer::new();
// Create a bounce animation.
animations.add(create_bounce_animation(animated_node));
AnimationPlayerBuilder::new(BaseBuilder::new())
.with_animations(animations)
.build(graph)
}
As you can see, the example is quite big. That’s why you should always prefer using the editor to create animations.
The example creates a bounce animation first - it is a simple animation that animates position of a given node
(animated_node
). Only then it creates an animation player node with an animation container with a single animation.
To understand why this is so complicated, see the docs of Animation
.
Implementations§
source§impl AnimationPlayer
impl AnimationPlayer
pub const BASE: &'static str = "base"
pub const ANIMATIONS: &'static str = "animations"
pub const AUTO_APPLY: &'static str = "auto_apply"
source§impl AnimationPlayer
impl AnimationPlayer
sourcepub fn set_auto_apply(&mut self, auto_apply: bool)
pub fn set_auto_apply(&mut self, auto_apply: bool)
Enables or disables automatic animation pose applying. Every animation in the node is updated first, and then their output pose could be applied to the graph, so the animation takes effect. Automatic applying is useful when you need your animations to be applied immediately to the graph, but in some cases (if you’re using animation blending state machines for example) this functionality is undesired.
sourcepub fn is_auto_apply(&self) -> bool
pub fn is_auto_apply(&self) -> bool
Returns true
if the node is automatically applying output poses of animations to the graph, false
-
otherwise.
sourcepub fn animations(
&self
) -> &InheritableVariable<AnimationContainer<Handle<Node>>>
pub fn animations( &self ) -> &InheritableVariable<AnimationContainer<Handle<Node>>>
Returns a reference to internal animations container.
sourcepub fn animations_mut(
&mut self
) -> &mut InheritableVariable<AnimationContainer<Handle<Node>>>
pub fn animations_mut( &mut self ) -> &mut InheritableVariable<AnimationContainer<Handle<Node>>>
Returns a reference to internal animations container. Keep in mind that mutable access to InheritableVariable
may have side effects if used inappropriately. Checks docs for InheritableVariable
for more info.
sourcepub fn set_animations(&mut self, animations: AnimationContainer<Handle<Node>>)
pub fn set_animations(&mut self, animations: AnimationContainer<Handle<Node>>)
Sets new animations container of the animation player.
Methods from Deref<Target = Base>§
pub const NAME: &'static str = "name"
pub const LOCAL_TRANSFORM: &'static str = "local_transform"
pub const VISIBILITY: &'static str = "visibility"
pub const LIFETIME: &'static str = "lifetime"
pub const DEPTH_OFFSET: &'static str = "depth_offset"
pub const LOD_GROUP: &'static str = "lod_group"
pub const MOBILITY: &'static str = "mobility"
pub const TAG: &'static str = "tag"
pub const CAST_SHADOWS: &'static str = "cast_shadows"
pub const PROPERTIES: &'static str = "properties"
pub const FRUSTUM_CULLING: &'static str = "frustum_culling"
pub const IS_RESOURCE_INSTANCE_ROOT: &'static str = "is_resource_instance_root"
pub const RESOURCE: &'static str = "resource"
pub const SCRIPTS: &'static str = "scripts"
pub const ENABLED: &'static str = "enabled"
sourcepub fn set_name<N>(&mut self, name: N)
pub fn set_name<N>(&mut self, name: N)
Sets name of node. Can be useful to mark a node to be able to find it later on.
sourcepub fn name_owned(&self) -> String
pub fn name_owned(&self) -> String
Returns owned name of node.
sourcepub fn local_transform(&self) -> &Transform
pub fn local_transform(&self) -> &Transform
Returns shared reference to local transform of a node, can be used to fetch some local spatial properties, such as position, rotation, scale, etc.
sourcepub fn local_transform_mut(&mut self) -> &mut Transform
pub fn local_transform_mut(&mut self) -> &mut Transform
Returns mutable reference to local transform of a node, can be used to set some local spatial properties, such as position, rotation, scale, etc.
sourcepub fn set_local_transform(&mut self, transform: Transform)
pub fn set_local_transform(&mut self, transform: Transform)
Sets new local transform of a node.
sourcepub fn find_properties_ref<'a>(
&'a self,
name: &'a str
) -> impl Iterator<Item = &'a Property>
pub fn find_properties_ref<'a>( &'a self, name: &'a str ) -> impl Iterator<Item = &'a Property>
Tries to find properties by the name. The method returns an iterator because it possible to have multiple properties with the same name.
sourcepub fn find_first_property_ref(&self, name: &str) -> Option<&Property>
pub fn find_first_property_ref(&self, name: &str) -> Option<&Property>
Tries to find a first property with the given name.
sourcepub fn set_properties(&mut self, properties: Vec<Property>) -> Vec<Property>
pub fn set_properties(&mut self, properties: Vec<Property>) -> Vec<Property>
Sets a new set of properties of the node.
sourcepub fn set_lifetime(&mut self, time_seconds: Option<f32>) -> &mut Base
pub fn set_lifetime(&mut self, time_seconds: Option<f32>) -> &mut Base
Sets lifetime of node in seconds, lifetime is useful for temporary objects. Example - you firing a gun, it produces two particle systems for each shot: one for gunpowder fumes and one when bullet hits some surface. These particle systems won’t last very long - usually they will disappear in 1-2 seconds but nodes will still be in scene consuming precious CPU clocks. This is where lifetimes become handy - you just set appropriate lifetime for a particle system node and it will be removed from scene when time will end. This is efficient algorithm because scene holds every object in pool and allocation or deallocation of node takes very little amount of time.
sourcepub fn lifetime(&self) -> Option<f32>
pub fn lifetime(&self) -> Option<f32>
Returns current lifetime of a node. Will be None if node has undefined lifetime.
For more info about lifetimes see set_lifetime
.
sourcepub fn children(&self) -> &[Handle<Node>]
pub fn children(&self) -> &[Handle<Node>]
Returns slice of handles to children nodes. This can be used, for example, to traverse tree starting from some node.
sourcepub fn global_transform(
&self
) -> Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>
pub fn global_transform( &self ) -> Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>
Returns global transform matrix, such matrix contains combined transformation of transforms of parent nodes. This is the final matrix that describes real location of object in the world.
sourcepub fn inv_bind_pose_transform(
&self
) -> Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>
pub fn inv_bind_pose_transform( &self ) -> Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>
Returns inverse of bind pose matrix. Bind pose matrix - is special matrix for bone nodes, it stores initial transform of bone node at the moment of “binding” vertices to bones.
sourcepub fn is_resource_instance_root(&self) -> bool
pub fn is_resource_instance_root(&self) -> bool
Returns true if this node is model resource instance root node.
sourcepub fn resource(&self) -> Option<Resource<Model>>
pub fn resource(&self) -> Option<Resource<Model>>
Returns resource from which this node was instantiated from.
sourcepub fn set_visibility(&mut self, visibility: bool) -> bool
pub fn set_visibility(&mut self, visibility: bool) -> bool
Sets local visibility of a node.
sourcepub fn visibility(&self) -> bool
pub fn visibility(&self) -> bool
Returns local visibility of a node.
sourcepub fn local_bounding_box(&self) -> AxisAlignedBoundingBox
pub fn local_bounding_box(&self) -> AxisAlignedBoundingBox
Returns current local-space bounding box. Keep in mind that this value is just a placeholder, because there is not information to calculate actual bounding box.
sourcepub fn world_bounding_box(&self) -> AxisAlignedBoundingBox
pub fn world_bounding_box(&self) -> AxisAlignedBoundingBox
Returns current world-space bounding box.
sourcepub fn set_mobility(&mut self, mobility: Mobility) -> Mobility
pub fn set_mobility(&mut self, mobility: Mobility) -> Mobility
Set new mobility for the node. See Mobility
docs for more info.
sourcepub fn global_visibility(&self) -> bool
pub fn global_visibility(&self) -> bool
Returns combined visibility of an node. This is the final visibility of a node. Global visibility calculated using visibility of all parent nodes until root one, so if some parent node upper on tree is invisible then all its children will be invisible. It defines if object will be rendered. It is not the same as real visibility from point of view of a camera. Use frustum-box intersection test instead.
sourcepub fn original_handle_in_resource(&self) -> Handle<Node>
pub fn original_handle_in_resource(&self) -> Handle<Node>
Handle to node in scene of model resource from which this node was instantiated from.
§Notes
This handle is extensively used to fetch information about the state of node in the resource to sync properties of instance with its original in the resource.
sourcepub fn global_position(
&self
) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn global_position( &self ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
Returns position of the node in absolute coordinates.
sourcepub fn look_vector(
&self
) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn look_vector( &self ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
Returns “look” vector of global transform basis, in most cases return vector will be non-normalized.
sourcepub fn side_vector(
&self
) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn side_vector( &self ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
Returns “side” vector of global transform basis, in most cases return vector will be non-normalized.
sourcepub fn up_vector(
&self
) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn up_vector( &self ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
Returns “up” vector of global transform basis, in most cases return vector will be non-normalized.
sourcepub fn set_depth_offset_factor(&mut self, factor: f32) -> f32
pub fn set_depth_offset_factor(&mut self, factor: f32) -> f32
Sets depth range offset factor. It allows you to move depth range by given value. This can be used to draw weapons on top of other stuff in scene.
§Details
This value is used to modify projection matrix before render node. Element m[4][3] of projection matrix usually set to -1 to which makes w coordinate of in homogeneous space to be -z_fragment for further perspective divide. We can abuse this to shift z of fragment by some value.
sourcepub fn depth_offset_factor(&self) -> f32
pub fn depth_offset_factor(&self) -> f32
Returns depth offset factor.
sourcepub fn set_lod_group(&mut self, lod_group: Option<LodGroup>) -> Option<LodGroup>
pub fn set_lod_group(&mut self, lod_group: Option<LodGroup>) -> Option<LodGroup>
Sets new lod group.
sourcepub fn take_lod_group(&mut self) -> Option<LodGroup>
pub fn take_lod_group(&mut self) -> Option<LodGroup>
Extracts lod group, leaving None in the node.
sourcepub fn lod_group_mut(&mut self) -> Option<&mut LodGroup>
pub fn lod_group_mut(&mut self) -> Option<&mut LodGroup>
Returns mutable reference to current lod group.
sourcepub fn frustum_culling(&self) -> bool
pub fn frustum_culling(&self) -> bool
Return the frustum_culling flag
sourcepub fn set_frustum_culling(&mut self, frustum_culling: bool) -> bool
pub fn set_frustum_culling(&mut self, frustum_culling: bool) -> bool
Sets whether to use frustum culling or not
sourcepub fn cast_shadows(&self) -> bool
pub fn cast_shadows(&self) -> bool
Returns true if the node should cast shadows, false - otherwise.
sourcepub fn set_cast_shadows(&mut self, cast_shadows: bool) -> bool
pub fn set_cast_shadows(&mut self, cast_shadows: bool) -> bool
Sets whether the mesh should cast shadows or not.
sourcepub fn instance_id(&self) -> SceneNodeId
pub fn instance_id(&self) -> SceneNodeId
Returns current instance id.
sourcepub fn remove_script(&mut self, index: usize)
pub fn remove_script(&mut self, index: usize)
Removes a script with the given index
from the scene node. The script will be destroyed
in either the current update tick (if it was removed from some other script) or in the next
update tick of the parent graph.
sourcepub fn remove_all_scripts(&mut self)
pub fn remove_all_scripts(&mut self)
Removes all assigned scripts from the scene node. The scripts will be removed from first-to-last order an their actual destruction will happen either on the current update tick of the parent graph (if it was removed from some other script) or in the next update tick.
sourcepub fn replace_script(&mut self, index: usize, script: Option<Script>)
pub fn replace_script(&mut self, index: usize, script: Option<Script>)
Sets a new script for the scene node by index. Previous script will be removed (see
Self::remove_script
docs for more info).
sourcepub fn add_script<T>(&mut self, script: T)where
T: ScriptTrait,
pub fn add_script<T>(&mut self, script: T)where
T: ScriptTrait,
Adds a new script to the scene node. The new script will be initialized either in the current
update tick (if the script was added in one of the ScriptTrait
methods) or on the next
update tick.
sourcepub fn has_script<T>(&self) -> boolwhere
T: ScriptTrait,
pub fn has_script<T>(&self) -> boolwhere
T: ScriptTrait,
Checks if the node has a script of a particular type. Returns false
if there is no such
script.
sourcepub fn has_scripts_assigned(&self) -> bool
pub fn has_scripts_assigned(&self) -> bool
Checks if the node has any scripts assigned.
sourcepub fn try_get_script<T>(&self) -> Option<&T>where
T: ScriptTrait,
pub fn try_get_script<T>(&self) -> Option<&T>where
T: ScriptTrait,
Tries to find a first script of the given type T
, returns None
if there’s no such
script.
sourcepub fn try_get_scripts<T>(&self) -> impl Iterator<Item = &T>where
T: ScriptTrait,
pub fn try_get_scripts<T>(&self) -> impl Iterator<Item = &T>where
T: ScriptTrait,
Returns an iterator that yields references to the scripts of the given type T
.
sourcepub fn try_get_script_mut<T>(&mut self) -> Option<&mut T>where
T: ScriptTrait,
pub fn try_get_script_mut<T>(&mut self) -> Option<&mut T>where
T: ScriptTrait,
Tries to find a first script of the given type T
, returns None
if there’s no such
script.
sourcepub fn try_get_scripts_mut<T>(&mut self) -> impl Iterator<Item = &mut T>where
T: ScriptTrait,
pub fn try_get_scripts_mut<T>(&mut self) -> impl Iterator<Item = &mut T>where
T: ScriptTrait,
Returns an iterator that yields references to the scripts of the given type T
.
sourcepub fn try_get_script_component<C>(&self) -> Option<&C>where
C: Any,
pub fn try_get_script_component<C>(&self) -> Option<&C>where
C: Any,
Tries find a component of the given type C
across all available scripts of the node.
If you want to search a component C
in a particular script, then use Self::try_get_script
and then search for component in it.
sourcepub fn try_get_script_component_mut<C>(&mut self) -> Option<&mut C>where
C: Any,
pub fn try_get_script_component_mut<C>(&mut self) -> Option<&mut C>where
C: Any,
Tries find a component of the given type C
across all available scripts of the node.
If you want to search a component C
in a particular script, then use Self::try_get_script
and then search for component in it.
sourcepub fn script_count(&self) -> usize
pub fn script_count(&self) -> usize
Returns total count of scripts assigned to the node.
sourcepub fn script(&self, index: usize) -> Option<&Script>
pub fn script(&self, index: usize) -> Option<&Script>
Returns a shared reference to a script instance with the given index
. This method will
return None
if the index
is out of bounds or the script is temporarily not available.
This could happen if this method was called from some method of a ScriptTrait
. It
happens because of borrowing rules - you cannot take another reference to a script that is
already mutably borrowed.
sourcepub fn scripts(&self) -> impl Iterator<Item = &Script>
pub fn scripts(&self) -> impl Iterator<Item = &Script>
Returns an iterator that yields all assigned scripts.
sourcepub fn script_mut(&mut self, index: usize) -> Option<&mut Script>
pub fn script_mut(&mut self, index: usize) -> Option<&mut Script>
Returns a mutable reference to a script instance with the given index
. This method will
return None
if the index
is out of bounds or the script is temporarily not available.
This could happen if this method was called from some method of a ScriptTrait
. It
happens because of borrowing rules - you cannot take another reference to a script that is
already mutably borrowed.
§Important notes
Do not replace script instance using mutable reference given to you by this method.
This will prevent correct script de-initialization! Use Self::replace_script
if you need
to replace the script.
sourcepub fn scripts_mut(&mut self) -> impl Iterator<Item = &mut Script>
pub fn scripts_mut(&mut self) -> impl Iterator<Item = &mut Script>
Returns an iterator that yields all assigned scripts.
sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enables or disables scene node. Disabled scene nodes won’t be updated (including scripts) or rendered.
§Important notes
Enabled/disabled state will affect children nodes. It means that if you have a node with children nodes,
and you disable the node, all children nodes will be disabled too even if their Self::is_enabled
method
returns true
.
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns true
if the node is enabled, false
- otherwise. The return value does not include the state
of parent nodes. It should be considered as “local” enabled flag. To get actual enabled state, that includes
the state of parent nodes, use Self::is_globally_enabled
method.
sourcepub fn is_globally_enabled(&self) -> bool
pub fn is_globally_enabled(&self) -> bool
Returns true
if the node and every parent up in hierarchy is enabled, false
- otherwise. This method
returns “true” enabled
flag. Its value could be different from the value returned by Self::is_enabled
.
sourcepub fn root_resource(&self) -> Option<Resource<Model>>
pub fn root_resource(&self) -> Option<Resource<Model>>
Returns a root resource of the scene node. This method crawls up on dependency tree until it finds that the ancestor node does not have any dependencies and returns this resource as the root resource. For example, in case of simple scene node instance, this method will return the resource from which the node was instantiated from. In case of 2 or more levels of dependency, it will always return the “top” dependency in the dependency graph.
Trait Implementations§
source§impl Clone for AnimationPlayer
impl Clone for AnimationPlayer
source§fn clone(&self) -> AnimationPlayer
fn clone(&self) -> AnimationPlayer
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AnimationPlayer
impl Debug for AnimationPlayer
source§impl Default for AnimationPlayer
impl Default for AnimationPlayer
source§fn default() -> AnimationPlayer
fn default() -> AnimationPlayer
source§impl Deref for AnimationPlayer
impl Deref for AnimationPlayer
source§impl DerefMut for AnimationPlayer
impl DerefMut for AnimationPlayer
source§impl NodeTrait for AnimationPlayer
impl NodeTrait for AnimationPlayer
source§fn query_component_ref(&self, type_id: TypeId) -> Option<&(dyn Any + 'static)>
fn query_component_ref(&self, type_id: TypeId) -> Option<&(dyn Any + 'static)>
source§fn query_component_mut(
&mut self,
type_id: TypeId
) -> Option<&mut (dyn Any + 'static)>
fn query_component_mut( &mut self, type_id: TypeId ) -> Option<&mut (dyn Any + 'static)>
source§fn local_bounding_box(&self) -> AxisAlignedBoundingBox
fn local_bounding_box(&self) -> AxisAlignedBoundingBox
source§fn world_bounding_box(&self) -> AxisAlignedBoundingBox
fn world_bounding_box(&self) -> AxisAlignedBoundingBox
source§fn id(&self) -> Uuid
fn id(&self) -> Uuid
source§fn update(&mut self, context: &mut UpdateContext<'_>)
fn update(&mut self, context: &mut UpdateContext<'_>)
source§fn on_removed_from_graph(&mut self, graph: &mut Graph)
fn on_removed_from_graph(&mut self, graph: &mut Graph)
source§fn on_unlink(&mut self, graph: &mut Graph)
fn on_unlink(&mut self, graph: &mut Graph)
source§fn sync_native(
&self,
self_handle: Handle<Node>,
context: &mut SyncContext<'_, '_>
)
fn sync_native( &self, self_handle: Handle<Node>, context: &mut SyncContext<'_, '_> )
crate::scene::rigidbody::RigidBody
node.source§fn sync_transform(
&self,
new_global_transform: &Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>,
_context: &mut SyncContext<'_, '_>
)
fn sync_transform( &self, new_global_transform: &Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>, _context: &mut SyncContext<'_, '_> )
source§fn is_alive(&self) -> bool
fn is_alive(&self) -> bool
source§fn collect_render_data(&self, ctx: &mut RenderContext<'_>) -> RdcControlFlow
fn collect_render_data(&self, ctx: &mut RenderContext<'_>) -> RdcControlFlow
source§fn debug_draw(&self, ctx: &mut SceneDrawingContext)
fn debug_draw(&self, ctx: &mut SceneDrawingContext)
source§impl Reflect for AnimationPlayerwhere
AnimationPlayer: 'static,
Base: Reflect,
InheritableVariable<AnimationContainer<Handle<Node>>>: Reflect,
bool: Reflect,
impl Reflect for AnimationPlayerwhere
AnimationPlayer: 'static,
Base: Reflect,
InheritableVariable<AnimationContainer<Handle<Node>>>: Reflect,
bool: Reflect,
fn source_path() -> &'static str
fn type_name(&self) -> &'static str
fn doc(&self) -> &'static str
source§fn assembly_name(&self) -> &'static str
fn assembly_name(&self) -> &'static str
#[derive(Reflect)]
) to ensure that this method will return correct assembly
name. In other words - there’s no guarantee, that any implementation other than proc-macro
will return a correct name of the assembly. Alternatively, you can use env!("CARGO_PKG_NAME")
as an implementation.source§fn type_assembly_name() -> &'static str
fn type_assembly_name() -> &'static str
#[derive(Reflect)]
) to ensure that this method will return correct assembly
name. In other words - there’s no guarantee, that any implementation other than proc-macro
will return a correct name of the assembly. Alternatively, you can use env!("CARGO_PKG_NAME")
as an implementation.fn fields_info(&self, func: &mut dyn FnMut(&[FieldInfo<'_, '_>]))
fn into_any(self: Box<AnimationPlayer>) -> Box<dyn Any>
fn set( &mut self, value: Box<dyn Reflect> ) -> Result<Box<dyn Reflect>, Box<dyn Reflect>>
fn as_any(&self, func: &mut dyn FnMut(&(dyn Any + 'static)))
fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut (dyn Any + 'static)))
fn as_reflect(&self, func: &mut dyn FnMut(&(dyn Reflect + 'static)))
fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut (dyn Reflect + 'static)))
fn fields(&self, func: &mut dyn FnMut(&[&(dyn Reflect + 'static)]))
fn fields_mut( &mut self, func: &mut dyn FnMut(&mut [&mut (dyn Reflect + 'static)]) )
fn field( &self, name: &str, func: &mut dyn FnMut(Option<&(dyn Reflect + 'static)>) )
fn field_mut( &mut self, name: &str, func: &mut dyn FnMut(Option<&mut (dyn Reflect + 'static)>) )
source§fn set_field(
&mut self,
field: &str,
value: Box<dyn Reflect>,
func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>)
)
fn set_field( &mut self, field: &str, value: Box<dyn Reflect>, func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>) )
#[reflect(setter = ..)]
or falls back to
Reflect::field_mut
fn as_array(&self, func: &mut dyn FnMut(Option<&(dyn ReflectArray + 'static)>))
fn as_array_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectArray + 'static)>) )
fn as_list(&self, func: &mut dyn FnMut(Option<&(dyn ReflectList + 'static)>))
fn as_list_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectList + 'static)>) )
fn as_inheritable_variable( &self, func: &mut dyn FnMut(Option<&(dyn ReflectInheritableVariable + 'static)>) )
fn as_inheritable_variable_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectInheritableVariable + 'static)>) )
fn as_hash_map( &self, func: &mut dyn FnMut(Option<&(dyn ReflectHashMap + 'static)>) )
fn as_hash_map_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectHashMap + 'static)>) )
source§impl TypeUuidProvider for AnimationPlayer
impl TypeUuidProvider for AnimationPlayer
source§impl Visit for AnimationPlayer
impl Visit for AnimationPlayer
source§fn visit(&mut self, name: &str, visitor: &mut Visitor) -> Result<(), VisitError>
fn visit(&mut self, name: &str, visitor: &mut Visitor) -> Result<(), VisitError>
Auto Trait Implementations§
impl !Freeze for AnimationPlayer
impl !RefUnwindSafe for AnimationPlayer
impl Send for AnimationPlayer
impl !Sync for AnimationPlayer
impl Unpin for AnimationPlayer
impl !UnwindSafe for AnimationPlayer
Blanket Implementations§
source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
source§impl<T> BaseNodeTrait for T
impl<T> BaseNodeTrait for T
source§fn clone_box(&self) -> Node
fn clone_box(&self) -> Node
source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Any
source§fn as_any_ref_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_ref_mut(&mut self) -> &mut (dyn Any + 'static)
Any
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.source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
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> Pointable for T
impl<T> Pointable for T
source§impl<T> ReflectBase for Twhere
T: Reflect,
impl<T> ReflectBase for Twhere
T: Reflect,
fn as_any_raw(&self) -> &(dyn Any + 'static)
fn as_any_raw_mut(&mut self) -> &mut (dyn Any + 'static)
source§impl<T> ResolvePath for Twhere
T: Reflect,
impl<T> ResolvePath for Twhere
T: Reflect,
fn resolve_path<'p>( &self, path: &'p str, func: &mut dyn FnMut(Result<&(dyn Reflect + 'static), ReflectPathError<'p>>) )
fn resolve_path_mut<'p>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>) )
fn get_resolve_path<'p, T>(
&self,
path: &'p str,
func: &mut dyn FnMut(Result<&T, ReflectPathError<'p>>)
)where
T: Reflect,
fn get_resolve_path_mut<'p, T>(
&mut self,
path: &'p str,
func: &mut dyn FnMut(Result<&mut T, ReflectPathError<'p>>)
)where
T: Reflect,
source§impl<T> ScriptMessagePayload for T
impl<T> ScriptMessagePayload for T
source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
self
as &dyn Any
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
self
as &dyn Any
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.