├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── LICENSE ├── README.md ├── Shooter.cpp ├── Shooter.h ├── ShooterConsts.h ├── Source.cpp ├── connect.txt ├── img ├── gamePlay2.png ├── gamePlay3.png ├── gamePlay4.png ├── gamePlay5.png ├── gamePlay6.png ├── gamePlay7.png ├── opengl.png └── structure.png ├── network ├── Chat.cpp ├── Chat.h ├── ShooterClient.cpp ├── ShooterClient.h ├── ShooterMsgType.cpp ├── ShooterMsgType.h ├── ShooterServer.cpp └── ShooterServer.h ├── obj ├── items │ ├── ability.obj │ ├── ak47.obj │ ├── gold_ak47.obj │ ├── gun.obj │ ├── hill.obj │ ├── rifle.obj │ └── shotgun.obj ├── man │ ├── body.obj │ ├── foot.obj │ └── head.obj ├── maps │ ├── map1.obj │ ├── map2.obj │ ├── map_simple.obj │ └── plane.obj └── other │ ├── XYZ.obj │ ├── cube.obj │ ├── sphere.obj │ └── vector.obj ├── player ├── Player.cpp ├── Player.h ├── PlayerController.cpp └── PlayerController.h ├── server.txt ├── sound ├── backNoise.ogg ├── classic_hurt.ogg ├── click.ogg ├── fallbig.ogg ├── fullAbility.ogg ├── fullHealth.ogg ├── kill.ogg ├── slow_mo.ogg ├── stonestep1.ogg ├── stonestep2.ogg ├── stonestep3.ogg ├── stonestep4.ogg ├── stonestep5.ogg ├── stonestep6.ogg ├── unslow_mo.ogg └── weapons │ ├── ak47.ogg │ ├── change_weapon.ogg │ ├── gun.ogg │ ├── no_ammo.ogg │ ├── reload_ak47.ogg │ ├── reload_gun.ogg │ ├── reload_shotgun.ogg │ └── shotgun.ogg ├── textures ├── back.png └── gui.png └── weapon ├── Ak47.h ├── Gold_Ak47.h ├── Gun.h ├── Rifle.h ├── Shotgun.h ├── Weapon.cpp └── Weapon.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Project exclude paths 2 | /cmake-build-debug/ 3 | /cmake-build-release/ 4 | /engine_log.txt 5 | .idea/ 6 | shooter 7 | 8 | # Compiled source # 9 | *.com 10 | *.class 11 | *.dll 12 | *.exe 13 | *.o 14 | *.so 15 | 16 | # Packages # 17 | # it's better to unpack these files and commit the raw source 18 | # git has its own built in compression methods 19 | *.7z 20 | *.dmg 21 | *.gz 22 | *.iso 23 | *.jar 24 | *.rar 25 | *.tar 26 | *.zip 27 | 28 | # Logs and databases # 29 | *.log 30 | *.sql 31 | *.sqlite 32 | 33 | # OS generated files # 34 | .DS_Store 35 | .DS_Store? 36 | ._* 37 | .Spotlight-V100 38 | .Trashes 39 | ehthumbs.db 40 | Thumbs.db 41 | ======= 42 | # Build folders 43 | out/ 44 | build/ 45 | cmake-build-*/ 46 | 47 | # IDE 48 | .vscode/ 49 | .idea/ 50 | .vs/ 51 | CMakeSettings.json 52 | 53 | # CMake 54 | CMakeUserPresets.json 55 | 56 | # MacOS 57 | .DS_Store 58 | 59 | # Project exclude paths 60 | engine.log 61 | shooter -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "3dzavr"] 2 | path = 3dzavr 3 | url = https://github.com/vectozavr/3dzavr 4 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.17) 2 | project(shooter) 3 | 4 | set(CMAKE_CXX_STANDARD 20) 5 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") 6 | 7 | add_executable(${CMAKE_PROJECT_NAME} 8 | # game: 9 | Source.cpp 10 | player/Player.cpp 11 | player/Player.h 12 | network/ShooterClient.cpp 13 | network/ShooterClient.h 14 | network/ShooterServer.cpp 15 | network/ShooterServer.h 16 | weapon/Weapon.cpp 17 | weapon/Weapon.h 18 | weapon/Ak47.h 19 | weapon/Shotgun.h 20 | weapon/Gun.h 21 | weapon/Gold_Ak47.h 22 | weapon/Rifle.h 23 | player/PlayerController.cpp 24 | player/PlayerController.h 25 | Shooter.cpp 26 | Shooter.h 27 | ShooterConsts.h 28 | network/ShooterMsgType.h 29 | network/ShooterMsgType.cpp 30 | network/Chat.cpp 31 | network/Chat.h 32 | ) 33 | 34 | # include 3dzavr engine into our project 35 | add_subdirectory(3dzavr/engine) 36 | target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC 3DZAVR) 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Ivan Ilin (Vectozavr) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shooter 3Dzavr SFML version 2 | 3 |

About:

4 | 5 | Source code of simple shooter on [3Dzavr SFML game engine](https://github.com/vectozavr/3dzavr/tree/sfml_version) 6 | 7 | ![Project demonstration](img/gamePlay2.png) 8 | 9 | [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://choosealicense.com/licenses/mit/) 10 | ![downloads](https://img.shields.io/github/downloads/vectozavr/shooter/total) 11 | [![Community Discord](https://img.shields.io/discord/788056426324426782.svg?label=discord&logo=discord)](https://discord.gg/NzSf5tyS) 12 | ![Commits](https://img.shields.io/github/last-commit/vectozavr/shooter) 13 | [![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/vectozavr/shooter)](https://www.tickgit.com/browse?repo=github.com/vectozavr/shooter) 14 | ![Repo size](https://img.shields.io/github/repo-size/vectozavr/shooter) 15 | 16 |

Installation:

17 | 1) [Download release](https://github.com/vectozavr/shooter/releases/tag/0.1.0), [unzip it](https://www.7-zip.org) and run shooter.exe file 18 | 19 | 20 | 2) Write ip and port of server in connect.txt file. 21 | 22 | 23 | 3) Write port of the server in server.txt file (only for computer where the server will be running). 24 | 25 | 26 | 3) Enjoy gaming! 27 | 28 | [
Click here if you want to run the server
](https://github.com/vectozavr/shooter_server) 29 | 30 |

Control:

31 | 32 | Mouse, Space, A, S, W, D – player control. 33 | 34 | SHIFT – slow motion (this ability is not infinite: its bar is next to hp) 35 | 36 | E & Q or keys <- -> – change weapon 37 | 38 | R – recharge 39 | 40 | O – turn OpenGL on/off 41 | 42 | Tab – turn debug mode on/off 43 | 44 |

Playing with a source code:

45 | 46 | 1) [Download and install OpenAL library](https://openal.org/downloads/) for SFML sound support (in current version you can't setup this engine without OpenAL) 47 | 48 | 2) Clone this repository 49 | 50 | 3) Open project 51 | 52 | Using [CLion](https://www.jetbrains.com/clion/) with [MinGW (32-bit)](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.3.0/threads-posix/dwarf/i686-7.3.0-release-posix-dwarf-rt_v5-rev0.7z/download) compiler: open CMakeList.txt as a project 53 | 54 | Using [Visual Studio](https://visualstudio.microsoft.com/ru/): open shooter.sln as a project 55 | 56 | 4) Built project and run the game 57 | 58 | Structure: 59 | ![Project demonstration](img/structure.png) 60 | 61 | Online: 62 | ![Project demonstration](img/gamePlay4.png) 63 | 64 | GamePlay: 65 | ![Project demonstration](img/gamePlay3.png) 66 | ![Project demonstration](img/gamePlay5.png) 67 | ![Project demonstration](img/gamePlay6.png) 68 | ![Project demonstration](img/gamePlay7.png) 69 | ![Project demonstration](img/opengl.png) 70 | -------------------------------------------------------------------------------- /Shooter.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 22.09.2021. 3 | // 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "Shooter.h" 13 | #include "ShooterConsts.h" 14 | #include "network/Chat.h" 15 | 16 | // Read server/client settings and start both. 17 | // If client doesn't connect to the localhost - server doesn't start. 18 | void Shooter::initNetwork() { 19 | std::string clientIp; 20 | sf::Uint16 clientPort; 21 | sf::Uint16 serverPort; 22 | std::string playerName; 23 | std::ifstream connectFile("connect.txt", std::ifstream::in); 24 | 25 | // If failed to read client settings 26 | if (!connectFile.is_open() || !(connectFile >> clientIp >> clientPort >> playerName) || 27 | sf::IpAddress(clientIp) == sf::IpAddress::None) { 28 | connectFile.close(); 29 | // Create file and write default settings 30 | clientIp = "127.0.0.1"; 31 | clientPort = 54000; 32 | playerName = "PlayerName"; 33 | std::ofstream temp("connect.txt", std::ofstream::out); 34 | temp << clientIp << std::endl << clientPort << std::endl << playerName; 35 | temp.close(); 36 | } 37 | connectFile.close(); 38 | 39 | // If failed to read server settings 40 | connectFile.open("server.txt", std::ifstream::in); 41 | if (!connectFile.is_open() || !(connectFile >> serverPort)) { 42 | connectFile.close(); 43 | // Create file and write default settings 44 | serverPort = 54000; 45 | std::ofstream temp("server.txt", std::ofstream::out); 46 | temp << serverPort; 47 | temp.close(); 48 | } 49 | connectFile.close(); 50 | 51 | if (clientIp == sf::IpAddress::LocalHost) { 52 | server->start(serverPort); 53 | if (server->isWorking()) 54 | server->generateBonuses(); 55 | } 56 | 57 | client->requestMap(clientIp, ¤t_map); 58 | client->connect(clientIp, clientPort); 59 | player->setPlayerNickName(playerName); 60 | } 61 | 62 | void Shooter::start() { 63 | // connecting to the server 64 | initNetwork(); 65 | 66 | // This code executed once in the beginning: 67 | setUpdateWorld(false); 68 | 69 | screen->setMouseCursorVisible(true); 70 | 71 | world->loadMap(current_map, Vec3D{5, 5, 5}); 72 | 73 | EventHandler::listen( 74 | Event("spawn_player"), 75 | [this](sf::Uint16 targetId) { 76 | spawnPlayer(targetId); 77 | }); 78 | EventHandler::listen( 79 | Event("remove_player"), 80 | [this](sf::Uint16 targetId) { 81 | removePlayer(targetId); 82 | }); 83 | EventHandler::listen(Event("fire"), [this](){ player->fireWeaponAnimation(); }); 84 | EventHandler::listen( 85 | Event("your_bullet"), 86 | [this](const Vec3D &from, const Vec3D &to) { 87 | addFireTrace(from, to); 88 | }); 89 | EventHandler::listen( 90 | Event("enemy_bullet"), 91 | [this](const Vec3D &from, const Vec3D &to) { 92 | addFireTrace(from, to); 93 | }); 94 | EventHandler::listen)>( 95 | Event("add_weapon"), 96 | [this](std::shared_ptr weapon) { 97 | addWeapon(weapon); 98 | }); 99 | EventHandler::listen)>( 100 | Event("remove_weapon"), 101 | [this](std::shared_ptr weapon) { 102 | removeWeapon(weapon); 103 | }); 104 | EventHandler::listen( 105 | Event("change_enemy_weapon"), 106 | [this](const std::string &weaponName, sf::Uint16 enemyId) { 107 | changeEnemyWeapon(weaponName, enemyId); 108 | }); 109 | EventHandler::listen( 110 | Event("add_bonus"), 111 | [this](const std::string &bonusName, const Vec3D &position) { addBonus(bonusName, position); } 112 | ); 113 | EventHandler::listen( 114 | Event("remove_bonus"), 115 | [this](const ObjectNameTag &bonusName) { removeBonus(bonusName); } 116 | ); 117 | 118 | EventHandler::listen(Event("reload_weapon"), [this](){ player->reloadWeaponAnimation(); }); 119 | 120 | player->setRayCastFunction([this](const Vec3D &from, const Vec3D &to) { return world->rayCast(from, to, "Player Weapon fireTrace bulletHole"); }); 121 | 122 | camera->translateToPoint(player->position() + Vec3D{0, 1.8, 0}); 123 | player->attach(camera); 124 | world->addBody(player); 125 | 126 | // Waiting for connect and updating server if it's same window 127 | while (client->isWorking() && !client->connected()) { 128 | client->update(); 129 | server->update(); 130 | Time::update(); 131 | } 132 | // If connect fail - return to menu 133 | if (!client->isWorking()) { 134 | inGame = false; 135 | server->stop(); 136 | } 137 | 138 | player->reInitWeapons(); 139 | 140 | // windows init: 141 | mainMenu.setTitle("Main menu"); 142 | mainMenu.setBackgroundTexture(ShooterConsts::MAIN_MENU_BACK, 1.1, 1.1, screen->width(), screen->height()); 143 | 144 | mainMenu.addButton(screen->width() / 2, 200, 200, 20, [this]() { 145 | this->play(); 146 | SoundController::loadAndPlay(SoundTag("click"), ShooterConsts::CLICK_SOUND); 147 | }, "Server: " + client->serverIp().toString(), 5, 5, ShooterConsts::MAIN_MENU_GUI, {0, 66}, {0, 86}, {0, 46}, 148 | Consts::MEDIUM_FONT, {255, 255, 255}); 149 | mainMenu.addButton(screen->width() / 2, 350, 200, 20, [this]() { 150 | this->player->translateToPoint(Vec3D{0, 0, 0}); 151 | this->player->setVelocity({}); 152 | this->play(); 153 | SoundController::loadAndPlay(SoundTag("click"), ShooterConsts::CLICK_SOUND); 154 | }, "Respawn", 5, 5, ShooterConsts::MAIN_MENU_GUI, {0, 66}, {0, 86}, {0, 46}, Consts::MEDIUM_FONT, {255, 255, 255}); 155 | 156 | mainMenu.addButton(screen->width() / 2, 500, 200, 20, [this]() { 157 | client->disconnect(); 158 | server->stop(); 159 | this->exit(); 160 | }, "Exit", 5, 5, ShooterConsts::MAIN_MENU_GUI, {0, 66}, {0, 86}, {0, 46}, Consts::MEDIUM_FONT, {255, 255, 255}); 161 | 162 | client->setChatManager(chat); 163 | } 164 | 165 | void Shooter::update() { 166 | // This code executed every time step: 167 | server->update(); 168 | client->update(); 169 | 170 | // Check all input after this condition please 171 | if (!screen->hasFocus()) { 172 | return; 173 | } 174 | if (keyboard->isKeyTapped(sf::Keyboard::Enter)) { 175 | if (isTypingMessage) { 176 | client->sendMessage(message); 177 | message = ""; 178 | } 179 | isTypingMessage = !isTypingMessage; 180 | } 181 | if (!isTypingMessage) { 182 | if (keyboard->isKeyTapped(sf::Keyboard::Escape)) { 183 | inGame = !inGame; 184 | screen->setMouseCursorVisible(!inGame); 185 | } 186 | 187 | if (keyboard->isKeyTapped(sf::Keyboard::O)) { 188 | setGlEnable(!glEnable()); 189 | } 190 | 191 | if (keyboard->isKeyTapped(sf::Keyboard::Tab)) { 192 | setDebugInfo(!showDebugInfo()); 193 | } 194 | 195 | if (keyboard->isKeyTapped(sf::Keyboard::P)) { 196 | screen->startRender(); 197 | } 198 | 199 | if (keyboard->isKeyTapped(sf::Keyboard::L)) { 200 | screen->stopRender(); 201 | } 202 | } 203 | 204 | if (inGame) { 205 | screen->setTitle(ShooterConsts::PROJECT_NAME); 206 | 207 | if (isTypingMessage) { 208 | std::string symbols = screen->getInputSymbols(); 209 | for (char s : symbols) { 210 | if (s == (char)8) { //backspace 211 | message = message.substr(0, message.size() - 1); 212 | } 213 | else if (s == (char)27) { //escape 214 | message = ""; //FIXME: не работает потому что isKeyTapped имеют задержку, 215 | isTypingMessage = false; //т. е. этот код выполняется после нажатия на ESC, 216 | } // но при следующем цикле при проверке isKeyTapped(ESC) возвращается TRUE 217 | else if (message.length() < ShooterConsts::MAX_MESSAGE_LENGTH && s!=(char)13) {//13=enter 218 | message += s; 219 | } 220 | } 221 | } 222 | else { 223 | playerController->update(); 224 | } 225 | 226 | } else { 227 | mainMenu.update(); 228 | } 229 | 230 | setUpdateWorld(inGame); 231 | 232 | // background sounds and music control 233 | if (SoundController::getStatus(SoundTag("background")) != sf::Sound::Status::Playing) { 234 | SoundController::loadAndPlay(SoundTag("background"), ShooterConsts::BACK_NOISE); 235 | } 236 | 237 | 238 | } 239 | 240 | void Shooter::drawChat() { 241 | sf::Color chatColor = isTypingMessage? sf::Color(50, 50, 50, 255) : sf::Color(50, 50, 50, chat->update(Time::deltaTime())); 242 | std::string chatText = isTypingMessage ? chat->getChat() : chat->getChatPreview(); 243 | 244 | screen->drawText(chatText, Vec2D{ 10, (double)screen->height()*0.25 }, 20, chatColor); 245 | 246 | if (isTypingMessage){ 247 | screen->drawTetragon( 248 | Vec2D{ (double)screen->width() * 0.05, (double)screen->height() * 0.7}, 249 | Vec2D{ (double)screen->width() * 0.95, (double)screen->height() * 0.7}, 250 | Vec2D{ (double)screen->width() * 0.95, (double)screen->height() * 0.7+50 }, 251 | Vec2D{ (double)screen->width() * 0.05, (double)screen->height() * 0.7+50 }, sf::Color(150, 150, 150, 150)); 252 | 253 | screen->drawText(message, Vec2D{(double)screen->width() * 0.05 + 10, (double)screen->height() * 0.7 - 30}, 30, sf::Color(0, 0, 0, 255)); 254 | } 255 | } 256 | 257 | void Shooter::gui() { 258 | sf::Sprite sprite; 259 | sprite.setTexture(*ResourceManager::loadTexture(ShooterConsts::MAIN_MENU_GUI)); 260 | sprite.setTextureRect(sf::IntRect(243, 3, 9, 9)); 261 | sprite.scale(3, 3); 262 | sprite.setPosition(static_cast(screen->width()) / 2.0f - 27.0f / 2.0f, 263 | static_cast(screen->height()) / 2.0f - 27.0f / 2.0f); 264 | sprite.setColor(sf::Color(0, 0, 0, 250)); 265 | screen->drawSprite(sprite); 266 | 267 | // health player stats 268 | drawPlayerStats(); 269 | drawStatsTable(); 270 | drawChat(); 271 | } 272 | 273 | void Shooter::drawStatsTable() { 274 | 275 | int i = 1; 276 | 277 | screen->drawText(client->lastEvent(), Vec2D{10, 10}, 25, sf::Color(0, 0, 0, 100)); 278 | 279 | std::vector> 280 | allPlayers; 281 | allPlayers.push_back(player); 282 | for (auto&[playerId, player] : client->players()) 283 | allPlayers.push_back(player); 284 | 285 | std::sort(allPlayers.begin(), allPlayers.end(), [](std::shared_ptr p1, std::shared_ptr p2) { 286 | return p1->kills() - p1->deaths() > p2->kills() - p2->deaths(); 287 | }); 288 | 289 | for (auto &p : allPlayers) { 290 | screen->drawText(std::to_string(i) + "\t" + p->playerNickName() + "\t" + std::to_string(p->kills()) + " / " + 291 | std::to_string(p->deaths()), 292 | Vec2D{10, 15 + 35.0 * i}, 25, p->color()); 293 | i++; 294 | } 295 | 296 | } 297 | 298 | void Shooter::drawPlayerStats() { 299 | // health bar 300 | double xPos = 10; 301 | double yPos = screen->height() - 20; 302 | 303 | int width = screen->width() / 2 - 20; 304 | int height = 10; 305 | 306 | screen->drawTetragon(Vec2D{xPos, yPos}, 307 | Vec2D{xPos + width * player->health() / ShooterConsts::HEALTH_MAX, yPos}, 308 | Vec2D{xPos + width * player->health() / ShooterConsts::HEALTH_MAX, yPos + height}, 309 | Vec2D{xPos, yPos + height}, 310 | {static_cast((ShooterConsts::HEALTH_MAX - player->health()) / 311 | ShooterConsts::HEALTH_MAX * 255), 312 | static_cast(player->health() * 255 / ShooterConsts::HEALTH_MAX), 0, 100}); 313 | 314 | screen->drawTetragon(Vec2D{xPos, yPos - 15}, 315 | Vec2D{xPos + width * player->ability() / ShooterConsts::ABILITY_MAX, yPos - 15}, 316 | Vec2D{xPos + width * player->ability() / ShooterConsts::ABILITY_MAX, yPos - 15 + height}, 317 | Vec2D{xPos, yPos - 15 + height}, 318 | {255, 168, 168, 100}); 319 | 320 | auto balance = player->weapon()->balance(); 321 | 322 | screen->drawText(std::to_string((int) balance.first), Vec2D{150, static_cast(screen->height() - 150)}, 100, 323 | sf::Color(0, 0, 0, 100)); 324 | screen->drawText(std::to_string((int) balance.second), Vec2D{50, static_cast(screen->height() - 100)}, 50, 325 | sf::Color(0, 0, 0, 70)); 326 | } 327 | 328 | void Shooter::play() { 329 | inGame = true; 330 | screen->setMouseCursorVisible(false); 331 | } 332 | 333 | void Shooter::spawnPlayer(sf::Uint16 id) { 334 | std::string name = "Enemy_" + std::to_string(id); 335 | 336 | std::shared_ptr newPlayer = std::make_shared(ObjectNameTag(name), ShooterConsts::BODY_OBJ, Vec3D{0.4, 0.4, 0.4}); 337 | 338 | client->addPlayer(id, newPlayer); 339 | world->addBody(newPlayer); 340 | newPlayer->setVisible(true); 341 | newPlayer->setCollision(false); 342 | newPlayer->setAcceleration(Vec3D{0, 0, 0}); 343 | 344 | // add head and other stuff: 345 | world->loadBody(ObjectNameTag(name + "_head"), ShooterConsts::HEAD_OBJ, Vec3D{0.4, 0.4, 0.4}); 346 | world->body(ObjectNameTag(name + "_head"))->translate(Vec3D{0, 2.2, 0}); 347 | newPlayer->attach(world->body(ObjectNameTag(name + "_head"))); 348 | 349 | world->loadBody(ObjectNameTag(name + "_foot_1"), ShooterConsts::FOOT_OBJ, Vec3D{0.4, 0.4, 0.4}); 350 | world->body(ObjectNameTag(name + "_foot_1"))->translate(Vec3D{-0.25, 0, 0}); 351 | newPlayer->attach(world->body(ObjectNameTag(name + "_foot_1"))); 352 | 353 | world->loadBody(ObjectNameTag(name + "_foot_2"), ShooterConsts::FOOT_OBJ, Vec3D{0.4, 0.4, 0.4}); 354 | world->body(ObjectNameTag(name + "_foot_2"))->translate(Vec3D{0.25, 0, 0}); 355 | newPlayer->attach(world->body(ObjectNameTag(name + "_foot_2"))); 356 | 357 | int colorBodyNum = static_cast (static_cast((rand() - 1)) / RAND_MAX * 5.0); 358 | int colorFootNum = static_cast (static_cast((rand() - 1)) / RAND_MAX * 5.0); 359 | 360 | newPlayer->setColor(Consts::WHITE_COLORS[colorBodyNum]); 361 | world->body(ObjectNameTag(name + "_foot_1"))->setColor(Consts::DARK_COLORS[colorFootNum]); 362 | world->body(ObjectNameTag(name + "_foot_2"))->setColor(Consts::DARK_COLORS[colorFootNum]); 363 | 364 | changeEnemyWeapon("gun", id); 365 | } 366 | 367 | void Shooter::removePlayer(sf::Uint16 id) { 368 | std::string name = "Enemy_" + std::to_string(id); 369 | 370 | auto playerToRemove = world->body(ObjectNameTag(name)); 371 | 372 | Timeline::addAnimation(AnimationListTag(name + "_remove"), playerToRemove, Vec3D(0.01, 0.01, 0.01)); 373 | Timeline::addAnimation(AnimationListTag(name + "_remove"), [this, name](){ 374 | world->removeBody(ObjectNameTag(name)); 375 | world->removeBody(ObjectNameTag(name + "_head")); 376 | world->removeBody(ObjectNameTag(name + "_weapon")); 377 | world->removeBody(ObjectNameTag(name + "_foot_1")); 378 | world->removeBody(ObjectNameTag(name + "_foot_2")); 379 | }); 380 | } 381 | 382 | void Shooter::addFireTrace(const Vec3D &from, const Vec3D &to) { 383 | std::string traceName = "Client_fireTrace_" + std::to_string(fireTraces++); 384 | world->addBody(std::make_shared(Mesh::LineTo(ObjectNameTag(traceName), from, to, 0.05))); 385 | world->body(ObjectNameTag(traceName))->setCollider(false); 386 | 387 | Timeline::addAnimation(AnimationListTag(traceName + "_fadeOut"), world->body(ObjectNameTag(traceName)), 388 | sf::Color{150, 150, 150, 0}); 389 | Timeline::addAnimation(AnimationListTag(traceName + "_delete"), 390 | [this, traceName]() { removeFireTrace(ObjectNameTag(traceName)); }, 1, 391 | 1); 392 | 393 | 394 | std::string bulletHoleName = "Client_bulletHole_" + std::to_string(fireTraces++); 395 | auto bulletHole = Mesh::Cube(ObjectNameTag(bulletHoleName), 0.2, sf::Color(70, 70, 70)); 396 | bulletHole.translate(to); 397 | world->addBody(std::make_shared(bulletHole)); 398 | world->body(ObjectNameTag(bulletHoleName))->setCollider(false); 399 | 400 | Timeline::addAnimation(AnimationListTag(bulletHoleName + "_delete"), 401 | [this, bulletHoleName]() { removeFireTrace(ObjectNameTag(bulletHoleName)); }, 1, 402 | 7); 403 | } 404 | 405 | void Shooter::removeFireTrace(const ObjectNameTag &traceName) { 406 | world->removeBody(traceName); 407 | } 408 | 409 | void Shooter::addBonus(const std::string &bonusName, const Vec3D &position) { 410 | 411 | std::string name = bonusName.substr(6, bonusName.size() - 3 - 5); 412 | 413 | ObjectNameTag nameTag(bonusName); 414 | 415 | world->addBody(std::make_shared(ObjectNameTag(bonusName), "obj/items/" + name + ".obj", Vec3D{3, 3, 3})); 416 | 417 | auto bonus = world->body(ObjectNameTag(bonusName)); 418 | 419 | bonus->translateToPoint(position); 420 | bonus->setCollider(false); 421 | bonus->setTrigger(true); 422 | bonus->scale(Vec3D(0.01, 0.01, 0.01)); 423 | Timeline::addAnimation(AnimationListTag(bonusName + "_creation"), bonus, Vec3D(100, 100, 100)); 424 | Timeline::addAnimation(AnimationListTag(bonusName + "_rotation"), 425 | bonus, Vec3D{0, 2 * Consts::PI, 0}, 4, 426 | Animation::LoopOut::Continue, 427 | Animation::InterpolationType::Linear); 428 | 429 | } 430 | 431 | void Shooter::removeBonus(const ObjectNameTag &bonusName) { 432 | world->removeBody(bonusName); 433 | Timeline::deleteAnimationList(AnimationListTag(bonusName.str() + "_rotation")); 434 | } 435 | 436 | void Shooter::addWeapon(std::shared_ptr weapon) { 437 | world->addBody(weapon); 438 | 439 | EventHandler::call(Event("change_weapon"), weapon->name().str()); 440 | } 441 | 442 | void Shooter::changeEnemyWeapon(const std::string &weaponName, sf::Uint16 enemyId) { 443 | ObjectNameTag weaponTag("Enemy_" + std::to_string(enemyId) + "_weapon"); 444 | auto head = world->body(ObjectNameTag("Enemy_" + std::to_string(enemyId) + "_head")); 445 | auto enemy = world->body(ObjectNameTag("Enemy_" + std::to_string(enemyId))); 446 | auto weapon = world->body(weaponTag); 447 | 448 | // remove old weapon: 449 | world->removeBody(weaponTag); 450 | enemy->unattach(weaponTag); 451 | 452 | world->loadBody(weaponTag, "obj/items/" + weaponName + ".obj"); 453 | world->body(weaponTag)->setCollider(false); 454 | world->body(weaponTag)->scale(Vec3D(3, 3, 3)); 455 | 456 | world->body(weaponTag)->translateToPoint(head->position() - enemy->left() * 1.0 - enemy->up() * 1.0 + enemy->lookAt()); 457 | 458 | world->body(weaponTag)->rotate(Vec3D(0, enemy->angle().y(), 0)); 459 | world->body(weaponTag)->rotateLeft(head->angleLeftUpLookAt().x()); 460 | enemy->attach(world->body(weaponTag)); 461 | 462 | Timeline::addAnimation(AnimationListTag("select_weapon_" + std::to_string(enemyId)), 463 | world->body(weaponTag), 464 | -2 * Consts::PI, 465 | 0.3, 466 | Animation::LoopOut::None, 467 | Animation::InterpolationType::Cos); 468 | } 469 | 470 | void Shooter::removeWeapon(std::shared_ptr weapon) { 471 | world->removeBody(weapon->name()); 472 | } 473 | -------------------------------------------------------------------------------- /Shooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 22.09.2021. 3 | // 4 | 5 | #ifndef SHOOTER_SHOOTER_H 6 | #define SHOOTER_SHOOTER_H 7 | 8 | #include 9 | #include 10 | 11 | #include "player/Player.h" 12 | #include "player/PlayerController.h" 13 | #include "player/PlayerController.h" 14 | #include "network/ShooterClient.h" 15 | #include "network/ShooterServer.h" 16 | 17 | class Shooter final : public Engine { 18 | private: 19 | std::shared_ptr player = std::make_shared(ObjectNameTag("Player"), 20 | ShooterConsts::CUBE_OBJ, 21 | Vec3D{1.5, 1.8, 1.5}); 22 | std::shared_ptr playerController = std::make_shared(player, keyboard, mouse); 23 | 24 | Window mainMenu; 25 | 26 | std::shared_ptr server = std::make_shared(); 27 | std::shared_ptr client = std::make_shared(player); 28 | std::shared_ptr chat = std::make_shared(); 29 | bool isTypingMessage = false; 30 | std::string message; 31 | 32 | bool inGame = false; 33 | int fireTraces = 0; 34 | std::string current_map = ShooterConsts::MAP_OBJ; 35 | 36 | void start() override; 37 | void update() override; 38 | void gui() override; 39 | void drawChat(); 40 | void play(); 41 | void drawPlayerStats(); 42 | void drawStatsTable(); 43 | 44 | void initNetwork(); 45 | 46 | void spawnPlayer(sf::Uint16 id); 47 | void removePlayer(sf::Uint16 id); 48 | void addFireTrace(const Vec3D &from, const Vec3D &to); 49 | void removeFireTrace(const ObjectNameTag &traceName); 50 | void addBonus(const std::string &bonusName, const Vec3D &position); 51 | void removeBonus(const ObjectNameTag &bonusName); 52 | void addWeapon(std::shared_ptr weapon); 53 | void removeWeapon(std::shared_ptr weapon); 54 | void changeEnemyWeapon(const std::string &weaponName, sf::Uint16 enemyId); 55 | 56 | public: 57 | Shooter() : mainMenu(screen, mouse) {}; 58 | }; 59 | 60 | 61 | #endif //SHOOTER_SHOOTER_H 62 | -------------------------------------------------------------------------------- /ShooterConsts.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 10.10.2021. 3 | // 4 | 5 | #ifndef SHOOTER_SHOOTERCONSTS_H 6 | #define SHOOTER_SHOOTERCONSTS_H 7 | 8 | namespace ShooterConsts { 9 | 10 | // Numeric constants 11 | const double GRAVITY = 35; 12 | const double HEALTH_MAX = 100; 13 | const double ABILITY_MAX = 10; 14 | const double JUMP_HEIGHT = 3; 15 | const double WALK_SPEED = 10; 16 | const double MOUSE_SENSITIVITY = 1.0 / 1000.0; 17 | const double SLOW_MO_COEFFICIENT = 5; 18 | const double FIRE_DISTANCE = 1000; 19 | const double BONUS_RECHARGE_TIME = 30; 20 | const int MAX_MESSAGE_LENGTH = 70; 21 | 22 | // String constants 23 | const std::string PLAYER_NAME = "Player"; 24 | const std::string PROJECT_NAME = "Shooter"; 25 | 26 | const std::string ABILITY_OBJ = "obj/items/ability.obj"; 27 | const std::string HILL_OBJ = "obj/items/hill.obj"; 28 | const std::string GUN_OBJ = "obj/items/gun.obj"; 29 | const std::string GUN_FIRE_SOUND = "sound/weapons/gun.ogg"; 30 | const std::string GUN_RELOAD_SOUND = "sound/weapons/reload_gun.ogg"; 31 | const std::string AK47_OBJ = "obj/items/ak47.obj"; 32 | const std::string AK47_FIRE_SOUND = "sound/weapons/ak47.ogg"; 33 | const std::string AK47_RELOAD_SOUND = "sound/weapons/reload_ak47.ogg"; 34 | const std::string GOLD_AK47_OBJ = "obj/items/gold_ak47.obj"; 35 | const std::string GOLD_AK47_FIRE_SOUND = "sound/weapons/ak47.ogg"; 36 | const std::string GOLD_AK47_RELOAD_SOUND = "sound/weapons/reload_ak47.ogg"; 37 | const std::string RIFLE_OBJ = "obj/items/rifle.obj"; 38 | const std::string RIFLE_FIRE_SOUND = "sound/weapons/shotgun.ogg"; 39 | const std::string RIFLE_RELOAD_SOUND = "sound/weapons/reload_ak47.ogg"; 40 | const std::string SHOTGUN_OBJ = "obj/items/shotgun.obj"; 41 | const std::string SHOTGUN_FIRE_SOUND = "sound/weapons/shotgun.ogg"; 42 | const std::string SHOTGUN_RELOAD_SOUND = "sound/weapons/reload_shotgun.ogg"; 43 | 44 | const std::string CUBE_OBJ = "obj/other/cube.obj"; 45 | const std::string MAP_OBJ = "obj/maps/map1.obj"; 46 | const std::string MAR_RAILWAY_OBJ = "obj/maps/railway.obj"; 47 | const std::string BIG_MAP_OBJ = "obj/maps/map2.obj"; 48 | const std::string SIMPLE_MAP_OBJ = "obj/maps/map_simple.obj"; 49 | const std::string PLANE_MAP_OBJ = "obj/maps/plane.obj"; 50 | const std::string MAIN_MENU_BACK = "textures/back.png"; 51 | const std::string MAIN_MENU_GUI = "textures/gui.png"; 52 | 53 | const std::string HEAD_OBJ = "obj/man/head.obj"; 54 | const std::string BODY_OBJ = "obj/man/body.obj"; 55 | const std::string FOOT_OBJ = "obj/man/foot.obj"; 56 | 57 | const std::string CLICK_SOUND = "sound/click.ogg"; 58 | const std::string BACK_NOISE = "sound/backNoise.ogg"; 59 | const std::string CHANGE_WEAPON_SOUND = "sound/weapons/change_weapon.ogg"; 60 | const std::string RESTORE_HEALTH_SOUND = "sound/fullHealth.ogg"; 61 | const std::string RESTORE_ABILITY_SOUND = "sound/fullAbility.ogg"; 62 | const std::string KILL_SOUND = "sound/kill.ogg"; 63 | const std::string DEATH_SOUND = "sound/classic_hurt.ogg"; 64 | const std::string SLOW_MO_SOUND = "sound/slow_mo.ogg"; 65 | const std::string UN_SLOW_MO_SOUND = "sound/unslow_mo.ogg"; 66 | const std::string NO_AMMO_SOUND = "sound/weapons/no_ammo.ogg"; 67 | } 68 | 69 | #endif //SHOOTER_SHOOTERCONSTS_H 70 | -------------------------------------------------------------------------------- /Source.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Ivan Ilin on 06.02.2021. 3 | // 4 | 5 | #include "Shooter.h" 6 | 7 | using namespace std; 8 | 9 | 10 | int main() { 11 | Shooter game; 12 | 13 | // Optimal for standard monitors: 14 | //game.create(720, 480, ShooterConsts::PROJECT_NAME, true); 15 | game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true); 16 | //game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen); 17 | 18 | // Optimal for MacBook Pro 16 display: 19 | //game.create(2048, 1152, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR); 20 | //game.create(3072, 1920, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen); 21 | 22 | return 0; 23 | } -------------------------------------------------------------------------------- /connect.txt: -------------------------------------------------------------------------------- 1 | 127.0.0.1 2 | 54000 3 | PlayerName -------------------------------------------------------------------------------- /img/gamePlay2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/img/gamePlay2.png -------------------------------------------------------------------------------- /img/gamePlay3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/img/gamePlay3.png -------------------------------------------------------------------------------- /img/gamePlay4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/img/gamePlay4.png -------------------------------------------------------------------------------- /img/gamePlay5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/img/gamePlay5.png -------------------------------------------------------------------------------- /img/gamePlay6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/img/gamePlay6.png -------------------------------------------------------------------------------- /img/gamePlay7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/img/gamePlay7.png -------------------------------------------------------------------------------- /img/opengl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/img/opengl.png -------------------------------------------------------------------------------- /img/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/img/structure.png -------------------------------------------------------------------------------- /network/Chat.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "Chat.h" 4 | 5 | void ChatManager::addNewMessage(const std::string& author, const std::string& message) { 6 | hide = 7.0; 7 | messages.push_back(message); 8 | authors.push_back(author); 9 | isChatUpdate = true; 10 | if (messages.size() > 20) { 11 | messages.erase(messages.begin()); 12 | } 13 | } 14 | int ChatManager::update(double delta) { 15 | hide = std::max(hide-delta, 0.0); 16 | return std::min((int)(hide * 255.0), 255); 17 | 18 | } 19 | std::string ChatManager::getChat() { 20 | updateChat(); 21 | return chatStr; 22 | } 23 | std::string ChatManager::getChatPreview() { 24 | updateChat(); 25 | return chatStrPrev; 26 | } 27 | 28 | void ChatManager::updateChat() { 29 | if (isChatUpdate) { 30 | isChatUpdate = false; 31 | size_t size = messages.size(); 32 | chatStr = ""; 33 | chatStrPrev = ""; 34 | for (int messageIndex = size - 1; messageIndex >= 0; messageIndex--) 35 | { 36 | if (messageIndex > size - 6) { 37 | chatStrPrev += authors[messageIndex] + ": " + messages[messageIndex] + "\n"; 38 | } 39 | chatStr += authors[messageIndex] + ": " + messages[messageIndex] + "\n"; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /network/Chat.h: -------------------------------------------------------------------------------- 1 | #ifndef SHOOTER_CHAT_H 2 | #define SHOOTER_CHAT_H 3 | 4 | #include 5 | #include 6 | 7 | class ChatManager final { 8 | private: 9 | std::vector messages; 10 | std::vector authors; 11 | 12 | bool isChatUpdate = true; 13 | std::string chatStr; 14 | std::string chatStrPrev; 15 | 16 | double hide = 0.0; 17 | 18 | void updateChat(); 19 | public: 20 | void addNewMessage(const std::string& author, const std::string& message); 21 | int update(double delta); 22 | 23 | std::string getChat(); 24 | std::string getChatPreview(); 25 | }; 26 | 27 | 28 | #endif -------------------------------------------------------------------------------- /network/ShooterClient.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 25.05.2021. 3 | // 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "ShooterClient.h" 16 | #include "ShooterMsgType.h" 17 | 18 | 19 | 20 | ShooterClient::ShooterClient(std::shared_ptr player) : _player(player) { 21 | EventHandler::listen( 22 | Event("take_bonus"), 23 | [this](const std::string& name){ this->takeBonus(name); } 24 | ); 25 | 26 | EventHandler::listen( 27 | Event("damage_player"), 28 | [this](sf::Uint16 targetId, double damage) { damagePlayer(targetId, damage); } ); 29 | 30 | EventHandler::listen( 31 | Event("your_bullet"), 32 | [this](const Vec3D &from, const Vec3D &to) { 33 | sendTrace(from, to); 34 | }); 35 | 36 | EventHandler::listen( 37 | Event("change_weapon"), 38 | [this](const std::string &name){ changeWeapon(name); } 39 | ); 40 | } 41 | 42 | void ShooterClient::updatePacket() { 43 | sf::Packet packet; 44 | packet << MsgType::ClientUpdate << _player->position().x() << _player->position().y() << _player->position().z() 45 | << _player->angle().y() << _player->headAngle() << _player->playerNickName(); 46 | _socket.send(packet, _socket.serverId()); 47 | } 48 | 49 | void ShooterClient::processInit(sf::Packet &packet) { 50 | sf::Uint16 targetId; 51 | double x, y, z, health; 52 | int kills, deaths; 53 | 54 | while (packet >> targetId >> x >> y >> z >> health >> kills >> deaths) { 55 | if (targetId != _socket.ownId()) { 56 | EventHandler::call(Event("spawn_player"), targetId); 57 | 58 | _players[targetId]->translateToPoint(Vec3D{x, y, z}); 59 | _players[targetId]->setHealth(health); 60 | _players[targetId]->setKills(kills); 61 | _players[targetId]->setDeaths(deaths); 62 | } 63 | } 64 | } 65 | 66 | void ShooterClient::processUpdate(sf::Packet &packet) { 67 | sf::Uint16 targetId; 68 | double x, y, z, health, bodyAngle, headAngle; 69 | std::string playerName; 70 | 71 | while (packet >> targetId >> x >> y >> z >> health >> bodyAngle >> headAngle >> playerName) { 72 | if (_players.count(targetId)) { 73 | std::string name = "Enemy_" + std::to_string(targetId); 74 | 75 | Vec3D newPosition = Vec3D{x, y, z}; 76 | 77 | bool isAnimate = (_players[targetId]->position() - newPosition).sqrAbs() > 0.2; 78 | 79 | _players[targetId]->translateToPoint(newPosition); 80 | 81 | _players[targetId]->setHealth(health); 82 | _players[targetId]->rotateToAngle(Vec3D{0, bodyAngle, 0}); 83 | _players[targetId]->setPlayerNickName(playerName); 84 | 85 | auto head = _players[targetId]->attached(ObjectNameTag(name + "_head")); 86 | auto weapon = _players[targetId]->attached(ObjectNameTag("Enemy_" + std::to_string(targetId) + "_weapon")); 87 | 88 | auto foot1 = _players[targetId]->attached(ObjectNameTag(name + "_foot_1")); 89 | auto foot2 = _players[targetId]->attached(ObjectNameTag(name + "_foot_2")); 90 | 91 | if (head != nullptr) { 92 | head->rotateLeft(headAngle - _players[targetId]->headAngle()); 93 | } 94 | if (weapon != nullptr) { 95 | weapon->rotateLeft(headAngle - _players[targetId]->headAngle()); 96 | } 97 | 98 | if (isAnimate) { 99 | if (foot1 != nullptr && foot2 != nullptr && 100 | !Timeline::isInAnimList(AnimationListTag(name + "_foot1_rotation"))) { 101 | Timeline::addAnimation(AnimationListTag(name + "_foot1_rotation"), 102 | foot1, 0.6, 0.2, Animation::LoopOut::None, 103 | Animation::InterpolationType::Linear); 104 | Timeline::addAnimation(AnimationListTag(name + "_foot1_rotation"), 0); 105 | Timeline::addAnimation(AnimationListTag(name + "_foot1_rotation"), 106 | foot1, -1.2, 0.2, Animation::LoopOut::None, 107 | Animation::InterpolationType::Linear); 108 | Timeline::addAnimation(AnimationListTag(name + "_foot1_rotation"), 0); 109 | Timeline::addAnimation(AnimationListTag(name + "_foot1_rotation"), 110 | foot1, 0.6, 0.2, Animation::LoopOut::None, 111 | Animation::InterpolationType::Linear); 112 | 113 | Timeline::addAnimation(AnimationListTag(name + "_foot2_rotation"), 114 | foot2, -0.6, 0.2, Animation::LoopOut::None, 115 | Animation::InterpolationType::Linear); 116 | Timeline::addAnimation(AnimationListTag(name + "_foot2_rotation"), 0); 117 | Timeline::addAnimation(AnimationListTag(name + "_foot2_rotation"), 118 | foot2, 1.2, 0.2, Animation::LoopOut::None, 119 | Animation::InterpolationType::Linear); 120 | Timeline::addAnimation(AnimationListTag(name + "_foot2_rotation"), 0); 121 | Timeline::addAnimation(AnimationListTag(name + "_foot2_rotation"), 122 | foot2, -0.6, 0.2, Animation::LoopOut::None, 123 | Animation::InterpolationType::Linear); 124 | } 125 | } 126 | 127 | _players[targetId]->setHeadAngle(headAngle); 128 | } else if (targetId == _socket.ownId()) { 129 | _player->setHealth(health); 130 | } 131 | } 132 | } 133 | 134 | void ShooterClient::processNewClient(sf::Packet &packet) { 135 | sf::Uint16 targetId; 136 | 137 | packet >> targetId; 138 | 139 | EventHandler::call(Event("spawn_player"), targetId); 140 | } 141 | 142 | void ShooterClient::processDisconnect(sf::Uint16 targetId) { 143 | if (targetId != _socket.ownId() && _players.count(targetId)) { 144 | _players.erase(targetId); 145 | EventHandler::call(Event("remove_player"), targetId); 146 | } 147 | } 148 | 149 | void ShooterClient::sendMessage(const std::string& message){ 150 | 151 | if (message.length() == 0) 152 | return; 153 | chatManager->addNewMessage(_player->playerNickName(), message); 154 | sf::Packet packet; 155 | packet << MsgType::Custom << ShooterMsgType::newMessage << message; 156 | _socket.send(packet, _socket.serverId()); 157 | } 158 | 159 | void ShooterClient::sendChatMessage(const std::string& message, const std::string& name) { 160 | chatManager->addNewMessage(name, message); 161 | } 162 | 163 | void ShooterClient::processCustomPacket(sf::Packet &packet) { 164 | sf::Uint16 buffId[2]; 165 | double dbuff[10]; 166 | std::string tmp, tmp2; 167 | 168 | ShooterMsgType type; 169 | packet >> type; 170 | std::string name, message; 171 | 172 | switch (type) { 173 | case ShooterMsgType::Kill: 174 | packet >> buffId[0] >> buffId[1]; 175 | _lastEvent = ""; 176 | if (buffId[1] == _socket.ownId()) { 177 | _player->addKill(); 178 | SoundController::loadAndPlay(SoundTag("kill"), ShooterConsts::KILL_SOUND); 179 | _lastEvent += _player->playerNickName(); 180 | } else { 181 | _players[buffId[1]]->addKill(); 182 | _lastEvent += _players[buffId[1]]->playerNickName(); 183 | } 184 | _lastEvent += " ~> "; 185 | 186 | if (buffId[0] == _socket.ownId()) { 187 | _player->addDeath(); 188 | 189 | auto camera = _player->attached(ObjectNameTag("Camera")); 190 | if (camera == nullptr) { 191 | break; 192 | } 193 | 194 | _player->unattach(ObjectNameTag("Camera")); 195 | _player->translateToPoint(Vec3D{10000}); 196 | camera->rotateLeft(-camera->angleLeftUpLookAt().x()); 197 | camera->transform(Matrix4x4::Rotation(-_player->angle())); 198 | 199 | Timeline::addAnimation(AnimationListTag("camera_anim"), 200 | camera, Vec3D(0, 30, -100)); 201 | Timeline::addAnimation(AnimationListTag("camera_anim"), 0); 202 | Timeline::addAnimation(AnimationListTag("camera_anim"), 203 | camera, Vec3D(0), Vec3D{0, Consts::PI, 0}, 204 | 5, Animation::LoopOut::None, 205 | Animation::InterpolationType::Linear); 206 | Timeline::addAnimation(AnimationListTag("camera_anim"), 0); 207 | Timeline::addAnimation(AnimationListTag("camera_anim"), [this, camera]() { 208 | // respawn 209 | _player->translateToPoint( 210 | Vec3D{50.0 * (-1 + 2.0 * (double) rand() / RAND_MAX), 30.0 * (double) rand() / RAND_MAX, 211 | 50.0 * (-1 + 2.0 * (double) rand() / RAND_MAX)}); 212 | _player->reInitWeapons(); 213 | _player->setFullAbility(); 214 | 215 | camera->rotateToAngle(Vec3D(0)); 216 | camera->transform(Matrix4x4::Rotation(Vec3D(_player->angle()))); 217 | camera->rotateLeft(_player->headAngle()); 218 | camera->translateToPoint(_player->position() + Vec3D{0, 1.8, 0}); 219 | _player->attach(camera); 220 | 221 | }, 1, 0.1); 222 | 223 | 224 | SoundController::loadAndPlay(SoundTag("death"), ShooterConsts::DEATH_SOUND); 225 | _lastEvent += _player->playerNickName(); 226 | } else { 227 | _players[buffId[0]]->addDeath(); 228 | _lastEvent += _players[buffId[0]]->playerNickName(); 229 | } 230 | break; 231 | case ShooterMsgType::FireTrace: 232 | 233 | if (buffId[0] != _socket.ownId()) { 234 | packet >> dbuff[0] >> dbuff[1] >> dbuff[2] >> dbuff[3] >> dbuff[4] >> dbuff[5]; 235 | 236 | EventHandler::call( 237 | Event("enemy_bullet"), 238 | Vec3D(dbuff[0], dbuff[1], dbuff[2]), Vec3D(dbuff[3], dbuff[4], dbuff[5])); 239 | } 240 | 241 | break; 242 | case ShooterMsgType::InitBonuses: 243 | while (packet >> tmp >> dbuff[0] >> dbuff[1] >> dbuff[2]) { 244 | EventHandler::call( 245 | Event("add_bonus"), tmp, Vec3D(dbuff[0], dbuff[1], dbuff[2])); 246 | } 247 | break; 248 | 249 | case ShooterMsgType::AddBonus: 250 | packet >> tmp >> dbuff[0] >> dbuff[1] >> dbuff[2]; 251 | EventHandler::call( 252 | Event("add_bonus"), tmp, Vec3D(dbuff[0], dbuff[1], dbuff[2])); 253 | 254 | break; 255 | case ShooterMsgType::RemoveBonus: 256 | packet >> tmp; 257 | EventHandler::call( 258 | Event("remove_bonus"), ObjectNameTag(tmp)); 259 | break; 260 | case ShooterMsgType::ChangeWeapon: 261 | packet >> buffId[0] >> tmp; 262 | 263 | EventHandler::call( 264 | Event("change_enemy_weapon"), tmp, buffId[0]); 265 | 266 | break; 267 | case ShooterMsgType::newMessage: 268 | 269 | packet >> name >> message; 270 | sendChatMessage(message, name); 271 | break; 272 | default: 273 | Log::log("ShooterClient::processCustomPacket: unknown message type " + 274 | std::to_string(static_cast(type))); 275 | return; 276 | } 277 | } 278 | 279 | void ShooterClient::processDisconnected() { 280 | for (auto it = _players.begin(); it != _players.end();) { 281 | processDisconnect(it++->first); 282 | } 283 | } 284 | 285 | void ShooterClient::damagePlayer(sf::Uint16 targetId, double damage) { 286 | sf::Packet packet; 287 | 288 | packet << MsgType::Custom << ShooterMsgType::Damage << targetId << damage; 289 | _socket.sendRely(packet, _socket.serverId()); 290 | 291 | Log::log("ShooterClient: damagePlayer " + std::to_string(targetId) + " ( -" + std::to_string(damage) + "hp )"); 292 | } 293 | 294 | void ShooterClient::sendTrace(const Vec3D &from, const Vec3D &to) { 295 | sf::Packet packet; 296 | 297 | packet << MsgType::Custom << ShooterMsgType::FireTrace << from.x() << from.y() << from.z() << to.x() << to.y() 298 | << to.z(); 299 | _socket.send(packet, _socket.serverId()); 300 | } 301 | 302 | void ShooterClient::takeBonus(const std::string &bonusName) { 303 | sf::Packet packet; 304 | 305 | packet << MsgType::Custom << ShooterMsgType::RemoveBonus << bonusName; 306 | _socket.sendRely(packet, _socket.serverId()); 307 | 308 | EventHandler::call( 309 | Event("remove_bonus"), ObjectNameTag(bonusName)); 310 | } 311 | 312 | void ShooterClient::changeWeapon(const std::string &weaponName) { 313 | sf::Packet packet; 314 | 315 | packet << MsgType::Custom << ShooterMsgType::ChangeWeapon << weaponName; 316 | _socket.sendRely(packet, _socket.serverId()); 317 | } 318 | 319 | void ShooterClient::addPlayer(sf::Uint16 id, std::shared_ptr player) { 320 | _players.insert({id, player}); 321 | } 322 | 323 | void ShooterClient::requestMap(const std::string& clientIp, std::string *current_map) { 324 | Log::log("---------[FTP server]---------"); 325 | sf::Ftp ftp; 326 | sf::Ftp::Response connectResponse = ftp.connect(clientIp, 21); 327 | if (connectResponse.isOk()) { 328 | ftp.login(); 329 | 330 | sf::Ftp::ListingResponse dirResponse = ftp.getDirectoryListing("current_map/"); 331 | Log::log("Response code: "+std::to_string(dirResponse.getStatus())+" | Message: "+dirResponse.getMessage()); 332 | if (dirResponse.isOk()) { 333 | const std::vector& listing = dirResponse.getListing(); 334 | 335 | 336 | if (listing.size() != 0) { 337 | for (std::vector::const_iterator it = listing.begin(); it != listing.end(); ++it) 338 | Log::log("- "+*it); 339 | 340 | sf::Ftp::Response downloadResponse = ftp.download(listing.at(0), "./obj/maps/", sf::Ftp::Ascii); 341 | Log::log("Response code: "+std::to_string(downloadResponse.getStatus())+" | Message: "+downloadResponse.getMessage()); 342 | 343 | if (downloadResponse.isOk()) { 344 | std::string map_path = listing.at(0); 345 | map_path = "./obj/maps"+map_path.substr(map_path.find("/")); 346 | Log::log("Map set to: "+map_path); 347 | *current_map = map_path; 348 | } 349 | } else { 350 | Log::log("there is no map file"); 351 | } 352 | } 353 | 354 | ftp.disconnect(); 355 | } else { 356 | Log::log("Couldn't connect to FTP server with ip: "+clientIp+" and port: 21"); 357 | } 358 | Log::log("------------------------------"); 359 | } 360 | -------------------------------------------------------------------------------- /network/ShooterClient.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 25.05.2021. 3 | // 4 | 5 | #ifndef SHOOTER_SHOOTERCLIENT_H 6 | #define SHOOTER_SHOOTERCLIENT_H 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include "../player/Player.h" 13 | #include "Chat.h" 14 | 15 | class ShooterClient final : public ClientUDP { 16 | private: 17 | std::string _lastEvent; 18 | 19 | std::map> _players{}; 20 | std::shared_ptr _player; 21 | 22 | std::shared_ptr chatManager; 23 | 24 | void damagePlayer(sf::Uint16 targetId, double damage); 25 | 26 | void takeBonus(const std::string &bonusName); 27 | 28 | void sendTrace(const Vec3D &from, const Vec3D &to); 29 | 30 | void changeWeapon(const std::string &weaponName); 31 | 32 | public: 33 | explicit ShooterClient(std::shared_ptr player); 34 | 35 | void sendMessage(const std::string& message); 36 | 37 | void sendChatMessage(const std::string& message, const std::string& name); 38 | 39 | void updatePacket() override; 40 | 41 | void processInit(sf::Packet &packet) override; 42 | 43 | void processUpdate(sf::Packet &packet) override; 44 | 45 | void processNewClient(sf::Packet &packet) override; 46 | 47 | void processDisconnect(sf::Uint16 targetId) override; 48 | 49 | void processCustomPacket(sf::Packet &packet) override; 50 | 51 | void processDisconnected() override; 52 | 53 | void setChatManager(std::shared_ptr chat) { chatManager = chat; }; 54 | 55 | void addPlayer(sf::Uint16 id, std::shared_ptr player); 56 | 57 | static void requestMap(const std::string& clientIp, std::string *current_map); 58 | 59 | [[nodiscard]] std::map> const &players() const { return _players; } 60 | 61 | [[nodiscard]] std::string lastEvent() const { return _lastEvent; } 62 | }; 63 | 64 | 65 | #endif //MINECRAFT_3DZAVR_CLIENT_H 66 | -------------------------------------------------------------------------------- /network/ShooterMsgType.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 27.10.2021. 3 | // 4 | 5 | #include "ShooterMsgType.h" 6 | 7 | sf::Packet &operator<<(sf::Packet &packet, ShooterMsgType type) { 8 | return packet << (sf::Uint16) type; 9 | } 10 | 11 | sf::Packet &operator>>(sf::Packet &packet, ShooterMsgType &type) { 12 | sf::Uint16 temp; 13 | packet >> temp; 14 | type = (ShooterMsgType) temp; 15 | return packet; 16 | } -------------------------------------------------------------------------------- /network/ShooterMsgType.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 27.10.2021. 3 | // 4 | 5 | #ifndef SHOOTER_SHOOTERMSGTYPE_H 6 | #define SHOOTER_SHOOTERMSGTYPE_H 7 | 8 | #include 9 | 10 | enum class ShooterMsgType { 11 | Damage, 12 | Kill, 13 | FireTrace, 14 | InitBonuses, 15 | AddBonus, 16 | RemoveBonus, 17 | ChangeWeapon, 18 | newMessage 19 | }; 20 | 21 | sf::Packet &operator<<(sf::Packet &packet, ShooterMsgType type); 22 | 23 | sf::Packet &operator>>(sf::Packet &packet, ShooterMsgType &type); 24 | 25 | #endif //SHOOTER_SHOOTERMSGTYPE_H 26 | -------------------------------------------------------------------------------- /network/ShooterServer.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 25.05.2021. 3 | // 4 | 5 | #include 6 | 7 | #include "ShooterServer.h" 8 | #include "ShooterMsgType.h" 9 | 10 | void ShooterServer::broadcast() { 11 | sf::Packet updatePacket; 12 | updatePacket << MsgType::ServerUpdate; 13 | 14 | for (auto&[playerId, player] : _players) { 15 | updatePacket << playerId << player->position().x() << player->position().y() << player->position().z() 16 | << player->health() << player->angle().y() << player->headAngle() << player->playerNickName(); 17 | } 18 | 19 | for (auto &player : _players) { 20 | _socket.send(updatePacket, player.first); 21 | } 22 | } 23 | 24 | 25 | void ShooterServer::processConnect(sf::Uint16 targetId) { 26 | sf::Packet sendPacket1, sendPacket2; 27 | sf::Packet extraPacket; 28 | 29 | // players init 30 | extraPacket << MsgType::NewClient << targetId; 31 | sendPacket1 << MsgType::Init << targetId; 32 | _players.insert({targetId, std::make_shared(ObjectNameTag("Player_" + std::to_string(targetId)))}); 33 | for (const auto&[playerId, player] : _players) { 34 | sendPacket1 << playerId << player->position().x() << player->position().y() << player->position().z() 35 | << player->health() << player->kills() << player->deaths(); 36 | if (playerId != targetId) 37 | _socket.sendRely(extraPacket, playerId); 38 | } 39 | _socket.sendRely(sendPacket1, targetId); 40 | 41 | // bonuses init 42 | sendPacket2 << MsgType::Custom << ShooterMsgType::InitBonuses; 43 | for (auto&[bonusName, bonusInfo] : _bonuses) { 44 | if (bonusInfo->onTheMap) { 45 | sendPacket2 << bonusName << bonusInfo->position.x() << bonusInfo->position.y() << bonusInfo->position.z(); 46 | } 47 | } 48 | _socket.sendRely(sendPacket2, targetId); 49 | 50 | } 51 | 52 | void ShooterServer::processClientUpdate(sf::Uint16 senderId, sf::Packet &packet) { 53 | double x, y, z, angleBody, headAngle; 54 | 55 | std::string playerName; 56 | 57 | packet >> x >> y >> z >> angleBody >> headAngle >> playerName; 58 | 59 | _players.at(senderId)->translateToPoint(Vec3D{x, y, z}); 60 | _players.at(senderId)->rotateToAngle(Vec3D{0, angleBody, 0}); 61 | _players.at(senderId)->setHeadAngle(headAngle); 62 | _players.at(senderId)->setPlayerNickName(playerName); 63 | } 64 | 65 | void ShooterServer::processDisconnect(sf::Uint16 senderId) { 66 | sf::Packet sendPacket; 67 | 68 | sendPacket << MsgType::Disconnect << senderId; 69 | _players.erase(senderId); 70 | for (const auto &player : _players) { 71 | _socket.sendRely(sendPacket, player.first); 72 | } 73 | } 74 | 75 | 76 | void ShooterServer::processCustomPacket(sf::Packet &packet, sf::Uint16 senderId) { 77 | sf::Packet sendPacket; 78 | double dbuff[10]; 79 | sf::Uint16 targetId; 80 | double damage; 81 | std::string tmp; 82 | double newHealth; 83 | std::string message; 84 | 85 | ShooterMsgType type; 86 | packet >> type; 87 | 88 | switch (type) { 89 | case ShooterMsgType::Damage: 90 | packet >> targetId >> damage; 91 | newHealth = _players[targetId]->health() - damage; 92 | if (newHealth > 0) { 93 | _players[targetId]->setHealth(newHealth); 94 | } else { 95 | _players[targetId]->setFullHealth(); 96 | _players[targetId]->setFullAbility(); 97 | _players[targetId]->addDeath(); 98 | _players[senderId]->addKill(); 99 | 100 | sendPacket << MsgType::Custom << ShooterMsgType::Kill << targetId << senderId; 101 | for (auto &player : _players) 102 | _socket.sendRely(sendPacket, player.first); 103 | } 104 | break; 105 | case ShooterMsgType::FireTrace: 106 | packet >> dbuff[0] >> dbuff[1] >> dbuff[2] >> dbuff[3] >> dbuff[4] >> dbuff[5]; 107 | sendPacket << MsgType::Custom << ShooterMsgType::FireTrace << dbuff[0] << dbuff[1] << dbuff[2] << dbuff[3] 108 | << dbuff[4] << dbuff[5]; 109 | for (auto &player : _players) { 110 | if (player.first != senderId) { 111 | _socket.send(sendPacket, player.first); 112 | } 113 | } 114 | 115 | break; 116 | case ShooterMsgType::RemoveBonus: 117 | packet >> tmp; 118 | 119 | if (tmp.find("Bonus_hill") != std::string::npos) { 120 | _players[senderId]->setFullHealth(); 121 | } 122 | if (tmp.find("Bonus_ability") != std::string::npos) { 123 | _players[senderId]->setFullAbility(); 124 | } 125 | 126 | _bonuses[tmp] = std::make_shared(BonusInfo{_bonuses[tmp]->position, Time::time(), false}); 127 | 128 | sendPacket << MsgType::Custom << ShooterMsgType::RemoveBonus << tmp; 129 | for (auto &player : _players) { 130 | if (player.first != senderId) { 131 | _socket.sendRely(sendPacket, player.first); 132 | } 133 | } 134 | break; 135 | case ShooterMsgType::ChangeWeapon: 136 | packet >> tmp; 137 | sendPacket << MsgType::Custom << ShooterMsgType::ChangeWeapon << senderId << tmp; 138 | 139 | for (auto &player : _players) { 140 | if (player.first != senderId) { 141 | _socket.sendRely(sendPacket, player.first); 142 | } 143 | } 144 | 145 | break; 146 | case ShooterMsgType::newMessage: 147 | 148 | packet >> message; 149 | sendPacket << MsgType::Custom << ShooterMsgType::newMessage << _players[senderId]->playerNickName() << message; 150 | if (message.length() == 0) 151 | break; 152 | for (auto& player : _players) { 153 | if (player.first != senderId) { 154 | _socket.send(sendPacket, player.first); 155 | } 156 | } 157 | break; 158 | default: 159 | Log::log("ShooterServer::processCustomPacket: unknown message type " + 160 | std::to_string(static_cast(type))); 161 | return; 162 | } 163 | } 164 | 165 | void ShooterServer::processStop() { 166 | _players.clear(); 167 | _bonuses.clear(); 168 | } 169 | 170 | void ShooterServer::generateBonuses() { 171 | _bonuses.insert({"Bonus_gun_1", std::make_shared( 172 | BonusInfo{Vec3D(-10, -2, -15), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 173 | _bonuses.insert({"Bonus_gun_2", std::make_shared( 174 | BonusInfo{Vec3D(10, -2, 15), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 175 | 176 | _bonuses.insert({"Bonus_shotgun_1", std::make_shared( 177 | BonusInfo{Vec3D(-10, 13, -24), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 178 | _bonuses.insert({"Bonus_shotgun_2", std::make_shared( 179 | BonusInfo{Vec3D(10, 13, 24), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 180 | 181 | _bonuses.insert({"Bonus_ak47_1", std::make_shared( 182 | BonusInfo{Vec3D(-25, 30, 50), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 183 | _bonuses.insert({"Bonus_ak47_2", std::make_shared( 184 | BonusInfo{Vec3D(25, 30, -50), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 185 | 186 | _bonuses.insert({"Bonus_gold_ak47_1", std::make_shared( 187 | BonusInfo{Vec3D(-35, 80, 25), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 188 | _bonuses.insert({"Bonus_gold_ak47_2", std::make_shared( 189 | BonusInfo{Vec3D(35, 80, -25), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 190 | 191 | _bonuses.insert({"Bonus_rifle_1", std::make_shared( 192 | BonusInfo{Vec3D(40, -2, 45), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 193 | _bonuses.insert({"Bonus_rifle_2", std::make_shared( 194 | BonusInfo{Vec3D(-40, -2, -45), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 195 | 196 | _bonuses.insert({"Bonus_hill_1", std::make_shared( 197 | BonusInfo{Vec3D(-40, -2, 45), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 198 | _bonuses.insert({"Bonus_hill_2", std::make_shared( 199 | BonusInfo{Vec3D(40, -2, -45), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 200 | 201 | _bonuses.insert({"Bonus_ability_1", std::make_shared( 202 | BonusInfo{Vec3D(25, 18, -33), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 203 | _bonuses.insert({"Bonus_ability_2", std::make_shared( 204 | BonusInfo{Vec3D(-25, 18, 33), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})}); 205 | } 206 | 207 | void ShooterServer::updateInfo() { 208 | for (auto&[bonusName, bonusInfo] : _bonuses) { 209 | if (!bonusInfo->onTheMap && std::abs(Time::time() - bonusInfo->lastTake) > ShooterConsts::BONUS_RECHARGE_TIME) { 210 | sf::Packet sendPacket; 211 | sendPacket << MsgType::Custom << ShooterMsgType::AddBonus << bonusName << bonusInfo->position.x() 212 | << bonusInfo->position.y() << bonusInfo->position.z(); 213 | for (const auto &player : _players) { 214 | _socket.sendRely(sendPacket, player.first); 215 | } 216 | bonusInfo = std::make_shared(BonusInfo{bonusInfo->position, bonusInfo->lastTake, true}); 217 | } 218 | } 219 | } 220 | 221 | ShooterServer::~ShooterServer() { 222 | processStop(); 223 | } 224 | -------------------------------------------------------------------------------- /network/ShooterServer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 25.05.2021. 3 | // 4 | 5 | #ifndef SHOOTER_SHOOTERSERVER_H 6 | #define SHOOTER_SHOOTERSERVER_H 7 | 8 | #include 9 | 10 | #include "../player/Player.h" 11 | 12 | struct BonusInfo final { 13 | const Vec3D position{}; 14 | const double lastTake = std::numeric_limits::min(); 15 | const bool onTheMap = false; 16 | }; 17 | 18 | class ShooterServer final : public ServerUDP { 19 | private: 20 | std::map> _players{}; 21 | std::map> _bonuses{}; 22 | public: 23 | ShooterServer() = default; 24 | 25 | void broadcast() override; 26 | 27 | void processConnect(sf::Uint16 senderId) override; 28 | 29 | void processClientUpdate(sf::Uint16 senderId, sf::Packet &packet) override; 30 | 31 | void processDisconnect(sf::Uint16 senderId) override; 32 | 33 | void processCustomPacket(sf::Packet &packet, sf::Uint16 senderId) override; 34 | 35 | void processStop() override; 36 | 37 | void generateBonuses(); 38 | 39 | void updateInfo() override; 40 | 41 | ~ShooterServer() override; 42 | }; 43 | 44 | 45 | #endif //MINECRAFT_3DZAVR_SERVER_H 46 | -------------------------------------------------------------------------------- /obj/items/ability.obj: -------------------------------------------------------------------------------- 1 | m 000 51 19 198 150 2 | o Cube 3 | v 0.005449 0.446474 -0.361719 4 | v 0.005449 0.446546 -0.372617 5 | v 0.004566 -0.366134 0.374185 6 | v 0.004566 -0.366294 0.365054 7 | v -0.005449 0.446474 -0.361719 8 | v -0.005449 0.446546 -0.372617 9 | v -0.004566 -0.366134 0.374185 10 | v -0.004566 -0.366294 0.365054 11 | v -0.112195 -0.019100 0.085016 12 | v 0.112195 0.200628 0.130515 13 | v -0.112195 0.200628 0.130515 14 | v 0.112195 -0.019100 0.085016 15 | v -0.112195 0.031076 -0.073104 16 | v 0.112195 -0.186195 -0.129173 17 | v -0.112195 -0.186195 -0.129173 18 | v 0.112195 0.031076 -0.073104 19 | g Cube_Cube_Material.000 20 | usemtl Material.000 21 | s off 22 | f 11 3 10 23 | f 3 8 4 24 | f 13 6 15 25 | f 12 8 9 26 | f 12 3 4 27 | f 5 2 6 28 | f 16 12 14 29 | f 14 9 15 30 | f 7 9 8 31 | f 13 10 16 32 | f 5 16 1 33 | f 2 15 6 34 | f 2 16 14 35 | f 9 13 15 36 | f 11 7 3 37 | f 3 7 8 38 | f 13 5 6 39 | f 12 4 8 40 | f 12 10 3 41 | f 5 1 2 42 | f 16 10 12 43 | f 14 12 9 44 | f 7 11 9 45 | f 13 11 10 46 | f 5 13 16 47 | f 2 14 15 48 | f 2 1 16 49 | f 9 11 13 50 | -------------------------------------------------------------------------------- /obj/items/ak47.obj: -------------------------------------------------------------------------------- 1 | m 001 59 39 34 255 2 | m 002 104 105 110 255 3 | m 003 64 64 64 255 4 | o Cube 5 | v -0.024207 -0.071709 -0.159259 6 | v -0.024207 0.104802 -0.159259 7 | v -0.024407 -0.048306 0.246812 8 | v -0.024407 0.077955 0.246812 9 | v 0.045930 -0.071709 -0.159259 10 | v 0.045930 0.104802 -0.159259 11 | v 0.045442 -0.048306 0.246813 12 | v 0.045442 0.077955 0.246813 13 | g Cube_Cube_Material.002 14 | usemtl Material.002 15 | s off 16 | f 1 7 3 17 | f 3 8 4 18 | f 8 5 6 19 | f 2 8 6 20 | f 1 4 2 21 | f 5 2 6 22 | f 1 5 7 23 | f 3 7 8 24 | f 8 7 5 25 | f 2 4 8 26 | f 1 3 4 27 | f 5 1 2 28 | o Cube.001 29 | v -0.005117 -0.016270 0.516193 30 | v -0.005117 0.013209 0.516193 31 | v -0.005118 -0.016270 0.604628 32 | v -0.005118 0.013209 0.604628 33 | v 0.026826 -0.016270 0.516193 34 | v 0.026826 0.013209 0.516193 35 | v 0.026825 -0.016270 0.604629 36 | v 0.026825 0.013209 0.604629 37 | g Cube.001_Cube.001_Material.002 38 | usemtl Material.002 39 | s off 40 | f 13 11 9 41 | f 11 16 12 42 | f 15 14 16 43 | f 10 16 14 44 | f 9 12 10 45 | f 13 10 14 46 | f 13 15 11 47 | f 11 15 16 48 | f 15 13 14 49 | f 10 12 16 50 | f 9 11 12 51 | f 13 9 10 52 | o Cube.002 53 | v -0.018558 -0.017699 0.245653 54 | v -0.018558 0.044784 0.245653 55 | v -0.018561 -0.017699 0.522281 56 | v -0.018561 0.044784 0.522281 57 | v 0.040273 -0.017699 0.245653 58 | v 0.040273 0.044784 0.245653 59 | v 0.040270 -0.017699 0.522282 60 | v 0.040270 0.044784 0.522282 61 | g Cube.002_Cube.002_Material.003 62 | usemtl Material.003 63 | s off 64 | f 21 19 17 65 | f 19 24 20 66 | f 23 22 24 67 | f 18 24 22 68 | f 17 20 18 69 | f 21 18 22 70 | f 21 23 19 71 | f 19 23 24 72 | f 23 21 22 73 | f 18 20 24 74 | f 17 19 20 75 | f 21 17 18 76 | o Cube.003 77 | v 0.044780 -0.350110 0.140219 78 | v 0.044781 -0.060851 0.099493 79 | v 0.044779 -0.332746 0.278174 80 | v 0.044779 -0.055020 0.237449 81 | v -0.023064 -0.350110 0.140218 82 | v -0.023063 -0.060851 0.099492 83 | v -0.023065 -0.332746 0.278174 84 | v -0.023065 -0.055020 0.237448 85 | g Cube.003_Cube.003_Material.003 86 | usemtl Material.003 87 | s off 88 | f 29 25 27 89 | f 27 28 32 90 | f 32 30 29 91 | f 26 30 32 92 | f 25 26 28 93 | f 29 30 26 94 | f 29 27 31 95 | f 27 32 31 96 | f 32 29 31 97 | f 26 32 28 98 | f 25 28 27 99 | f 29 26 25 100 | o Cube.004 101 | v -0.007564 -0.227337 -0.031552 102 | v -0.007565 -0.064152 0.005996 103 | v -0.007564 -0.208299 -0.120240 104 | v -0.007564 -0.068160 -0.067640 105 | v 0.029284 -0.227337 -0.031552 106 | v 0.029284 -0.064152 0.005997 107 | v 0.029285 -0.208299 -0.120239 108 | v 0.029285 -0.068160 -0.067639 109 | g Cube.004_Cube.004_Material.003 110 | usemtl Material.003 111 | s off 112 | f 37 33 35 113 | f 35 36 40 114 | f 40 38 37 115 | f 34 38 40 116 | f 33 34 36 117 | f 37 38 34 118 | f 37 35 39 119 | f 35 40 39 120 | f 40 37 39 121 | f 34 40 36 122 | f 33 36 35 123 | f 37 34 33 124 | o Cube.005 125 | v -0.020753 -0.107119 -0.531392 126 | v -0.020753 0.141412 -0.544338 127 | v -0.003664 -0.021946 -0.158935 128 | v -0.003664 0.082729 -0.158876 129 | v 0.042483 -0.107119 -0.531391 130 | v 0.042483 0.141412 -0.544337 131 | v 0.025386 -0.021946 -0.158934 132 | v 0.025386 0.082729 -0.158876 133 | g Cube.005_Cube.005_Material.001 134 | usemtl Material.001 135 | s off 136 | f 41 47 43 137 | f 43 48 44 138 | f 48 45 46 139 | f 42 48 46 140 | f 41 44 42 141 | f 45 42 46 142 | f 41 45 47 143 | f 43 47 48 144 | f 48 47 45 145 | f 42 44 48 146 | f 41 43 44 147 | f 45 41 42 148 | o Cube.006 149 | v 0.000571 -0.118602 0.107896 150 | v -0.002720 -0.121230 -0.009059 151 | v 0.000603 -0.135248 0.110277 152 | v -0.002688 -0.137877 -0.012546 153 | v 0.024406 -0.118562 0.107455 154 | v 0.021115 -0.121190 -0.009501 155 | v 0.024439 -0.135209 0.109835 156 | v 0.021147 -0.137837 -0.012988 157 | g Cube.006_Cube.006_Material.002 158 | usemtl Material.002 159 | s off 160 | f 49 51 55 161 | f 51 52 56 162 | f 55 56 54 163 | f 54 56 52 164 | f 50 52 51 165 | f 54 50 49 166 | f 49 55 53 167 | f 51 56 55 168 | f 55 54 53 169 | f 54 52 50 170 | f 50 51 49 171 | f 54 49 53 172 | o Cube.007 173 | v -0.007304 0.044419 0.246262 174 | v -0.007304 0.077544 0.246262 175 | v -0.007306 0.044419 0.398763 176 | v -0.007306 0.077544 0.398763 177 | v 0.029018 0.044419 0.246262 178 | v 0.029018 0.077544 0.246262 179 | v 0.029017 0.044419 0.398763 180 | v 0.029017 0.077544 0.398763 181 | g Cube.007_Cube.007_Material.001 182 | usemtl Material.001 183 | s off 184 | f 61 59 57 185 | f 59 64 60 186 | f 63 62 64 187 | f 58 64 62 188 | f 57 60 58 189 | f 61 58 62 190 | f 61 63 59 191 | f 59 63 64 192 | f 63 61 62 193 | f 58 60 64 194 | f 57 59 60 195 | f 61 57 58 196 | o Cube.008 197 | v -0.007094 0.103856 -0.148231 198 | v -0.007095 0.099831 -0.064245 199 | v 0.004551 0.120408 -0.147438 200 | v 0.004550 0.116383 -0.063451 201 | v 0.028816 0.103856 -0.148230 202 | v 0.028815 0.099831 -0.064244 203 | v 0.016708 0.120408 -0.147437 204 | v 0.016707 0.116383 -0.063451 205 | v 0.004876 0.109148 -0.147438 206 | v 0.016846 0.109148 -0.147437 207 | v 0.016845 0.105123 -0.063451 208 | v 0.004875 0.105123 -0.063451 209 | g Cube.008_Cube.008_Material.003 210 | usemtl Material.003 211 | s off 212 | f 65 73 69 213 | f 74 75 72 214 | f 71 72 70 215 | f 70 75 66 216 | f 65 66 68 217 | f 69 70 66 218 | f 68 76 73 219 | f 73 76 75 220 | f 69 74 71 221 | f 73 65 67 222 | f 69 73 74 223 | f 74 72 71 224 | f 71 70 69 225 | f 66 76 68 226 | f 75 70 72 227 | f 66 75 76 228 | f 65 68 67 229 | f 69 66 65 230 | f 68 73 67 231 | f 73 75 74 232 | o Cube.009 233 | v 0.008374 0.012463 0.566580 234 | v 0.008374 0.012329 0.580457 235 | v 0.008374 0.083038 0.570030 236 | v 0.008374 0.082435 0.583906 237 | v 0.013334 0.012463 0.566580 238 | v 0.013334 0.012329 0.580457 239 | v 0.013334 0.083038 0.570030 240 | v 0.013334 0.082435 0.583906 241 | g Cube.009_Cube.009_Material.003 242 | usemtl Material.003 243 | s off 244 | f 81 77 79 245 | f 79 80 84 246 | f 83 84 82 247 | f 78 82 84 248 | f 78 80 79 249 | f 81 82 78 250 | f 81 79 83 251 | f 79 84 83 252 | f 83 82 81 253 | f 78 84 80 254 | f 78 79 77 255 | f 81 78 77 256 | o Cube.010 257 | v -0.017007 0.054364 0.092651 258 | v -0.017007 0.021382 0.092235 259 | v -0.017009 0.052611 0.231668 260 | v -0.017009 0.019628 0.231252 261 | v -0.031851 0.054364 0.092651 262 | v -0.031851 0.021382 0.092235 263 | v -0.031853 0.052611 0.231668 264 | v -0.031853 0.019628 0.231252 265 | g Cube.010_Cube.010_Material.003 266 | usemtl Material.003 267 | s off 268 | f 89 87 85 269 | f 87 92 88 270 | f 91 90 92 271 | f 86 92 90 272 | f 85 88 86 273 | f 89 86 90 274 | f 89 91 87 275 | f 87 91 92 276 | f 91 89 90 277 | f 86 88 92 278 | f 85 87 88 279 | f 89 85 86 280 | o Cube.011 281 | v -0.018695 0.017758 -0.097471 282 | v -0.018695 -0.013556 -0.105649 283 | v -0.022360 -0.037346 0.072602 284 | v -0.022360 -0.048649 0.069650 285 | v -0.030160 0.017758 -0.097471 286 | v -0.030160 -0.013556 -0.105649 287 | v -0.026498 -0.037346 0.072601 288 | v -0.026498 -0.048649 0.069650 289 | g Cube.011_Cube.011_Material.003 290 | usemtl Material.003 291 | s off 292 | f 97 95 93 293 | f 95 100 96 294 | f 99 98 100 295 | f 98 96 100 296 | f 94 95 96 297 | f 97 94 98 298 | f 97 99 95 299 | f 95 99 100 300 | f 99 97 98 301 | f 98 94 96 302 | f 94 93 95 303 | f 97 93 94 304 | o Cube.012 305 | v 0.009382 0.000237 0.595298 306 | v 0.009382 -0.002708 0.595298 307 | v 0.009382 0.000237 0.592354 308 | v 0.009382 -0.002708 0.592354 309 | v 0.012326 0.000237 0.595298 310 | v 0.012326 -0.002708 0.595298 311 | v 0.012326 0.000237 0.592354 312 | v 0.012326 -0.002708 0.592354 313 | g Cube.012_Cube.012_None 314 | usemtl None 315 | s off 316 | f 102 101 103 317 | f 104 103 107 318 | f 108 107 105 319 | f 106 105 101 320 | f 107 103 101 321 | f 104 108 106 322 | f 102 103 104 323 | f 104 107 108 324 | f 108 105 106 325 | f 106 101 102 326 | f 107 101 105 327 | f 104 106 102 328 | -------------------------------------------------------------------------------- /obj/items/gold_ak47.obj: -------------------------------------------------------------------------------- 1 | m 001 59 39 34 255 2 | m 002 152 111 22 255 3 | m 003 191 154 46 255 4 | o Cube 5 | v -0.024207 -0.071709 -0.159259 6 | v -0.024207 0.104802 -0.159259 7 | v -0.024407 -0.048306 0.246812 8 | v -0.024407 0.077955 0.246812 9 | v 0.045930 -0.071709 -0.159259 10 | v 0.045930 0.104802 -0.159259 11 | v 0.045442 -0.048306 0.246813 12 | v 0.045442 0.077955 0.246813 13 | g Cube_Cube_Material.002 14 | usemtl Material.002 15 | s off 16 | f 1 7 3 17 | f 3 8 4 18 | f 8 5 6 19 | f 2 8 6 20 | f 1 4 2 21 | f 5 2 6 22 | f 1 5 7 23 | f 3 7 8 24 | f 8 7 5 25 | f 2 4 8 26 | f 1 3 4 27 | f 5 1 2 28 | o Cube.001 29 | v -0.005117 -0.016270 0.516193 30 | v -0.005117 0.013209 0.516193 31 | v -0.005118 -0.016270 0.604628 32 | v -0.005118 0.013209 0.604628 33 | v 0.026826 -0.016270 0.516193 34 | v 0.026826 0.013209 0.516193 35 | v 0.026825 -0.016270 0.604629 36 | v 0.026825 0.013209 0.604629 37 | g Cube.001_Cube.001_Material.002 38 | usemtl Material.002 39 | s off 40 | f 13 11 9 41 | f 11 16 12 42 | f 15 14 16 43 | f 10 16 14 44 | f 9 12 10 45 | f 13 10 14 46 | f 13 15 11 47 | f 11 15 16 48 | f 15 13 14 49 | f 10 12 16 50 | f 9 11 12 51 | f 13 9 10 52 | o Cube.002 53 | v -0.018558 -0.017699 0.245653 54 | v -0.018558 0.044784 0.245653 55 | v -0.018561 -0.017699 0.522281 56 | v -0.018561 0.044784 0.522281 57 | v 0.040273 -0.017699 0.245653 58 | v 0.040273 0.044784 0.245653 59 | v 0.040270 -0.017699 0.522282 60 | v 0.040270 0.044784 0.522282 61 | g Cube.002_Cube.002_Material.003 62 | usemtl Material.003 63 | s off 64 | f 21 19 17 65 | f 19 24 20 66 | f 23 22 24 67 | f 18 24 22 68 | f 17 20 18 69 | f 21 18 22 70 | f 21 23 19 71 | f 19 23 24 72 | f 23 21 22 73 | f 18 20 24 74 | f 17 19 20 75 | f 21 17 18 76 | o Cube.003 77 | v 0.044780 -0.350110 0.140219 78 | v 0.044781 -0.060851 0.099493 79 | v 0.044779 -0.332746 0.278174 80 | v 0.044779 -0.055020 0.237449 81 | v -0.023064 -0.350110 0.140218 82 | v -0.023063 -0.060851 0.099492 83 | v -0.023065 -0.332746 0.278174 84 | v -0.023065 -0.055020 0.237448 85 | g Cube.003_Cube.003_Material.003 86 | usemtl Material.003 87 | s off 88 | f 29 25 27 89 | f 27 28 32 90 | f 32 30 29 91 | f 26 30 32 92 | f 25 26 28 93 | f 29 30 26 94 | f 29 27 31 95 | f 27 32 31 96 | f 32 29 31 97 | f 26 32 28 98 | f 25 28 27 99 | f 29 26 25 100 | o Cube.004 101 | v -0.007564 -0.227337 -0.031552 102 | v -0.007565 -0.064152 0.005996 103 | v -0.007564 -0.208299 -0.120240 104 | v -0.007564 -0.068160 -0.067640 105 | v 0.029284 -0.227337 -0.031552 106 | v 0.029284 -0.064152 0.005997 107 | v 0.029285 -0.208299 -0.120239 108 | v 0.029285 -0.068160 -0.067639 109 | g Cube.004_Cube.004_Material.003 110 | usemtl Material.003 111 | s off 112 | f 37 33 35 113 | f 35 36 40 114 | f 40 38 37 115 | f 34 38 40 116 | f 33 34 36 117 | f 37 38 34 118 | f 37 35 39 119 | f 35 40 39 120 | f 40 37 39 121 | f 34 40 36 122 | f 33 36 35 123 | f 37 34 33 124 | o Cube.005 125 | v -0.020753 -0.107119 -0.531392 126 | v -0.020753 0.141412 -0.544338 127 | v -0.003664 -0.021946 -0.158935 128 | v -0.003664 0.082729 -0.158876 129 | v 0.042483 -0.107119 -0.531391 130 | v 0.042483 0.141412 -0.544337 131 | v 0.025386 -0.021946 -0.158934 132 | v 0.025386 0.082729 -0.158876 133 | g Cube.005_Cube.005_Material.001 134 | usemtl Material.001 135 | s off 136 | f 41 47 43 137 | f 43 48 44 138 | f 48 45 46 139 | f 42 48 46 140 | f 41 44 42 141 | f 45 42 46 142 | f 41 45 47 143 | f 43 47 48 144 | f 48 47 45 145 | f 42 44 48 146 | f 41 43 44 147 | f 45 41 42 148 | o Cube.006 149 | v 0.000571 -0.118602 0.107896 150 | v -0.002720 -0.121230 -0.009059 151 | v 0.000603 -0.135248 0.110277 152 | v -0.002688 -0.137877 -0.012546 153 | v 0.024406 -0.118562 0.107455 154 | v 0.021115 -0.121190 -0.009501 155 | v 0.024439 -0.135209 0.109835 156 | v 0.021147 -0.137837 -0.012988 157 | g Cube.006_Cube.006_Material.002 158 | usemtl Material.002 159 | s off 160 | f 49 51 55 161 | f 51 52 56 162 | f 55 56 54 163 | f 54 56 52 164 | f 50 52 51 165 | f 54 50 49 166 | f 49 55 53 167 | f 51 56 55 168 | f 55 54 53 169 | f 54 52 50 170 | f 50 51 49 171 | f 54 49 53 172 | o Cube.007 173 | v -0.007304 0.044419 0.246262 174 | v -0.007304 0.077544 0.246262 175 | v -0.007306 0.044419 0.398763 176 | v -0.007306 0.077544 0.398763 177 | v 0.029018 0.044419 0.246262 178 | v 0.029018 0.077544 0.246262 179 | v 0.029017 0.044419 0.398763 180 | v 0.029017 0.077544 0.398763 181 | g Cube.007_Cube.007_Material.001 182 | usemtl Material.001 183 | s off 184 | f 61 59 57 185 | f 59 64 60 186 | f 63 62 64 187 | f 58 64 62 188 | f 57 60 58 189 | f 61 58 62 190 | f 61 63 59 191 | f 59 63 64 192 | f 63 61 62 193 | f 58 60 64 194 | f 57 59 60 195 | f 61 57 58 196 | o Cube.008 197 | v -0.007094 0.103856 -0.148231 198 | v -0.007095 0.099831 -0.064245 199 | v 0.004551 0.120408 -0.147438 200 | v 0.004550 0.116383 -0.063451 201 | v 0.028816 0.103856 -0.148230 202 | v 0.028815 0.099831 -0.064244 203 | v 0.016708 0.120408 -0.147437 204 | v 0.016707 0.116383 -0.063451 205 | v 0.004876 0.109148 -0.147438 206 | v 0.016846 0.109148 -0.147437 207 | v 0.016845 0.105123 -0.063451 208 | v 0.004875 0.105123 -0.063451 209 | g Cube.008_Cube.008_Material.003 210 | usemtl Material.003 211 | s off 212 | f 65 73 69 213 | f 74 75 72 214 | f 71 72 70 215 | f 70 75 66 216 | f 65 66 68 217 | f 69 70 66 218 | f 68 76 73 219 | f 73 76 75 220 | f 69 74 71 221 | f 73 65 67 222 | f 69 73 74 223 | f 74 72 71 224 | f 71 70 69 225 | f 66 76 68 226 | f 75 70 72 227 | f 66 75 76 228 | f 65 68 67 229 | f 69 66 65 230 | f 68 73 67 231 | f 73 75 74 232 | o Cube.009 233 | v 0.008374 0.012463 0.566580 234 | v 0.008374 0.012329 0.580457 235 | v 0.008374 0.083038 0.570030 236 | v 0.008374 0.082435 0.583906 237 | v 0.013334 0.012463 0.566580 238 | v 0.013334 0.012329 0.580457 239 | v 0.013334 0.083038 0.570030 240 | v 0.013334 0.082435 0.583906 241 | g Cube.009_Cube.009_Material.003 242 | usemtl Material.003 243 | s off 244 | f 81 77 79 245 | f 79 80 84 246 | f 83 84 82 247 | f 78 82 84 248 | f 78 80 79 249 | f 81 82 78 250 | f 81 79 83 251 | f 79 84 83 252 | f 83 82 81 253 | f 78 84 80 254 | f 78 79 77 255 | f 81 78 77 256 | o Cube.010 257 | v -0.017007 0.054364 0.092651 258 | v -0.017007 0.021382 0.092235 259 | v -0.017009 0.052611 0.231668 260 | v -0.017009 0.019628 0.231252 261 | v -0.031851 0.054364 0.092651 262 | v -0.031851 0.021382 0.092235 263 | v -0.031853 0.052611 0.231668 264 | v -0.031853 0.019628 0.231252 265 | g Cube.010_Cube.010_Material.003 266 | usemtl Material.003 267 | s off 268 | f 89 87 85 269 | f 87 92 88 270 | f 91 90 92 271 | f 86 92 90 272 | f 85 88 86 273 | f 89 86 90 274 | f 89 91 87 275 | f 87 91 92 276 | f 91 89 90 277 | f 86 88 92 278 | f 85 87 88 279 | f 89 85 86 280 | o Cube.011 281 | v -0.018695 0.017758 -0.097471 282 | v -0.018695 -0.013556 -0.105649 283 | v -0.022360 -0.037346 0.072602 284 | v -0.022360 -0.048649 0.069650 285 | v -0.030160 0.017758 -0.097471 286 | v -0.030160 -0.013556 -0.105649 287 | v -0.026498 -0.037346 0.072601 288 | v -0.026498 -0.048649 0.069650 289 | g Cube.011_Cube.011_Material.003 290 | usemtl Material.003 291 | s off 292 | f 97 95 93 293 | f 95 100 96 294 | f 99 98 100 295 | f 98 96 100 296 | f 94 95 96 297 | f 97 94 98 298 | f 97 99 95 299 | f 95 99 100 300 | f 99 97 98 301 | f 98 94 96 302 | f 94 93 95 303 | f 97 93 94 304 | o Cube.012 305 | v 0.009382 0.000237 0.595298 306 | v 0.009382 -0.002708 0.595298 307 | v 0.009382 0.000237 0.592354 308 | v 0.009382 -0.002708 0.592354 309 | v 0.012326 0.000237 0.595298 310 | v 0.012326 -0.002708 0.595298 311 | v 0.012326 0.000237 0.592354 312 | v 0.012326 -0.002708 0.592354 313 | g Cube.012_Cube.012_None 314 | usemtl None 315 | s off 316 | f 102 101 103 317 | f 104 103 107 318 | f 108 107 105 319 | f 106 105 101 320 | f 107 103 101 321 | f 104 108 106 322 | f 102 103 104 323 | f 104 107 108 324 | f 108 105 106 325 | f 106 101 102 326 | f 107 101 105 327 | f 104 106 102 328 | -------------------------------------------------------------------------------- /obj/items/gun.obj: -------------------------------------------------------------------------------- 1 | m 000 115 115 115 255 2 | m 001 186 185 185 255 3 | m 002 59 59 59 255 4 | o Cube 5 | v -0.024252 0.023934 -0.086526 6 | v -0.023618 -0.047762 -0.071141 7 | v -0.026816 -0.141525 -0.217037 8 | v -0.026812 -0.146248 -0.125833 9 | v 0.020828 0.025550 -0.086710 10 | v 0.021300 -0.048903 -0.071143 11 | v 0.025944 -0.141525 -0.217040 12 | v 0.025949 -0.146248 -0.125835 13 | v -0.030155 -0.011802 -0.077804 14 | v 0.025946 -0.145332 -0.172253 15 | v -0.026814 -0.145332 -0.167923 16 | v 0.027652 -0.012270 -0.077145 17 | v -0.000429 -0.063540 -0.068120 18 | v -0.000436 -0.141525 -0.217039 19 | v -0.000432 -0.146248 -0.125834 20 | v -0.000430 0.039735 -0.092054 21 | v -0.000429 -0.009761 -0.080915 22 | v -0.000434 -0.145332 -0.167925 23 | v 0.019666 -0.075621 -0.106346 24 | v -0.021522 -0.010121 -0.159039 25 | v 0.019466 -0.009502 -0.159326 26 | v -0.021254 -0.075167 -0.106494 27 | v -0.023994 -0.043008 -0.136460 28 | v 0.022326 -0.043107 -0.136138 29 | v -0.000488 -0.081045 -0.103217 30 | v -0.000491 -0.004563 -0.163317 31 | v 0.022759 -0.107398 -0.119066 32 | v -0.024129 -0.074246 -0.206445 33 | v -0.025383 -0.088212 -0.160993 34 | v -0.000460 -0.110152 -0.117477 35 | v -0.000465 -0.071424 -0.208618 36 | v 0.022654 -0.073932 -0.206592 37 | v -0.023990 -0.107168 -0.119140 38 | v 0.024108 -0.088262 -0.160830 39 | g Cube_Cube_Material.000 40 | usemtl Material.000 41 | s off 42 | f 32 14 31 43 | f 14 10 18 44 | f 21 12 24 45 | f 33 15 30 46 | f 29 3 11 47 | f 17 1 9 48 | f 17 2 13 49 | f 33 11 4 50 | f 24 6 19 51 | f 18 8 15 52 | f 11 15 4 53 | f 6 17 13 54 | f 5 17 12 55 | f 27 15 8 56 | f 3 18 11 57 | f 28 14 3 58 | f 16 20 1 59 | f 13 19 6 60 | f 34 19 27 61 | f 2 23 22 62 | f 9 20 23 63 | f 13 22 25 64 | f 32 24 34 65 | f 16 21 26 66 | f 7 34 10 67 | f 10 27 8 68 | f 20 31 28 69 | f 19 30 27 70 | f 22 29 33 71 | f 23 28 29 72 | f 22 30 25 73 | f 21 31 26 74 | f 32 7 14 75 | f 14 7 10 76 | f 21 5 12 77 | f 33 4 15 78 | f 29 28 3 79 | f 17 16 1 80 | f 17 9 2 81 | f 33 29 11 82 | f 24 12 6 83 | f 18 10 8 84 | f 11 18 15 85 | f 6 12 17 86 | f 5 16 17 87 | f 27 30 15 88 | f 3 14 18 89 | f 28 31 14 90 | f 16 26 20 91 | f 13 25 19 92 | f 34 24 19 93 | f 2 9 23 94 | f 9 1 20 95 | f 13 2 22 96 | f 32 21 24 97 | f 16 5 21 98 | f 7 32 34 99 | f 10 34 27 100 | f 20 26 31 101 | f 19 25 30 102 | f 22 23 29 103 | f 23 20 28 104 | f 22 33 30 105 | f 21 32 31 106 | o Cylinder 107 | v -0.000429 -0.066073 -0.070777 108 | v -0.025224 -0.050268 -0.074393 109 | v -0.031918 -0.012112 -0.081069 110 | v -0.025225 0.026045 -0.090815 111 | v -0.000430 0.041850 -0.097547 112 | v 0.022953 0.026045 -0.090818 113 | v 0.029647 -0.012112 -0.081072 114 | v 0.022953 -0.050268 -0.074395 115 | v -0.000426 -0.042293 -0.022314 116 | v -0.038583 -0.026488 -0.022312 117 | v -0.039557 0.011669 -0.022312 118 | v -0.027496 0.051486 -0.023865 119 | v -0.000426 0.062581 -0.023279 120 | v 0.037730 0.049826 -0.022315 121 | v 0.053535 0.011669 -0.022316 122 | v 0.037730 -0.026488 -0.022316 123 | g Cylinder_Cylinder_Material.001 124 | usemtl Material.001 125 | s off 126 | f 45 44 43 127 | f 40 41 38 128 | f 42 43 35 129 | f 41 50 42 130 | f 40 49 41 131 | f 39 48 40 132 | f 46 39 38 133 | f 45 38 37 134 | f 44 37 36 135 | f 43 36 35 136 | f 43 50 45 137 | f 50 49 45 138 | f 49 48 45 139 | f 48 47 45 140 | f 47 46 45 141 | f 42 35 36 142 | f 36 37 42 143 | f 37 38 41 144 | f 42 37 41 145 | f 38 39 40 146 | f 42 50 43 147 | f 41 49 50 148 | f 40 48 49 149 | f 39 47 48 150 | f 46 47 39 151 | f 45 46 38 152 | f 44 45 37 153 | f 43 44 36 154 | o Cylinder.001 155 | v 0.000680 -0.050063 -0.044457 156 | v 0.000686 -0.068082 0.069826 157 | v -0.030562 -0.037122 -0.044455 158 | v -0.043296 -0.049864 0.069828 159 | v -0.043503 -0.005880 -0.044454 160 | v -0.061514 -0.005881 0.069829 161 | v -0.030562 0.025362 -0.044455 162 | v -0.043296 0.038101 0.069829 163 | v 0.000680 0.038303 -0.044456 164 | v 0.000686 0.056320 0.069827 165 | v 0.031923 0.025362 -0.044458 166 | v 0.044669 0.038101 0.069824 167 | v 0.044864 -0.005880 -0.044459 168 | v 0.062887 -0.005881 0.069823 169 | v 0.031923 -0.037122 -0.044458 170 | v 0.044669 -0.049864 0.069824 171 | v 0.000681 -0.068081 -0.025774 172 | v -0.043301 -0.049863 -0.025771 173 | v -0.061519 -0.005880 -0.025770 174 | v -0.043301 0.038102 -0.025771 175 | v 0.000681 0.056320 -0.025773 176 | v 0.044664 0.038102 -0.025775 177 | v 0.062882 -0.005880 -0.025776 178 | v 0.044664 -0.049863 -0.025776 179 | g Cylinder.001_Cylinder.001_Material.000 180 | usemtl Material.000 181 | s off 182 | f 52 68 67 183 | f 54 69 68 184 | f 56 70 69 185 | f 58 71 70 186 | f 71 62 72 187 | f 72 64 73 188 | f 56 52 64 189 | f 73 66 74 190 | f 74 52 67 191 | f 63 65 57 192 | f 74 51 65 193 | f 73 65 63 194 | f 72 63 61 195 | f 71 61 59 196 | f 57 71 59 197 | f 55 70 57 198 | f 53 69 55 199 | f 51 68 53 200 | f 52 54 68 201 | f 54 56 69 202 | f 56 58 70 203 | f 58 60 71 204 | f 71 60 62 205 | f 72 62 64 206 | f 56 54 52 207 | f 52 66 64 208 | f 64 62 60 209 | f 60 58 64 210 | f 58 56 64 211 | f 73 64 66 212 | f 74 66 52 213 | f 65 51 57 214 | f 51 53 57 215 | f 53 55 57 216 | f 57 59 61 217 | f 61 63 57 218 | f 74 67 51 219 | f 73 74 65 220 | f 72 73 63 221 | f 71 72 61 222 | f 57 70 71 223 | f 55 69 70 224 | f 53 68 69 225 | f 51 67 68 226 | o Cylinder.002 227 | v -0.000573 -0.016042 -0.024385 228 | v -0.000560 -0.016045 0.229626 229 | v -0.028713 -0.004386 -0.024383 230 | v -0.028700 -0.004389 0.229628 231 | v -0.040369 0.023754 -0.024383 232 | v -0.040356 0.023751 0.229628 233 | v -0.028713 0.051894 -0.024383 234 | v -0.028700 0.051891 0.229628 235 | v -0.000573 0.063550 -0.024384 236 | v -0.000560 0.063547 0.229627 237 | v 0.027567 0.051894 -0.024386 238 | v 0.027580 0.051891 0.229625 239 | v 0.039223 0.023754 -0.024387 240 | v 0.039236 0.023751 0.229624 241 | v 0.027567 -0.004386 -0.024386 242 | v 0.027580 -0.004389 0.229625 243 | g Cylinder.002_Cylinder.002_Material.001 244 | usemtl Material.001 245 | s off 246 | f 75 78 77 247 | f 77 80 79 248 | f 79 82 81 249 | f 81 84 83 250 | f 84 85 83 251 | f 86 87 85 252 | f 80 76 88 253 | f 88 89 87 254 | f 90 75 89 255 | f 81 85 89 256 | f 75 76 78 257 | f 77 78 80 258 | f 79 80 82 259 | f 81 82 84 260 | f 84 86 85 261 | f 86 88 87 262 | f 80 78 76 263 | f 76 90 88 264 | f 88 86 84 265 | f 84 82 88 266 | f 82 80 88 267 | f 88 90 89 268 | f 90 76 75 269 | f 89 75 77 270 | f 77 79 81 271 | f 81 83 85 272 | f 85 87 89 273 | f 89 77 81 274 | o Cube.001 275 | v 0.011799 -0.050196 0.066325 276 | v 0.011799 -0.009981 0.066325 277 | v 0.011801 -0.050196 0.101949 278 | v 0.011802 -0.009981 0.111867 279 | v -0.012643 -0.050196 0.066326 280 | v -0.012643 -0.009981 0.066326 281 | v -0.012641 -0.050196 0.101951 282 | v -0.012641 -0.009981 0.111869 283 | v 0.011800 -0.055613 0.078765 284 | v 0.011801 -0.009981 0.089096 285 | v -0.012642 -0.055613 0.078767 286 | v -0.012642 -0.009981 0.089098 287 | g Cube.001_Cube.001_Material.000 288 | usemtl Material.000 289 | s off 290 | f 100 93 99 291 | f 94 97 93 292 | f 102 95 101 293 | f 96 91 95 294 | f 101 91 99 295 | f 100 96 102 296 | f 94 102 98 297 | f 97 99 93 298 | f 97 102 101 299 | f 91 100 99 300 | f 100 94 93 301 | f 94 98 97 302 | f 102 96 95 303 | f 96 92 91 304 | f 101 95 91 305 | f 100 92 96 306 | f 94 100 102 307 | f 97 101 99 308 | f 97 98 102 309 | f 91 92 100 310 | o Cube.002 311 | v 0.008749 -0.050911 0.081093 312 | v 0.008742 -0.044649 -0.066548 313 | v 0.008749 -0.053230 0.071768 314 | v 0.008742 -0.053814 -0.063661 315 | v -0.009591 -0.050911 0.081094 316 | v -0.009599 -0.044649 -0.066547 317 | v -0.009592 -0.053230 0.071769 318 | v -0.009599 -0.053814 -0.063660 319 | v 0.008748 -0.103724 0.062261 320 | v 0.008748 -0.096336 0.056117 321 | v -0.009593 -0.096336 0.056118 322 | v -0.009592 -0.103724 0.062262 323 | v 0.008749 -0.074446 0.071501 324 | v -0.009592 -0.074446 0.071502 325 | v -0.009592 -0.078461 0.080232 326 | v 0.008749 -0.078461 0.080231 327 | v 0.008746 -0.121718 0.019546 328 | v 0.008746 -0.112126 0.018982 329 | v -0.009595 -0.112126 0.018983 330 | v -0.009595 -0.121718 0.019547 331 | v 0.008741 -0.071969 -0.080498 332 | v 0.008742 -0.074470 -0.071221 333 | v -0.009599 -0.074470 -0.071220 334 | v -0.009600 -0.071969 -0.080497 335 | v 0.008742 -0.082089 -0.068848 336 | v -0.009599 -0.082089 -0.068847 337 | v -0.009600 -0.082304 -0.078308 338 | v 0.008741 -0.082304 -0.078308 339 | v 0.008742 -0.103777 -0.056970 340 | v -0.009599 -0.103777 -0.056969 341 | v -0.009599 -0.109410 -0.062400 342 | v 0.008742 -0.109410 -0.062401 343 | v 0.008744 -0.114815 -0.024823 344 | v -0.009597 -0.114815 -0.024822 345 | v -0.009597 -0.123457 -0.027256 346 | v 0.008744 -0.123457 -0.027257 347 | g Cube.002_Cube.002_Material.002 348 | usemtl Material.002 349 | s off 350 | f 104 124 123 351 | f 106 125 124 352 | f 125 108 126 353 | f 108 123 126 354 | f 109 103 105 355 | f 106 108 110 356 | f 114 118 117 357 | f 116 114 117 358 | f 112 116 115 359 | f 111 115 118 360 | f 118 105 103 361 | f 115 109 105 362 | f 109 117 107 363 | f 117 103 107 364 | f 122 111 114 365 | f 113 122 114 366 | f 120 113 112 367 | f 119 112 111 368 | f 126 130 129 369 | f 125 129 128 370 | f 124 128 127 371 | f 130 124 127 372 | f 134 127 131 373 | f 127 132 131 374 | f 128 133 132 375 | f 133 130 134 376 | f 133 138 137 377 | f 132 137 136 378 | f 131 136 135 379 | f 138 131 135 380 | f 119 135 120 381 | f 135 121 120 382 | f 136 122 121 383 | f 137 119 122 384 | f 104 106 124 385 | f 106 110 125 386 | f 125 110 108 387 | f 108 104 123 388 | f 109 107 103 389 | f 106 104 108 390 | f 114 111 118 391 | f 116 113 114 392 | f 112 113 116 393 | f 111 112 115 394 | f 118 115 105 395 | f 115 116 109 396 | f 109 116 117 397 | f 117 118 103 398 | f 122 119 111 399 | f 113 121 122 400 | f 120 121 113 401 | f 119 120 112 402 | f 126 123 130 403 | f 125 126 129 404 | f 124 125 128 405 | f 130 123 124 406 | f 134 130 127 407 | f 127 128 132 408 | f 128 129 133 409 | f 133 129 130 410 | f 133 134 138 411 | f 132 133 137 412 | f 131 132 136 413 | f 138 134 131 414 | f 119 138 135 415 | f 135 136 121 416 | f 136 137 122 417 | f 137 138 119 418 | o Cube.003 419 | v 0.006236 -0.050323 -0.046138 420 | v 0.004583 -0.104634 -0.011012 421 | v -0.007090 -0.050324 -0.046139 422 | v -0.004588 -0.104635 -0.011012 423 | v 0.006235 -0.048151 -0.038315 424 | v 0.004582 -0.099372 -0.009133 425 | v -0.007090 -0.048151 -0.038315 426 | v -0.004588 -0.099373 -0.009132 427 | v 0.006659 -0.083864 -0.034361 428 | v -0.006666 -0.083865 -0.034361 429 | v -0.006667 -0.078845 -0.027979 430 | v 0.006659 -0.078844 -0.027979 431 | g Cube.003_Cube.003_Material.002 432 | usemtl Material.002 433 | s off 434 | f 147 142 148 435 | f 142 149 148 436 | f 146 150 149 437 | f 150 140 147 438 | f 145 139 141 439 | f 142 144 146 440 | f 143 147 139 441 | f 149 143 145 442 | f 148 145 141 443 | f 139 148 141 444 | f 147 140 142 445 | f 142 146 149 446 | f 146 144 150 447 | f 150 144 140 448 | f 145 143 139 449 | f 142 140 144 450 | f 143 150 147 451 | f 149 150 143 452 | f 148 149 145 453 | f 139 147 148 454 | o Cube.004 455 | v 0.008641 0.043812 -0.051105 456 | v 0.005812 0.072982 -0.104861 457 | v -0.009202 0.043813 -0.051103 458 | v -0.004953 0.072982 -0.104860 459 | v 0.008639 0.035930 -0.064192 460 | v 0.005811 0.064529 -0.107332 461 | v -0.009204 0.035931 -0.064190 462 | v -0.004954 0.064529 -0.107332 463 | v 0.009206 0.064448 -0.066805 464 | v -0.008636 0.064448 -0.066803 465 | v -0.008638 0.056124 -0.079558 466 | v 0.009205 0.056124 -0.079561 467 | g Cube.004_Cube.004_Material.000 468 | usemtl Material.000 469 | s off 470 | f 159 154 160 471 | f 154 161 160 472 | f 158 162 161 473 | f 162 152 159 474 | f 157 151 153 475 | f 154 156 158 476 | f 155 159 151 477 | f 161 155 157 478 | f 160 157 153 479 | f 151 160 153 480 | f 159 152 154 481 | f 154 158 161 482 | f 158 156 162 483 | f 162 156 152 484 | f 157 155 151 485 | f 154 152 156 486 | f 155 162 159 487 | f 161 162 155 488 | f 160 161 157 489 | f 151 159 160 490 | o Cube.005 491 | v -0.002470 0.077137 0.216076 492 | v -0.009079 0.062662 0.216076 493 | v -0.002472 0.077137 0.174878 494 | v -0.009082 0.062662 0.174879 495 | v 0.001956 0.077137 0.216076 496 | v 0.008303 0.062662 0.216075 497 | v 0.001954 0.077137 0.174878 498 | v 0.008301 0.062662 0.174878 499 | v 0.001665 0.070057 0.174878 500 | v 0.001665 0.062662 0.174878 501 | v 0.001667 0.070057 0.216076 502 | v 0.001667 0.062662 0.216076 503 | v -0.002681 0.070057 0.174878 504 | v -0.002679 0.062662 0.216076 505 | v -0.002681 0.062662 0.174878 506 | v -0.002679 0.070057 0.216076 507 | g Cube.005_Cube.005_Material.000 508 | usemtl Material.000 509 | s off 510 | f 164 163 165 511 | f 171 169 170 512 | f 170 169 167 513 | f 178 163 164 514 | f 169 171 173 515 | f 166 177 176 516 | f 172 170 168 517 | f 171 175 178 518 | f 168 167 173 519 | f 177 175 171 520 | f 166 165 175 521 | f 175 165 163 522 | f 177 172 174 523 | f 174 173 178 524 | f 164 165 166 525 | f 171 170 172 526 | f 170 167 168 527 | f 178 164 176 528 | f 169 173 167 529 | f 166 176 164 530 | f 172 168 174 531 | f 171 178 173 532 | f 168 173 174 533 | f 177 171 172 534 | f 166 175 177 535 | f 175 163 178 536 | f 177 174 176 537 | f 174 178 176 538 | o fire_place_Cube.006 539 | v -0.003127 0.028591 0.223943 540 | v -0.003127 0.023740 0.223943 541 | v -0.003127 0.028591 0.219092 542 | v -0.003127 0.023740 0.219092 543 | v 0.001724 0.028591 0.223943 544 | v 0.001724 0.023740 0.223943 545 | v 0.001724 0.028591 0.219091 546 | v 0.001724 0.023740 0.219091 547 | g fire_place_Cube.006_None 548 | usemtl None 549 | s off 550 | f 180 179 181 551 | f 182 181 185 552 | f 186 185 183 553 | f 184 183 179 554 | f 185 181 179 555 | f 182 186 184 556 | f 180 181 182 557 | f 182 185 186 558 | f 186 183 184 559 | f 184 179 180 560 | f 185 179 183 561 | f 182 184 180 562 | -------------------------------------------------------------------------------- /obj/items/hill.obj: -------------------------------------------------------------------------------- 1 | m 000 255 255 255 255 2 | m 001 139 139 139 255 3 | m 002 231 92 71 255 4 | o Cube 5 | v -0.180827 -0.334950 0.425389 6 | v -0.180827 0.138945 0.425389 7 | v -0.180827 -0.334950 -0.425389 8 | v -0.180827 0.138945 -0.425389 9 | v 0.180827 -0.334950 0.425389 10 | v 0.180827 0.138945 0.425389 11 | v 0.180827 -0.334950 -0.425389 12 | v 0.180827 0.138945 -0.425389 13 | g Cube_Cube_Material.000 14 | usemtl Material.000 15 | s off 16 | f 5 1 3 17 | f 3 4 8 18 | f 7 8 6 19 | f 2 6 8 20 | f 1 2 4 21 | f 5 6 2 22 | f 5 3 7 23 | f 3 8 7 24 | f 7 6 5 25 | f 2 8 4 26 | f 1 4 3 27 | f 5 2 1 28 | o Cube.001_Cube.014 29 | v -0.057016 0.133674 0.270927 30 | v -0.057016 0.133700 0.214045 31 | v -0.057016 0.134697 -0.271347 32 | v -0.057016 0.134697 -0.214466 33 | v 0.057016 0.133674 0.270927 34 | v 0.057016 0.133700 0.214045 35 | v 0.057016 0.134697 -0.271347 36 | v 0.057016 0.134697 -0.214466 37 | v 0.057016 0.235886 0.159556 38 | v -0.057016 0.276102 0.199782 39 | v 0.057016 0.276102 0.199782 40 | v -0.057016 0.235886 0.159556 41 | v 0.057016 0.234873 -0.161984 42 | v -0.057016 0.275094 -0.202205 43 | v 0.057016 0.275094 -0.202205 44 | v -0.057016 0.234873 -0.161984 45 | g Cube.001_Cube.014_Material.001 46 | usemtl Material.001 47 | s off 48 | f 23 11 22 49 | f 11 16 12 50 | f 17 13 14 51 | f 24 16 21 52 | f 24 11 12 53 | f 13 10 14 54 | f 9 20 10 55 | f 10 17 14 56 | f 23 17 21 57 | f 13 18 9 58 | f 15 21 16 59 | f 20 22 24 60 | f 20 21 17 61 | f 19 22 18 62 | f 23 15 11 63 | f 11 15 16 64 | f 17 19 13 65 | f 24 12 16 66 | f 24 22 11 67 | f 13 9 10 68 | f 9 18 20 69 | f 10 20 17 70 | f 23 19 17 71 | f 13 19 18 72 | f 15 23 21 73 | f 20 18 22 74 | f 20 24 21 75 | f 19 23 22 76 | o Cube.002_Cube.015 77 | v 0.221679 0.007596 0.175239 78 | v 0.221679 0.007596 -0.175239 79 | v 0.170536 0.007596 -0.175239 80 | v 0.170536 0.007596 0.175239 81 | v 0.221679 -0.175675 -0.175239 82 | v 0.170536 -0.175675 -0.175239 83 | v 0.170536 -0.175675 0.175239 84 | v 0.221679 -0.175675 0.175239 85 | v 0.221679 -0.266031 0.093126 86 | v 0.221679 0.084447 0.093126 87 | v 0.170536 -0.266031 0.093126 88 | v 0.170536 0.084447 0.093126 89 | v 0.170536 0.007596 0.093126 90 | v 0.221679 0.007596 0.093126 91 | v 0.221679 -0.175675 0.093126 92 | v 0.170536 -0.175675 0.093126 93 | v 0.221679 0.084447 -0.102038 94 | v 0.170536 -0.266031 -0.102038 95 | v 0.221679 0.007596 -0.102038 96 | v 0.221679 -0.175675 -0.102038 97 | v 0.221679 -0.266031 -0.102038 98 | v 0.170536 0.084447 -0.102038 99 | v 0.170536 0.007596 -0.102038 100 | v 0.170536 -0.175675 -0.102038 101 | g Cube.002_Cube.015_Material.002 102 | usemtl Material.002 103 | s off 104 | f 46 41 43 105 | f 47 43 26 106 | f 39 31 40 107 | f 28 31 32 108 | f 37 40 31 109 | f 26 29 30 110 | f 43 44 29 111 | f 48 42 35 112 | f 39 32 31 113 | f 25 32 39 114 | f 47 48 40 115 | f 41 46 36 116 | f 42 45 33 117 | f 46 47 37 118 | f 27 47 26 119 | f 43 47 46 120 | f 27 30 48 121 | f 39 33 45 122 | f 38 39 44 123 | f 34 38 43 124 | f 33 39 35 125 | f 40 35 39 126 | f 28 25 37 127 | f 38 37 25 128 | f 36 37 34 129 | f 38 34 37 130 | f 45 42 44 131 | f 42 48 44 132 | f 30 29 48 133 | f 44 48 29 134 | f 28 32 25 135 | f 37 31 28 136 | f 26 30 27 137 | f 43 29 26 138 | f 48 35 40 139 | f 25 39 38 140 | f 47 40 37 141 | f 41 36 34 142 | f 42 33 35 143 | f 46 37 36 144 | f 27 48 47 145 | f 39 45 44 146 | f 38 44 43 147 | f 34 43 41 148 | o Cube.003_Cube.016 149 | v -0.173033 0.007596 0.175239 150 | v -0.173033 0.007596 -0.175239 151 | v -0.224176 0.007596 -0.175239 152 | v -0.224176 0.007596 0.175239 153 | v -0.173033 -0.175675 -0.175239 154 | v -0.224176 -0.175675 -0.175239 155 | v -0.224176 -0.175675 0.175239 156 | v -0.173033 -0.175675 0.175239 157 | v -0.173033 -0.266031 0.093126 158 | v -0.173033 0.084447 0.093126 159 | v -0.224176 -0.266031 0.093126 160 | v -0.224176 0.084447 0.093126 161 | v -0.224176 0.007596 0.093126 162 | v -0.173033 0.007596 0.093126 163 | v -0.173033 -0.175675 0.093126 164 | v -0.224176 -0.175675 0.093126 165 | v -0.173033 0.084447 -0.102038 166 | v -0.224176 -0.266031 -0.102038 167 | v -0.173033 0.007596 -0.102038 168 | v -0.173033 -0.175675 -0.102038 169 | v -0.173033 -0.266031 -0.102038 170 | v -0.224176 0.084447 -0.102038 171 | v -0.224176 0.007596 -0.102038 172 | v -0.224176 -0.175675 -0.102038 173 | g Cube.003_Cube.016_Material.002 174 | usemtl Material.002 175 | s off 176 | f 70 65 67 177 | f 71 67 50 178 | f 63 55 64 179 | f 52 55 56 180 | f 61 64 55 181 | f 50 53 54 182 | f 67 68 53 183 | f 72 66 59 184 | f 63 56 55 185 | f 49 56 63 186 | f 71 72 64 187 | f 65 70 60 188 | f 66 69 57 189 | f 70 71 61 190 | f 51 71 50 191 | f 67 71 70 192 | f 51 54 72 193 | f 63 57 69 194 | f 62 63 68 195 | f 58 62 67 196 | f 57 63 59 197 | f 64 59 63 198 | f 52 49 61 199 | f 62 61 49 200 | f 60 61 58 201 | f 62 58 61 202 | f 69 66 68 203 | f 66 72 68 204 | f 54 53 72 205 | f 68 72 53 206 | f 52 56 49 207 | f 61 55 52 208 | f 50 54 51 209 | f 67 53 50 210 | f 72 59 64 211 | f 49 63 62 212 | f 71 64 61 213 | f 65 60 58 214 | f 66 57 59 215 | f 70 61 60 216 | f 51 72 71 217 | f 63 69 68 218 | f 62 68 67 219 | f 58 67 65 220 | -------------------------------------------------------------------------------- /obj/items/rifle.obj: -------------------------------------------------------------------------------- 1 | m 000 122 122 122 255 2 | m 001 65 65 65 255 3 | o Cube 4 | v 0.001885 0.082987 0.933810 5 | v -0.081111 0.000009 0.933814 6 | v 0.001827 -0.054465 -0.286563 7 | v -0.022099 -0.053682 -0.304169 8 | v 0.084863 -0.000009 0.933807 9 | v 0.001867 -0.082987 0.933810 10 | v 0.025747 -0.053681 -0.304177 11 | v 0.001820 -0.052874 -0.322313 12 | v 0.001802 -0.080995 -0.592278 13 | v 0.001816 0.086524 -0.709669 14 | v 0.084796 -0.022335 -0.650970 15 | v -0.081178 -0.022322 -0.650977 16 | v 0.001804 -0.178469 -0.553477 17 | v 0.001818 -0.266415 -0.673016 18 | v 0.084798 -0.227338 -0.608313 19 | v -0.081176 -0.227351 -0.608319 20 | v 0.084801 -0.000009 -0.553860 21 | v -0.081174 0.000009 -0.553853 22 | v 0.001804 -0.082987 -0.553857 23 | v 0.001823 0.082987 -0.553857 24 | v 0.001810 -0.159592 -0.408492 25 | v 0.001832 -0.247885 -0.321054 26 | v 0.084809 -0.206522 -0.362020 27 | v -0.081166 -0.206535 -0.362000 28 | g Cube_Cube_Material.000 29 | usemtl Material.000 30 | s off 31 | f 23 3 22 32 | f 3 8 4 33 | f 17 6 19 34 | f 21 4 8 35 | f 24 3 4 36 | f 5 2 6 37 | f 18 10 12 38 | f 19 12 9 39 | f 15 9 13 40 | f 17 10 20 41 | f 23 13 21 42 | f 12 14 16 43 | f 9 16 13 44 | f 11 14 10 45 | f 5 20 1 46 | f 2 19 6 47 | f 1 18 2 48 | f 9 17 19 49 | f 7 21 8 50 | f 16 22 24 51 | f 13 24 21 52 | f 15 22 14 53 | f 23 7 3 54 | f 3 7 8 55 | f 17 5 6 56 | f 21 24 4 57 | f 24 22 3 58 | f 5 1 2 59 | f 18 20 10 60 | f 19 18 12 61 | f 15 11 9 62 | f 17 11 10 63 | f 23 15 13 64 | f 12 10 14 65 | f 9 12 16 66 | f 11 15 14 67 | f 5 17 20 68 | f 2 18 19 69 | f 1 20 18 70 | f 9 11 17 71 | f 7 23 21 72 | f 16 14 22 73 | f 13 16 24 74 | f 15 23 22 75 | o Cube.001_Cube.014 76 | v -0.057575 -0.022317 0.457073 77 | v -0.057576 -0.171069 0.435865 78 | v -0.057589 -0.022317 0.127004 79 | v -0.057589 -0.212921 0.127004 80 | v 0.061287 -0.022317 0.457068 81 | v 0.061286 -0.171069 0.435860 82 | v 0.061273 -0.022317 0.126999 83 | v 0.061273 -0.212921 0.126999 84 | g Cube.001_Cube.014_Material.001 85 | usemtl Material.001 86 | s off 87 | f 26 25 27 88 | f 28 27 31 89 | f 31 29 30 90 | f 30 29 25 91 | f 31 27 25 92 | f 28 32 30 93 | f 26 27 28 94 | f 28 31 32 95 | f 31 30 32 96 | f 30 25 26 97 | f 31 25 29 98 | f 28 30 26 99 | o Cube.002_Cube.015 100 | v 0.042829 -0.039642 -0.085369 101 | v 0.042830 -0.120081 -0.064718 102 | v 0.042824 -0.039642 0.130102 103 | v 0.042824 -0.148946 0.130102 104 | v -0.039149 -0.039642 -0.085375 105 | v -0.039148 -0.120081 -0.064724 106 | v -0.039154 -0.039642 0.130096 107 | v -0.039154 -0.148946 0.130096 108 | g Cube.002_Cube.015_Material.001 109 | usemtl Material.001 110 | s off 111 | f 34 33 35 112 | f 36 35 39 113 | f 39 37 38 114 | f 38 37 33 115 | f 39 35 33 116 | f 40 38 34 117 | f 34 35 36 118 | f 36 39 40 119 | f 39 38 40 120 | f 38 33 34 121 | f 39 33 37 122 | f 40 34 36 123 | o Cube.003_Cube.016 124 | v 0.028564 -0.307684 -0.147592 125 | v 0.028568 -0.094102 -0.050945 126 | v 0.028569 -0.311346 -0.035781 127 | v 0.028573 -0.112165 0.054349 128 | v -0.024904 -0.307684 -0.147590 129 | v -0.024900 -0.094102 -0.050943 130 | v -0.024899 -0.311346 -0.035779 131 | v -0.024895 -0.112165 0.054352 132 | g Cube.003_Cube.016_Material.000 133 | usemtl Material.000 134 | s off 135 | f 42 43 41 136 | f 44 47 43 137 | f 47 46 45 138 | f 46 41 45 139 | f 47 41 43 140 | f 44 46 48 141 | f 42 44 43 142 | f 44 48 47 143 | f 47 48 46 144 | f 46 42 41 145 | f 47 45 41 146 | f 44 42 46 147 | o Cube.004_Cube.017 148 | v -0.041260 -0.113834 0.421355 149 | v -0.041261 -0.290583 0.405969 150 | v -0.041272 -0.141307 0.151790 151 | v -0.041272 -0.320945 0.151790 152 | v 0.044969 -0.113834 0.421352 153 | v 0.044968 -0.290583 0.405966 154 | v 0.044957 -0.141307 0.151786 155 | v 0.044957 -0.320945 0.151786 156 | g Cube.004_Cube.017_Material.000 157 | usemtl Material.000 158 | s off 159 | f 50 49 51 160 | f 52 51 55 161 | f 55 53 54 162 | f 54 53 49 163 | f 55 51 49 164 | f 52 56 54 165 | f 50 51 52 166 | f 52 55 56 167 | f 55 54 56 168 | f 54 49 50 169 | f 55 49 53 170 | f 52 54 50 171 | o Cube.005_Cube.018 172 | v 0.001887 0.037245 1.250957 173 | v -0.035355 -0.000002 1.250958 174 | v 0.001873 0.037245 0.917899 175 | v -0.035369 -0.000002 0.917900 176 | v 0.039134 0.000002 1.250955 177 | v 0.001891 -0.037245 1.250957 178 | v 0.039120 0.000002 0.917897 179 | v 0.001877 -0.037245 0.917899 180 | g Cube.005_Cube.018_Material.001 181 | usemtl Material.001 182 | s off 183 | f 58 57 59 184 | f 60 59 63 185 | f 64 63 61 186 | f 62 61 57 187 | f 63 59 57 188 | f 60 64 62 189 | f 58 59 60 190 | f 60 63 64 191 | f 64 61 62 192 | f 62 57 58 193 | f 63 57 61 194 | f 60 62 58 195 | o Cube.006_Cube.019 196 | v 0.001892 0.053070 1.380614 197 | v -0.051175 -0.000003 1.380616 198 | v 0.001886 0.053070 1.236989 199 | v -0.051181 -0.000003 1.236991 200 | v 0.054965 0.000003 1.380612 201 | v 0.001897 -0.053070 1.380614 202 | v 0.054959 0.000003 1.236987 203 | v 0.001891 -0.053070 1.236989 204 | g Cube.006_Cube.019_Material.000 205 | usemtl Material.000 206 | s off 207 | f 66 65 67 208 | f 68 67 71 209 | f 72 71 69 210 | f 70 69 65 211 | f 71 67 65 212 | f 68 72 70 213 | f 66 67 68 214 | f 68 71 72 215 | f 72 69 70 216 | f 70 65 66 217 | f 71 65 69 218 | f 68 70 66 219 | o Cube.007_Cube.020 220 | v 0.001861 0.212243 0.653267 221 | v -0.059906 0.150470 0.653269 222 | v 0.001832 0.195325 -0.057189 223 | v -0.043018 0.150471 -0.057187 224 | v 0.063634 0.150476 0.653264 225 | v 0.001867 0.088703 0.653267 226 | v 0.046686 0.150475 -0.057190 227 | v 0.001836 0.105621 -0.057189 228 | v 0.001841 0.176931 0.145795 229 | v -0.024615 0.150472 0.145796 230 | v 0.028300 0.150474 0.145794 231 | v 0.001844 0.124015 0.145795 232 | v 0.001852 0.176931 0.389041 233 | v 0.001854 0.124015 0.389041 234 | v -0.024605 0.150472 0.389042 235 | v 0.028310 0.150474 0.389040 236 | v -0.043012 0.150471 0.085227 237 | v 0.046692 0.150475 0.085223 238 | v 0.001838 0.195325 0.085225 239 | v 0.001842 0.105621 0.085225 240 | v 0.001853 0.212243 0.454632 241 | v 0.001859 0.088703 0.454632 242 | v -0.059914 0.150470 0.454635 243 | v 0.063626 0.150476 0.454629 244 | g Cube.007_Cube.020_Material.000 245 | usemtl Material.000 246 | s off 247 | f 89 91 75 248 | f 76 75 79 249 | f 94 96 77 250 | f 78 77 73 251 | f 96 93 73 252 | f 95 94 78 253 | f 92 84 82 254 | f 90 91 81 255 | f 92 90 83 256 | f 87 85 81 257 | f 95 93 85 258 | f 82 84 86 259 | f 83 81 85 260 | f 84 83 88 261 | f 80 79 90 262 | f 79 75 91 263 | f 76 80 92 264 | f 82 81 91 265 | f 74 73 93 266 | f 86 94 95 267 | f 88 85 93 268 | f 86 88 96 269 | f 89 75 76 270 | f 76 79 80 271 | f 94 77 78 272 | f 78 73 74 273 | f 96 73 77 274 | f 95 78 74 275 | f 92 82 89 276 | f 90 81 83 277 | f 92 83 84 278 | f 87 81 82 279 | f 95 85 87 280 | f 82 86 87 281 | f 83 85 88 282 | f 84 88 86 283 | f 80 90 92 284 | f 79 91 90 285 | f 76 92 89 286 | f 82 91 89 287 | f 74 93 95 288 | f 86 95 87 289 | f 88 93 96 290 | f 86 96 94 291 | o Cube.008_Cube.021 292 | v 0.010750 0.058733 0.175734 293 | v 0.010750 0.136208 0.175734 294 | v 0.010751 0.058733 0.193083 295 | v 0.010751 0.136208 0.193083 296 | v -0.007062 0.058733 0.175735 297 | v -0.007062 0.136208 0.175735 298 | v -0.007061 0.058733 0.193084 299 | v -0.007061 0.136208 0.193084 300 | g Cube.008_Cube.021_Material.001 301 | usemtl Material.001 302 | s off 303 | f 98 99 97 304 | f 100 103 99 305 | f 104 101 103 306 | f 102 97 101 307 | f 103 97 99 308 | f 100 102 104 309 | f 98 100 99 310 | f 100 104 103 311 | f 104 102 101 312 | f 102 98 97 313 | f 103 101 97 314 | f 100 98 102 315 | o Cube.009_Cube.022 316 | v 0.010758 0.058733 0.360248 317 | v 0.010758 0.136208 0.360248 318 | v 0.010757 0.058733 0.345559 319 | v 0.010757 0.136208 0.345559 320 | v -0.007054 0.058733 0.360249 321 | v -0.007054 0.136208 0.360249 322 | v -0.007055 0.058733 0.345560 323 | v -0.007055 0.136208 0.345560 324 | g Cube.009_Cube.022_Material.001 325 | usemtl Material.001 326 | s off 327 | f 106 105 107 328 | f 108 107 111 329 | f 112 111 109 330 | f 110 109 105 331 | f 111 107 105 332 | f 108 112 110 333 | f 106 107 108 334 | f 108 111 112 335 | f 112 109 110 336 | f 110 105 106 337 | f 111 105 109 338 | f 108 110 106 339 | o Cube.010_Cube.023 340 | v -0.029837 0.186333 0.299222 341 | v -0.029837 0.122961 0.299222 342 | v -0.029839 0.186333 0.235850 343 | v -0.029839 0.122961 0.235850 344 | v 0.033535 0.186333 0.299219 345 | v 0.033535 0.122961 0.299219 346 | v 0.033532 0.186333 0.235848 347 | v 0.033532 0.122961 0.235848 348 | g Cube.010_Cube.023_Material.001 349 | usemtl Material.001 350 | s off 351 | f 114 113 115 352 | f 116 115 119 353 | f 120 119 117 354 | f 118 117 113 355 | f 119 115 113 356 | f 116 120 118 357 | f 114 115 116 358 | f 116 119 120 359 | f 120 117 118 360 | f 118 113 114 361 | f 119 113 117 362 | f 116 118 114 363 | o Cube.011_Cube.024 364 | v -0.011731 0.210064 0.281114 365 | v -0.011731 0.182905 0.281114 366 | v -0.011732 0.210064 0.253956 367 | v -0.011732 0.182905 0.253956 368 | v 0.015428 0.210064 0.281113 369 | v 0.015428 0.182905 0.281113 370 | v 0.015427 0.210064 0.253955 371 | v 0.015427 0.182905 0.253955 372 | g Cube.011_Cube.024_Material.000 373 | usemtl Material.000 374 | s off 375 | f 122 121 123 376 | f 124 123 127 377 | f 128 127 125 378 | f 126 125 121 379 | f 127 123 121 380 | f 124 128 126 381 | f 122 123 124 382 | f 124 127 128 383 | f 128 125 126 384 | f 126 121 122 385 | f 127 121 125 386 | f 124 126 122 387 | o Cube.012_Cube.025 388 | v 0.053549 0.055509 -0.056592 389 | v 0.053549 0.090038 -0.056592 390 | v 0.053590 0.055509 0.935856 391 | v 0.053590 0.090038 0.935856 392 | v -0.049880 0.055509 -0.056588 393 | v -0.049880 0.090038 -0.056588 394 | v -0.049838 0.055509 0.935860 395 | v -0.049838 0.090038 0.935860 396 | g Cube.012_Cube.025_Material.001 397 | usemtl Material.001 398 | s off 399 | f 130 131 129 400 | f 132 135 131 401 | f 136 133 135 402 | f 134 129 133 403 | f 135 129 131 404 | f 132 134 136 405 | f 130 132 131 406 | f 132 136 135 407 | f 136 134 133 408 | f 134 130 129 409 | f 135 133 129 410 | f 132 130 134 411 | o Cube.013_Cube.026 412 | v -0.029814 -0.040129 0.826322 413 | v -0.029814 -0.103500 0.826322 414 | v -0.029817 -0.040129 0.762951 415 | v -0.029817 -0.103500 0.762951 416 | v 0.033557 -0.040129 0.826319 417 | v 0.033557 -0.103500 0.826319 418 | v 0.033554 -0.040129 0.762948 419 | v 0.033554 -0.103500 0.762948 420 | g Cube.013_Cube.026_Material.001 421 | usemtl Material.001 422 | s off 423 | f 138 137 139 424 | f 140 139 143 425 | f 144 143 141 426 | f 142 141 137 427 | f 143 139 137 428 | f 140 144 142 429 | f 138 139 140 430 | f 140 143 144 431 | f 144 141 142 432 | f 142 137 138 433 | f 143 137 141 434 | f 140 142 138 435 | o Cube.014_Cube.027 436 | v -0.022691 -0.091652 0.813067 437 | v -0.171917 -0.385605 0.813074 438 | v -0.022693 -0.091652 0.776205 439 | v -0.171919 -0.385605 0.776211 440 | v -0.008738 -0.098735 0.813067 441 | v -0.157964 -0.392689 0.813073 442 | v -0.008739 -0.098735 0.776204 443 | v -0.157965 -0.392689 0.776210 444 | g Cube.014_Cube.027_Material.001 445 | usemtl Material.001 446 | s off 447 | f 146 145 147 448 | f 148 147 151 449 | f 152 151 149 450 | f 150 149 145 451 | f 151 147 145 452 | f 148 152 150 453 | f 146 147 148 454 | f 148 151 152 455 | f 152 149 150 456 | f 150 145 146 457 | f 151 145 149 458 | f 148 150 146 459 | o Cube.015_Cube.028 460 | v 0.013195 -0.089756 0.813066 461 | v 0.124972 -0.399890 0.813061 462 | v 0.013193 -0.089756 0.776203 463 | v 0.124970 -0.399890 0.776199 464 | v 0.027916 -0.084450 0.813065 465 | v 0.139693 -0.394584 0.813060 466 | v 0.027915 -0.084450 0.776203 467 | v 0.139692 -0.394584 0.776198 468 | g Cube.015_Cube.028_Material.001 469 | usemtl Material.001 470 | s off 471 | f 154 153 155 472 | f 156 155 159 473 | f 160 159 157 474 | f 158 157 153 475 | f 159 155 153 476 | f 156 160 158 477 | f 154 155 156 478 | f 156 159 160 479 | f 160 157 158 480 | f 158 153 154 481 | f 159 153 157 482 | f 156 158 154 483 | o Cube.016_Cube.029 484 | v -0.021347 -0.192881 0.137784 485 | v -0.021347 -0.206264 0.137784 486 | v -0.021352 -0.198527 0.009256 487 | v -0.021352 -0.210756 0.003821 488 | v 0.025031 -0.192881 0.137782 489 | v 0.025031 -0.206264 0.137782 490 | v 0.025026 -0.198527 0.009254 491 | v 0.025026 -0.210756 0.003819 492 | v -0.021349 -0.203531 0.091898 493 | v -0.021348 -0.216888 0.092724 494 | v 0.025029 -0.203531 0.091896 495 | v 0.025029 -0.216888 0.092722 496 | v -0.021351 -0.219030 0.027559 497 | v 0.025027 -0.205647 0.027557 498 | v -0.021351 -0.205647 0.027559 499 | v 0.025027 -0.219030 0.027557 500 | g Cube.016_Cube.029_Material.000 501 | usemtl Material.000 502 | s off 503 | f 175 163 164 504 | f 164 163 167 505 | f 171 165 166 506 | f 166 165 161 507 | f 171 169 161 508 | f 170 172 166 509 | f 173 176 172 510 | f 174 175 169 511 | f 174 171 172 512 | f 162 161 169 513 | f 168 167 174 514 | f 167 163 175 515 | f 164 168 176 516 | f 170 169 175 517 | f 175 164 173 518 | f 164 167 168 519 | f 171 166 172 520 | f 166 161 162 521 | f 171 161 165 522 | f 170 166 162 523 | f 173 172 170 524 | f 174 169 171 525 | f 174 172 176 526 | f 162 169 170 527 | f 168 174 176 528 | f 167 175 174 529 | f 164 176 173 530 | f 170 175 173 531 | o Cube.017_Cube.030 532 | v 0.006002 -0.181480 0.090428 533 | v 0.011074 -0.125829 0.050765 534 | v 0.006001 -0.186370 0.082835 535 | v 0.011073 -0.136682 0.033914 536 | v -0.002321 -0.181480 0.090428 537 | v -0.007397 -0.125829 0.050766 538 | v -0.002321 -0.186370 0.082835 539 | v -0.007397 -0.136682 0.033915 540 | v 0.011075 -0.154524 0.069247 541 | v 0.011074 -0.165377 0.052395 542 | v -0.007397 -0.165377 0.052396 543 | v -0.007396 -0.154524 0.069247 544 | g Cube.017_Cube.030_Material.001 545 | usemtl Material.001 546 | s off 547 | f 178 185 186 548 | f 180 186 187 549 | f 184 187 188 550 | f 182 188 185 551 | f 183 179 177 552 | f 180 184 182 553 | f 188 181 177 554 | f 183 181 188 555 | f 186 179 183 556 | f 185 177 179 557 | f 178 186 180 558 | f 180 187 184 559 | f 184 188 182 560 | f 182 185 178 561 | f 183 177 181 562 | f 180 182 178 563 | f 188 177 185 564 | f 183 188 187 565 | f 186 183 187 566 | f 185 179 186 567 | o Cube.018_Cube.031 568 | v 0.004020 -0.002128 1.330054 569 | v 0.004020 0.002128 1.330054 570 | v 0.004020 -0.002128 1.334309 571 | v 0.004020 0.002128 1.334309 572 | v -0.000235 -0.002128 1.330054 573 | v -0.000235 0.002128 1.330054 574 | v -0.000235 -0.002128 1.334309 575 | v -0.000235 0.002128 1.334309 576 | g Cube.018_Cube.031_None 577 | usemtl None 578 | s off 579 | f 190 191 189 580 | f 192 195 191 581 | f 196 193 195 582 | f 194 189 193 583 | f 195 189 191 584 | f 192 194 196 585 | f 190 192 191 586 | f 192 196 195 587 | f 196 194 193 588 | f 194 190 189 589 | f 195 193 189 590 | f 192 190 194 591 | -------------------------------------------------------------------------------- /obj/items/shotgun.obj: -------------------------------------------------------------------------------- 1 | m 000 169 169 169 255 2 | m 001 166 102 74 255 3 | m 002 125 125 125 255 4 | m 003 77 77 77 255 5 | o Cube 6 | v -0.030710 0.012938 -0.190583 7 | v -0.030710 -0.100172 -0.190583 8 | v -0.030710 0.052238 0.156284 9 | v -0.030710 -0.100172 0.156284 10 | v 0.044140 0.012938 -0.190583 11 | v 0.044140 -0.100172 -0.190583 12 | v 0.044140 0.052238 0.156284 13 | v 0.044140 -0.100172 0.156284 14 | v 0.044140 -0.100172 -0.101109 15 | v -0.030710 0.052238 -0.101109 16 | v 0.044140 0.052238 -0.101109 17 | v -0.030710 -0.100172 -0.101109 18 | g Cube_Cube_Material.000 19 | usemtl Material.000 20 | s off 21 | f 3 11 10 22 | f 8 3 4 23 | f 9 5 11 24 | f 8 12 9 25 | f 4 10 12 26 | f 2 5 6 27 | f 12 1 2 28 | f 9 2 6 29 | f 9 7 8 30 | f 10 5 1 31 | f 3 7 11 32 | f 8 7 3 33 | f 9 6 5 34 | f 8 4 12 35 | f 4 3 10 36 | f 2 1 5 37 | f 12 10 1 38 | f 9 12 2 39 | f 9 11 7 40 | f 10 11 5 41 | o Cube.001_Cube.014 42 | v -0.028476 0.051727 0.622690 43 | v -0.028476 -0.013340 0.622690 44 | v -0.028476 0.051727 0.151723 45 | v -0.028476 -0.013340 0.151723 46 | v 0.041905 0.051727 0.622690 47 | v 0.041905 -0.013340 0.622690 48 | v 0.041906 0.051727 0.151723 49 | v 0.041906 -0.013340 0.151723 50 | g Cube.001_Cube.014_Material.002 51 | usemtl Material.002 52 | s off 53 | f 14 13 15 54 | f 16 15 19 55 | f 20 19 17 56 | f 18 17 13 57 | f 19 15 13 58 | f 16 20 18 59 | f 14 15 16 60 | f 16 19 20 61 | f 20 17 18 62 | f 18 13 14 63 | f 19 13 17 64 | f 16 18 14 65 | o Cube.002_Cube.015 66 | v -0.014664 -0.031104 0.273492 67 | v -0.014664 -0.073861 0.273492 68 | v -0.014664 -0.031104 0.150758 69 | v -0.014664 -0.073861 0.150758 70 | v 0.028094 -0.031104 0.273492 71 | v 0.028094 -0.073861 0.273492 72 | v 0.028094 -0.031104 0.150758 73 | v 0.028094 -0.073861 0.150758 74 | g Cube.002_Cube.015_Material.003 75 | usemtl Material.003 76 | s off 77 | f 22 21 23 78 | f 24 23 27 79 | f 28 27 25 80 | f 26 25 21 81 | f 27 23 21 82 | f 24 28 26 83 | f 22 23 24 84 | f 24 27 28 85 | f 28 25 26 86 | f 26 21 22 87 | f 27 21 25 88 | f 24 26 22 89 | o Cube.003_Cube.016 90 | v -0.038850 -0.006980 0.508055 91 | v -0.038850 -0.095975 0.508055 92 | v -0.038850 -0.006980 0.262587 93 | v -0.038850 -0.095975 0.262587 94 | v 0.052280 -0.006980 0.508055 95 | v 0.052280 -0.095975 0.508055 96 | v 0.052280 -0.006980 0.262587 97 | v 0.052280 -0.095975 0.262587 98 | g Cube.003_Cube.016_Material.001 99 | usemtl Material.001 100 | s off 101 | f 30 29 31 102 | f 32 31 35 103 | f 36 35 33 104 | f 34 33 29 105 | f 35 31 29 106 | f 32 36 34 107 | f 30 31 32 108 | f 32 35 36 109 | f 36 33 34 110 | f 34 29 30 111 | f 35 29 33 112 | f 32 34 30 113 | o Cube.004_Cube.017 114 | v -0.014664 -0.031104 0.611678 115 | v -0.014664 -0.073861 0.611678 116 | v -0.014664 -0.031104 0.498633 117 | v -0.014664 -0.073861 0.498633 118 | v 0.028093 -0.031104 0.611678 119 | v 0.028093 -0.073861 0.611678 120 | v 0.028093 -0.031104 0.498633 121 | v 0.028093 -0.073861 0.498633 122 | g Cube.004_Cube.017_Material.003 123 | usemtl Material.003 124 | s off 125 | f 38 37 39 126 | f 40 39 43 127 | f 44 43 41 128 | f 42 41 37 129 | f 43 39 37 130 | f 40 44 42 131 | f 38 39 40 132 | f 40 43 44 133 | f 44 41 42 134 | f 42 37 38 135 | f 43 37 41 136 | f 40 42 38 137 | o Cube.005_Cube.018 138 | v -0.028018 0.009276 -0.187437 139 | v -0.030710 -0.201524 -0.447391 140 | v -0.028018 -0.095286 -0.189475 141 | v -0.030710 -0.205988 -0.341846 142 | v 0.041447 0.009276 -0.187437 143 | v 0.044140 -0.201524 -0.447391 144 | v 0.041447 -0.095286 -0.189475 145 | v 0.044140 -0.205988 -0.341846 146 | v -0.030710 -0.072097 -0.339260 147 | v 0.044140 -0.131249 -0.276670 148 | v -0.030710 -0.131249 -0.276670 149 | v 0.044140 -0.072097 -0.339260 150 | g Cube.005_Cube.018_Material.001 151 | usemtl Material.001 152 | s off 153 | f 47 49 45 154 | f 54 47 55 155 | f 54 49 51 156 | f 52 46 50 157 | f 55 45 53 158 | f 56 45 49 159 | f 46 56 50 160 | f 46 55 53 161 | f 50 54 52 162 | f 52 55 48 163 | f 47 51 49 164 | f 54 51 47 165 | f 54 56 49 166 | f 52 48 46 167 | f 55 47 45 168 | f 56 53 45 169 | f 46 53 56 170 | f 46 48 55 171 | f 50 56 54 172 | f 52 54 55 173 | o Cube.006_Cube.019 174 | v -0.038565 0.028561 0.122593 175 | v -0.038565 -0.010358 0.122593 176 | v -0.038565 0.028561 -0.014314 177 | v -0.038565 -0.010358 -0.014314 178 | v -0.026746 0.028561 0.122593 179 | v -0.026746 -0.010358 0.122593 180 | v -0.026746 0.028561 -0.014314 181 | v -0.026746 -0.010358 -0.014314 182 | g Cube.006_Cube.019_Material.003 183 | usemtl Material.003 184 | s off 185 | f 58 57 59 186 | f 60 59 63 187 | f 64 63 61 188 | f 62 61 57 189 | f 63 59 57 190 | f 60 64 62 191 | f 58 59 60 192 | f 60 63 64 193 | f 64 61 62 194 | f 62 57 58 195 | f 63 57 61 196 | f 60 62 58 197 | o Cube.007_Cube.020 198 | v -0.005722 -0.101077 -0.137020 199 | v -0.005722 -0.101584 -0.113633 200 | v -0.005721 -0.166865 -0.313548 201 | v -0.005721 -0.181229 -0.323349 202 | v 0.027696 -0.101077 -0.137020 203 | v 0.027696 -0.101584 -0.113633 204 | v 0.027696 -0.166865 -0.313548 205 | v 0.027696 -0.181229 -0.323349 206 | v -0.005722 -0.179786 -0.241980 207 | v -0.005722 -0.197009 -0.237788 208 | v 0.027696 -0.179786 -0.241980 209 | v 0.027696 -0.197009 -0.237788 210 | v -0.005722 -0.146774 -0.177205 211 | v 0.027696 -0.161731 -0.163688 212 | v -0.005722 -0.161731 -0.163688 213 | v 0.027696 -0.146774 -0.177205 214 | g Cube.007_Cube.020_Material.003 215 | usemtl Material.003 216 | s off 217 | f 73 67 68 218 | f 68 67 71 219 | f 80 69 70 220 | f 70 69 65 221 | f 80 77 65 222 | f 79 78 70 223 | f 68 72 76 224 | f 71 67 73 225 | f 72 71 75 226 | f 79 77 73 227 | f 66 65 77 228 | f 74 76 78 229 | f 75 73 77 230 | f 75 80 78 231 | f 73 68 74 232 | f 68 71 72 233 | f 80 70 78 234 | f 70 65 66 235 | f 80 65 69 236 | f 79 70 66 237 | f 68 76 74 238 | f 71 73 75 239 | f 72 75 76 240 | f 79 73 74 241 | f 66 77 79 242 | f 74 78 79 243 | f 75 77 80 244 | f 75 78 76 245 | o Cube.008_Cube.021 246 | v -0.018777 -0.079592 0.580647 247 | v -0.018777 -0.079592 0.529664 248 | v -0.018777 -0.002804 0.580647 249 | v -0.018777 -0.002805 0.529663 250 | v 0.032206 -0.079592 0.580647 251 | v 0.032206 -0.079592 0.529664 252 | v 0.032206 -0.002804 0.580647 253 | v 0.032206 -0.002805 0.529663 254 | g Cube.008_Cube.021_Material.000 255 | usemtl Material.000 256 | s off 257 | f 82 81 83 258 | f 84 83 87 259 | f 88 87 85 260 | f 86 85 81 261 | f 87 83 81 262 | f 84 88 86 263 | f 82 83 84 264 | f 84 87 88 265 | f 88 85 86 266 | f 86 81 82 267 | f 87 81 85 268 | f 84 86 82 269 | o Cube.009_Cube.022 270 | v 0.003813 0.017297 0.568185 271 | v 0.003813 0.012256 0.568185 272 | v 0.003813 0.017297 0.563144 273 | v 0.003813 0.012256 0.563144 274 | v 0.008854 0.017297 0.568185 275 | v 0.008854 0.012256 0.568185 276 | v 0.008854 0.017297 0.563144 277 | v 0.008854 0.012256 0.563144 278 | g Cube.009_Cube.022_None 279 | usemtl None 280 | s off 281 | f 90 89 91 282 | f 92 91 95 283 | f 96 95 93 284 | f 94 93 89 285 | f 95 91 89 286 | f 92 96 94 287 | f 90 91 92 288 | f 92 95 96 289 | f 96 93 94 290 | f 94 89 90 291 | f 95 89 93 292 | f 92 94 90 293 | -------------------------------------------------------------------------------- /obj/man/body.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.91.0 OBJ File: 'body.blend' 2 | # www.blender.org 3 | mtllib body.mtl 4 | o Cube 5 | v 1.470880 4.046328 0.990075 6 | v 1.227793 -0.007857 0.756304 7 | v -1.471015 4.046328 0.989874 8 | v -1.227895 -0.007857 0.756137 9 | v 1.471015 4.046328 -0.989874 10 | v 1.227895 -0.007857 -0.756137 11 | v -1.470880 4.046328 -0.990075 12 | v -1.227793 -0.007857 -0.756304 13 | v -0.362043 4.746272 0.386594 14 | v -0.361991 4.746272 -0.386643 15 | v 0.361991 4.746272 0.386643 16 | v 0.362043 4.746272 -0.386594 17 | g Cube_Cube_Material 18 | usemtl Material 19 | s off 20 | f 1 9 3 21 | f 3 8 4 22 | f 7 6 8 23 | f 2 8 6 24 | f 1 4 2 25 | f 5 2 6 26 | f 12 9 11 27 | f 5 11 1 28 | f 3 10 7 29 | f 7 12 5 30 | f 1 11 9 31 | f 3 7 8 32 | f 7 5 6 33 | f 2 4 8 34 | f 1 3 4 35 | f 5 1 2 36 | f 12 10 9 37 | f 5 12 11 38 | f 3 9 10 39 | f 7 10 12 40 | -------------------------------------------------------------------------------- /obj/man/foot.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.91.0 OBJ File: 'foot.blend' 2 | # www.blender.org 3 | mtllib foot.mtl 4 | o Cube 5 | v 0.483757 0.004051 -0.472253 6 | v 0.320470 -5.020987 -0.308967 7 | v 0.483757 0.004051 0.495260 8 | v 0.320470 -5.020987 0.331974 9 | v -0.483757 0.004051 -0.472253 10 | v -0.320470 -5.020987 -0.308967 11 | v -0.483757 0.004051 0.495260 12 | v -0.320470 -5.020987 0.331974 13 | g Cube_Cube_Material 14 | usemtl Material 15 | s off 16 | f 5 3 1 17 | f 3 8 4 18 | f 7 6 8 19 | f 2 8 6 20 | f 1 4 2 21 | f 5 2 6 22 | f 5 7 3 23 | f 3 7 8 24 | f 7 5 6 25 | f 2 4 8 26 | f 1 3 4 27 | f 5 1 2 28 | -------------------------------------------------------------------------------- /obj/man/head.obj: -------------------------------------------------------------------------------- 1 | m 000 255 213 196 255 2 | m 001 43 64 59 255 3 | m 002 255 255 255 255 4 | m 003 166 101 103 255 5 | m 004 205 157 154 255 6 | m 005 0 0 0 255 7 | o Cube 8 | v 0.907299 1.198761 0.858237 9 | v 1.010992 0.696886 0.961946 10 | v -0.885299 1.198761 0.858105 11 | v -0.989008 0.696886 0.961798 12 | v 0.907431 1.198761 -0.934361 13 | v 1.011140 0.696886 -1.038054 14 | v -0.885167 1.198761 -0.934493 15 | v -0.988860 0.696886 -1.038202 16 | v 0.967071 0.236114 -1.056951 17 | v -0.944742 0.236114 -1.057085 18 | v 0.966874 0.236114 0.964204 19 | v -0.944939 0.236114 0.964070 20 | v 0.749151 -0.298993 -0.874153 21 | v -0.726867 -0.298993 -0.874242 22 | v 0.748999 -0.298993 0.840097 23 | v -0.727019 -0.298993 0.840008 24 | v 0.492345 -0.714590 -0.449255 25 | v -0.470114 -0.714590 -0.449298 26 | v 0.492246 -0.714590 0.523183 27 | v -0.470213 -0.714590 0.523139 28 | g Cube_Cube_Material.000 29 | usemtl Material.000 30 | s off 31 | f 5 3 1 32 | f 4 7 8 33 | f 8 5 6 34 | f 6 11 9 35 | f 2 3 4 36 | f 6 1 2 37 | f 12 14 16 38 | f 8 12 4 39 | f 6 10 8 40 | f 4 11 2 41 | f 14 17 18 42 | f 10 13 14 43 | f 11 16 15 44 | f 11 13 9 45 | f 19 18 17 46 | f 15 20 19 47 | f 15 17 13 48 | f 16 18 20 49 | f 5 7 3 50 | f 4 3 7 51 | f 8 7 5 52 | f 6 2 11 53 | f 2 1 3 54 | f 6 5 1 55 | f 12 10 14 56 | f 8 10 12 57 | f 6 9 10 58 | f 4 12 11 59 | f 14 13 17 60 | f 10 9 13 61 | f 11 12 16 62 | f 11 15 13 63 | f 19 20 18 64 | f 15 16 20 65 | f 15 19 17 66 | f 16 14 18 67 | o Cube.001 68 | v 0.800978 1.910599 0.407931 69 | v 1.101399 1.626708 0.813982 70 | v -0.778962 1.910564 0.407820 71 | v -1.079428 1.626659 0.813828 72 | v 0.801094 1.430055 -1.097155 73 | v 1.101561 0.963401 -1.263525 74 | v -0.778845 1.430019 -1.097266 75 | v -1.079267 0.963352 -1.263679 76 | v -0.185483 2.063048 -0.263768 77 | v -0.185454 1.943495 -0.638215 78 | v 0.207587 2.063057 -0.263740 79 | v 0.207616 1.943504 -0.638187 80 | v 1.232467 0.482932 -1.247517 81 | v -1.210154 0.482877 -1.247689 82 | v 1.232286 1.225864 1.079380 83 | v -1.210334 1.225809 1.079208 84 | v -0.809460 1.398426 1.186800 85 | v 0.831389 1.398463 1.186915 86 | v -0.853770 1.276649 1.222782 87 | v 0.875699 1.276688 1.222904 88 | v -0.518071 1.609557 1.980855 89 | v 0.539879 1.609580 1.980929 90 | v -0.546640 1.531040 2.004055 91 | v 0.568448 1.531065 2.004133 92 | g Cube.001_Cube.001_Material.001 93 | usemtl Material.001 94 | s off 95 | f 23 30 27 96 | f 23 28 24 97 | f 27 26 28 98 | f 28 36 24 99 | f 21 24 22 100 | f 25 22 26 101 | f 32 29 31 102 | f 27 32 25 103 | f 21 29 23 104 | f 25 31 21 105 | f 35 34 33 106 | f 26 34 28 107 | f 36 37 24 108 | f 22 33 26 109 | f 37 43 41 110 | f 35 39 36 111 | f 24 38 22 112 | f 35 38 40 113 | f 41 44 42 114 | f 37 42 38 115 | f 38 44 40 116 | f 40 43 39 117 | f 23 29 30 118 | f 23 27 28 119 | f 27 25 26 120 | f 28 34 36 121 | f 21 23 24 122 | f 25 21 22 123 | f 32 30 29 124 | f 27 30 32 125 | f 21 31 29 126 | f 25 32 31 127 | f 35 36 34 128 | f 26 33 34 129 | f 36 39 37 130 | f 22 35 33 131 | f 37 39 43 132 | f 35 40 39 133 | f 24 37 38 134 | f 35 22 38 135 | f 41 43 44 136 | f 37 41 42 137 | f 38 42 44 138 | f 40 44 43 139 | o Cone 140 | v 0.409214 0.190070 0.811393 141 | v -0.387430 0.190393 0.811365 142 | v 0.011172 0.880146 0.811332 143 | v 0.010989 0.211125 1.238715 144 | g Cone_Cone_Material.004 145 | usemtl Material.004 146 | s off 147 | f 45 48 46 148 | f 45 46 47 149 | f 46 48 47 150 | f 47 48 45 151 | o Sphere 152 | v -0.511086 0.982705 0.728083 153 | v -0.511086 0.832705 0.619102 154 | v -0.511086 0.647295 0.619102 155 | v -0.511086 0.497295 0.728083 156 | v -0.373221 0.982705 0.794475 157 | v -0.288016 0.832705 0.726527 158 | v -0.288016 0.647295 0.726527 159 | v -0.373221 0.497295 0.794476 160 | v -0.339171 0.982705 0.943657 161 | v -0.232922 0.832705 0.967908 162 | v -0.232922 0.647295 0.967908 163 | v -0.339171 0.497295 0.943657 164 | v -0.434577 0.982705 1.063292 165 | v -0.387291 0.832705 1.161481 166 | v -0.387291 0.647295 1.161481 167 | v -0.434577 0.497295 1.063292 168 | v -0.511086 1.040000 0.904419 169 | v -0.587595 0.982705 1.063292 170 | v -0.634880 0.832705 1.161481 171 | v -0.634880 0.647295 1.161481 172 | v -0.587595 0.497295 1.063292 173 | v -0.511086 0.440000 0.904419 174 | v -0.683000 0.982705 0.943657 175 | v -0.789249 0.832705 0.967908 176 | v -0.789249 0.647295 0.967908 177 | v -0.683000 0.497295 0.943657 178 | v -0.648951 0.982705 0.794475 179 | v -0.734156 0.832705 0.726527 180 | v -0.734156 0.647295 0.726527 181 | v -0.648951 0.497295 0.794475 182 | g Sphere_Sphere_Material.002 183 | usemtl Material.002 184 | s off 185 | f 70 52 56 186 | f 50 55 51 187 | f 49 65 53 188 | f 51 56 52 189 | f 49 54 50 190 | f 53 58 54 191 | f 70 56 60 192 | f 54 59 55 193 | f 53 65 57 194 | f 55 60 56 195 | f 57 62 58 196 | f 70 60 64 197 | f 58 63 59 198 | f 57 65 61 199 | f 59 64 60 200 | f 61 67 62 201 | f 70 64 69 202 | f 62 68 63 203 | f 61 65 66 204 | f 63 69 64 205 | f 67 71 72 206 | f 70 69 74 207 | f 67 73 68 208 | f 66 65 71 209 | f 69 73 74 210 | f 72 75 76 211 | f 70 74 78 212 | f 72 77 73 213 | f 71 65 75 214 | f 73 78 74 215 | f 76 49 50 216 | f 70 78 52 217 | f 76 51 77 218 | f 75 65 49 219 | f 77 52 78 220 | f 50 54 55 221 | f 51 55 56 222 | f 49 53 54 223 | f 53 57 58 224 | f 54 58 59 225 | f 55 59 60 226 | f 57 61 62 227 | f 58 62 63 228 | f 59 63 64 229 | f 61 66 67 230 | f 62 67 68 231 | f 63 68 69 232 | f 67 66 71 233 | f 67 72 73 234 | f 69 68 73 235 | f 72 71 75 236 | f 72 76 77 237 | f 73 77 78 238 | f 76 75 49 239 | f 76 50 51 240 | f 77 51 52 241 | o Sphere.001 242 | v 0.526424 0.982705 0.728083 243 | v 0.526424 0.832705 0.619102 244 | v 0.526424 0.647295 0.619102 245 | v 0.526424 0.497295 0.728083 246 | v 0.664288 0.982705 0.794475 247 | v 0.749493 0.832705 0.726527 248 | v 0.749493 0.647295 0.726527 249 | v 0.664288 0.497295 0.794476 250 | v 0.698338 0.982705 0.943657 251 | v 0.804587 0.832705 0.967908 252 | v 0.804587 0.647295 0.967908 253 | v 0.698338 0.497295 0.943657 254 | v 0.602933 0.982705 1.063292 255 | v 0.650218 0.832705 1.161481 256 | v 0.650218 0.647295 1.161481 257 | v 0.602933 0.497295 1.063292 258 | v 0.526424 1.040000 0.904419 259 | v 0.449914 0.982705 1.063292 260 | v 0.402629 0.832705 1.161481 261 | v 0.402629 0.647295 1.161481 262 | v 0.449914 0.497295 1.063292 263 | v 0.526424 0.440000 0.904419 264 | v 0.354509 0.982705 0.943657 265 | v 0.248260 0.832705 0.967908 266 | v 0.248260 0.647295 0.967908 267 | v 0.354509 0.497295 0.943657 268 | v 0.388559 0.982705 0.794475 269 | v 0.303354 0.832705 0.726527 270 | v 0.303354 0.647295 0.726527 271 | v 0.388559 0.497295 0.794475 272 | g Sphere.001_Sphere.001_Material.002 273 | usemtl Material.002 274 | s off 275 | f 100 82 86 276 | f 80 85 81 277 | f 79 95 83 278 | f 81 86 82 279 | f 79 84 80 280 | f 83 88 84 281 | f 100 86 90 282 | f 84 89 85 283 | f 83 95 87 284 | f 85 90 86 285 | f 87 92 88 286 | f 100 90 94 287 | f 88 93 89 288 | f 87 95 91 289 | f 89 94 90 290 | f 91 97 92 291 | f 100 94 99 292 | f 92 98 93 293 | f 91 95 96 294 | f 93 99 94 295 | f 97 101 102 296 | f 100 99 104 297 | f 97 103 98 298 | f 96 95 101 299 | f 99 103 104 300 | f 102 105 106 301 | f 100 104 108 302 | f 102 107 103 303 | f 101 95 105 304 | f 103 108 104 305 | f 106 79 80 306 | f 100 108 82 307 | f 106 81 107 308 | f 105 95 79 309 | f 107 82 108 310 | f 80 84 85 311 | f 81 85 86 312 | f 79 83 84 313 | f 83 87 88 314 | f 84 88 89 315 | f 85 89 90 316 | f 87 91 92 317 | f 88 92 93 318 | f 89 93 94 319 | f 91 96 97 320 | f 92 97 98 321 | f 93 98 99 322 | f 97 96 101 323 | f 97 102 103 324 | f 99 98 103 325 | f 102 101 105 326 | f 102 106 107 327 | f 103 107 108 328 | f 106 105 79 329 | f 106 80 81 330 | f 107 81 82 331 | o Sphere.002 332 | v -0.606089 0.904048 1.058318 333 | v -0.606089 0.846289 1.016354 334 | v -0.606089 0.774896 1.016354 335 | v -0.606089 0.717137 1.058318 336 | v -0.553003 0.904048 1.083883 337 | v -0.520194 0.846289 1.057719 338 | v -0.520194 0.774896 1.057719 339 | v -0.553003 0.717137 1.083883 340 | v -0.539892 0.904048 1.141326 341 | v -0.498980 0.846289 1.150664 342 | v -0.498980 0.774896 1.150664 343 | v -0.539892 0.717137 1.141326 344 | v -0.576629 0.904048 1.187392 345 | v -0.558421 0.846289 1.225201 346 | v -0.558421 0.774896 1.225201 347 | v -0.576629 0.717137 1.187392 348 | v -0.606089 0.926109 1.126217 349 | v -0.635549 0.904048 1.187392 350 | v -0.653757 0.846289 1.225201 351 | v -0.653757 0.774896 1.225201 352 | v -0.635549 0.717137 1.187392 353 | v -0.606089 0.695075 1.126217 354 | v -0.672286 0.904048 1.141326 355 | v -0.713198 0.846289 1.150664 356 | v -0.713198 0.774896 1.150664 357 | v -0.672286 0.717137 1.141326 358 | v -0.659175 0.904048 1.083883 359 | v -0.691984 0.846289 1.057719 360 | v -0.691984 0.774896 1.057719 361 | v -0.659175 0.717137 1.083883 362 | g Sphere.002_Sphere.002_Material.005 363 | usemtl Material.005 364 | s off 365 | f 130 112 116 366 | f 110 115 111 367 | f 109 125 113 368 | f 111 116 112 369 | f 109 114 110 370 | f 113 118 114 371 | f 130 116 120 372 | f 114 119 115 373 | f 113 125 117 374 | f 115 120 116 375 | f 117 122 118 376 | f 130 120 124 377 | f 118 123 119 378 | f 117 125 121 379 | f 119 124 120 380 | f 121 127 122 381 | f 130 124 129 382 | f 122 128 123 383 | f 121 125 126 384 | f 123 129 124 385 | f 127 131 132 386 | f 130 129 134 387 | f 127 133 128 388 | f 126 125 131 389 | f 129 133 134 390 | f 132 135 136 391 | f 130 134 138 392 | f 132 137 133 393 | f 131 125 135 394 | f 133 138 134 395 | f 136 109 110 396 | f 130 138 112 397 | f 136 111 137 398 | f 135 125 109 399 | f 137 112 138 400 | f 110 114 115 401 | f 111 115 116 402 | f 109 113 114 403 | f 113 117 118 404 | f 114 118 119 405 | f 115 119 120 406 | f 117 121 122 407 | f 118 122 123 408 | f 119 123 124 409 | f 121 126 127 410 | f 122 127 128 411 | f 123 128 129 412 | f 127 126 131 413 | f 127 132 133 414 | f 129 128 133 415 | f 132 131 135 416 | f 132 136 137 417 | f 133 137 138 418 | f 136 135 109 419 | f 136 110 111 420 | f 137 111 112 421 | o Sphere.003 422 | v 0.643381 0.904048 1.058318 423 | v 0.643381 0.846289 1.016354 424 | v 0.643381 0.774896 1.016354 425 | v 0.643381 0.717137 1.058318 426 | v 0.696466 0.904048 1.083883 427 | v 0.729275 0.846289 1.057719 428 | v 0.729275 0.774896 1.057719 429 | v 0.696466 0.717137 1.083883 430 | v 0.709578 0.904048 1.141326 431 | v 0.750489 0.846289 1.150664 432 | v 0.750489 0.774896 1.150664 433 | v 0.709578 0.717137 1.141326 434 | v 0.672841 0.904048 1.187392 435 | v 0.691049 0.846289 1.225201 436 | v 0.691049 0.774896 1.225201 437 | v 0.672841 0.717137 1.187392 438 | v 0.643381 0.926109 1.126217 439 | v 0.613920 0.904048 1.187392 440 | v 0.595713 0.846289 1.225201 441 | v 0.595713 0.774896 1.225201 442 | v 0.613920 0.717137 1.187392 443 | v 0.643381 0.695075 1.126217 444 | v 0.577184 0.904048 1.141326 445 | v 0.536272 0.846289 1.150664 446 | v 0.536272 0.774896 1.150664 447 | v 0.577184 0.717137 1.141326 448 | v 0.590295 0.904048 1.083883 449 | v 0.557486 0.846289 1.057719 450 | v 0.557486 0.774896 1.057719 451 | v 0.590295 0.717137 1.083883 452 | g Sphere.003_Sphere.003_Material.005 453 | usemtl Material.005 454 | s off 455 | f 160 142 146 456 | f 140 145 141 457 | f 139 155 143 458 | f 141 146 142 459 | f 139 144 140 460 | f 143 148 144 461 | f 160 146 150 462 | f 144 149 145 463 | f 143 155 147 464 | f 145 150 146 465 | f 147 152 148 466 | f 160 150 154 467 | f 148 153 149 468 | f 147 155 151 469 | f 149 154 150 470 | f 151 157 152 471 | f 160 154 159 472 | f 152 158 153 473 | f 151 155 156 474 | f 153 159 154 475 | f 157 161 162 476 | f 160 159 164 477 | f 157 163 158 478 | f 156 155 161 479 | f 159 163 164 480 | f 162 165 166 481 | f 160 164 168 482 | f 162 167 163 483 | f 161 155 165 484 | f 163 168 164 485 | f 166 139 140 486 | f 160 168 142 487 | f 166 141 167 488 | f 165 155 139 489 | f 167 142 168 490 | f 140 144 145 491 | f 141 145 146 492 | f 139 143 144 493 | f 143 147 148 494 | f 144 148 149 495 | f 145 149 150 496 | f 147 151 152 497 | f 148 152 153 498 | f 149 153 154 499 | f 151 156 157 500 | f 152 157 158 501 | f 153 158 159 502 | f 157 156 161 503 | f 157 162 163 504 | f 159 158 163 505 | f 162 161 165 506 | f 162 166 167 507 | f 163 167 168 508 | f 166 165 139 509 | f 166 140 141 510 | f 167 141 142 511 | o Cube.002 512 | v 0.127461 -0.123684 0.783712 513 | v 0.127461 -0.256695 0.751703 514 | v 0.127461 -0.168855 0.971419 515 | v 0.127461 -0.301867 0.939410 516 | v -0.127461 -0.123684 0.783712 517 | v -0.127461 -0.256695 0.751703 518 | v -0.127461 -0.168855 0.971419 519 | v -0.127461 -0.301867 0.939410 520 | v -0.325082 -0.210565 0.961381 521 | v -0.251488 -0.112197 0.985053 522 | v -0.251488 -0.067026 0.797346 523 | v -0.325082 -0.165394 0.773674 524 | v 0.240724 -0.112203 0.985052 525 | v 0.240724 -0.067032 0.797345 526 | v 0.329399 -0.151580 0.776999 527 | v 0.329399 -0.205403 0.962624 528 | v -0.376131 0.022724 1.017522 529 | v -0.285318 0.021204 1.017156 530 | v -0.285318 0.066375 0.829449 531 | v -0.376131 0.067895 0.829815 532 | v 0.287942 0.020124 1.018650 533 | v 0.287942 0.065296 0.830943 534 | v 0.381668 0.069207 0.831884 535 | v 0.389536 0.019994 1.018618 536 | g Cube.002_Cube.002_Material.003 537 | usemtl Material.003 538 | s off 539 | f 171 172 184 540 | f 172 171 175 541 | f 174 176 177 542 | f 174 173 169 543 | f 175 171 169 544 | f 172 176 174 545 | f 180 177 185 546 | f 175 178 177 547 | f 173 174 180 548 | f 175 173 179 549 | f 181 184 192 550 | f 169 182 183 551 | f 170 183 184 552 | f 169 171 181 553 | f 185 186 187 554 | f 178 186 185 555 | f 179 180 188 556 | f 178 179 187 557 | f 191 190 189 558 | f 182 190 191 559 | f 183 191 192 560 | f 181 189 190 561 | f 171 184 181 562 | f 172 175 176 563 | f 174 177 180 564 | f 174 169 170 565 | f 175 169 173 566 | f 172 174 170 567 | f 180 185 188 568 | f 175 177 176 569 | f 173 180 179 570 | f 175 179 178 571 | f 181 192 189 572 | f 169 183 170 573 | f 170 184 172 574 | f 169 181 182 575 | f 185 187 188 576 | f 178 185 177 577 | f 179 188 187 578 | f 178 187 186 579 | f 191 189 192 580 | f 182 191 183 581 | f 183 192 184 582 | f 181 190 182 583 | -------------------------------------------------------------------------------- /obj/maps/plane.obj: -------------------------------------------------------------------------------- 1 | m 000 196 173 255 255 2 | m 001 255 255 255 100 3 | m 002 179 116 122 255 4 | m 003 198 73 231 255 5 | m 004 86 81 125 255 6 | m 005 126 179 231 255 7 | m 006 231 180 162 255 8 | m 007 105 148 231 255 9 | m 008 231 160 111 255 10 | m 009 231 161 90 255 11 | m 010 147 231 139 255 12 | m 011 255 199 179 100 13 | m 012 231 88 85 100 14 | m 013 231 66 78 255 15 | m 014 198 73 231 255 16 | m 016 117 231 150 100 17 | m 017 103 79 100 100 18 | m 018 198 73 231 255 19 | m 019 103 79 231 100 20 | m 020 231 30 217 255 21 | m 021 117 231 150 100 22 | m 022 231 66 78 255 23 | m 023 231 30 217 255 24 | m 024 231 88 85 100 25 | m 025 231 161 90 255 26 | m 026 85 231 139 255 27 | m 027 255 199 179 100 28 | m 028 126 179 231 255 29 | m 029 198 73 231 255 30 | m 030 105 148 231 255 31 | m 031 231 180 162 255 32 | m 032 85 231 139 255 33 | m 033 231 160 111 255 34 | m 034 144 103 84 255 35 | m 035 179 116 122 255 36 | m 036 196 173 255 255 37 | m 037 86 81 125 255 38 | m 038 147 231 139 255 39 | o Cube.006_Cube 40 | v -11.718338 -0.958877 10.910831 41 | v -11.718338 -17.776073 10.910831 42 | v -11.718338 -0.958877 -10.910831 43 | v -11.718338 -17.776073 -10.910831 44 | v 11.718338 -0.958877 10.910831 45 | v 11.718338 -17.776073 10.910831 46 | v 11.718338 -0.958877 -10.910831 47 | v 11.718338 -17.776073 -10.910831 48 | v -11.718338 -0.958877 0.000000 49 | v 0.000000 -0.958877 -10.910831 50 | v 11.718338 -0.958877 0.000000 51 | v 0.000000 -0.958877 10.910831 52 | v 0.000000 -0.958877 0.000000 53 | g Cube.006_Cube_Material.001 54 | usemtl Material.001 55 | s off 56 | f 4 9 3 57 | f 8 10 7 58 | f 6 11 5 59 | f 2 12 1 60 | f 11 13 12 61 | f 4 8 6 62 | f 13 9 1 63 | f 10 3 9 64 | f 7 10 13 65 | f 9 2 1 66 | f 2 9 4 67 | f 10 4 3 68 | f 4 10 8 69 | f 11 8 7 70 | f 8 11 6 71 | f 12 6 5 72 | f 6 12 2 73 | f 11 12 5 74 | f 4 6 2 75 | f 13 1 12 76 | f 10 9 13 77 | f 7 13 11 78 | -------------------------------------------------------------------------------- /obj/other/XYZ.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.91.0 OBJ File: '' 2 | # www.blender.org 3 | mtllib XYZ.mtl 4 | o Cylinder 5 | v 0.000000 -0.037199 -0.030000 6 | v 0.000000 2.662802 -0.030000 7 | v 0.009271 -0.037199 -0.028532 8 | v 0.009271 2.662802 -0.028532 9 | v 0.017634 -0.037199 -0.024271 10 | v 0.017634 2.662802 -0.024271 11 | v 0.024271 -0.037199 -0.017634 12 | v 0.024271 2.662802 -0.017634 13 | v 0.028532 -0.037199 -0.009271 14 | v 0.028532 2.662802 -0.009271 15 | v 0.030000 -0.037199 0.000000 16 | v 0.030000 2.662802 0.000000 17 | v 0.028532 -0.037199 0.009271 18 | v 0.028532 2.662802 0.009271 19 | v 0.024271 -0.037199 0.017634 20 | v 0.024271 2.662802 0.017634 21 | v 0.017634 -0.037199 0.024271 22 | v 0.017634 2.662802 0.024271 23 | v 0.009271 -0.037199 0.028532 24 | v 0.009271 2.662802 0.028532 25 | v -0.000000 -0.037199 0.030000 26 | v -0.000000 2.662802 0.030000 27 | v -0.009271 -0.037199 0.028532 28 | v -0.009271 2.662802 0.028532 29 | v -0.017634 -0.037199 0.024271 30 | v -0.017634 2.662802 0.024271 31 | v -0.024271 -0.037199 0.017634 32 | v -0.024271 2.662802 0.017634 33 | v -0.028532 -0.037199 0.009271 34 | v -0.028532 2.662802 0.009271 35 | v -0.030000 -0.037199 -0.000000 36 | v -0.030000 2.662802 -0.000000 37 | v -0.028532 -0.037199 -0.009271 38 | v -0.028532 2.662802 -0.009271 39 | v -0.024271 -0.037199 -0.017634 40 | v -0.024271 2.662802 -0.017634 41 | v -0.017634 -0.037199 -0.024271 42 | v -0.017634 2.662802 -0.024271 43 | v -0.009270 -0.037199 -0.028532 44 | v -0.009270 2.662802 -0.028532 45 | g Cylinder_Cylinder_None 46 | usemtl None 47 | s off 48 | f 2 3 1 49 | f 4 5 3 50 | f 6 7 5 51 | f 8 9 7 52 | f 10 11 9 53 | f 12 13 11 54 | f 14 15 13 55 | f 16 17 15 56 | f 18 19 17 57 | f 20 21 19 58 | f 22 23 21 59 | f 24 25 23 60 | f 26 27 25 61 | f 28 29 27 62 | f 30 31 29 63 | f 32 33 31 64 | f 34 35 33 65 | f 36 37 35 66 | f 30 14 6 67 | f 38 39 37 68 | f 40 1 39 69 | f 15 31 39 70 | f 2 4 3 71 | f 4 6 5 72 | f 6 8 7 73 | f 8 10 9 74 | f 10 12 11 75 | f 12 14 13 76 | f 14 16 15 77 | f 16 18 17 78 | f 18 20 19 79 | f 20 22 21 80 | f 22 24 23 81 | f 24 26 25 82 | f 26 28 27 83 | f 28 30 29 84 | f 30 32 31 85 | f 32 34 33 86 | f 34 36 35 87 | f 36 38 37 88 | f 6 4 2 89 | f 2 40 38 90 | f 38 36 34 91 | f 34 32 30 92 | f 30 28 26 93 | f 26 24 30 94 | f 24 22 30 95 | f 22 20 18 96 | f 18 16 14 97 | f 14 12 6 98 | f 12 10 6 99 | f 10 8 6 100 | f 6 2 38 101 | f 38 34 6 102 | f 34 30 6 103 | f 22 18 14 104 | f 30 22 14 105 | f 38 40 39 106 | f 40 2 1 107 | f 39 1 3 108 | f 3 5 7 109 | f 7 9 11 110 | f 11 13 7 111 | f 13 15 7 112 | f 15 17 19 113 | f 19 21 15 114 | f 21 23 15 115 | f 23 25 27 116 | f 27 29 31 117 | f 31 33 35 118 | f 35 37 31 119 | f 37 39 31 120 | f 39 3 7 121 | f 23 27 15 122 | f 27 31 15 123 | f 39 7 15 124 | o Cylinder.001_Cylinder.002 125 | v 0.000000 -0.033146 0.030194 126 | v 0.000000 -0.033046 -2.669806 127 | v 0.009271 -0.031678 0.030194 128 | v 0.009271 -0.031578 -2.669806 129 | v 0.017634 -0.027416 0.030194 130 | v 0.017634 -0.027316 -2.669806 131 | v 0.024271 -0.020779 0.030194 132 | v 0.024271 -0.020679 -2.669806 133 | v 0.028532 -0.012416 0.030195 134 | v 0.028532 -0.012316 -2.669806 135 | v 0.030000 -0.003146 0.030195 136 | v 0.030000 -0.003046 -2.669805 137 | v 0.028532 0.006125 0.030195 138 | v 0.028532 0.006225 -2.669805 139 | v 0.024271 0.014488 0.030196 140 | v 0.024271 0.014588 -2.669805 141 | v 0.017634 0.021125 0.030196 142 | v 0.017634 0.021225 -2.669804 143 | v 0.009271 0.025386 0.030196 144 | v 0.009271 0.025486 -2.669804 145 | v -0.000000 0.026854 0.030196 146 | v -0.000000 0.026954 -2.669804 147 | v -0.009271 0.025386 0.030196 148 | v -0.009271 0.025486 -2.669804 149 | v -0.017634 0.021125 0.030196 150 | v -0.017634 0.021225 -2.669804 151 | v -0.024271 0.014488 0.030196 152 | v -0.024271 0.014588 -2.669805 153 | v -0.028532 0.006125 0.030195 154 | v -0.028532 0.006225 -2.669805 155 | v -0.030000 -0.003146 0.030195 156 | v -0.030000 -0.003046 -2.669805 157 | v -0.028532 -0.012416 0.030195 158 | v -0.028532 -0.012316 -2.669806 159 | v -0.024271 -0.020779 0.030194 160 | v -0.024271 -0.020679 -2.669806 161 | v -0.017634 -0.027416 0.030194 162 | v -0.017634 -0.027316 -2.669806 163 | v -0.009270 -0.031678 0.030194 164 | v -0.009270 -0.031578 -2.669806 165 | g Cylinder.001_Cylinder.002_None 166 | usemtl None 167 | s off 168 | f 42 43 41 169 | f 44 45 43 170 | f 46 47 45 171 | f 48 49 47 172 | f 50 51 49 173 | f 52 53 51 174 | f 54 55 53 175 | f 56 57 55 176 | f 58 59 57 177 | f 60 61 59 178 | f 62 63 61 179 | f 64 65 63 180 | f 66 67 65 181 | f 68 69 67 182 | f 70 71 69 183 | f 72 73 71 184 | f 74 75 73 185 | f 76 77 75 186 | f 70 54 46 187 | f 78 79 77 188 | f 80 41 79 189 | f 55 71 79 190 | f 42 44 43 191 | f 44 46 45 192 | f 46 48 47 193 | f 48 50 49 194 | f 50 52 51 195 | f 52 54 53 196 | f 54 56 55 197 | f 56 58 57 198 | f 58 60 59 199 | f 60 62 61 200 | f 62 64 63 201 | f 64 66 65 202 | f 66 68 67 203 | f 68 70 69 204 | f 70 72 71 205 | f 72 74 73 206 | f 74 76 75 207 | f 76 78 77 208 | f 46 44 42 209 | f 42 80 78 210 | f 78 76 74 211 | f 74 72 70 212 | f 70 68 66 213 | f 66 64 70 214 | f 64 62 70 215 | f 62 60 58 216 | f 58 56 54 217 | f 54 52 46 218 | f 52 50 46 219 | f 50 48 46 220 | f 46 42 78 221 | f 78 74 46 222 | f 74 70 46 223 | f 62 58 54 224 | f 70 62 54 225 | f 78 80 79 226 | f 80 42 41 227 | f 79 41 43 228 | f 43 45 47 229 | f 47 49 51 230 | f 51 53 47 231 | f 53 55 47 232 | f 55 57 59 233 | f 59 61 55 234 | f 61 63 55 235 | f 63 65 67 236 | f 67 69 71 237 | f 71 73 75 238 | f 75 77 71 239 | f 77 79 71 240 | f 79 43 47 241 | f 63 67 55 242 | f 67 71 55 243 | f 79 47 55 244 | o Cylinder.002_Cylinder.003 245 | v -0.030214 -0.033641 -0.001049 246 | v 2.669786 -0.033541 -0.001185 247 | v -0.030213 -0.032173 0.008222 248 | v 2.669787 -0.032073 0.008085 249 | v -0.030213 -0.027912 0.016585 250 | v 2.669787 -0.027812 0.016448 251 | v -0.030213 -0.021275 0.023222 252 | v 2.669787 -0.021175 0.023085 253 | v -0.030213 -0.012912 0.027483 254 | v 2.669787 -0.012812 0.027346 255 | v -0.030213 -0.003641 0.028951 256 | v 2.669787 -0.003541 0.028815 257 | v -0.030214 0.005629 0.027483 258 | v 2.669786 0.005729 0.027346 259 | v -0.030214 0.013992 0.023222 260 | v 2.669786 0.014092 0.023085 261 | v -0.030215 0.020629 0.016585 262 | v 2.669785 0.020729 0.016448 263 | v -0.030215 0.024891 0.008222 264 | v 2.669785 0.024991 0.008085 265 | v -0.030216 0.026359 -0.001049 266 | v 2.669784 0.026459 -0.001185 267 | v -0.030216 0.024891 -0.010319 268 | v 2.669784 0.024991 -0.010456 269 | v -0.030216 0.020629 -0.018682 270 | v 2.669784 0.020729 -0.018819 271 | v -0.030217 0.013992 -0.025319 272 | v 2.669784 0.014092 -0.025456 273 | v -0.030216 0.005629 -0.029581 274 | v 2.669784 0.005729 -0.029717 275 | v -0.030216 -0.003641 -0.031049 276 | v 2.669784 -0.003541 -0.031186 277 | v -0.030216 -0.012912 -0.029581 278 | v 2.669784 -0.012812 -0.029717 279 | v -0.030215 -0.021275 -0.025319 280 | v 2.669785 -0.021175 -0.025456 281 | v -0.030215 -0.027912 -0.018682 282 | v 2.669785 -0.027812 -0.018819 283 | v -0.030214 -0.032173 -0.010319 284 | v 2.669786 -0.032073 -0.010456 285 | g Cylinder.002_Cylinder.003_None 286 | usemtl None 287 | s off 288 | f 82 83 81 289 | f 84 85 83 290 | f 86 87 85 291 | f 88 89 87 292 | f 90 91 89 293 | f 92 93 91 294 | f 94 95 93 295 | f 96 97 95 296 | f 98 99 97 297 | f 100 101 99 298 | f 102 103 101 299 | f 104 105 103 300 | f 106 107 105 301 | f 108 109 107 302 | f 110 111 109 303 | f 112 113 111 304 | f 114 115 113 305 | f 116 117 115 306 | f 110 94 86 307 | f 118 119 117 308 | f 120 81 119 309 | f 95 111 119 310 | f 82 84 83 311 | f 84 86 85 312 | f 86 88 87 313 | f 88 90 89 314 | f 90 92 91 315 | f 92 94 93 316 | f 94 96 95 317 | f 96 98 97 318 | f 98 100 99 319 | f 100 102 101 320 | f 102 104 103 321 | f 104 106 105 322 | f 106 108 107 323 | f 108 110 109 324 | f 110 112 111 325 | f 112 114 113 326 | f 114 116 115 327 | f 116 118 117 328 | f 86 84 82 329 | f 82 120 118 330 | f 118 116 114 331 | f 114 112 110 332 | f 110 108 106 333 | f 106 104 110 334 | f 104 102 110 335 | f 102 100 98 336 | f 98 96 94 337 | f 94 92 86 338 | f 92 90 86 339 | f 90 88 86 340 | f 86 82 118 341 | f 118 114 86 342 | f 114 110 86 343 | f 102 98 94 344 | f 110 102 94 345 | f 118 120 119 346 | f 120 82 81 347 | f 119 81 83 348 | f 83 85 87 349 | f 87 89 91 350 | f 91 93 87 351 | f 93 95 87 352 | f 95 97 99 353 | f 99 101 95 354 | f 101 103 95 355 | f 103 105 107 356 | f 107 109 111 357 | f 111 113 115 358 | f 115 117 111 359 | f 117 119 111 360 | f 119 83 87 361 | f 103 107 95 362 | f 107 111 95 363 | f 119 87 95 364 | o Cone 365 | v 0.000000 2.214305 -0.193550 366 | v 0.078724 2.214305 -0.176817 367 | v 0.143836 2.214305 -0.129510 368 | v 0.184077 2.214305 -0.059810 369 | v 0.192490 2.214305 0.020232 370 | v 0.167619 2.214305 0.096775 371 | v 0.113766 2.214305 0.156586 372 | v 0.040241 2.214305 0.189321 373 | v -0.040241 2.214305 0.189321 374 | v -0.113766 2.214305 0.156586 375 | v -0.167620 2.214305 0.096775 376 | v -0.192490 2.214305 0.020231 377 | v -0.184077 2.214305 -0.059810 378 | v -0.143836 2.214305 -0.129510 379 | v -0.078724 2.214305 -0.176817 380 | v 0.000000 2.789091 0.000000 381 | g Cone_Cone_None 382 | usemtl None 383 | s off 384 | f 121 136 122 385 | f 122 136 123 386 | f 123 136 124 387 | f 124 136 125 388 | f 125 136 126 389 | f 126 136 127 390 | f 127 136 128 391 | f 128 136 129 392 | f 129 136 130 393 | f 130 136 131 394 | f 131 136 132 395 | f 132 136 133 396 | f 133 136 134 397 | f 132 134 126 398 | f 134 136 135 399 | f 135 136 121 400 | f 135 121 134 401 | f 121 122 134 402 | f 122 123 124 403 | f 124 125 126 404 | f 126 127 128 405 | f 128 129 126 406 | f 129 130 126 407 | f 130 131 132 408 | f 132 133 134 409 | f 122 124 134 410 | f 124 126 134 411 | f 130 132 126 412 | o Cone.001 413 | v 0.000000 -0.183155 -2.218309 414 | v 0.078724 -0.166422 -2.218311 415 | v 0.143836 -0.119116 -2.218315 416 | v 0.184077 -0.049415 -2.218320 417 | v 0.192490 0.030626 -2.218327 418 | v 0.167619 0.107170 -2.218333 419 | v 0.113766 0.166980 -2.218338 420 | v 0.040241 0.199716 -2.218341 421 | v -0.040241 0.199716 -2.218341 422 | v -0.113766 0.166980 -2.218338 423 | v -0.167620 0.107170 -2.218333 424 | v -0.192490 0.030626 -2.218327 425 | v -0.184077 -0.049415 -2.218320 426 | v -0.143836 -0.119116 -2.218315 427 | v -0.078724 -0.166422 -2.218311 428 | v 0.000000 0.010348 -2.793111 429 | g Cone.001_Cone.001_None 430 | usemtl None 431 | s off 432 | f 137 152 138 433 | f 138 152 139 434 | f 139 152 140 435 | f 140 152 141 436 | f 141 152 142 437 | f 142 152 143 438 | f 143 152 144 439 | f 144 152 145 440 | f 145 152 146 441 | f 146 152 147 442 | f 147 152 148 443 | f 148 152 149 444 | f 149 152 150 445 | f 148 150 142 446 | f 150 152 151 447 | f 151 152 137 448 | f 151 137 150 449 | f 137 138 150 450 | f 138 139 140 451 | f 140 141 142 452 | f 142 143 144 453 | f 144 145 142 454 | f 145 146 142 455 | f 146 147 148 456 | f 148 149 150 457 | f 138 140 150 458 | f 140 142 150 459 | f 146 148 142 460 | o Cone.002 461 | v 2.200030 -0.000605 -0.193550 462 | v 2.200028 -0.079329 -0.176817 463 | v 2.200026 -0.144441 -0.129510 464 | v 2.200025 -0.184683 -0.059810 465 | v 2.200024 -0.193096 0.020232 466 | v 2.200025 -0.168225 0.096775 467 | v 2.200027 -0.114371 0.156586 468 | v 2.200029 -0.040847 0.189321 469 | v 2.200032 0.039636 0.189321 470 | v 2.200034 0.113161 0.156586 471 | v 2.200036 0.167014 0.096775 472 | v 2.200036 0.191885 0.020231 473 | v 2.200036 0.183472 -0.059810 474 | v 2.200035 0.143230 -0.129510 475 | v 2.200033 0.078119 -0.176817 476 | v 2.774816 -0.000623 0.000000 477 | g Cone.002_Cone.002_None 478 | usemtl None 479 | s off 480 | f 153 168 154 481 | f 154 168 155 482 | f 155 168 156 483 | f 156 168 157 484 | f 157 168 158 485 | f 158 168 159 486 | f 159 168 160 487 | f 160 168 161 488 | f 161 168 162 489 | f 162 168 163 490 | f 163 168 164 491 | f 164 168 165 492 | f 165 168 166 493 | f 164 166 158 494 | f 166 168 167 495 | f 167 168 153 496 | f 167 153 166 497 | f 153 154 166 498 | f 154 155 156 499 | f 156 157 158 500 | f 158 159 160 501 | f 160 161 158 502 | f 161 162 158 503 | f 162 163 164 504 | f 164 165 166 505 | f 154 156 166 506 | f 156 158 166 507 | f 162 164 158 508 | -------------------------------------------------------------------------------- /obj/other/cube.obj: -------------------------------------------------------------------------------- 1 | v 1.000000 -1.000000 -1.000000 2 | v 1.000000 -1.000000 1.000000 3 | v -1.000000 -1.000000 1.000000 4 | v -1.000000 -1.000000 -1.000000 5 | v 1.000000 1.000000 -0.999999 6 | v 0.999999 1.000000 1.000001 7 | v -1.000000 1.000000 1.000000 8 | v -1.000000 1.000000 -1.000000 9 | s off 10 | f 2 4 1 11 | f 8 6 5 12 | f 5 2 1 13 | f 6 3 2 14 | f 3 8 4 15 | f 1 8 5 16 | f 2 3 4 17 | f 8 7 6 18 | f 5 6 2 19 | f 6 7 3 20 | f 3 7 8 21 | f 1 4 8 22 | -------------------------------------------------------------------------------- /obj/other/sphere.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.91.0 OBJ File: '' 2 | # www.blender.org 3 | mtllib sphere.mtl 4 | o Sphere 5 | v 0.000000 -0.500000 -0.866025 6 | v 0.000000 -0.866025 -0.500000 7 | v -0.000000 1.000000 -0.000000 8 | v 0.293893 0.866025 -0.404509 9 | v 0.509037 0.500000 -0.700629 10 | v 0.587785 -0.000000 -0.809017 11 | v 0.509037 -0.500000 -0.700629 12 | v 0.293893 -0.866025 -0.404509 13 | v 0.475528 0.866025 -0.154509 14 | v 0.823639 0.500000 -0.267617 15 | v 0.951056 -0.000000 -0.309017 16 | v 0.823639 -0.500000 -0.267617 17 | v 0.475528 -0.866025 -0.154509 18 | v 0.475528 0.866025 0.154508 19 | v 0.823639 0.500000 0.267616 20 | v 0.951056 -0.000000 0.309017 21 | v 0.823639 -0.500000 0.267616 22 | v 0.475528 -0.866025 0.154508 23 | v 0.293893 0.866025 0.404508 24 | v 0.509037 0.500000 0.700629 25 | v 0.587785 -0.000000 0.809017 26 | v 0.509037 -0.500000 0.700629 27 | v 0.293893 -0.866025 0.404508 28 | v 0.000000 0.866025 0.500000 29 | v 0.000000 0.500000 0.866025 30 | v -0.000000 -0.000000 1.000000 31 | v -0.000000 -0.500000 0.866025 32 | v 0.000000 -0.866025 0.500000 33 | v -0.293893 0.866025 0.404508 34 | v -0.509037 0.500000 0.700629 35 | v -0.587785 -0.000000 0.809017 36 | v -0.509037 -0.500000 0.700629 37 | v -0.293893 -0.866025 0.404508 38 | v 0.000000 -1.000000 -0.000000 39 | v -0.475528 0.866025 0.154508 40 | v -0.823639 0.500000 0.267616 41 | v -0.951056 -0.000000 0.309017 42 | v -0.823639 -0.500000 0.267616 43 | v -0.475528 -0.866025 0.154508 44 | v -0.475528 0.866025 -0.154509 45 | v -0.823639 0.500000 -0.267617 46 | v -0.951056 -0.000000 -0.309017 47 | v -0.823639 -0.500000 -0.267617 48 | v -0.475528 -0.866025 -0.154509 49 | v -0.293893 0.866025 -0.404508 50 | v -0.509037 0.500000 -0.700629 51 | v -0.587785 -0.000000 -0.809017 52 | v -0.509037 -0.500000 -0.700629 53 | v -0.293893 -0.866025 -0.404509 54 | v -0.000000 0.866025 -0.500000 55 | v -0.000000 0.500000 -0.866025 56 | v -0.000000 -0.000000 -1.000000 57 | g Sphere_Sphere_None 58 | usemtl None 59 | s off 60 | f 1 8 2 61 | f 51 6 52 62 | f 50 3 4 63 | f 34 2 8 64 | f 1 6 7 65 | f 50 5 51 66 | f 4 3 9 67 | f 34 8 13 68 | f 6 12 7 69 | f 5 9 10 70 | f 7 13 8 71 | f 6 10 11 72 | f 34 13 18 73 | f 11 17 12 74 | f 9 15 10 75 | f 12 18 13 76 | f 11 15 16 77 | f 9 3 14 78 | f 34 18 23 79 | f 17 21 22 80 | f 15 19 20 81 | f 17 23 18 82 | f 16 20 21 83 | f 14 3 19 84 | f 34 23 28 85 | f 21 27 22 86 | f 19 25 20 87 | f 22 28 23 88 | f 20 26 21 89 | f 19 3 24 90 | f 26 32 27 91 | f 24 30 25 92 | f 28 32 33 93 | f 25 31 26 94 | f 24 3 29 95 | f 34 28 33 96 | f 29 36 30 97 | f 32 39 33 98 | f 30 37 31 99 | f 29 3 35 100 | f 34 33 39 101 | f 31 38 32 102 | f 38 44 39 103 | f 36 42 37 104 | f 35 3 40 105 | f 34 39 44 106 | f 38 42 43 107 | f 36 40 41 108 | f 43 49 44 109 | f 41 47 42 110 | f 40 3 45 111 | f 34 44 49 112 | f 43 47 48 113 | f 41 45 46 114 | f 48 2 49 115 | f 46 52 47 116 | f 45 3 50 117 | f 34 49 2 118 | f 48 52 1 119 | f 46 50 51 120 | f 1 7 8 121 | f 51 5 6 122 | f 1 52 6 123 | f 50 4 5 124 | f 6 11 12 125 | f 5 4 9 126 | f 7 12 13 127 | f 6 5 10 128 | f 11 16 17 129 | f 9 14 15 130 | f 12 17 18 131 | f 11 10 15 132 | f 17 16 21 133 | f 15 14 19 134 | f 17 22 23 135 | f 16 15 20 136 | f 21 26 27 137 | f 19 24 25 138 | f 22 27 28 139 | f 20 25 26 140 | f 26 31 32 141 | f 24 29 30 142 | f 28 27 32 143 | f 25 30 31 144 | f 29 35 36 145 | f 32 38 39 146 | f 30 36 37 147 | f 31 37 38 148 | f 38 43 44 149 | f 36 41 42 150 | f 38 37 42 151 | f 36 35 40 152 | f 43 48 49 153 | f 41 46 47 154 | f 43 42 47 155 | f 41 40 45 156 | f 48 1 2 157 | f 46 51 52 158 | f 48 47 52 159 | f 46 45 50 160 | -------------------------------------------------------------------------------- /obj/other/vector.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.91.0 OBJ File: '' 2 | # www.blender.org 3 | mtllib vector.mtl 4 | o Cylinder.002_Cylinder.003 5 | v 2.669786 -0.033541 -0.001185 6 | v -0.030213 -0.032173 0.008222 7 | v -0.030214 -0.033641 -0.001049 8 | v 2.669787 -0.032073 0.008085 9 | v -0.030213 -0.027912 0.016585 10 | v 2.669787 -0.027812 0.016448 11 | v -0.030213 -0.021275 0.023222 12 | v 2.669787 -0.021175 0.023085 13 | v -0.030213 -0.012912 0.027483 14 | v 2.669787 -0.012812 0.027346 15 | v -0.030213 -0.003641 0.028951 16 | v 2.669787 -0.003541 0.028815 17 | v -0.030214 0.005629 0.027483 18 | v 2.669786 0.005729 0.027346 19 | v -0.030214 0.013992 0.023222 20 | v 2.669786 0.014092 0.023085 21 | v -0.030215 0.020629 0.016585 22 | v 2.669785 0.020729 0.016448 23 | v -0.030215 0.024891 0.008222 24 | v 2.669785 0.024991 0.008085 25 | v -0.030216 0.026359 -0.001049 26 | v 2.669784 0.026459 -0.001185 27 | v -0.030216 0.024891 -0.010319 28 | v 2.669784 0.024991 -0.010456 29 | v -0.030216 0.020629 -0.018682 30 | v 2.669784 0.020729 -0.018819 31 | v -0.030217 0.013992 -0.025319 32 | v 2.669784 0.014092 -0.025456 33 | v -0.030216 0.005629 -0.029581 34 | v 2.669784 0.005729 -0.029717 35 | v -0.030216 -0.003641 -0.031049 36 | v 2.669784 -0.003541 -0.031186 37 | v -0.030216 -0.012912 -0.029581 38 | v 2.669784 -0.012812 -0.029717 39 | v -0.030215 -0.021275 -0.025319 40 | v 2.669785 -0.021175 -0.025456 41 | v -0.030215 -0.027912 -0.018682 42 | v 2.669785 -0.027812 -0.018819 43 | v -0.030214 -0.032173 -0.010319 44 | v 2.669786 -0.032073 -0.010456 45 | g Cylinder.002_Cylinder.003_Cylinder.002_Cylinder.003_None 46 | usemtl None 47 | s off 48 | f 1 2 3 49 | f 4 5 2 50 | f 6 7 5 51 | f 8 9 7 52 | f 10 11 9 53 | f 12 13 11 54 | f 14 15 13 55 | f 16 17 15 56 | f 18 19 17 57 | f 20 21 19 58 | f 22 23 21 59 | f 24 25 23 60 | f 26 27 25 61 | f 28 29 27 62 | f 30 31 29 63 | f 32 33 31 64 | f 34 35 33 65 | f 36 37 35 66 | f 30 14 6 67 | f 38 39 37 68 | f 40 3 39 69 | f 15 31 39 70 | f 1 4 2 71 | f 4 6 5 72 | f 6 8 7 73 | f 8 10 9 74 | f 10 12 11 75 | f 12 14 13 76 | f 14 16 15 77 | f 16 18 17 78 | f 18 20 19 79 | f 20 22 21 80 | f 22 24 23 81 | f 24 26 25 82 | f 26 28 27 83 | f 28 30 29 84 | f 30 32 31 85 | f 32 34 33 86 | f 34 36 35 87 | f 36 38 37 88 | f 6 4 1 89 | f 1 40 38 90 | f 38 36 34 91 | f 34 32 30 92 | f 30 28 26 93 | f 26 24 30 94 | f 24 22 30 95 | f 22 20 18 96 | f 18 16 14 97 | f 14 12 6 98 | f 12 10 6 99 | f 10 8 6 100 | f 6 1 38 101 | f 38 34 6 102 | f 34 30 6 103 | f 22 18 14 104 | f 30 22 14 105 | f 38 40 39 106 | f 40 1 3 107 | f 39 3 2 108 | f 2 5 7 109 | f 7 9 11 110 | f 11 13 7 111 | f 13 15 7 112 | f 15 17 19 113 | f 19 21 15 114 | f 21 23 15 115 | f 23 25 27 116 | f 27 29 31 117 | f 31 33 35 118 | f 35 37 31 119 | f 37 39 31 120 | f 39 2 7 121 | f 23 27 15 122 | f 27 31 15 123 | f 39 7 15 124 | o Cone.002 125 | v 2.200030 -0.000605 -0.193550 126 | v 2.774816 -0.000623 -0.000000 127 | v 2.200028 -0.079329 -0.176817 128 | v 2.200026 -0.144441 -0.129510 129 | v 2.200025 -0.184683 -0.059810 130 | v 2.200024 -0.193096 0.020232 131 | v 2.200025 -0.168225 0.096775 132 | v 2.200027 -0.114371 0.156586 133 | v 2.200029 -0.040847 0.189321 134 | v 2.200032 0.039636 0.189321 135 | v 2.200034 0.113161 0.156586 136 | v 2.200036 0.167014 0.096775 137 | v 2.200036 0.191885 0.020231 138 | v 2.200036 0.183472 -0.059810 139 | v 2.200035 0.143230 -0.129510 140 | v 2.200033 0.078119 -0.176817 141 | g Cone.002_Cone.002_None 142 | usemtl None 143 | s off 144 | f 41 42 43 145 | f 43 42 44 146 | f 44 42 45 147 | f 45 42 46 148 | f 46 42 47 149 | f 47 42 48 150 | f 48 42 49 151 | f 49 42 50 152 | f 50 42 51 153 | f 51 42 52 154 | f 52 42 53 155 | f 53 42 54 156 | f 54 42 55 157 | f 53 55 47 158 | f 55 42 56 159 | f 56 42 41 160 | f 56 41 55 161 | f 41 43 55 162 | f 43 44 45 163 | f 45 46 47 164 | f 47 48 49 165 | f 49 50 47 166 | f 50 51 47 167 | f 51 52 53 168 | f 53 54 55 169 | f 43 45 55 170 | f 45 47 55 171 | f 51 53 47 172 | -------------------------------------------------------------------------------- /player/Player.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 14.03.2021. 3 | // 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "Player.h" 13 | 14 | Player::Player(ObjectNameTag name, const std::string &filename, const Vec3D &scale) : RigidBody(std::move(name), filename, scale) { 15 | setAcceleration(Vec3D{0, -ShooterConsts::GRAVITY, 0}); 16 | setCollision(true); 17 | setVisible(false); 18 | setColor(sf::Color(0,0,0)); 19 | 20 | setCollisionCallBack([this](const ObjectNameTag &tag, std::shared_ptr obj) { collisionWithObject(tag, obj); }); 21 | } 22 | 23 | void Player::rotateWeaponsRelativePoint(const Vec3D &point4D, const Vec3D &v, double val) { 24 | for (auto &weapon : _weapons) { 25 | weapon->rotateRelativePoint(point4D, v, val); 26 | } 27 | } 28 | 29 | void Player::collisionWithObject(const ObjectNameTag &tag, std::shared_ptr obj) { 30 | if (tag.str().find("Bonus_gun") != std::string::npos) { 31 | addWeapon(std::make_shared()); 32 | } 33 | 34 | if (tag.str().find("Bonus_shotgun") != std::string::npos) { 35 | addWeapon(std::make_shared()); 36 | } 37 | 38 | if (tag.str().find("Bonus_ak47") != std::string::npos) { 39 | addWeapon(std::make_shared()); 40 | } 41 | 42 | if (tag.str().find("Bonus_gold_ak47") != std::string::npos) { 43 | addWeapon(std::make_shared()); 44 | } 45 | 46 | if (tag.str().find("Bonus_rifle") != std::string::npos) { 47 | addWeapon(std::make_shared()); 48 | } 49 | 50 | if (tag.str().find("Bonus_hill") != std::string::npos) { 51 | setFullHealth(); 52 | } 53 | 54 | if (tag.str().find("Bonus_ability") != std::string::npos) { 55 | setFullAbility(); 56 | } 57 | 58 | if (tag.str().find("Bonus") != std::string::npos) { 59 | EventHandler::call(Event("take_bonus"), tag.str()); 60 | } 61 | } 62 | 63 | void Player::addWeapon(std::shared_ptr weapon) { 64 | SoundController::loadAndPlay(SoundTag("changeWeapon"), ShooterConsts::CHANGE_WEAPON_SOUND); 65 | 66 | for (auto &w : _weapons) { 67 | if (w->name() == weapon->name()) { 68 | w->addAPack(); 69 | return; 70 | } 71 | } 72 | 73 | _weapons.push_back(weapon); 74 | attach(weapon); 75 | 76 | _weapons.back()->translate(position()); 77 | _weapons.back()->rotateRelativePoint(position() + Vec3D{0, 1.8, 0}, Vec3D{0, 1, 0}, angle().y()); 78 | _weapons.back()->rotateRelativePoint(position() + Vec3D{0, 1.8, 0}, left(), headAngle()); 79 | } 80 | 81 | void Player::reInitWeapons() { 82 | 83 | if (!_weapons.empty()) { 84 | for (auto weapon : _weapons) { 85 | unattach(ObjectNameTag(weapon->name())); 86 | } 87 | 88 | EventHandler::call)>(Event("remove_weapon"), 89 | _weapons[_selectedWeapon]); 90 | 91 | _weapons.clear(); 92 | } 93 | 94 | _selectedWeapon = 0; 95 | addWeapon(std::make_shared()); 96 | 97 | EventHandler::call)>(Event("add_weapon"), 98 | _weapons[_selectedWeapon]); 99 | } 100 | 101 | void Player::selectNextWeapon() { 102 | if (_weapons.size() > 1) { 103 | // change '_selectedWeapon' 104 | EventHandler::call)>(Event("remove_weapon"), 105 | _weapons[_selectedWeapon]); 106 | 107 | _selectedWeapon = (_selectedWeapon + 1) % _weapons.size(); 108 | 109 | EventHandler::call)>(Event("add_weapon"), 110 | _weapons[_selectedWeapon]); 111 | 112 | Log::log("selectedWeapon " + std::to_string(_selectedWeapon)); 113 | SoundController::loadAndPlay(SoundTag("changeWeapon"), ShooterConsts::CHANGE_WEAPON_SOUND); 114 | selectWeaponAnimation(); 115 | } 116 | 117 | } 118 | 119 | void Player::selectPreviousWeapon() { 120 | if (_weapons.size() > 1) { 121 | // change '_selectedWeapon' 122 | EventHandler::call)>(Event("remove_weapon"), 123 | _weapons[_selectedWeapon]); 124 | 125 | if (_selectedWeapon > 0) { 126 | _selectedWeapon = (_selectedWeapon - 1) % _weapons.size(); 127 | } else { 128 | _selectedWeapon = _weapons.size() - 1; 129 | } 130 | 131 | EventHandler::call)>(Event("add_weapon"), 132 | _weapons[_selectedWeapon]); 133 | 134 | Log::log("selectedWeapon " + std::to_string(_selectedWeapon)); 135 | SoundController::loadAndPlay(SoundTag("changeWeapon"), ShooterConsts::CHANGE_WEAPON_SOUND); 136 | selectWeaponAnimation(); 137 | } 138 | } 139 | 140 | bool Player::fire() { 141 | auto camera = attached(ObjectNameTag("Camera")); 142 | if (camera != nullptr) { 143 | auto fireInfo = _weapons[_selectedWeapon]->fire(_rayCastFunction, camera->position(), camera->lookAt()); 144 | for (auto&[damagedPlayerName, damage] : fireInfo.damagedPlayers) { 145 | sf::Uint16 targetId = std::stoi(damagedPlayerName.str().substr(6)); 146 | EventHandler::call(Event("damage_player"), targetId, damage); 147 | } 148 | return fireInfo.shot; 149 | } 150 | return false; 151 | } 152 | 153 | void Player::reload() { 154 | _weapons[_selectedWeapon]->reload(); 155 | } 156 | 157 | void Player::setFullHealth() { 158 | _health = ShooterConsts::HEALTH_MAX; 159 | SoundController::loadAndPlay(SoundTag("addHealth"), ShooterConsts::RESTORE_HEALTH_SOUND); 160 | } 161 | 162 | void Player::setFullAbility() { 163 | _ability = ShooterConsts::ABILITY_MAX; 164 | SoundController::loadAndPlay(SoundTag("addAbility"), ShooterConsts::RESTORE_ABILITY_SOUND); 165 | } 166 | 167 | void Player::selectWeaponAnimation() { 168 | Timeline::addAnimation(AnimationListTag("select_weapon"), 169 | _weapons[_selectedWeapon], 170 | -2 * Consts::PI, 171 | 0.3, 172 | Animation::LoopOut::None, 173 | Animation::InterpolationType::Cos); 174 | } 175 | 176 | void Player::fireWeaponAnimation() { 177 | Timeline::addAnimation(AnimationListTag("fire_weapon"), 178 | _weapons[_selectedWeapon], 179 | -_weapons[_selectedWeapon]->fireDelay(), 180 | _weapons[_selectedWeapon]->fireDelay()/3, 181 | Animation::LoopOut::None, 182 | Animation::InterpolationType::Cos); 183 | Timeline::addAnimation(AnimationListTag("fire_weapon"), 0); 184 | Timeline::addAnimation(AnimationListTag("fire_weapon"), 185 | _weapons[_selectedWeapon], 186 | _weapons[_selectedWeapon]->fireDelay(), 187 | _weapons[_selectedWeapon]->fireDelay()/3, 188 | Animation::LoopOut::None, 189 | Animation::InterpolationType::Cos); 190 | } 191 | 192 | void Player::reloadWeaponAnimation() { 193 | Timeline::addAnimation(AnimationListTag("reload_weapon"), 194 | _weapons[_selectedWeapon], 195 | -2 * Consts::PI, 196 | _weapons[_selectedWeapon]->reloadTime() / 2, 197 | Animation::LoopOut::None, 198 | Animation::InterpolationType::Cos); 199 | } 200 | -------------------------------------------------------------------------------- /player/Player.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 14.03.2021. 3 | // 4 | 5 | #ifndef SHOOTER_PLAYER_H 6 | #define SHOOTER_PLAYER_H 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include "../weapon/Ak47.h" 17 | #include "../weapon/Shotgun.h" 18 | #include "../weapon/Gun.h" 19 | #include "../weapon/Gold_Ak47.h" 20 | #include "../weapon/Rifle.h" 21 | #include "../ShooterConsts.h" 22 | 23 | 24 | class Player final : public RigidBody { 25 | private: 26 | double _health = ShooterConsts::HEALTH_MAX; 27 | double _ability = ShooterConsts::ABILITY_MAX; 28 | 29 | double _headAngle = 0; 30 | 31 | int _kills = 0; 32 | int _deaths = 0; 33 | 34 | std::vector> _weapons; 35 | size_t _selectedWeapon = 0; 36 | 37 | std::string _nickName = ShooterConsts::PLAYER_NAME; 38 | 39 | std::function _rayCastFunction; 40 | 41 | void collisionWithObject(const ObjectNameTag &tag, std::shared_ptr obj); 42 | 43 | public: 44 | explicit Player(ObjectNameTag name, const std::string &filename = ShooterConsts::CUBE_OBJ, const Vec3D &scale = Vec3D{1, 1, 1}); 45 | 46 | void setHealth(double h) { _health = h; } 47 | 48 | void setAbility(double a) { _ability = a; } 49 | 50 | [[nodiscard]] double health() const { return _health; } 51 | 52 | [[nodiscard]] double ability() const { return _ability; } 53 | 54 | void setFullHealth(); 55 | 56 | void setFullAbility(); 57 | 58 | void reInitWeapons(); 59 | 60 | void addWeapon(std::shared_ptr weapon); 61 | 62 | void selectNextWeapon(); 63 | 64 | void selectPreviousWeapon(); 65 | 66 | bool fire(); 67 | 68 | void reload(); 69 | 70 | [[nodiscard]] std::shared_ptr weapon() const { return _weapons[_selectedWeapon]; } 71 | 72 | void rotateWeaponsRelativePoint(const Vec3D &point, const Vec3D &v, double val); 73 | 74 | [[nodiscard]] int kills() const { return _kills; } 75 | 76 | [[nodiscard]] int deaths() const { return _deaths; } 77 | 78 | void addKill() { _kills++; } 79 | 80 | void addDeath() { _deaths++; } 81 | 82 | void setKills(int kills) { _kills = kills; } 83 | 84 | void setDeaths(int deaths) { _deaths = deaths; } 85 | 86 | void setRayCastFunction(std::function rayCastFunction) { 87 | _rayCastFunction = std::move(rayCastFunction); 88 | } 89 | 90 | // This is for situation when you want to store the position of the head but you dont have attached camera 91 | void setHeadAngle(double a) { _headAngle = a; } 92 | 93 | [[nodiscard]] double headAngle() const { return _headAngle; }; 94 | 95 | [[nodiscard]] std::string playerNickName() const { return _nickName; } 96 | 97 | void setPlayerNickName(const std::string &name) { _nickName = name; } 98 | 99 | void selectWeaponAnimation(); 100 | 101 | void fireWeaponAnimation(); 102 | 103 | void reloadWeaponAnimation(); 104 | }; 105 | 106 | 107 | #endif //MINECRAFT_3DZAVR_PLAYER_H 108 | -------------------------------------------------------------------------------- /player/PlayerController.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 19.09.2021. 3 | // 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include "PlayerController.h" 11 | 12 | PlayerController::PlayerController(std::shared_ptr player, 13 | std::shared_ptr keyboard, 14 | std::shared_ptr mouse) : _player(player), _keyboard(keyboard), 15 | _mouse(mouse) {} 16 | 17 | void PlayerController::update() { 18 | // friction 19 | if (_player->inCollision()) { 20 | _player->setVelocity(_player->velocity() * (1.0 - Time::deltaTime() * 2)); 21 | } 22 | 23 | if (_isInSlowMo) { 24 | if (_player->ability() > 0) { 25 | _player->setAbility(_player->ability() - Time::deltaTime()); 26 | } else { 27 | _player->setAbility(0); 28 | _isInSlowMo = false; 29 | _player->setVelocity(_player->velocity() * ShooterConsts::SLOW_MO_COEFFICIENT); 30 | _player->setAcceleration( 31 | _player->acceleration() * ShooterConsts::SLOW_MO_COEFFICIENT * ShooterConsts::SLOW_MO_COEFFICIENT); 32 | SoundController::stopSound(SoundTag("slowMo")); 33 | SoundController::loadAndPlay(SoundTag("unSlowMo"), ShooterConsts::UN_SLOW_MO_SOUND); 34 | } 35 | } 36 | 37 | double coeff = _isInSlowMo ? 1.0 / ShooterConsts::SLOW_MO_COEFFICIENT : 1.0; 38 | 39 | bool inRunning_old = _inRunning; 40 | _inRunning = (Keyboard::isKeyPressed(sf::Keyboard::A) || 41 | Keyboard::isKeyPressed(sf::Keyboard::D) || 42 | Keyboard::isKeyPressed(sf::Keyboard::W) || 43 | Keyboard::isKeyPressed(sf::Keyboard::S)); 44 | 45 | std::shared_ptr camera = _player->attached(ObjectNameTag("Camera")); 46 | 47 | if(camera != nullptr) { 48 | // random motion during high speed 49 | if (!Timeline::isInAnimList(AnimationListTag("high_speed_motion"))) { 50 | double d_alpha = _player->velocity().abs()/2000*rand()/RAND_MAX; 51 | double dt = 0.12; 52 | 53 | Timeline::addAnimation(AnimationListTag("high_speed_motion"), 54 | camera, Vec3D(0, 0, d_alpha), dt, 55 | Animation::LoopOut::None, 56 | Animation::InterpolationType::Cos); 57 | Timeline::addAnimation(AnimationListTag("high_speed_motion"), 0); 58 | Timeline::addAnimation(AnimationListTag("high_speed_motion"), 59 | camera, Vec3D(0, 0, -d_alpha), dt, 60 | Animation::LoopOut::None, 61 | Animation::InterpolationType::Cos); 62 | Timeline::addAnimation(AnimationListTag("high_speed_motion"), 0); 63 | 64 | } 65 | } 66 | 67 | 68 | if (camera != nullptr && _inRunning && _player->inCollision()) { 69 | if (!Timeline::isInAnimList(AnimationListTag("camera_hor_oscil"))) { 70 | Timeline::addAnimation(AnimationListTag("camera_hor_oscil"), 71 | camera, -camera->left() / 6, 0.3, 72 | Animation::LoopOut::None, 73 | Animation::InterpolationType::Cos); 74 | Timeline::addAnimation(AnimationListTag("camera_hor_oscil"), 0); 75 | Timeline::addAnimation(AnimationListTag("camera_hor_oscil"), 76 | camera, camera->left() / 6, 0.3, 77 | Animation::LoopOut::None, 78 | Animation::InterpolationType::Cos); 79 | 80 | Timeline::addAnimation(AnimationListTag("camera_vert_oscil"), 81 | camera, -Vec3D{0, 1, 0} / 12, 0.15, 82 | Animation::LoopOut::None, 83 | Animation::InterpolationType::Cos); 84 | Timeline::addAnimation(AnimationListTag("camera_vert_oscil"), 0); 85 | Timeline::addAnimation(AnimationListTag("camera_vert_oscil"), 86 | camera, Vec3D{0, 1, 0} / 12, 0.15, 87 | Animation::LoopOut::None, 88 | Animation::InterpolationType::Cos); 89 | Timeline::addAnimation(AnimationListTag("camera_vert_oscil"), 0); 90 | Timeline::addAnimation(AnimationListTag("camera_vert_oscil"), 91 | camera, -Vec3D{0, 1, 0} / 12, 0.15, 92 | Animation::LoopOut::None, 93 | Animation::InterpolationType::Cos); 94 | Timeline::addAnimation(AnimationListTag("camera_vert_oscil"), 0); 95 | Timeline::addAnimation(AnimationListTag("camera_vert_oscil"), 96 | camera, Vec3D{0, 1, 0} / 12, 0.15, 97 | Animation::LoopOut::None, 98 | Animation::InterpolationType::Cos); 99 | 100 | Timeline::addAnimation(AnimationListTag("camera_init"), 101 | camera, _player->position() + Vec3D{0, 1.8, 0}, 102 | 0.3, 103 | Animation::LoopOut::None, 104 | Animation::InterpolationType::Cos); 105 | } 106 | } else if (camera != nullptr && inRunning_old && !_inRunning) { 107 | Timeline::deleteAnimationList(AnimationListTag("camera_hor_oscil")); 108 | Timeline::deleteAnimationList(AnimationListTag("camera_vert_oscil")); 109 | Timeline::deleteAnimationList(AnimationListTag("camera_init")); 110 | Timeline::addAnimation(AnimationListTag("camera_init"), 111 | camera, _player->position() + Vec3D{0, 1.8, 0}, 0.15, 112 | Animation::LoopOut::None, 113 | Animation::InterpolationType::Cos); 114 | } 115 | 116 | // Left and right 117 | 118 | if (Keyboard::isKeyPressed(sf::Keyboard::A)) { 119 | _player->translate(_player->left() * Time::deltaTime() * ShooterConsts::WALK_SPEED * coeff); 120 | if (_player->inCollision()) { 121 | _player->setVelocity(Vec3D{0, 0, 0}); 122 | } 123 | } 124 | if (Keyboard::isKeyPressed(sf::Keyboard::D)) { 125 | _player->translate(-_player->left() * Time::deltaTime() * ShooterConsts::WALK_SPEED * coeff); 126 | if (_player->inCollision()) { 127 | _player->setVelocity(Vec3D{0, 0, 0}); 128 | } 129 | } 130 | 131 | // Forward and backward 132 | if (Keyboard::isKeyPressed(sf::Keyboard::W)) { 133 | _player->translate(_player->lookAt() * Time::deltaTime() * ShooterConsts::WALK_SPEED * coeff); 134 | if (_player->inCollision()) { 135 | _player->setVelocity(Vec3D{0, 0, 0}); 136 | } 137 | } 138 | 139 | if (Keyboard::isKeyPressed(sf::Keyboard::S)) { 140 | _player->translate(-_player->lookAt() * Time::deltaTime() * ShooterConsts::WALK_SPEED * coeff); 141 | 142 | if (_player->inCollision()) { 143 | _player->setVelocity(Vec3D{0, 0, 0}); 144 | } 145 | } 146 | 147 | if (_player->ability() > 0 && !_isInSlowMo && Keyboard::isKeyPressed(sf::Keyboard::LShift)) { 148 | // slow mo 149 | _isInSlowMo = true; 150 | _player->setVelocity(_player->velocity() / ShooterConsts::SLOW_MO_COEFFICIENT); 151 | _player->setAcceleration(Vec3D(0, -ShooterConsts::GRAVITY / 152 | (ShooterConsts::SLOW_MO_COEFFICIENT * ShooterConsts::SLOW_MO_COEFFICIENT), 153 | 0)); 154 | SoundController::stopSound(SoundTag("unSlowMo")); 155 | SoundController::loadAndPlay(SoundTag("slowMo"), ShooterConsts::SLOW_MO_SOUND); 156 | } else if (_isInSlowMo && !Keyboard::isKeyPressed(sf::Keyboard::LShift)) { 157 | _isInSlowMo = false; 158 | _player->setVelocity(_player->velocity() * ShooterConsts::SLOW_MO_COEFFICIENT); 159 | _player->setAcceleration(Vec3D(0, -ShooterConsts::GRAVITY, 0)); 160 | SoundController::stopSound(SoundTag("slowMo")); 161 | SoundController::loadAndPlay(SoundTag("unSlowMo"), ShooterConsts::UN_SLOW_MO_SOUND); 162 | } 163 | 164 | if (Mouse::isButtonPressed(sf::Mouse::Button::Left)) { 165 | bool shot = _player->fire(); 166 | 167 | if (shot) { 168 | if (_player->weapon()->name() == ObjectNameTag("shotgun")) { 169 | _player->addVelocity(-camera->lookAt() * 30 * coeff); 170 | } 171 | } 172 | } 173 | 174 | if (Keyboard::isKeyPressed(sf::Keyboard::Space) && _player->inCollision()) { 175 | // if we just want to jump, we have to add particular speed 176 | 177 | if (!_isSliding) { 178 | _player->addVelocity(Vec3D{0, std::abs(_player->collisionNormal().y()) * 179 | sqrt(2 * -_player->acceleration().y() * ShooterConsts::JUMP_HEIGHT) * coeff, 180 | 0}); 181 | // if we want to slide, we have to add speed * 60/fps to make it independent on frame rate 182 | } else { 183 | _player->addVelocity(Vec3D{0, std::abs(_player->collisionNormal().y()) * 184 | sqrt(2 * -_player->acceleration().y() * ShooterConsts::JUMP_HEIGHT) * coeff * 185 | Time::deltaTime() * 60, 0}); 186 | } 187 | _player->translate(Vec3D{0, Time::deltaTime() * ShooterConsts::WALK_SPEED * 2 * coeff, 0}); 188 | 189 | //_player->setVelocity(Vec3D{_player->velocity().x(), sqrt(2 * -_player->acceleration().y() * ShooterConsts::JUMP_HEIGHT) * coeff,_player->velocity().z()}); 190 | _isSliding = true; 191 | } else { 192 | _isSliding = false; 193 | } 194 | 195 | // Mouse movement 196 | Vec2D displacement = _mouse->getMouseDisplacement(); 197 | 198 | _player->rotate(Vec3D{0, -displacement.x() * ShooterConsts::MOUSE_SENSITIVITY, 0}); 199 | _player->setVelocity(Matrix4x4::RotationY(-displacement.x() * ShooterConsts::MOUSE_SENSITIVITY) * _player->velocity()); 200 | 201 | double rotationLeft = displacement.y() * ShooterConsts::MOUSE_SENSITIVITY; 202 | 203 | // You can only see in range [-90 : 90] grad 204 | if (_player->headAngle() + rotationLeft > Consts::PI / 2) { 205 | rotationLeft = Consts::PI / 2 - _player->headAngle(); 206 | } 207 | if (_player->headAngle() + rotationLeft < -Consts::PI / 2) { 208 | rotationLeft = -Consts::PI / 2 - _player->headAngle(); 209 | } 210 | 211 | _player->setHeadAngle(_player->headAngle() + rotationLeft); 212 | _player->rotateWeaponsRelativePoint(_player->position() + Vec3D{0, 1.8, 0}, _player->left(), rotationLeft); 213 | 214 | if (camera != nullptr) { 215 | double lookAtAngle = camera->angleLeftUpLookAt().z(); 216 | camera->rotateLookAt(-lookAtAngle); 217 | camera->rotateLeft(_player->headAngle() - camera->angleLeftUpLookAt().x()); 218 | camera->rotateLookAt(lookAtAngle); 219 | } 220 | 221 | if (_keyboard->isKeyTapped(sf::Keyboard::Right) || _keyboard->isKeyTapped(sf::Keyboard::E)) { 222 | _player->selectNextWeapon(); 223 | } 224 | 225 | if (_keyboard->isKeyTapped(sf::Keyboard::Left) || _keyboard->isKeyTapped(sf::Keyboard::Q)) { 226 | _player->selectPreviousWeapon(); 227 | } 228 | 229 | if (Keyboard::isKeyPressed(sf::Keyboard::R)) { 230 | _player->reload(); 231 | } 232 | 233 | bool walkSoundPlayed = false; 234 | for (int k = 1; k < 7; k++) { 235 | if (SoundController::getStatus(SoundTag("walkSound_" + std::to_string(k))) == sf::Sound::Status::Playing) { 236 | walkSoundPlayed = true; 237 | } 238 | } 239 | if ((_inRunning || _player->velocity().sqrAbs() > 3) && _player->inCollision() && !walkSoundPlayed) { 240 | int soundNum = (int) ((double) rand() / RAND_MAX * 6) + 1; 241 | SoundController::loadAndPlay(SoundTag("walkSound_" + std::to_string(soundNum)), 242 | "sound/stonestep" + std::to_string(soundNum) + ".ogg"); 243 | } 244 | } 245 | -------------------------------------------------------------------------------- /player/PlayerController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 19.09.2021. 3 | // 4 | 5 | #ifndef SHOOTER_PLAYERCONTROLLER_H 6 | #define SHOOTER_PLAYERCONTROLLER_H 7 | 8 | #include 9 | #include 10 | 11 | #include "Player.h" 12 | 13 | class PlayerController final { 14 | private: 15 | std::shared_ptr _player; 16 | std::shared_ptr _keyboard; 17 | std::shared_ptr _mouse; 18 | 19 | bool _inRunning = false; 20 | bool _isSliding = false; 21 | bool _isInSlowMo = false; 22 | 23 | public: 24 | PlayerController(std::shared_ptr player, std::shared_ptr keyboard, std::shared_ptr mouse); 25 | 26 | void update(); 27 | }; 28 | 29 | 30 | #endif //SHOOTER_PLAYERCONTROLLER_H 31 | -------------------------------------------------------------------------------- /server.txt: -------------------------------------------------------------------------------- 1 | 54000 -------------------------------------------------------------------------------- /sound/backNoise.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/backNoise.ogg -------------------------------------------------------------------------------- /sound/classic_hurt.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/classic_hurt.ogg -------------------------------------------------------------------------------- /sound/click.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/click.ogg -------------------------------------------------------------------------------- /sound/fallbig.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/fallbig.ogg -------------------------------------------------------------------------------- /sound/fullAbility.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/fullAbility.ogg -------------------------------------------------------------------------------- /sound/fullHealth.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/fullHealth.ogg -------------------------------------------------------------------------------- /sound/kill.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/kill.ogg -------------------------------------------------------------------------------- /sound/slow_mo.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/slow_mo.ogg -------------------------------------------------------------------------------- /sound/stonestep1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/stonestep1.ogg -------------------------------------------------------------------------------- /sound/stonestep2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/stonestep2.ogg -------------------------------------------------------------------------------- /sound/stonestep3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/stonestep3.ogg -------------------------------------------------------------------------------- /sound/stonestep4.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/stonestep4.ogg -------------------------------------------------------------------------------- /sound/stonestep5.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/stonestep5.ogg -------------------------------------------------------------------------------- /sound/stonestep6.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/stonestep6.ogg -------------------------------------------------------------------------------- /sound/unslow_mo.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/unslow_mo.ogg -------------------------------------------------------------------------------- /sound/weapons/ak47.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/weapons/ak47.ogg -------------------------------------------------------------------------------- /sound/weapons/change_weapon.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/weapons/change_weapon.ogg -------------------------------------------------------------------------------- /sound/weapons/gun.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/weapons/gun.ogg -------------------------------------------------------------------------------- /sound/weapons/no_ammo.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/weapons/no_ammo.ogg -------------------------------------------------------------------------------- /sound/weapons/reload_ak47.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/weapons/reload_ak47.ogg -------------------------------------------------------------------------------- /sound/weapons/reload_gun.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/weapons/reload_gun.ogg -------------------------------------------------------------------------------- /sound/weapons/reload_shotgun.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/weapons/reload_shotgun.ogg -------------------------------------------------------------------------------- /sound/weapons/shotgun.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/sound/weapons/shotgun.ogg -------------------------------------------------------------------------------- /textures/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/textures/back.png -------------------------------------------------------------------------------- /textures/gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vectozavr/shooter/0db33018c5b08f32d29e9ccc71a6164a0d4952a8/textures/gui.png -------------------------------------------------------------------------------- /weapon/Ak47.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 02.06.2021. 3 | // 4 | 5 | #ifndef SHOOTER_AK47_H 6 | #define SHOOTER_AK47_H 7 | 8 | #include "Weapon.h" 9 | #include "../ShooterConsts.h" 10 | 11 | class Ak47 final : public Weapon { 12 | public: 13 | explicit Ak47() : Weapon(100, 30, 3.0, 0.1, 50, 2.0, 14 | ShooterConsts::AK47_FIRE_SOUND, ShooterConsts::AK47_RELOAD_SOUND, 15 | ObjectNameTag("ak47"), ShooterConsts::AK47_OBJ, 16 | Vec3D{3, 3, 3}, Vec3D{-2.3, 0.8, 1.8},Vec3D{0, 0, 0}) {} 17 | }; 18 | 19 | #endif //SHOOTER_3DZAVR_AK47_H 20 | -------------------------------------------------------------------------------- /weapon/Gold_Ak47.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 05.06.2021. 3 | // 4 | 5 | #ifndef SHOOTER_GOLD_AK47_H 6 | #define SHOOTER_GOLD_AK47_H 7 | 8 | #include "Weapon.h" 9 | #include "../ShooterConsts.h" 10 | 11 | class Gold_Ak47 final : public Weapon { 12 | public: 13 | explicit Gold_Ak47() : Weapon(200, 60, 1.5, 0.07, 50, 1.0, 14 | ShooterConsts::GOLD_AK47_FIRE_SOUND, 15 | ShooterConsts::GOLD_AK47_RELOAD_SOUND, ObjectNameTag("gold_ak47"), 16 | ShooterConsts::GOLD_AK47_OBJ, Vec3D{3, 3, 3}, Vec3D{-2.3, 0.8, 1.8}, 17 | Vec3D{0, 0, 0}) { 18 | } 19 | }; 20 | 21 | #endif //SHOOTER_3DZAVR_GOLD_AK47_H 22 | -------------------------------------------------------------------------------- /weapon/Gun.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 03.06.2021. 3 | // 4 | 5 | #ifndef SHOOTER_GUN_H 6 | #define SHOOTER_GUN_H 7 | 8 | #include "Weapon.h" 9 | #include "../ShooterConsts.h" 10 | 11 | class Gun final : public Weapon { 12 | public: 13 | explicit Gun() : Weapon(30, 6, 2.0, 0.3, 150, 3.0, 14 | ShooterConsts::GUN_FIRE_SOUND, ShooterConsts::GUN_RELOAD_SOUND, ObjectNameTag("gun"), 15 | ShooterConsts::GUN_OBJ, Vec3D{3, 3, 3}, 16 | Vec3D{-2.2, 1.0, 2.0}, Vec3D{0, 0, 0}) {} 17 | }; 18 | 19 | 20 | #endif //SHOOTER_3DZAVR_GUN_H 21 | -------------------------------------------------------------------------------- /weapon/Rifle.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 06.06.2021. 3 | // 4 | 5 | #ifndef SHOOTER_RIFLE_H 6 | #define SHOOTER_RIFLE_H 7 | 8 | #include "Weapon.h" 9 | #include "../ShooterConsts.h" 10 | 11 | class Rifle final : public Weapon { 12 | public: 13 | explicit Rifle() : Weapon(5, 1, 1.0, 1.0, 10000, 0.5, 14 | ShooterConsts::RIFLE_FIRE_SOUND, ShooterConsts::RIFLE_RELOAD_SOUND, 15 | ObjectNameTag("rifle"), ShooterConsts::RIFLE_OBJ, Vec3D{3, 3, 3}, 16 | Vec3D{-2.6, 1, 1.5},Vec3D{0, 0, 0}) {} 17 | }; 18 | 19 | 20 | #endif //SHOOTER_3DZAVR_RIFLE_H 21 | -------------------------------------------------------------------------------- /weapon/Shotgun.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 02.06.2021. 3 | // 4 | 5 | #ifndef SHOOTER_SHOTGUN_H 6 | #define SHOOTER_SHOTGUN_H 7 | 8 | #include "Weapon.h" 9 | #include "../ShooterConsts.h" 10 | 11 | class Shotgun final : public Weapon { 12 | public: 13 | explicit Shotgun() : Weapon(15, 1, 1.0, 1.0, 50, 5.0, ShooterConsts::SHOTGUN_FIRE_SOUND, 14 | ShooterConsts::SHOTGUN_RELOAD_SOUND, ObjectNameTag("shotgun"), 15 | ShooterConsts::SHOTGUN_OBJ, 16 | Vec3D{3, 3, 3}, Vec3D{-2.1, 0.8, 1.9}, Vec3D{0, 0, 0}) {} 17 | 18 | std::map 19 | processFire(std::function rayCastFunction, 20 | const Vec3D &position, const Vec3D &direction) const override { 21 | 22 | std::map damagedPlayers; 23 | 24 | for (int i = 0; i < 15; i++) { 25 | std::map damaged = fireABullet(rayCastFunction, position, direction); 26 | for (auto &[playerName, damage] : damaged) { 27 | damagedPlayers[playerName] += damage; 28 | } 29 | } 30 | 31 | return damagedPlayers; 32 | } 33 | }; 34 | 35 | 36 | #endif //SHOOTER_3DZAVR_SHOTGUN_H 37 | -------------------------------------------------------------------------------- /weapon/Weapon.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 01.06.2021. 3 | // 4 | 5 | #include 6 | #include 7 | 8 | #include "Weapon.h" 9 | #include "../ShooterConsts.h" 10 | 11 | using namespace std; 12 | 13 | Weapon::Weapon(int initialPack, int clipCapacity, double reloadTime, double fireDelay, double damage, double spreading, 14 | std::string fireSound, std::string reloadSound, ObjectNameTag weaponName, const std::string &objFileName, 15 | const Vec3D &s, const Vec3D &t, const Vec3D &r) : RigidBody(std::move(weaponName), objFileName), 16 | _initialPack(initialPack), _clipCapacity(clipCapacity), 17 | _reloadTime(reloadTime), _fireDelay(fireDelay), 18 | _damage(damage), _spreading(spreading), 19 | _fireSound(std::move(fireSound)), 20 | _reloadSound(std::move(reloadSound)) { 21 | _stockAmmo = _initialPack - _clipCapacity; 22 | _clipAmmo = _clipCapacity; 23 | 24 | loadObj(objFileName, s); 25 | setCollider(false); 26 | rotate(r); 27 | translate(t); 28 | } 29 | 30 | FireInformation Weapon::fire(std::function rayCastFunction, 31 | const Vec3D &position, const Vec3D &direction) { 32 | if (_clipAmmo == 0) { 33 | reload(); 34 | if (_clipAmmo == 0 && SoundController::getStatus(SoundTag("noAmmo")) != sf::Sound::Status::Playing) { 35 | SoundController::loadAndPlay(SoundTag("noAmmo"), ShooterConsts::NO_AMMO_SOUND); 36 | } 37 | } 38 | 39 | if (_clipAmmo <= 0 || std::abs(Time::time() - _lastFireTime) < _fireDelay || 40 | std::abs(Time::time() - _lastReloadTime) < _reloadTime) { 41 | return FireInformation{std::map(), false}; 42 | } 43 | 44 | _lastFireTime = Time::time(); 45 | _clipAmmo--; 46 | 47 | SoundController::loadAndPlay(SoundTag("fireSound_" + name().str()), _fireSound); 48 | Log::log("Weapon::fire (" + std::to_string(_stockAmmo) + " : " + std::to_string(_clipAmmo) + ")"); 49 | 50 | EventHandler::call(Event("fire")); 51 | 52 | return FireInformation{processFire(std::move(rayCastFunction), position, direction), true}; 53 | } 54 | 55 | void Weapon::reload() { 56 | if (_stockAmmo == 0 || std::abs(Time::time() - _lastReloadTime) < _reloadTime || _clipAmmo == _clipCapacity) { 57 | return; 58 | } 59 | if (_clipCapacity - _clipAmmo <= _stockAmmo) { 60 | _stockAmmo -= _clipCapacity - _clipAmmo; 61 | _clipAmmo = _clipCapacity; 62 | } else { 63 | _clipAmmo += _stockAmmo; 64 | _stockAmmo = 0; 65 | } 66 | 67 | SoundController::loadAndPlay(SoundTag("reloadSound_" + name().str()), _reloadSound); 68 | Log::log("Weapon::reload (" + std::to_string(_stockAmmo) + " : " + std::to_string(_clipAmmo) + ")"); 69 | _lastReloadTime = Time::time(); 70 | 71 | EventHandler::call(Event("reload_weapon")); 72 | } 73 | 74 | std::map 75 | Weapon::processFire(std::function rayCastFunction, 76 | const Vec3D &position, const Vec3D &direction) const { 77 | // Standard weapon usually fire one bullet at a time 78 | // But some types of weapon can fire several bullet at the same time (for ex. shotgun) 79 | // That's why processFire() is s virtual function 80 | return fireABullet(std::move(rayCastFunction), position, direction); 81 | } 82 | 83 | std::map 84 | Weapon::fireABullet(std::function rayCastFunction, 85 | const Vec3D &cameraPosition, const Vec3D &direction) const { 86 | std::map damagedPlayers; 87 | 88 | double spreading = _spreading * ShooterConsts::FIRE_DISTANCE / 100.0; 89 | 90 | //generate random vector 91 | Vec3D randV(spreading * (1.0 - 2.0 * static_cast(rand()) / RAND_MAX), 92 | spreading * (1.0 - 2.0 * static_cast(rand()) / RAND_MAX), 93 | spreading * (1.0 - 2.0 * static_cast(rand()) / RAND_MAX)); 94 | 95 | // damage player 96 | auto rayCast = rayCastFunction(cameraPosition, cameraPosition + direction * ShooterConsts::FIRE_DISTANCE + randV); 97 | if (rayCast.objectName.contains(ObjectNameTag("Enemy"))) { 98 | 99 | damagedPlayers[rayCast.objectName] += _damage / (1.0 + rayCast.distanceToObject); 100 | 101 | // If you hit the head the damage will be doubled 102 | if (rayCast.objectName.contains(ObjectNameTag("head"))) { 103 | damagedPlayers[rayCast.objectName] += _damage / (1.0 + rayCast.distanceToObject); 104 | } 105 | // If you hit the foot the damage will be divided by 2 106 | if (rayCast.objectName.contains(ObjectNameTag("foot"))) { 107 | damagedPlayers[rayCast.objectName] -= 0.5 * _damage / (1.0 + rayCast.distanceToObject); 108 | } 109 | } 110 | 111 | // add trace line 112 | Vec3D lineFrom = position() + model() * Vec3D(triangles().back()[0]); 113 | Vec3D lineTo = rayCast.intersected ? rayCast.pointOfIntersection : position() + 114 | direction * ShooterConsts::FIRE_DISTANCE + 115 | randV; 116 | 117 | EventHandler::call(Event("your_bullet"), lineFrom, lineTo); 118 | 119 | return damagedPlayers; 120 | } -------------------------------------------------------------------------------- /weapon/Weapon.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Иван Ильин on 01.06.2021. 3 | // 4 | 5 | #ifndef SHOOTER_WEAPON_H 6 | #define SHOOTER_WEAPON_H 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | struct FireInformation final { 20 | const std::map damagedPlayers; 21 | const bool shot; 22 | }; 23 | 24 | class Weapon : public RigidBody { 25 | private: 26 | const int _initialPack = 100; // how much ammo do you have when you find the weapon 27 | const int _clipCapacity = 30; // how much ammo can be stored in one clip 28 | int _stockAmmo; // how much ammo do you have in stock 29 | int _clipAmmo; // how much ammo do you have in current clip 30 | const double _reloadTime = 3.0; 31 | const double _fireDelay = 0.1; // time delay between fires 32 | const double _damage = 300; 33 | const double _spreading = 2.0; 34 | 35 | const std::string _fireSound; 36 | const std::string _reloadSound; 37 | 38 | double _lastFireTime = std::numeric_limits::min(); 39 | double _lastReloadTime = std::numeric_limits::min(); 40 | 41 | protected: 42 | std::map 43 | fireABullet(std::function rayCastFunction, 44 | const Vec3D &position, const Vec3D &direction) const; 45 | 46 | virtual std::map 47 | processFire(std::function rayCastFunction, 48 | const Vec3D &position, const Vec3D &direction) const; 49 | 50 | public: 51 | Weapon(int initialPack, int clipCapacity, double reloadTime, double fireDelay, double damage, double spreading, 52 | std::string fireSound, std::string reloadSound, ObjectNameTag weaponName, const std::string &objFileName, 53 | const Vec3D &s, const Vec3D &t, const Vec3D &r); 54 | 55 | FireInformation 56 | fire(std::function rayCastFunction, const Vec3D &cameraPosition, 57 | const Vec3D &direction); 58 | 59 | void reload(); 60 | [[nodiscard]] double reloadTime() const { return _reloadTime; } 61 | [[nodiscard]] double fireDelay() const { return _fireDelay; } 62 | 63 | [[nodiscard]] std::pair balance() const { return std::make_pair(_clipAmmo, _stockAmmo); } 64 | 65 | void addAPack() { _stockAmmo += initialPack(); } 66 | 67 | [[nodiscard]] int initialPack() const { return _initialPack; } 68 | }; 69 | 70 | 71 | #endif //SHOOTER_3DZAVR_WEAPON_H 72 | --------------------------------------------------------------------------------