Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upTransform System Rewrite/Update #403
Conversation
| @@ -13,8 +13,8 @@ use amethyst::config::Config; | ||
| use amethyst::ecs::World; | ||
| use amethyst::ecs::input::InputBundle; | ||
| use amethyst::ecs::rendering::{AmbientColor, Factory, LightComponent, MaterialComponent, | ||
| - MeshComponent, MeshContext, RenderBundle, TextureComponent, | ||
| - TextureContext}; | ||
| +MeshComponent, MeshContext, RenderBundle, TextureComponent, |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 11, 2017
Member
This looks like broken formatting, are you using the latest rustfmt-nightly? And running cargo +nightly fmt --all ?
Rhuagh
Oct 11, 2017
Member
This looks like broken formatting, are you using the latest rustfmt-nightly? And running cargo +nightly fmt --all ?
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 11, 2017
Member
I don't really know what went on here either, I ran the latest nightly but I'll try again this afternoon.
Aceeri
Oct 11, 2017
Member
I don't really know what went on here either, I ran the latest nightly but I'll try again this afternoon.
| + .with(Transform::default()) | ||
| + .build(); | ||
| + | ||
| + dispatcher.dispatch(&mut world.res); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 11, 2017
Member
Why not just do RunNow on the system? Feels like unnecessary overhead to use a real Dispatcher.
Rhuagh
Oct 11, 2017
Member
Why not just do RunNow on the system? Feels like unnecessary overhead to use a real Dispatcher.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 11, 2017
Member
Was just easier to set up, overhead doesn't really matter that much in these tests anyways.
Aceeri
Oct 11, 2017
Member
Was just easier to set up, overhead doesn't really matter that much in these tests anyways.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
How is this coming along? Any progress? Is it done or ? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 14, 2017
Member
@Rhuagh Got held up for a couple days this week, working on it this weekend.
|
@Rhuagh Got held up for a couple days this week, working on it this weekend. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Cool |
nchashch
self-requested a review
Oct 15, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 17, 2017
Member
Been fuzzy testing and I think I've fixed all the issues so far, so we will probably be able to merge this by the end of the week. Going to rebase all my changes later this afternoon.
|
Been fuzzy testing and I think I've fixed all the issues so far, so we will probably be able to merge this by the end of the week. Going to rebase all my changes later this afternoon. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Seems @nchashch wants to review this before merge. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Yep, just updating you all on it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Did you rebase against your local develop our the upstream develop? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Oct 18, 2017
Member
It would probably be easier to rewrite this PR at this point. Please re-open if you disagree with me @Aceeri
|
It would probably be easier to rewrite this PR at this point. Please re-open if you disagree with me @Aceeri |
Xaeroxe
closed this
Oct 18, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 19, 2017
Member
I disagree, the commits earlier are just an error in git and I just have to drop the commits due to duplicates. Currently fixing the history.
|
I disagree, the commits earlier are just an error in git and I just have to drop the commits due to duplicates. Currently fixing the history. |
Aceeri
reopened this
Oct 19, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Issue with commits has been fixed. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Do you still consider this to be WIP? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 19, 2017
Member
Not really, it could use some review though, entirely possible I've missed something.
|
Not really, it could use some review though, entirely possible I've missed something. |
Aceeri
changed the title from
[WIP] Transform System Rewrite/Update
to
Transform System Rewrite/Update
Oct 19, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I'll take a look later today. |
| @@ -169,17 +185,29 @@ impl<'a> System<'a> for TransformSystem { | ||
| index += 1; | ||
| } | ||
| - self.dirty.clear(); | ||
| + println!("with parent updated: {:?}", parented); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| self.dead.clear(); | ||
| - self.swapped.clear(); | ||
| } | ||
| } | ||
| #[cfg(test)] |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| - let _ = entities.delete(entity); | ||
| - self.dead.insert(entity); | ||
| + { | ||
| + for (entity, parent) in (&*entities, parents.open().1).join() { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 19, 2017
Member
It is only running on modified parents, so I don't think it should be that heavy.
Aceeri
Oct 19, 2017
Member
It is only running on modified parents, so I don't think it should be that heavy.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 19, 2017
Member
Yeah, the issue is you'd have to expose the underlying UnprotectedStorage methods onto Storage if you wanted it to be more straightforward.
Aceeri
Oct 19, 2017
Member
Yeah, the issue is you'd have to expose the underlying UnprotectedStorage methods onto Storage if you wanted it to be more straightforward.
| + initted.push(entity.id()); | ||
| + } | ||
| + | ||
| + println!("Initialized: {:?}", initted); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| + for (_entity, local, global, _) in (&*entities, locals_flagged, &mut globals, !&parents).join() { | ||
| + global.0 = local.matrix(); | ||
| + noparents.push(_entity.id()); | ||
| + #[cfg(debug_assertions)] |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| + (&mut locals).open().1.clear_flags(); | ||
| + (&mut parents).open().1.clear_flags(); | ||
| + | ||
| + for bit in (&self.frame_init).iter() { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 20, 2017
Member
Our BitSetLikes don't implement IntoIterator, but they probably should so: slide-rs/hibitset#18
Aceeri
Oct 20, 2017
•
Member
Our BitSetLikes don't implement IntoIterator, but they probably should so: slide-rs/hibitset#18
| + | ||
| +use specs::{Component, DenseVecStorage, Entity, FlaggedStorage}; | ||
| + | ||
| +/// Component for defining a parent entity. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Oct 19, 2017
Member
This documentation should exactly document on which entity one has to place the component. (It's confusing whether this is a "has" relation or an "is parent of").
torkleyy
Oct 19, 2017
•
Member
This documentation should exactly document on which entity one has to place the component. (It's confusing whether this is a "has" relation or an "is parent of").
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| // Swap took place, re-try this index. | ||
| continue; | ||
| } | ||
| } | ||
| - if local.is_dirty() || child.is_dirty() || self.dirty.contains(&child.parent()) | ||
| - { | ||
| + // Kill the entity is the parent is dead. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| - } | ||
| + for (_entity, local, global, _) in (&*entities, locals_flagged, &mut globals, !&parents).join() { | ||
| + global.0 = local.matrix(); | ||
| + debug_assert!(global.0 == global.0, format!("Entity {:?} had NaN transform.", _entity)); | ||
| } |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 21, 2017
Member
I don't think [[f32; 4]; 4] has methods implemented by default? f32 has is_finite, but not this.
Aceeri
Oct 21, 2017
Member
I don't think [[f32; 4]; 4] has methods implemented by default? f32 has is_finite, but not this.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Oct 21, 2017
Member
Ah right. I wonder if this is valid then? I'm not sure if the total equality check catches everything is_finite does
torkleyy
Oct 21, 2017
Member
Ah right. I wonder if this is valid then? I'm not sure if the total equality check catches everything is_finite does
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Aceeri
Oct 21, 2017
Member
It doesn't check for Infinity, but I'm not sure if it matters if we allow that or not.
Aceeri
Oct 21, 2017
Member
It doesn't check for Infinity, but I'm not sure if it matters if we allow that or not.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
requested changes
Oct 22, 2017
I'd just like to re-iterate @torkleyy 's expressed concerns. Even if he's approved the PR I'm still requesting these changes be made.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 22, 2017
Member
Also needs some fixes in the GLTF system (it uses Child atm, needs to be changed to Parent).
|
Also needs some fixes in the GLTF system (it uses Child atm, needs to be changed to Parent). |
Aceeri
added some commits
Sep 11, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
bors r+ |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
|
Rhuagh
added
the
status: ready
label
Oct 22, 2017
Rhuagh
removed
the
status: working
label
Oct 22, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
bors r+ |
Aceeri commentedOct 11, 2017
•
edited by torkleyy
Edited 1 time
-
torkleyy
edited Oct 17, 2017 (most recent)
Cleans up the transform system with some new specs features, adds unit tests.
Still plan on adding some tests using
quickcheckfor some more "fuzzy" testing to catch the odd edge cases.Fixes #336