Struct ambient_api::animation::BlendNodeRef
source · pub struct BlendNodeRef(pub AnimationNodeRef);
Expand description
Blend animation node. This is an animation node which can be plugged into an animation player or other animation nodes.
This is just a reference to an entity which lives in the ecs. You need to call despawn
to
remove it.
Tuple Fields§
§0: AnimationNodeRef
Implementations§
source§impl BlendNodeRef
impl BlendNodeRef
sourcepub fn new(
left: impl AsRef<AnimationNodeRef>,
right: impl AsRef<AnimationNodeRef>,
weight: f32
) -> BlendNodeRef
pub fn new( left: impl AsRef<AnimationNodeRef>, right: impl AsRef<AnimationNodeRef>, weight: f32 ) -> BlendNodeRef
Create a new blend animation node.
If the weight is 0, only the left animation will play. If the weight is 1, only the right animation will play. Values in between blend between the two animations.
sourcepub fn from_entity(entity: EntityId) -> BlendNodeRef
pub fn from_entity(entity: EntityId) -> BlendNodeRef
Use an existing node
sourcepub fn set_weight(&self, weight: f32)
pub fn set_weight(&self, weight: f32)
Set the weight of this blend node.
If the weight is 0, only the left animation will play. If the weight is 1, only the right animation will play. Values in between blend between the two animations.
sourcepub fn set_mask(&self, weights: Vec<(BindId, f32)>)
pub fn set_mask(&self, weights: Vec<(BindId, f32)>)
Sets the mask of this blend node.
For example blend_node.set_mask(vec![("LeftLeg".to_string(), 1.)])
means
that the LeftLeg is always controlled by the right animation.
sourcepub fn set_mask_humanoid_lower_body(&self, weight: f32)
pub fn set_mask_humanoid_lower_body(&self, weight: f32)
Sets a mask value to all bones of a humanoids lower body
sourcepub fn set_mask_humanoid_upper_body(&self, weight: f32)
pub fn set_mask_humanoid_upper_body(&self, weight: f32)
Sets a mask value to all bones of a humanoids upper body
Trait Implementations§
source§impl AsRef<AnimationNodeRef> for BlendNodeRef
impl AsRef<AnimationNodeRef> for BlendNodeRef
source§fn as_ref(&self) -> &AnimationNodeRef
fn as_ref(&self) -> &AnimationNodeRef
source§impl Clone for BlendNodeRef
impl Clone for BlendNodeRef
source§fn clone(&self) -> BlendNodeRef
fn clone(&self) -> BlendNodeRef
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more