Skip to content

Commit

Permalink
refactor: Relax Copy constraint on interpolation primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhuagh committed Oct 30, 2018
1 parent b006afb commit 8233e64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion amethyst_animation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fnv = "1"
hibitset = { version = "0.5.1", features = ["parallel"] }
itertools = "0.7.8"
log = "0.4"
minterpolate = { version = "0.3", features = ["serde"] }
minterpolate = { version = "0.4", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }

thread_profiler = { version = "0.3", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion amethyst_animation/src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub trait ApplyData<'a> {
/// Master trait used to define animation sampling on a component
pub trait AnimationSampling: Send + Sync + 'static + for<'b> ApplyData<'b> {
/// The interpolation primitive
type Primitive: InterpolationPrimitive + Clone + Copy + Send + Sync + 'static;
type Primitive: InterpolationPrimitive + Clone + Send + Sync + 'static;
/// An independent grouping or type of functions that operate on attributes of a component
///
/// For example, `translation`, `scaling` and `rotation` are transformation channels independent
Expand Down
8 changes: 6 additions & 2 deletions amethyst_animation/src/systems/sampling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ where
.inner
.iter()
.filter(|p| p.1 == *channel)
.map(|p| p.2)
.map(|p| p.2.clone())
.last()
{
comp.apply_sample(channel, &p, &apply_data);
Expand Down Expand Up @@ -138,7 +138,11 @@ fn process_sampler<T>(
}
Done => {
if let EndControl::Normal = control.end {
output.push((control.blend_weight, control.channel.clone(), control.after));
output.push((
control.blend_weight,
control.channel.clone(),
control.after.clone(),
));
}
if let EndControl::Stay = control.end {
let last_frame = sampler.input.last().cloned().unwrap_or(0.);
Expand Down

0 comments on commit 8233e64

Please sign in to comment.