From 2ce00a74aaedc104304a1c97d63e365605391703 Mon Sep 17 00:00:00 2001 From: Tyler Lentz Date: Thu, 6 Jun 2024 23:38:39 -0700 Subject: [PATCH] add marble tp trap --- config.json | 2 +- include/client/client.hpp | 1 + src/client/client.cpp | 9 ++++++--- src/server/game/object.cpp | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config.json b/config.json index e9e75c66..23872b00 100644 --- a/config.json +++ b/config.json @@ -14,7 +14,7 @@ "server": { "lobby_name": "Hope you're doing well!", "lobby_broadcast": true, - "max_players": 4, + "max_players": 1, "disable_dm": false, "skip_intro": true }, diff --git a/include/client/client.hpp b/include/client/client.hpp index 7506f7b1..c6c48bfe 100644 --- a/include/client/client.hpp +++ b/include/client/client.hpp @@ -279,6 +279,7 @@ class Client { std::unique_ptr lava_horizontal_model; std::unique_ptr lightning_model; std::unique_ptr chest_model; + std::unique_ptr teleport_model; GLFWwindow *window; diff --git a/src/client/client.cpp b/src/client/client.cpp index 9a6b387a..eae32cdf 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -256,6 +256,9 @@ bool Client::init() { auto orb_model_path = item_models_dir / "orb_final/Orb 1.obj"; this->orb_model = std::make_unique(orb_model_path.string(), false); + auto teleport_model_path = env_models_dir / "teleport" / "teleport.obj"; + this->teleport_model = std::make_unique(teleport_model_path.string(), true); + auto exit_model_path = env_models_dir / "exit.obj"; this->exit_model = std::make_unique(exit_model_path.string(), true); @@ -1194,9 +1197,9 @@ void Client::geometryPass() { if (!is_dm && sharedObject->trapInfo->dm_hover) { break; } - this->orb_model->setDimensions( sharedObject->physics.dimensions); - this->orb_model->translateAbsolute(sharedObject->physics.getCenterPosition()); - this->orb_model->draw(this->deferred_geometry_shader.get(), + this->teleport_model->setDimensions(sharedObject->physics.dimensions); + this->teleport_model->translateAbsolute(sharedObject->physics.getCenterPosition()); + this->teleport_model->draw(this->deferred_geometry_shader.get(), this->cam->getPos(), true); break; diff --git a/src/server/game/object.cpp b/src/server/game/object.cpp index 723b6522..86e228bb 100644 --- a/src/server/game/object.cpp +++ b/src/server/game/object.cpp @@ -57,7 +57,8 @@ std::unordered_map Object::models ({ {ModelType::FloorSpikeVertical, FLOOR_SPIKE_DIMENSIONS}, {ModelType::Lightning, glm::vec3(3.0f, 100.0f, 3.0f)}, {ModelType::Orb, glm::vec3(0.887116, 0.941508, 0.950092)}, - {ModelType::Chest, glm::vec3(1.377020, 1.355794, 1.092905)} + {ModelType::Chest, glm::vec3(1.377020, 1.355794, 1.092905)}, + {ModelType::TeleporterTrap, glm::vec3(1.0f, 3.0f, 1.0f)} }); /* SharedGameState generation */