pub struct Graph {
pub physics: PhysicsWorld,
pub physics2d: PhysicsWorld,
pub sound_context: SoundContext,
pub performance_statistics: GraphPerformanceStatistics,
pub event_broadcaster: GraphEventBroadcaster,
/* private fields */
}
Expand description
See module docs.
Fields§
§physics: PhysicsWorld
Backing physics “world”. It is responsible for the physics simulation.
physics2d: PhysicsWorld
Backing 2D physics “world”. It is responsible for the 2D physics simulation.
sound_context: SoundContext
Backing sound context. It is responsible for sound rendering.
performance_statistics: GraphPerformanceStatistics
Performance statistics of a last Graph::update
call.
event_broadcaster: GraphEventBroadcaster
Allows you to “subscribe” for graph events.
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn from_hierarchy(root: Handle<Node>, other_graph: &Self) -> Self
pub fn from_hierarchy(root: Handle<Node>, other_graph: &Self) -> Self
Creates a new graph using a hierarchy of nodes specified by the root
.
Sourcepub fn change_root_node(&mut self, root: Node)
pub fn change_root_node(&mut self, root: Node)
Sets new root of the graph and attaches the old root to the new root. Old root becomes a child node of the new root.
Sourcepub fn find_references_to(&self, target: Handle<Node>) -> Vec<Handle<Node>>
pub fn find_references_to(&self, target: Handle<Node>) -> Vec<Handle<Node>>
Tries to find references of the given node in other scene nodes. It could be used to check if the node is used by some other scene node or not. Returns an array of nodes, that references the given node. This method is reflection-based, so it is quite slow and should not be used every frame.
Sourcepub fn get_two_mut(
&mut self,
nodes: (Handle<Node>, Handle<Node>),
) -> (&mut Node, &mut Node)
pub fn get_two_mut( &mut self, nodes: (Handle<Node>, Handle<Node>), ) -> (&mut Node, &mut Node)
Tries to borrow mutable references to two nodes at the same time by given handles. Will panic if handles overlaps (points to same node).
Sourcepub fn get_three_mut(
&mut self,
nodes: (Handle<Node>, Handle<Node>, Handle<Node>),
) -> (&mut Node, &mut Node, &mut Node)
pub fn get_three_mut( &mut self, nodes: (Handle<Node>, Handle<Node>, Handle<Node>), ) -> (&mut Node, &mut Node, &mut Node)
Tries to borrow mutable references to three nodes at the same time by given handles. Will return Err of handles overlaps (points to same node).
Sourcepub fn get_four_mut(
&mut self,
nodes: (Handle<Node>, Handle<Node>, Handle<Node>, Handle<Node>),
) -> (&mut Node, &mut Node, &mut Node, &mut Node)
pub fn get_four_mut( &mut self, nodes: (Handle<Node>, Handle<Node>, Handle<Node>, Handle<Node>), ) -> (&mut Node, &mut Node, &mut Node, &mut Node)
Tries to borrow mutable references to four nodes at the same time by given handles. Will panic if handles overlaps (points to same node).
Sourcepub fn try_get_mut(&mut self, handle: Handle<Node>) -> Option<&mut Node>
pub fn try_get_mut(&mut self, handle: Handle<Node>) -> Option<&mut Node>
Tries to mutably borrow a node, returns Some(node) if the handle is valid, None - otherwise.
Sourcepub fn begin_multi_borrow(
&mut self,
) -> MultiBorrowContext<'_, Node, NodeContainer>
pub fn begin_multi_borrow( &mut self, ) -> MultiBorrowContext<'_, Node, NodeContainer>
Begins multi-borrow that allows you borrow to as many shared references to the graph
nodes as you need and only one mutable reference to a node. See
MultiBorrowContext::try_get
for more info.
§Examples
let mut graph = Graph::new();
let handle1 = PivotBuilder::new(BaseBuilder::new()).build(&mut graph);
let handle2 = PivotBuilder::new(BaseBuilder::new()).build(&mut graph);
let handle3 = PivotBuilder::new(BaseBuilder::new()).build(&mut graph);
let handle4 = PivotBuilder::new(BaseBuilder::new()).build(&mut graph);
let mut ctx = graph.begin_multi_borrow();
let node1 = ctx.try_get(handle1);
let node2 = ctx.try_get(handle2);
let node3 = ctx.try_get(handle3);
let node4 = ctx.try_get(handle4);
assert!(node1.is_ok());
assert!(node2.is_ok());
assert!(node3.is_ok());
assert!(node4.is_ok());
// An attempt to borrow the same node twice as immutable and mutable will fail.
assert!(ctx.try_get_mut(handle1).is_err());
Sourcepub fn link_nodes_keep_global_position_rotation(
&mut self,
child: Handle<Node>,
parent: Handle<Node>,
)
pub fn link_nodes_keep_global_position_rotation( &mut self, child: Handle<Node>, parent: Handle<Node>, )
Links specified child with specified parent while keeping the child’s global position and rotation.
Sourcepub fn find_first_by_script<S>(
&self,
root_node: Handle<Node>,
) -> Option<(Handle<Node>, &Node)>where
S: ScriptTrait,
pub fn find_first_by_script<S>(
&self,
root_node: Handle<Node>,
) -> Option<(Handle<Node>, &Node)>where
S: ScriptTrait,
Searches for a first node with a script of the given type S
in the hierarchy starting from the
given root_node
.
Sourcepub fn copy_node<F, Pre, Post>(
&self,
node_handle: Handle<Node>,
dest_graph: &mut Graph,
filter: &mut F,
pre_process_callback: &mut Pre,
post_process_callback: &mut Post,
) -> (Handle<Node>, NodeHandleMap<Node>)
pub fn copy_node<F, Pre, Post>( &self, node_handle: Handle<Node>, dest_graph: &mut Graph, filter: &mut F, pre_process_callback: &mut Pre, post_process_callback: &mut Post, ) -> (Handle<Node>, NodeHandleMap<Node>)
Creates deep copy of node with all children. This is relatively heavy operation!
In case if any error happened it returns Handle::NONE
. This method can be used
to create exact copy of given node hierarchy. For example you can prepare rocket
model: case of rocket will be mesh, and fire from nozzle will be particle system,
and when you fire from rocket launcher you just need to create a copy of such
“prefab”.
§Implementation notes
Returns tuple where first element is handle to copy of node, and second element - old-to-new hash map, which can be used to easily find copy of node by its original.
Filter allows to exclude some nodes from copied hierarchy. It must return false for odd nodes. Filtering applied only to descendant nodes.
Sourcepub fn copy_node_inplace<F>(
&mut self,
node_handle: Handle<Node>,
filter: &mut F,
) -> (Handle<Node>, NodeHandleMap<Node>)
pub fn copy_node_inplace<F>( &mut self, node_handle: Handle<Node>, filter: &mut F, ) -> (Handle<Node>, NodeHandleMap<Node>)
Creates deep copy of node with all children. This is relatively heavy operation!
In case if any error happened it returns Handle::NONE
. This method can be used
to create exact copy of given node hierarchy. For example you can prepare rocket
model: case of rocket will be mesh, and fire from nozzle will be particle system,
and when you fire from rocket launcher you just need to create a copy of such
“prefab”.
§Implementation notes
Returns tuple where first element is handle to copy of node, and second element - old-to-new hash map, which can be used to easily find copy of node by its original.
Filter allows to exclude some nodes from copied hierarchy. It must return false for odd nodes. Filtering applied only to descendant nodes.
Sourcepub fn copy_single_node(&self, node_handle: Handle<Node>) -> Node
pub fn copy_single_node(&self, node_handle: Handle<Node>) -> Node
Creates copy of a node and breaks all connections with other nodes. Keep in mind that this method may give unexpected results when the node has connections with other nodes. For example if you’ll try to copy a skinned mesh, its copy won’t be skinned anymore - you’ll get just a “shallow” mesh. Also unlike copy_node this method returns copied node directly, it does not inserts it in any graph.
Sourcepub fn set_lightmap(
&mut self,
lightmap: Lightmap,
) -> Result<Option<Lightmap>, &'static str>
pub fn set_lightmap( &mut self, lightmap: Lightmap, ) -> Result<Option<Lightmap>, &'static str>
Tries to set new lightmap to scene.
Sourcepub fn aabb_of_descendants<F>(
&self,
root: Handle<Node>,
filter: F,
) -> Option<AxisAlignedBoundingBox>
pub fn aabb_of_descendants<F>( &self, root: Handle<Node>, filter: F, ) -> Option<AxisAlignedBoundingBox>
Tries to compute combined axis-aligned bounding box (AABB) in world-space of the hierarchy starting from the given
scene node. It will return None
if the scene node handle is invalid, otherwise it will return AABB that enclosing
all the nodes in the hierarchy.
Sourcepub fn update_hierarchical_data_for_descendants(
&mut self,
node_handle: Handle<Node>,
)
pub fn update_hierarchical_data_for_descendants( &mut self, node_handle: Handle<Node>, )
Calculates local and global transform, global visibility for each node in graph starting from the specified node and down the tree. The main use case of the method is to update global position (etc.) of an hierarchy of the nodes of some new prefab instance.
§Important Notes
This method could be slow for large hierarchies. You should call it only when absolutely needed.
Sourcepub fn update_hierarchical_data(&mut self)
pub fn update_hierarchical_data(&mut self)
Calculates local and global transform, global visibility for each node in graph starting from the specified node and down the tree. The main use case of the method is to update global position (etc.) of an hierarchy of the nodes of some new prefab instance.
§Important Notes
This method could be slow for large graph. You should call it only when absolutely needed.
Sourcepub fn update(
&mut self,
frame_size: Vector2<f32>,
dt: f32,
switches: GraphUpdateSwitches,
)
pub fn update( &mut self, frame_size: Vector2<f32>, dt: f32, switches: GraphUpdateSwitches, )
Updates nodes in the graph using given delta time.
§Update Switches
Update switches allows you to disable update for parts of the update pipeline, it could be useful for editors where you need to have preview mode to update only specific set of nodes, etc.
Sourcepub fn capacity(&self) -> u32
pub fn capacity(&self) -> u32
Returns capacity of internal pool. Can be used to iterate over all potentially available indices and try to convert them to handles.
let mut graph = Graph::new();
graph.add_node(Node::new(Pivot::default()));
graph.add_node(Node::new(Pivot::default()));
for i in 0..graph.capacity() {
let handle = graph.handle_from_index(i);
if handle.is_some() {
let node = &mut graph[handle];
// Do something with node.
}
}
Sourcepub fn handle_from_index(&self, index: u32) -> Handle<Node>
pub fn handle_from_index(&self, index: u32) -> Handle<Node>
Makes new handle from given index. Handle will be none if index was either out-of-bounds or point to a vacant pool entry.
let mut graph = Graph::new();
graph.add_node(Node::new(Pivot::default()));
graph.add_node(Node::new(Pivot::default()));
for i in 0..graph.capacity() {
let handle = graph.handle_from_index(i);
if handle.is_some() {
let node = &mut graph[handle];
// Do something with node.
}
}
Sourcepub fn generate_free_handles(&self, amount: usize) -> Vec<Handle<Node>>
pub fn generate_free_handles(&self, amount: usize) -> Vec<Handle<Node>>
Generates a set of handles that could be used to spawn a set of nodes.
Sourcepub fn linear_iter(&self) -> impl Iterator<Item = &Node>
pub fn linear_iter(&self) -> impl Iterator<Item = &Node>
Creates an iterator that has linear iteration order over internal collection of nodes. It does not perform any tree traversal!
Sourcepub fn pair_iter_mut(
&mut self,
) -> impl Iterator<Item = (Handle<Node>, &mut Node)>
pub fn pair_iter_mut( &mut self, ) -> impl Iterator<Item = (Handle<Node>, &mut Node)>
Creates new iterator that iterates over internal collection giving (handle; node) pairs.
Sourcepub fn take_reserve(&mut self, handle: Handle<Node>) -> (Ticket<Node>, Node)
pub fn take_reserve(&mut self, handle: Handle<Node>) -> (Ticket<Node>, Node)
Extracts node from graph and reserves its handle. It is used to temporarily take ownership over node, and then put node back using given ticket. Extracted node is detached from its parent!
Sourcepub fn put_back(&mut self, ticket: Ticket<Node>, node: Node) -> Handle<Node>
pub fn put_back(&mut self, ticket: Ticket<Node>, node: Node) -> Handle<Node>
Puts node back by given ticket. Attaches back to root node of graph.
Sourcepub fn forget_ticket(&mut self, ticket: Ticket<Node>, node: Node) -> Node
pub fn forget_ticket(&mut self, ticket: Ticket<Node>, node: Node) -> Node
Makes node handle vacant again.
Sourcepub fn take_reserve_sub_graph(&mut self, root: Handle<Node>) -> SubGraph
pub fn take_reserve_sub_graph(&mut self, root: Handle<Node>) -> SubGraph
Extracts sub-graph starting from a given node. All handles to extracted nodes becomes reserved and will be marked as “occupied”, an attempt to borrow a node at such handle will result in panic!. Please note that root node will be detached from its parent!
Sourcepub fn put_sub_graph_back(&mut self, sub_graph: SubGraph) -> Handle<Node>
pub fn put_sub_graph_back(&mut self, sub_graph: SubGraph) -> Handle<Node>
Puts previously extracted sub-graph into graph. Handles to nodes will become valid again. After that you probably want to re-link returned handle with its previous parent.
Sourcepub fn forget_sub_graph(&mut self, sub_graph: SubGraph)
pub fn forget_sub_graph(&mut self, sub_graph: SubGraph)
Forgets the entire sub-graph making handles to nodes invalid.
Sourcepub fn node_count(&self) -> u32
pub fn node_count(&self) -> u32
Returns the number of nodes in the graph.
Sourcepub fn clone<F, Pre, Post>(
&self,
root: Handle<Node>,
filter: &mut F,
pre_process_callback: &mut Pre,
post_process_callback: &mut Post,
) -> (Self, NodeHandleMap<Node>)
pub fn clone<F, Pre, Post>( &self, root: Handle<Node>, filter: &mut F, pre_process_callback: &mut Pre, post_process_callback: &mut Post, ) -> (Self, NodeHandleMap<Node>)
Creates deep copy of graph. Allows filtering while copying, returns copy and old-to-new node mapping.
Sourcepub fn local_transform_no_scale(&self, node: Handle<Node>) -> Matrix4<f32>
pub fn local_transform_no_scale(&self, node: Handle<Node>) -> Matrix4<f32>
Returns local transformation matrix of a node without scale.
Sourcepub fn global_transform_no_scale(&self, node: Handle<Node>) -> Matrix4<f32>
pub fn global_transform_no_scale(&self, node: Handle<Node>) -> Matrix4<f32>
Returns world transformation matrix of a node without scale.
Sourcepub fn isometric_local_transform(&self, node: Handle<Node>) -> Matrix4<f32>
pub fn isometric_local_transform(&self, node: Handle<Node>) -> Matrix4<f32>
Returns isometric local transformation matrix of a node. Such transform has only translation and rotation.
Sourcepub fn isometric_global_transform(&self, node: Handle<Node>) -> Matrix4<f32>
pub fn isometric_global_transform(&self, node: Handle<Node>) -> Matrix4<f32>
Returns world transformation matrix of a node only. Such transform has only translation and rotation.
Sourcepub fn global_scale_matrix(&self, node: Handle<Node>) -> Matrix4<f32>
pub fn global_scale_matrix(&self, node: Handle<Node>) -> Matrix4<f32>
Returns global scale matrix of a node.
Sourcepub fn global_rotation(&self, node: Handle<Node>) -> UnitQuaternion<f32>
pub fn global_rotation(&self, node: Handle<Node>) -> UnitQuaternion<f32>
Returns rotation quaternion of a node in world coordinates.
Sourcepub fn isometric_global_rotation(
&self,
node: Handle<Node>,
) -> UnitQuaternion<f32>
pub fn isometric_global_rotation( &self, node: Handle<Node>, ) -> UnitQuaternion<f32>
Returns rotation quaternion of a node in world coordinates without pre- and post-rotations.
Sourcepub fn global_rotation_position_no_scale(
&self,
node: Handle<Node>,
) -> (UnitQuaternion<f32>, Vector3<f32>)
pub fn global_rotation_position_no_scale( &self, node: Handle<Node>, ) -> (UnitQuaternion<f32>, Vector3<f32>)
Returns rotation quaternion and position of a node in world coordinates, scale is eliminated.
Sourcepub fn isometric_global_rotation_position(
&self,
node: Handle<Node>,
) -> (UnitQuaternion<f32>, Vector3<f32>)
pub fn isometric_global_rotation_position( &self, node: Handle<Node>, ) -> (UnitQuaternion<f32>, Vector3<f32>)
Returns isometric global rotation and position.
Sourcepub fn try_get_script_of<T>(&self, node: Handle<Node>) -> Option<&T>where
T: ScriptTrait,
pub fn try_get_script_of<T>(&self, node: Handle<Node>) -> Option<&T>where
T: ScriptTrait,
Tries to borrow a node using the given handle and searches the script buffer for a script of type T and cast the first script, that could be found to the specified type.
Sourcepub fn try_get_scripts_of<T: ScriptTrait>(
&self,
node: Handle<Node>,
) -> Option<impl Iterator<Item = &T>>
pub fn try_get_scripts_of<T: ScriptTrait>( &self, node: Handle<Node>, ) -> Option<impl Iterator<Item = &T>>
Tries to borrow a node and query all scripts of the given type T
. This method returns
None
if the given node handle is invalid, otherwise it returns an iterator over the
scripts of the type T
.
Sourcepub fn try_get_script_of_mut<T>(&mut self, node: Handle<Node>) -> Option<&mut T>where
T: ScriptTrait,
pub fn try_get_script_of_mut<T>(&mut self, node: Handle<Node>) -> Option<&mut T>where
T: ScriptTrait,
Tries to borrow a node using the given handle and searches the script buffer for a script of type T and cast the first script, that could be found to the specified type.
Sourcepub fn try_get_scripts_of_mut<T: ScriptTrait>(
&mut self,
node: Handle<Node>,
) -> Option<impl Iterator<Item = &mut T>>
pub fn try_get_scripts_of_mut<T: ScriptTrait>( &mut self, node: Handle<Node>, ) -> Option<impl Iterator<Item = &mut T>>
Tries to borrow a node and query all scripts of the given type T
. This method returns
None
if the given node handle is invalid, otherwise it returns an iterator over the
scripts of the type T
.
Sourcepub fn try_get_script_component_of<C>(&self, node: Handle<Node>) -> Option<&C>where
C: Any,
pub fn try_get_script_component_of<C>(&self, node: Handle<Node>) -> Option<&C>where
C: Any,
Tries to borrow a node and 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_of
and then search for component in it.
Sourcepub fn try_get_script_component_of_mut<C>(
&mut self,
node: Handle<Node>,
) -> Option<&mut C>where
C: Any,
pub fn try_get_script_component_of_mut<C>(
&mut self,
node: Handle<Node>,
) -> Option<&mut C>where
C: Any,
Tries to borrow a node and 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_of_mut
and then search for component in it.
Sourcepub fn id_to_node_handle(&self, id: SceneNodeId) -> Option<&Handle<Node>>
pub fn id_to_node_handle(&self, id: SceneNodeId) -> Option<&Handle<Node>>
Returns a handle of the node that has the given id.
Sourcepub fn node_by_id(&self, id: SceneNodeId) -> Option<(Handle<Node>, &Node)>
pub fn node_by_id(&self, id: SceneNodeId) -> Option<(Handle<Node>, &Node)>
Tries to borrow a node by its id.
Sourcepub fn node_by_id_mut(
&mut self,
id: SceneNodeId,
) -> Option<(Handle<Node>, &mut Node)>
pub fn node_by_id_mut( &mut self, id: SceneNodeId, ) -> Option<(Handle<Node>, &mut Node)>
Tries to borrow a node by its id.
Trait Implementations§
Source§impl AbstractSceneGraph for Graph
impl AbstractSceneGraph for Graph
fn try_get_node_untyped( &self, handle: ErasedHandle, ) -> Option<&dyn AbstractSceneNode>
fn try_get_node_untyped_mut( &mut self, handle: ErasedHandle, ) -> Option<&mut dyn AbstractSceneNode>
Source§impl BaseSceneGraph for Graph
impl BaseSceneGraph for Graph
type Prefab = Model
type Node = Node
Source§fn set_root(&mut self, root: Handle<Self::Node>)
fn set_root(&mut self, root: Handle<Self::Node>)
Source§fn is_valid_handle(&self, handle: Handle<Self::Node>) -> bool
fn is_valid_handle(&self, handle: Handle<Self::Node>) -> bool
Source§fn remove_node(&mut self, node_handle: Handle<Self::Node>)
fn remove_node(&mut self, node_handle: Handle<Self::Node>)
Source§fn link_nodes(&mut self, child: Handle<Self::Node>, parent: Handle<Self::Node>)
fn link_nodes(&mut self, child: Handle<Self::Node>, parent: Handle<Self::Node>)
Source§fn unlink_node(&mut self, node_handle: Handle<Node>)
fn unlink_node(&mut self, node_handle: Handle<Node>)
Source§fn isolate_node(&mut self, node_handle: Handle<Self::Node>)
fn isolate_node(&mut self, node_handle: Handle<Self::Node>)
Source§fn try_get(&self, handle: Handle<Self::Node>) -> Option<&Self::Node>
fn try_get(&self, handle: Handle<Self::Node>) -> Option<&Self::Node>
Source§fn try_get_mut(&mut self, handle: Handle<Self::Node>) -> Option<&mut Self::Node>
fn try_get_mut(&mut self, handle: Handle<Self::Node>) -> Option<&mut Self::Node>
Source§fn node_mut(&mut self, handle: Handle<Self::Node>) -> &mut Self::Node
fn node_mut(&mut self, handle: Handle<Self::Node>) -> &mut Self::Node
Source§fn change_hierarchy_root(
&mut self,
prev_root: Handle<Self::Node>,
new_root: Handle<Self::Node>,
) -> LinkScheme<Self::Node>
fn change_hierarchy_root( &mut self, prev_root: Handle<Self::Node>, new_root: Handle<Self::Node>, ) -> LinkScheme<Self::Node>
new_root
becomes the root node for the entire hierarchy
under the prev_root
node. For example, if we have this hierarchy and want to set C
as
the new root: Read moreSource§fn apply_link_scheme(&mut self, scheme: LinkScheme<Self::Node>)
fn apply_link_scheme(&mut self, scheme: LinkScheme<Self::Node>)
Self::change_hierarchy_root
.Source§fn remove_nodes(&mut self, nodes: &[Handle<Self::Node>])
fn remove_nodes(&mut self, nodes: &[Handle<Self::Node>])
Source§impl ConstructorProvider<Node, Graph> for AnimationBlendingStateMachine
impl ConstructorProvider<Node, Graph> for AnimationBlendingStateMachine
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for AnimationPlayer
impl ConstructorProvider<Node, Graph> for AnimationPlayer
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Camera
impl ConstructorProvider<Node, Graph> for Camera
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Collider
impl ConstructorProvider<Node, Graph> for Collider
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Collider
impl ConstructorProvider<Node, Graph> for Collider
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Decal
impl ConstructorProvider<Node, Graph> for Decal
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for DirectionalLight
impl ConstructorProvider<Node, Graph> for DirectionalLight
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Joint
impl ConstructorProvider<Node, Graph> for Joint
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Joint
impl ConstructorProvider<Node, Graph> for Joint
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Listener
impl ConstructorProvider<Node, Graph> for Listener
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Mesh
impl ConstructorProvider<Node, Graph> for Mesh
fn constructor() -> NodeConstructor
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for ParticleSystem
impl ConstructorProvider<Node, Graph> for ParticleSystem
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Pivot
impl ConstructorProvider<Node, Graph> for Pivot
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for PointLight
impl ConstructorProvider<Node, Graph> for PointLight
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Ragdoll
impl ConstructorProvider<Node, Graph> for Ragdoll
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Rectangle
impl ConstructorProvider<Node, Graph> for Rectangle
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for RigidBody
impl ConstructorProvider<Node, Graph> for RigidBody
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for RigidBody
impl ConstructorProvider<Node, Graph> for RigidBody
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Sound
impl ConstructorProvider<Node, Graph> for Sound
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for SpotLight
impl ConstructorProvider<Node, Graph> for SpotLight
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Sprite
impl ConstructorProvider<Node, Graph> for Sprite
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Terrain
impl ConstructorProvider<Node, Graph> for Terrain
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for TileMap
impl ConstructorProvider<Node, Graph> for TileMap
fn constructor() -> NodeConstructor
Source§impl Reflect for Graphwhere
Self: 'static,
NodePool: Reflect,
PhysicsWorld: Reflect,
PhysicsWorld: Reflect,
Option<Lightmap>: Reflect,
FxHashMap<SceneNodeId, Handle<Node>>: Reflect,
impl Reflect for Graphwhere
Self: 'static,
NodePool: Reflect,
PhysicsWorld: Reflect,
PhysicsWorld: Reflect,
Option<Lightmap>: Reflect,
FxHashMap<SceneNodeId, Handle<Node>>: 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<Self>) -> 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))
fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut dyn Any))
fn as_reflect(&self, func: &mut dyn FnMut(&dyn Reflect))
fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut dyn Reflect))
fn fields(&self, func: &mut dyn FnMut(&[&dyn Reflect]))
fn fields_mut(&mut self, func: &mut dyn FnMut(&mut [&mut dyn Reflect]))
fn field(&self, name: &str, func: &mut dyn FnMut(Option<&dyn Reflect>))
fn field_mut( &mut self, name: &str, func: &mut dyn FnMut(Option<&mut dyn Reflect>), )
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 SceneGraph for Graph
impl SceneGraph for Graph
Source§fn pair_iter(&self) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>
fn pair_iter(&self) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>
Source§fn linear_iter(&self) -> impl Iterator<Item = &Self::Node>
fn linear_iter(&self) -> impl Iterator<Item = &Self::Node>
Source§fn linear_iter_mut(&mut self) -> impl Iterator<Item = &mut Self::Node>
fn linear_iter_mut(&mut self) -> impl Iterator<Item = &mut Self::Node>
Source§fn try_get_of_type<T>(&self, handle: Handle<Self::Node>) -> Option<&T>where
T: 'static,
fn try_get_of_type<T>(&self, handle: Handle<Self::Node>) -> Option<&T>where
T: 'static,
Source§fn try_get_mut_of_type<T>(
&mut self,
handle: Handle<Self::Node>,
) -> Option<&mut T>where
T: 'static,
fn try_get_mut_of_type<T>(
&mut self,
handle: Handle<Self::Node>,
) -> Option<&mut T>where
T: 'static,
Source§fn has_component<T>(&self, handle: Handle<Self::Node>) -> boolwhere
T: 'static,
fn has_component<T>(&self, handle: Handle<Self::Node>) -> boolwhere
T: 'static,
Source§fn find_map<C, T>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Option<(Handle<Self::Node>, &T)>
fn find_map<C, T>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &T)>
None
.Source§fn find_up<C>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find_up<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.Source§fn find_handle_up<C>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Handle<Self::Node>
fn find_handle_up<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Handle<Self::Node>
Self::find_up
, but only returns node handle which will be Handle::NONE
if nothing is found.fn find_component_up<T>(
&self,
node_handle: Handle<Self::Node>,
) -> Option<(Handle<Self::Node>, &T)>where
T: 'static,
fn find_component<T>(
&self,
node_handle: Handle<Self::Node>,
) -> Option<(Handle<Self::Node>, &T)>where
T: 'static,
Source§fn find_up_map<C, T>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Option<(Handle<Self::Node>, &T)>
fn find_up_map<C, T>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &T)>
None
.Source§fn find_by_name(
&self,
root_node: Handle<Self::Node>,
name: &str,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find_by_name( &self, root_node: Handle<Self::Node>, name: &str, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.Source§fn find_up_by_name(
&self,
root_node: Handle<Self::Node>,
name: &str,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find_up_by_name( &self, root_node: Handle<Self::Node>, name: &str, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.Source§fn find_by_name_from_root(
&self,
name: &str,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find_by_name_from_root( &self, name: &str, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.fn find_handle_by_name_from_root(&self, name: &str) -> Handle<Self::Node>
Source§fn find_from_root<C>(
&self,
cmp: &mut C,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find_from_root<C>( &self, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.Source§fn find<C>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.Source§fn find_handle<C>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Handle<Self::Node>
fn find_handle<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Handle<Self::Node>
Self::find
, but only returns node handle which will be Handle::NONE
if nothing is found.Source§fn relative_position(
&self,
child: Handle<Self::Node>,
offset: isize,
) -> Option<(Handle<Self::Node>, usize)>
fn relative_position( &self, child: Handle<Self::Node>, offset: isize, ) -> Option<(Handle<Self::Node>, usize)>
offset
to the position. For example, if you have the following hierarchy: Read moreSource§fn traverse_iter(
&self,
from: Handle<Self::Node>,
) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>
fn traverse_iter( &self, from: Handle<Self::Node>, ) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>
Source§fn traverse_handle_iter(
&self,
from: Handle<Self::Node>,
) -> impl Iterator<Item = Handle<Self::Node>>
fn traverse_handle_iter( &self, from: Handle<Self::Node>, ) -> impl Iterator<Item = Handle<Self::Node>>
Source§fn restore_integrity<F>(
&mut self,
instantiate: F,
) -> Vec<(Handle<Self::Node>, Resource<Self::Prefab>)>
fn restore_integrity<F>( &mut self, instantiate: F, ) -> Vec<(Handle<Self::Node>, Resource<Self::Prefab>)>
fn restore_original_handles_and_inherit_properties<F>( &mut self, ignored_types: &[TypeId], before_inherit: F, )
Source§fn remap_handles(
&mut self,
instances: &[(Handle<Self::Node>, Resource<Self::Prefab>)],
)
fn remap_handles( &mut self, instances: &[(Handle<Self::Node>, Resource<Self::Prefab>)], )
Auto Trait Implementations§
impl !Freeze for Graph
impl !RefUnwindSafe for Graph
impl Send for Graph
impl !Sync for Graph
impl Unpin for Graph
impl !UnwindSafe for Graph
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
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<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()
.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.