
.. _program_listing_file_Src_GraphicsEngineOpenGL_scene_GameObject.ixx:

Program Listing for File GameObject.ixx
=======================================

|exhale_lsh| :ref:`Return to documentation for file <file_Src_GraphicsEngineOpenGL_scene_GameObject.ixx>` (``Src/GraphicsEngineOpenGL/scene/GameObject.ixx``)

.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS

.. code-block:: cpp

   module;
   
   #include <string>
   #include <memory>
   #include <glad/glad.h>
   #include <glm/glm.hpp>
   
   export module kataglyphis.opengl.game_object;
   
   import kataglyphis.opengl.rotation;
   import kataglyphis.opengl.model;
   import kataglyphis.opengl.aabb;
   
   export class GameObject
   {
     public:
       GameObject();
   
       GameObject(const std::string &model_path, glm::vec3 translation, GLfloat scale, Rotation rot);
   
       void init(const std::string &model_path, glm::vec3 translation, GLfloat scale, Rotation rot);
   
       glm::mat4 get_world_trafo();
       glm::mat4 get_normal_world_trafo();
   
       std::shared_ptr<AABB> get_aabb();
       std::shared_ptr<Model> get_model();
   
       void translate(glm::vec3 translate);
       void scale(GLfloat scale_factor);
       void rotate(Rotation rot);
   
       void render();
   
       ~GameObject();
   
     private:
       std::shared_ptr<Model> model;
   
       GLfloat scale_factor{};
       Rotation rot{};
       glm::vec3 translation{};
   };
