New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Rest state for animation needs to be controllable. #611

Merged
merged 1 commit into from Apr 3, 2018

Conversation

Projects
None yet
3 participants
@Rhuagh
Member

Rhuagh commented Mar 28, 2018

Will now be set to the state of the base component on the first animation, unless it has already been set.

The previous solution caused the end state to become incorrect for staggered animatinos.


This change is Reviewable

amethyst_animation/src/resources.rs
+ F: Fn(Entity) -> Option<T>,
+ {
+ for entity in self.nodes.values() {
+ if let None = states.get(*entity) {

This comment has been minimized.

@jojolepro

jojolepro Mar 28, 2018

Collaborator

just a preference, but when checking for none I prefer using
if states.get(*entity).is_none()
as this shows a little bit better the intent. Just my opinion, feel free to ignore.

@jojolepro

jojolepro Mar 28, 2018

Collaborator

just a preference, but when checking for none I prefer using
if states.get(*entity).is_none()
as this shows a little bit better the intent. Just my opinion, feel free to ignore.

This comment has been minimized.

@Rhuagh

Rhuagh Mar 28, 2018

Member

I'll change it. For some reason I instinctively go to matching

@Rhuagh

Rhuagh Mar 28, 2018

Member

I'll change it. For some reason I instinctively go to matching

This comment has been minimized.

@Rhuagh

Rhuagh Mar 30, 2018

Member

Fixed

@Rhuagh

Rhuagh Mar 30, 2018

Member

Fixed

@@ -339,8 +339,8 @@ mod tests {
match TextureData::from([0.25, 0.50, 0.75]) {
TextureData::Rgba(color, _) => {
assert_eq!(color, [0.25, 0.50, 0.75, 1.0]);
- },
- _ => panic!("Expected [f32; 3] to turn into TextureData::Rgba")
+ }

This comment has been minimized.

@jojolepro

jojolepro Mar 28, 2018

Collaborator

hum?

@jojolepro

jojolepro Mar 28, 2018

Collaborator

hum?

This comment has been minimized.

@Rhuagh

Rhuagh Mar 28, 2018

Member

Match arm removed comma at end. Took me a while to see that one too :)

@Rhuagh

Rhuagh Mar 28, 2018

Member

Match arm removed comma at end. Took me a while to see that one too :)

This comment has been minimized.

@jojolepro

jojolepro Mar 28, 2018

Collaborator

Maybe I should write more helpful messages than "hum" when I review. I was pointing out that the comma was removed, and implicitly asking if that was intended or not. I guess I'll work on communication a bit more :)

@jojolepro

jojolepro Mar 28, 2018

Collaborator

Maybe I should write more helpful messages than "hum" when I review. I was pointing out that the comma was removed, and implicitly asking if that was intended or not. I guess I'll work on communication a bit more :)

This comment has been minimized.

@Rhuagh

Rhuagh Mar 29, 2018

Member

Cargo fmt did that

@Rhuagh

Rhuagh Mar 29, 2018

Member

Cargo fmt did that

This comment has been minimized.

@jojolepro

jojolepro Mar 29, 2018

Collaborator

if you are using the latest version, then I assume its fine and you can ignore this comment ;)

@jojolepro

jojolepro Mar 29, 2018

Collaborator

if you are using the latest version, then I assume its fine and you can ignore this comment ;)

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
fix: Rest state for animation needs to be controllable. Will now be s…
…et to the state of the base component on the first animation, unless it has already been set.
@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Apr 3, 2018

Member

:lgtm:


Reviewed 3 of 5 files at r1, 1 of 2 files at r2.
Review status: 4 of 5 files reviewed at latest revision, 2 unresolved discussions.


Comments from Reviewable

Member

torkleyy commented Apr 3, 2018

:lgtm:


Reviewed 3 of 5 files at r1, 1 of 2 files at r2.
Review status: 4 of 5 files reviewed at latest revision, 2 unresolved discussions.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Apr 3, 2018

Member

bors r+

Member

Rhuagh commented Apr 3, 2018

bors r+

bors bot added a commit that referenced this pull request Apr 3, 2018

Merge #611
611: fix: Rest state for animation needs to be controllable.  r=Rhuagh a=Rhuagh

Will now be set to the state of the base component on the first animation, unless it has already been set.

The previous solution caused the end state to become incorrect for staggered animatinos.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/amethyst/amethyst/611)
<!-- Reviewable:end -->
@bors

This comment has been minimized.

Show comment
Hide comment

@bors bors bot merged commit 2245c85 into amethyst:develop Apr 3, 2018

3 of 4 checks passed

code-review/reviewable 1 file, 2 discussions left (jojolepro, Rhuagh)
Details
bors Build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Rhuagh Rhuagh deleted the Rhuagh:fix/rest-pose branch Apr 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment