From 2345cfb22aba02306dcac77b0d0946887b1485d0 Mon Sep 17 00:00:00 2001 From: falsycat Date: Mon, 14 Oct 2019 00:00:00 +0000 Subject: [PATCH] [update] Moved codes to initialize LobbyWorld. --- src/sj/LobbyWorld.d | 15 ++++++++++++++- src/sj/TitleScene.d | 16 ---------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/sj/LobbyWorld.d b/src/sj/LobbyWorld.d index 09ab8a4..9658e8d 100644 --- a/src/sj/LobbyWorld.d +++ b/src/sj/LobbyWorld.d @@ -20,6 +20,19 @@ class LobbyWorld { this(ProgramSet programs) { background_ = new Background(programs.Get!BackgroundProgram); cube_program_ = programs.Get!CubeProgram; + + view.pos = vec3(0, -0.15, -1); + view.target = vec3(0, -0.15, 0); + view.up = vec3(0, 1, 0); + + background.inner_color = vec4(0, 0, 0, 0); + background.outer_color = vec4(0, 0, 0, 0); + + cube_material.diffuse_color = vec3(0.1, 0.1, 0.1); + cube_material.light_color = vec3(1, 0.8, 0.8); + cube_material.light_power = vec3(100, 100, 100); + cube_material.ambient_color = vec3(0.2, 0.2, 0.2); + cube_material.specular_color = vec3(0.5, 0.2, 0.2); } /// @@ -43,7 +56,7 @@ class LobbyWorld { /// ViewMatrixFactory view; /// - vec3 light_pos = vec3(0, 10, 0); + vec3 light_pos = vec3(0, 9, -1); /// CubeProgram.Material cube_material; /// diff --git a/src/sj/TitleScene.d b/src/sj/TitleScene.d index 27cb6cf..0cff0ff 100644 --- a/src/sj/TitleScene.d +++ b/src/sj/TitleScene.d @@ -39,22 +39,6 @@ class TitleScene : SceneInterface { this(LobbyWorld lobby, ProgramSet program) { lobby_ = lobby; title_ = program.Get!TitleTextProgram; - - lobby_.view.pos = vec3(0, -0.15, -1); - lobby_.view.target = vec3(0, -0.15, 0); - lobby_.view.up = vec3(0, 1, 0); - - lobby_.background.inner_color = BgInnerColor; - lobby_.background.outer_color = BgOuterColor; - - lobby_.light_pos = vec3(0, 9, -1); - lobby_.cube_material.diffuse_color = vec3(0.1, 0.1, 0.1); - lobby_.cube_material.light_color = vec3(1, 0.8, 0.8); - lobby_.cube_material.light_power = vec3(100, 100, 100); - lobby_.cube_material.ambient_color = vec3(0.2, 0.2, 0.2); - lobby_.cube_material.specular_color = vec3(0.5, 0.2, 0.2); - - lobby_.cube_interval = CubeInterval; } ///