logo
pub struct ValueAccessorReadWriteAnimate<T> { /* private fields */ }
Expand description

A ValueAccessor is used to set/get/animate a component value. bool and i64 types will be set to target directly when using animate.

Example:

let ball_mesh = ...;
let ball_entity = Entity::create("ball");
ball_entity.render().mesh().set(ball_mesh);
ball_entity
    .transform()
    .position() // ValueAccessor returned here
    .set(Vec3::ZERO);
let duration = 1.0; // Duration is in seconds
ball_entity
    .transform()
    .position() // ValueAccessor returned here
    .animate(Vec3::new(0.0, 2.5, -40.0), duration);

Implementations

Create a new value accessor for a specific entity, component and parameter.

Sets the value to v.

Returns the current value.

Will linearly animate / transition the value from the current value to the target v using duration (in seconds).

Will stop and continue from any ongoing animation.

Note: bools and integers (also all kinds of entity references) will be set to their target directly, however delay can be used to delay the set of the value.

Will linearly animate / transition the value from the current value to the

Will stop and continue from any ongoing animation. A smoothing constant of 0 means no smoothing, higher value means more smoothing (i.e. the value will take a longer time to change).

Useful if you want to smoothen out discontinuities when animating to new targets, cancelling the old animation.

Note: bools and integers (also all kinds of entity references) will be set to their target directly, however delay can be used to delay the set of the value.

Starts setting up an animation of this value.

Call methods on the returned AnimationBuilder to configure it.

Trait Implementations

Implementation of trait for animating component values

Will linearly animate / transition the value from the current value to the target v using duration (in seconds).

Will stop and continue from any ongoing animation.

Note: bools and integers (also all kinds of entity references) will be set to their target directly, however delay can be used to delay the set of the value.

Will linearly animate / transition the value from the current value to the

Will stop and continue from any ongoing animation. A smoothing constant of 0 means no smoothing, higher value means more smoothing (i.e. the value will take a longer time to change).

Useful if you want to smoothen out discontinuities when animating to new targets, cancelling the old animation.

Note: bools and integers (also all kinds of entity references) will be set to their target directly, however delay can be used to delay the set of the value.

Starts setting up an animation of this value.

Call methods on the returned AnimationBuilder to configure it.

Implementation of trait for reading component values

Returns the current value.

Implementation of trait for writing component values

Sets the value to v.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.