Every GameObject has a transform
As we learned earlier in the chapter in the Entity-Component pattern section, every GameObject
will have a Transform
class as a member. The Transform
class will hold all the data and perform all the operations that are common to all GameObject
instances- plus a bit more. In a fuller game engine, the Transform
class would typically be quite a small class but we are going to cheat and make it quite big in order to incorporate some data and methods that wouldn't typically be part of Transform
.
We are doing it this way to stop the structure of our code becoming even more complicated. While planning the book it seemed that the structure of this project had already increased in complexity. Therefore, this class will be a kind of catch-all for common things that our component classes don't handle. You will notice that not all GameObjects
will need all the functionality/data. This isn't best practice, but it will serve as a stepping stone to get this...