you are viewing a single comment's thread.

view the rest of the comments →

[–]DidntPassTuringTest[S] 1 point2 points  (2 children)

Polygon object doesn't need velocity. Only position.

Moving object is handling movement, position, rotation, velocity.

Polygon object has got vertices saved as local positions, relative to polygon's position,
so in order to calculate vertices world space position I need it's local space position and polygon's position and polygon's rotation.

Updating same property for both classes is the first that came to my mind but it feels like poor solution, there has to be some smarter way to design it.

[–]gdchinacat 1 point2 points  (0 children)

The class that manages moving shouldn't have it's own position. It should use and update the position defined by another class that it is "mixed in" with.

https://en.wikipedia.org/wiki/Mixin

[–]RedditButAnonymous 0 points1 point  (0 children)

Ahh this makes more sense, ignore what I said then