EngoEngine / engo

Engo is an open-source 2D game engine written in Go.
https://engoengine.github.io
MIT License
1.74k stars 136 forks source link

2D Scene Graph #704

Closed diwant closed 4 years ago

diwant commented 4 years ago

I've discovered a need for hierarchy in my entities, whereby child nodes are affected by parent node transformations.

An example of a situation that this would allow is a moon entity would be able to spin about an earth entity, which is spinning about a sun entity, which is moving. Rotating/scaling/translating the sun would also rotate/scale/translate the earth and the moon as well, but rotating/scaling/translating the earth would only also rotate/scale/translate the moon and not the sun. i.e. Transformations only apply from the current node down through its child nodes and not up through parent nodes.

Essentially, I'm building a 2D scene graph. I've opened an issue here to gather thoughts, and as I complete my code I'll share it here with everyone so engo can include this functionality if accepted by the contributor community.

diwant commented 4 years ago

This is a duplicate of https://github.com/EngoEngine/engo/issues/555