pub type ModelResource = Resource<Model>;Expand description
Type alias for model resources.
Aliased Type§
pub struct ModelResource { /* private fields */ }Trait Implementations§
Source§impl ModelResourceExtension for ModelResource
impl ModelResourceExtension for ModelResource
Source§fn instantiate_from<Pre>(
model: ModelResource,
model_data: &Model,
handle: Handle<Node>,
dest_graph: &mut Graph,
pre_processing_callback: &mut Pre,
) -> (Handle<Node>, NodeHandleMap<Node>)
fn instantiate_from<Pre>( model: ModelResource, model_data: &Model, handle: Handle<Node>, dest_graph: &mut Graph, pre_processing_callback: &mut Pre, ) -> (Handle<Node>, NodeHandleMap<Node>)
Tries to instantiate model from given resource.
Source§fn begin_instantiation<'a>(
&'a self,
dest_scene: &'a mut Scene,
) -> InstantiationContext<'a>
fn begin_instantiation<'a>( &'a self, dest_scene: &'a mut Scene, ) -> InstantiationContext<'a>
Begins instantiation of the model.
Source§fn instantiate(&self, dest_scene: &mut Scene) -> Handle<Node>
fn instantiate(&self, dest_scene: &mut Scene) -> Handle<Node>
Tries to instantiate model from given resource.
Source§fn instantiate_at(
&self,
scene: &mut Scene,
position: Vector3<f32>,
orientation: UnitQuaternion<f32>,
) -> Handle<Node>
fn instantiate_at( &self, scene: &mut Scene, position: Vector3<f32>, orientation: UnitQuaternion<f32>, ) -> Handle<Node>
Instantiates a prefab and places it at specified position and orientation in global coordinates.
Source§fn instantiate_and_attach(
&self,
scene: &mut Scene,
parent: Handle<Node>,
position: Vector3<f32>,
face_towards: Vector3<f32>,
scale: Vector3<f32>,
) -> Handle<Node>
fn instantiate_and_attach( &self, scene: &mut Scene, parent: Handle<Node>, position: Vector3<f32>, face_towards: Vector3<f32>, scale: Vector3<f32>, ) -> Handle<Node>
Instantiates a prefab and places it at specified position, orientation, scale in global
coordinates and attaches it to the specified parent. This method automatically calculates
required local position, rotation, scaling for the instance so it will remain at the same
place in world space after attachment. This method could be useful if you need to instantiate
an object at some other object.
Source§fn retarget_animations_directly(
&self,
root: Handle<Node>,
graph: &Graph,
) -> Vec<Animation> ⓘ
fn retarget_animations_directly( &self, root: Handle<Node>, graph: &Graph, ) -> Vec<Animation> ⓘ
Tries to retarget animations from given model resource to a node hierarchy starting
from
root on a given scene. Read moreSource§fn retarget_animations_to_player(
&self,
root: Handle<Node>,
dest_animation_player: Handle<Node>,
graph: &mut Graph,
) -> Vec<Handle<Animation>>
fn retarget_animations_to_player( &self, root: Handle<Node>, dest_animation_player: Handle<Node>, graph: &mut Graph, ) -> Vec<Handle<Animation>>
Tries to retarget animations from given model resource to a node hierarchy starting
from
root on a given scene. Unlike Self::retarget_animations_directly, it automatically
adds retargetted animations to the specified animation player in the hierarchy of given root. Read moreSource§fn retarget_animations(
&self,
root: Handle<Node>,
graph: &mut Graph,
) -> Vec<Handle<Animation>>
fn retarget_animations( &self, root: Handle<Node>, graph: &mut Graph, ) -> Vec<Handle<Animation>>
Tries to retarget animations from given model resource to a node hierarchy starting
from
root on a given scene. Unlike Self::retarget_animations_directly, it automatically
adds retargetted animations to a first animation player in the hierarchy of given root. Read moreSource§fn generate_ids(&self) -> FxHashMap<Handle<Node>, SceneNodeId>
fn generate_ids(&self) -> FxHashMap<Handle<Node>, SceneNodeId>
Generates a set of unique IDs for every node in the model. Use this method in pair with
ModelResource::begin_instantiation.