A Steroid 0.5s This is the documentation of the fifth version of A Steroid modified according the proposed exercises.
Solution to the exercises:
- Textured Asteroids. To add detail to the Asteroid by texturing it we have modified various classes in order to make access to texture mapping more easier and consistent. We have added a member 't' to the Vertex class in order to have a common place where to store texture coordinates. We have added a MapMode enum to the Mesh class. in order to specify various possible mappings (now only planar and cylindrical). A SetMapping function effectively compute the new texture coordinates according to the choosen MapMode. Another problem that arise when there are many textured object is the lackness of texture memory. When two objects uses a the same image as texture, it should not be loaded twice, for this reason we have added a SetTexture member function to the Mesh class to use a previously loaded and binded texture. In order to avoid waste texture memory the same texture is shared among all asteroids. For this reason we have some static stuff to the Ast3DFract class.
New Features:
- Audio deselectable. if started with the parameter -s (-silent) the game has no music (in this way is slightly faster).
- Optimization in mesh loading, now with new constructors and new interface of Ast3DFract::GenerateSub() we no more load the same mesh many times.
- Added credits in main title
Known bugs and problems:
- Memory management is a mess. We do not delete allocated asteroids and subasteroids
Alphabetic index Hierarchy of classes