NablaZeroLabs / mxd

Space Mission Design Support Tools
MIT License
4 stars 4 forks source link

Implement Geometry component #8

Open arrieta opened 5 years ago

arrieta commented 5 years ago

Implement the Window component started by commit 6fd30ec4abee7a0df91f6ee9b6279a0cbb26e864.

fayalalebrun commented 5 years ago

I think this class should be purely virtual, with perhaps a draw, position, and rotation methods, to be able to make a distinction between lines and meshes. We could try and draw everything with the same Geometry class, but we would need to use GL_TRIANGLES for lines as well, which would be inefficient, as we would have to supply 4 points for every points. However, if we use GL_LINES instead, we would be able to send the graphics card only one point per point. The drawback is that changing the line width may be a bit trickier, since the function to do so is only supported by some graphics cards. However, the default line size usually good enough (It is what I used in Astraria). What do you think?

I also think we should plan out the graphics engine itself. With Astraria, I just added things as I needed them, and the result was not as comprehensive as I would have liked. But I believe if we define what the graphics engine should be able to do early on and design the components accordingly, we should be able to make a renderer with a a good design and that makes sense.

arrieta commented 5 years ago

A class hierarchy can work, but it also comes with drawbacks.

Architecturally, I prefer we target an Entity Component System. Some explanations and examples:

  1. Wikipedia - Entity–component–system
  2. Gamasutra - The Entity-Component-System - An awesome game-design pattern in C++
  3. GitHub - EntityX

This architectural pattern can help us retain a flat collection of functionality that we add piece-by-piece to every Actor or Entity in our system.

fayalalebrun commented 5 years ago

I've done some cursory reading over the websites you have linked, and I think I have only used the hierarchical method before. However, this system you mention seems very promising and it will be interesting to implement and learn. I will do some more research to understand how something like this is supposed to work.

fayalalebrun commented 5 years ago

After spending much time reading about Entity-component systems, I am believe I have reached a good understanding of them. I am ready to carry on development with this technique, but I am not sure what the design of the program should look like, and thus I am reluctant to add more classes. I think we should reach a consensus on this before carrying on.

@arrieta Could we hold a video-conference fairly soon?