UnderwaterApps / overlap2d-runtime-libgdx

Overlap2D - UI and Level Editor libgdx runtime
http://overlap2d.com
Other
170 stars 96 forks source link

Fix transforms not working with physics composites objects #88

Closed leruaa closed 8 years ago

leruaa commented 8 years ago

This PR fix the issue #81.

The transforms offset computing are now moved from Overlap2dRenderer to a TransformSystem system that is processed before the PhysicsSystem and Overlap2dRenderer.

I tested the fix in runtime and in the editor.

leruaa commented 8 years ago

Sorry to bother you again ;) but do you plan to merge this ?

azakhary commented 8 years ago

Yes I do. the problem is, we changed bunch of stuff, just a week ago, regarding transforms. This is probably not affecting this, but we kinda have to re-test this again, against this latest changes, because it can break stuff.

@Sasun could you please take a look?

leruaa commented 8 years ago

Yeah I saw that ;)

I just checked the issue #81 is still there with all the last changes, and that it is still resolved with my PR.

azakhary commented 8 years ago

I am currently looking at the implementation. and I understand offsetX is a variable in transform component set for physics only, and it seems it should not be, because transform only should know it's entities position in it's parent. Even more then that, fixing this issue should not anyhow change the way drawable logics work. So this is an issue.

The way this properly should be fixed is - when positioning the box2d item in physics system, we should position it using not local coordinates, but global coordinates calculation (by recursively going up through parents)

leruaa commented 8 years ago

Ok, well I think I will start over in a new PR.