3 #ifndef GDK_GFX_WEBGL1ES2_SCENE 4 #define GDK_GFX_WEBGL1ES2_SCENE 7 #include <gdk/webgl1es2_screen_camera.h> 8 #include <gdk/webgl1es2_texture_camera.h> 9 #include <gdk/webgl1es2_material.h> 10 #include <gdk/webgl1es2_model.h> 12 #include <unordered_set> 21 using entity_ptr_type = std::shared_ptr<const entity>;
22 using material_ptr_type = std::shared_ptr<webgl1es2_material>;
23 using model_ptr_type = std::shared_ptr<webgl1es2_model>;
24 using model_to_entity_collection = std::unordered_map<model_ptr_type,
25 std::unordered_set<entity_ptr_type>>;
26 using material_to_model_to_entity_collection_collection =
27 std::unordered_map<material_ptr_type, model_to_entity_collection>;
31 virtual void try_add(entity_ptr_type);
36 material_to_model_to_entity_collection_collection m_MaterialToModelToEntityCollection;
38 std::unordered_set<entity_ptr_type> m_unique_entities;
46 virtual void try_add(entity_ptr_type)
override;
66 std::unordered_set<std::shared_ptr<const entity>>>;
70 std::unordered_map<material_ptr_type, model_to_entity_collection>;
75 virtual void add(
const std::shared_ptr<const screen_camera> &pCamera)
override;
76 virtual void add(
const std::shared_ptr<const texture_camera> &pCamera)
override;
77 virtual void add(
const std::shared_ptr<const entity> &pEntity)
override;
79 virtual void remove(
const std::shared_ptr<const screen_camera> &pCamera)
override;
80 virtual void remove(
const std::shared_ptr<const texture_camera> &pCamera)
override;
81 virtual void remove(
const std::shared_ptr<const entity> &pEntity)
override;
83 virtual void draw(
const gdk::graphics_intvector2_type &aFrameBufferSize)
const override;
88 std::unordered_set<std::shared_ptr<const webgl1es2_screen_camera>> m_screen_cameras;
91 std::unordered_set<std::shared_ptr<const webgl1es2_texture_camera>> m_texture_cameras;
set of objects to render
Definition: webgl1es2_scene.h:18
Definition: webgl1es2_scene.h:41
std::shared_ptr< webgl1es2_model > model_ptr_type
models can be shared across webgl1es2_scenes
Definition: webgl1es2_scene.h:61
render scene.
Definition: webgl1es2_scene.h:55
std::shared_ptr< webgl1es2_material > material_ptr_type
materials can be shared across webgl1es2_scenes
Definition: webgl1es2_scene.h:59
a 3d environment within which cameras draw entities
Definition: scene.h:18
std::unordered_map< material_ptr_type, model_to_entity_collection > material_to_model_to_entity_collection_collection
Definition: webgl1es2_scene.h:70
webgl1es2_camera implementation of camera
Definition: webgl1es2_camera.h:21
std::unordered_map< model_ptr_type, std::unordered_set< std::shared_ptr< const entity > >> model_to_entity_collection
Definition: webgl1es2_scene.h:66