diff --git a/game__scene_8cpp_source.html b/game__scene_8cpp_source.html index 7dd5f5b..f9532d2 100644 --- a/game__scene_8cpp_source.html +++ b/game__scene_8cpp_source.html @@ -106,9 +106,9 @@
35  init_materials();
36  init_levels();
37  init_player();
-
38  // init_sphere_gallery();
-
39  // init_transparency_gallery();
-
40  init_shadow_gallery();
+
38  init_sphere_gallery();
+
39  init_transparency_gallery();
+
40  // init_shadow_gallery();
41  }
42 
43  void game_scene::pre_update() {
@@ -122,7 +122,7 @@
51  }
52 
53  void game_scene::init_input() {
-
54  // input_manager::instance().set_relative_mouse(true);
+
54  input_manager::instance().set_relative_mouse(true);
55 
56  // Register Buttons
57  input_manager::instance().register_button(quit, input_context_default, controller_index_default, kc_escape);
@@ -413,19 +413,19 @@
342  }
343 
344  // Directional Light
-
345  /*{
-
346  transform light_trans;
-
347  light_trans.set_position({0.0f, 0.0f, 0.0f});
-
348  quaternion rotation_x, rotation_y;
-
349  rotation_x.set_rotation(vector3::x_axis(), 45.0f * maths_util::deg2rad);
-
350  // rotation_y.set_rotation(vector3::y_axis(), 45.0f * maths_util::deg2rad);
-
351  light_trans.set_rotation(rotation_x * rotation_y);
-
352  light lt;
-
353  lt.set_shadow_distance(30.0f);
-
354  lt.set_mode(light_mode::directional);
-
355  lt.set_power(1.0f);
-
356  world_.entity().set<transform>(light_trans).set<light>(lt).add<local_to_world>();
-
357  }*/
+
345  {
+
346  transform light_trans;
+
347  light_trans.set_position({0.0f, 0.0f, 0.0f});
+
348  quaternion rotation_x, rotation_y;
+
349  rotation_x.set_rotation(vector3::x_axis(), 45.0f * maths_util::deg2rad);
+
350  rotation_y.set_rotation(vector3::y_axis(), 45.0f * maths_util::deg2rad);
+
351  light_trans.set_rotation(rotation_x * rotation_y);
+
352  light lt;
+
353  lt.set_shadow_distance(30.0f);
+
354  lt.set_mode(light_mode::directional);
+
355  lt.set_power(1.0f);
+
356  world_.entity().set<transform>(light_trans).set<light>(lt).add<local_to_world>();
+
357  }
358 
359  // Point Light
360  /*{
@@ -454,7 +454,7 @@
383 
384  void game_scene::init_player() {
385  transform head_trans;
-
386  head_trans.set_position({0.0f, 4.0f, 0.0f});
+
386  head_trans.set_position({0.0f, 1.7f, 0.0f});
387 
388  camera cam;
389  cam.skybox_.shader_ = shader_manager::instance().get_shader("skybox");
@@ -497,7 +497,7 @@
426  render_mesh rend{};
427  rend.mesh_ = mesh_manager::instance().get_mesh("sphere");
428  rend.material_ = material_manager::instance().get_material("pavement");
-
429  world_.entity().set<transform>(trans).set<render_mesh>(rend).add<local_to_world>().add<rotate_tag>();
+
429  world_.entity().set<transform>(trans).set<render_mesh>(rend).add<local_to_world>();
430  }
431 
432  {
@@ -689,6 +689,7 @@
mkr::game_scene::hcs_
head_control_system hcs_
Definition: game_scene.h:12
mkr::geometry_shader
Definition: geometry_shader.h:6
mkr::light
Definition: light.h:13
+
mkr::light::set_shadow_distance
void set_shadow_distance(float _distance)
Definition: light.h:71
mkr::light::set_mode
void set_mode(light_mode _type)
Definition: light.h:35
mkr::light::set_power
void set_power(float _power)
Definition: light.h:39
mkr::lighting_shader
Definition: lighting_shader.h:7
@@ -720,6 +721,7 @@
mkr
Definition: application.cpp:10
mkr::controller_index_default
@ controller_index_default
Definition: input.h:68
mkr::input_context_default
@ input_context_default
Definition: input.h:44
+
mkr::directional
@ directional
Definition: light.h:10
mkr::spot
@ spot
Definition: light.h:9
mkr::point
@ point
Definition: light.h:8
mkr::kc_gamepad_button_dpad_right
@ kc_gamepad_button_dpad_right
Definition: keycode.h:279