Aether3D Game Engine
Scene.hpp
1 #ifndef SCENE_H
2 #define SCENE_H
3 
4 #include <vector>
5 #include <string>
6 #include "Vec3.hpp"
7 
8 namespace ae3d
9 {
10  namespace FileSystem
11  {
12  struct FileContentsData;
13  }
14 
16  class Scene
17  {
18  public:
20  enum class DeserializeResult { Success, ParseError };
21 
23  void Add( class GameObject* gameObject );
24 
26  void Remove( GameObject* gameObject );
27 
29  void Render();
30 
32  void SetSkybox( const class TextureCube* skyTexture );
33 
35  std::string GetSerialized() const;
36 
40  DeserializeResult Deserialize( const FileSystem::FileContentsData& serialized, std::vector< GameObject >& outGameObjects ) const;
41 
42  private:
43  void RenderWithCamera( GameObject* cameraGo, int cubeMapFace );
44  void RenderShadowsWithCamera( GameObject* cameraGo, int cubeMapFace );
45  void GenerateAABB();
46 
47  std::vector< GameObject* > gameObjects;
48  unsigned nextFreeGameObject = 0;
49  const TextureCube* skybox = nullptr;
50  GameObject* mainCamera = nullptr;
51  Vec3 aabbMin;
52  Vec3 aabbMax;
53  };
54 }
55 #endif
Definition: AudioClip.hpp:4
DeserializeResult Deserialize(const FileSystem::FileContentsData &serialized, std::vector< GameObject > &outGameObjects) const
3-component vector.
Definition: Vec3.hpp:12
Cube Map texture.
Definition: TextureCube.hpp:15
std::string GetSerialized() const
GameObject is composed of components that define its behavior.
Definition: GameObject.hpp:9
void Render()
Renders the scene.
void Add(class GameObject *gameObject)
Adds a game object into the scene if it does not exist there already.
void Remove(GameObject *gameObject)
DeserializeResult
Result of GetSerialized.
Definition: Scene.hpp:20
Definition: FileSystem.hpp:12
Contains game objects in a transform hierarchy.
Definition: Scene.hpp:16
void SetSkybox(const class TextureCube *skyTexture)