Aether3D Game Engine
Scene.hpp
1 #ifndef SCENE_H
2 #define SCENE_H
3 
4 #include <vector>
5 #include <map>
6 #include <string>
7 #include "Vec3.hpp"
8 
9 namespace ae3d
10 {
11  namespace FileSystem
12  {
13  struct FileContentsData;
14  }
15 
17  class Scene
18  {
19  public:
21  enum class DeserializeResult { Success, ParseError };
22 
24  void Add( class GameObject* gameObject );
25 
27  void Remove( GameObject* gameObject );
28 
30  void Render();
31 
33  void SetSkybox( class TextureCube* skyTexture );
34 
36  std::string GetSerialized() const;
37 
45  DeserializeResult Deserialize( const FileSystem::FileContentsData& serialized, std::vector< GameObject >& outGameObjects,
46  std::map< std::string, class Texture2D* >& outTexture2Ds,
47  std::map< std::string, class Material* >& outMaterials,
48  std::vector< class Mesh* >& outMeshes ) const;
49 
50  private:
51  void RenderWithCamera( GameObject* cameraGo, int cubeMapFace );
52  void RenderShadowsWithCamera( GameObject* cameraGo, int cubeMapFace );
53  void GenerateAABB();
54 
55  std::vector< GameObject* > gameObjects;
56  unsigned nextFreeGameObject = 0;
57  TextureCube* skybox = nullptr;
58  Vec3 aabbMin;
59  Vec3 aabbMax;
60  };
61 }
62 #endif
Definition: AudioClip.hpp:4
3-component vector.
Definition: Vec3.hpp:12
Cube Map texture.
Definition: TextureCube.hpp:18
GameObject is composed of components that define its behavior.
Definition: GameObject.hpp:9
DeserializeResult
Result of GetSerialized.
Definition: Scene.hpp:21
Definition: FileSystem.hpp:12
Contains game objects in a transform hierarchy.
Definition: Scene.hpp:17