Working on new locations
This commit is contained in:
1 parent
fb7b42ddf9
commit
7e94009217
57 files changed
+732417
-528
No files matched your search
+42
-7
@@ -166,28 +166,42 @@ namespace ZL
|
||||
params1.dialoguesJsonPath = "resources/dialogue/sample_dialogues.json";
|
||||
params1.navigationJsonPath = "resources/config2/navigation.json";
|
||||
params1.scriptPath = "resources/start.lua";
|
||||
params1.playerPosition = Eigen::Vector3f::Zero();
|
||||
params1.teleportPosition = Eigen::Vector3f(-2.03001f, 0.f, -4.95618f);
|
||||
params1.playerPosition = Eigen::Vector3f(0.942694, 0, -9.63104);
|
||||
params1.teleportPosition = Eigen::Vector3f(2.64621, 0, -9.37259);
|
||||
params1.teleportRadius = 1.5f;
|
||||
|
||||
location1 = std::make_shared<Location>(renderer, inventory);
|
||||
location1->setup(params1);
|
||||
|
||||
|
||||
LocationSetup params2 = params1;
|
||||
params2.roomMeshPath = "resources/w/exterior/Segmented_Plane002.txt";
|
||||
params2.roomTexturePath = "resources/w/exterior/Segmented_Plane002.png";
|
||||
params2.gameObjectsJsonPath = "resources/config2/gameobjects2.json";
|
||||
params2.navigationJsonPath = "resources/config2/navigation2.json";
|
||||
params2.scriptPath = "resources/start2.lua";
|
||||
params2.playerPosition = Eigen::Vector3f(7.f, 0.f, 27.f);
|
||||
params2.playerPosition = Eigen::Vector3f(5, 0, -18.4);
|
||||
|
||||
params2.npcsJsonPath = "resources/config2/npcs2.json";
|
||||
params2.teleportPosition = Eigen::Vector3f(-6.45, 0.0, 7.82);
|
||||
params2.teleportPosition = Eigen::Vector3f(8.2, 0, -9.9);
|
||||
params2.teleportRadius = 1.5f;
|
||||
location2 = std::make_shared<Location>(renderer, inventory);
|
||||
location2->setup(params2);
|
||||
|
||||
LocationSetup params_dorm;
|
||||
params_dorm.roomMeshPath = "";
|
||||
params_dorm.roomTexturePath = "";
|
||||
params_dorm.gameObjectsJsonPath = "resources/config2/gameobjects_dorm.json";
|
||||
params_dorm.npcsJsonPath = "resources/config2/npcs_dorm.json";
|
||||
params_dorm.dialoguesJsonPath = "resources/dialogue/sample_dialogues.json";
|
||||
params_dorm.navigationJsonPath = "resources/config2/navigation_dorm.json";
|
||||
params_dorm.scriptPath = "resources/start_dorm.lua";
|
||||
params_dorm.playerPosition = Eigen::Vector3f(6.0357, 0, -16.0581);
|
||||
params_dorm.teleportPosition = Eigen::Vector3f(-8.32343, 0, -0.152264);
|
||||
params_dorm.teleportRadius = 1.5f;
|
||||
|
||||
location_dorm = std::make_shared<Location>(renderer, inventory);
|
||||
location_dorm->setup(params_dorm);
|
||||
|
||||
// Teleport callbacks: stepping into a location's zone hands the player
|
||||
// to the other location at *its* teleport position. We pre-arm the
|
||||
// destination's playerInTeleportZone so the player must walk out and
|
||||
@@ -211,7 +225,17 @@ namespace ZL
|
||||
currentLocation->playerInTeleportZone = true;
|
||||
};
|
||||
|
||||
currentLocation = location2;
|
||||
location_dorm->onTeleport = [this]() {
|
||||
std::cout << "[TELEPORT] location 2 -> location 1" << std::endl;
|
||||
currentLocation = location2;
|
||||
if (currentLocation->player) {
|
||||
currentLocation->player->position = currentLocation->teleportPosition;
|
||||
currentLocation->player->setTarget(currentLocation->teleportPosition);
|
||||
}
|
||||
currentLocation->playerInTeleportZone = true;
|
||||
};
|
||||
|
||||
currentLocation = location_dorm;
|
||||
|
||||
std::cout << "Load resurces step 5" << std::endl;
|
||||
|
||||
@@ -220,11 +244,18 @@ namespace ZL
|
||||
// Shadow mapping shaders
|
||||
#ifdef EMSCRIPTEN
|
||||
renderer.shaderManager.AddShaderFromFiles("shadow_depth", "resources/shaders/shadow_depth.vertex", "resources/shaders/shadow_depth_web.fragment", CONST_ZIP_FILE);
|
||||
std::cout << "Load resurces step 12x1" << std::endl;
|
||||
renderer.shaderManager.AddShaderFromFiles("shadow_depth_skinning", "resources/shaders/shadow_depth_skinning.vertex", "resources/shaders/shadow_depth_web.fragment", CONST_ZIP_FILE);
|
||||
std::cout << "Load resurces step 12x2" << std::endl;
|
||||
renderer.shaderManager.AddShaderFromFiles("default_shadow", "resources/shaders/default_shadow.vertex", "resources/shaders/default_shadow_web.fragment", CONST_ZIP_FILE);
|
||||
std::cout << "Load resurces step 12x3" << std::endl;
|
||||
renderer.shaderManager.AddShaderFromFiles("skinning_shadow", "resources/shaders/skinning_shadow.vertex", "resources/shaders/default_shadow_web.fragment", CONST_ZIP_FILE);
|
||||
std::cout << "Load resurces step 12x4" << std::endl;
|
||||
renderer.shaderManager.AddShaderFromFiles("fog_shadow", "resources/shaders/fog_shadow.vertex", "resources/shaders/fog_shadow_web.fragment", CONST_ZIP_FILE);
|
||||
std::cout << "Load resurces step 12x5" << std::endl;
|
||||
renderer.shaderManager.AddShaderFromFiles("fog_skinning_shadow", "resources/shaders/fog_skinning_shadow.vertex", "resources/shaders/fog_shadow_web.fragment", CONST_ZIP_FILE);
|
||||
std::cout << "Load resurces step 12x6" << std::endl;
|
||||
|
||||
#else
|
||||
renderer.shaderManager.AddShaderFromFiles("shadow_depth", "resources/shaders/shadow_depth.vertex", "resources/shaders/shadow_depth_desktop.fragment", CONST_ZIP_FILE);
|
||||
renderer.shaderManager.AddShaderFromFiles("shadow_depth_skinning", "resources/shaders/shadow_depth_skinning.vertex", "resources/shaders/shadow_depth_desktop.fragment", CONST_ZIP_FILE);
|
||||
@@ -496,12 +527,16 @@ namespace ZL
|
||||
|
||||
case SDLK_o:
|
||||
//y = y + 0.002;
|
||||
currentLocation->player->hp = 200;
|
||||
//currentLocation->player->hp = 200;
|
||||
//currentLocation->npcs[3]->walkSpeed += 0.02f;
|
||||
//std::cout << "Walk speed: " << currentLocation->npcs[3]->walkSpeed << std::endl;
|
||||
break;
|
||||
|
||||
case SDLK_k:
|
||||
//y = y - 0.002;
|
||||
std::cout << "Player pos: " << currentLocation->player->position.transpose() << std::endl;
|
||||
//currentLocation->npcs[3]->walkSpeed -= 0.02f;
|
||||
//std::cout << "Walk speed: " << currentLocation->npcs[3]->walkSpeed << std::endl;
|
||||
break;
|
||||
|
||||
case SDLK_p:
|
||||
|
||||
Reference in new issue
Block a user