Compare commits
No commits in common. "0db33018c5b08f32d29e9ccc71a6164a0d4952a8" and "84436771f3dc768b861da35dd881747c4b94d9e7" have entirely different histories.
0db33018c5
...
84436771f3
|
@ -1,61 +0,0 @@
|
|||
# Project exclude paths
|
||||
/cmake-build-debug/
|
||||
/cmake-build-release/
|
||||
/engine_log.txt
|
||||
.idea/
|
||||
shooter
|
||||
|
||||
# Compiled source #
|
||||
*.com
|
||||
*.class
|
||||
*.dll
|
||||
*.exe
|
||||
*.o
|
||||
*.so
|
||||
|
||||
# Packages #
|
||||
# it's better to unpack these files and commit the raw source
|
||||
# git has its own built in compression methods
|
||||
*.7z
|
||||
*.dmg
|
||||
*.gz
|
||||
*.iso
|
||||
*.jar
|
||||
*.rar
|
||||
*.tar
|
||||
*.zip
|
||||
|
||||
# Logs and databases #
|
||||
*.log
|
||||
*.sql
|
||||
*.sqlite
|
||||
|
||||
# OS generated files #
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
=======
|
||||
# Build folders
|
||||
out/
|
||||
build/
|
||||
cmake-build-*/
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
.vs/
|
||||
CMakeSettings.json
|
||||
|
||||
# CMake
|
||||
CMakeUserPresets.json
|
||||
|
||||
# MacOS
|
||||
.DS_Store
|
||||
|
||||
# Project exclude paths
|
||||
engine.log
|
||||
shooter
|
|
@ -1,3 +0,0 @@
|
|||
[submodule "3dzavr"]
|
||||
path = 3dzavr
|
||||
url = https://github.com/vectozavr/3dzavr
|
1
3dzavr
|
@ -1 +0,0 @@
|
|||
Subproject commit 3af8e6c6fb8a685647ed97054392c716423e719d
|
|
@ -1,36 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.17)
|
||||
project(shooter)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
add_executable(${CMAKE_PROJECT_NAME}
|
||||
# game:
|
||||
Source.cpp
|
||||
player/Player.cpp
|
||||
player/Player.h
|
||||
network/ShooterClient.cpp
|
||||
network/ShooterClient.h
|
||||
network/ShooterServer.cpp
|
||||
network/ShooterServer.h
|
||||
weapon/Weapon.cpp
|
||||
weapon/Weapon.h
|
||||
weapon/Ak47.h
|
||||
weapon/Shotgun.h
|
||||
weapon/Gun.h
|
||||
weapon/Gold_Ak47.h
|
||||
weapon/Rifle.h
|
||||
player/PlayerController.cpp
|
||||
player/PlayerController.h
|
||||
Shooter.cpp
|
||||
Shooter.h
|
||||
ShooterConsts.h
|
||||
network/ShooterMsgType.h
|
||||
network/ShooterMsgType.cpp
|
||||
network/Chat.cpp
|
||||
network/Chat.h
|
||||
)
|
||||
|
||||
# include 3dzavr engine into our project
|
||||
add_subdirectory(3dzavr/engine)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC 3DZAVR)
|
22
LICENSE
|
@ -1,21 +1,5 @@
|
|||
MIT License
|
||||
Copyright (C) 2024 by nakidai nakidai@noreply.localhost
|
||||
|
||||
Copyright (c) 2023 Ivan Ilin (Vectozavr)
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
|
70
README.md
|
@ -1,69 +1,3 @@
|
|||
# Shooter 3Dzavr SFML version
|
||||
# shooter_server
|
||||
|
||||
<h4>About:</h4>
|
||||
|
||||
Source code of simple shooter on [3Dzavr SFML game engine](https://github.com/vectozavr/3dzavr/tree/sfml_version)
|
||||
|
||||
![Project demonstration](img/gamePlay2.png)
|
||||
|
||||
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://choosealicense.com/licenses/mit/)
|
||||
![downloads](https://img.shields.io/github/downloads/vectozavr/shooter/total)
|
||||
[![Community Discord](https://img.shields.io/discord/788056426324426782.svg?label=discord&logo=discord)](https://discord.gg/NzSf5tyS)
|
||||
![Commits](https://img.shields.io/github/last-commit/vectozavr/shooter)
|
||||
[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/vectozavr/shooter)](https://www.tickgit.com/browse?repo=github.com/vectozavr/shooter)
|
||||
![Repo size](https://img.shields.io/github/repo-size/vectozavr/shooter)
|
||||
|
||||
<h4>Installation:</h4>
|
||||
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
|
||||
|
||||
|
||||
2) Write <b>ip</b> and <b>port</b> of server in <b>connect.txt</b> file.
|
||||
|
||||
|
||||
3) Write <b>port</b> of the server in <b>server.txt</b> file (only for computer where the server will be running).
|
||||
|
||||
|
||||
3) Enjoy gaming!
|
||||
|
||||
[<h5>Click here if you want to run the server</h3>](https://github.com/vectozavr/shooter_server)
|
||||
|
||||
<h4>Control:</h4>
|
||||
|
||||
<b>Mouse</b>, <b>Space</b>, <b>A</b>, <b>S</b>, <b>W</b>, <b>D</b> – player control.
|
||||
|
||||
<b>SHIFT</b> – slow motion (this ability is not infinite: its bar is next to hp)
|
||||
|
||||
<b>E & Q </b> or keys <b> <- -> </b> – change weapon
|
||||
|
||||
<b>R</b> – recharge
|
||||
|
||||
<b>O</b> – turn OpenGL on/off
|
||||
|
||||
<b>Tab</b> – turn debug mode on/off
|
||||
|
||||
<h4>Playing with a source code:</h4>
|
||||
|
||||
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)
|
||||
|
||||
2) Clone this repository
|
||||
|
||||
3) Open project
|
||||
|
||||
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 <b>CMakeList.txt</b> as a project
|
||||
|
||||
Using [Visual Studio](https://visualstudio.microsoft.com/ru/): open <b>shooter.sln</b> as a project
|
||||
|
||||
4) Built project and run the game
|
||||
|
||||
Structure:
|
||||
![Project demonstration](img/structure.png)
|
||||
|
||||
Online:
|
||||
![Project demonstration](img/gamePlay4.png)
|
||||
|
||||
GamePlay:
|
||||
![Project demonstration](img/gamePlay3.png)
|
||||
![Project demonstration](img/gamePlay5.png)
|
||||
![Project demonstration](img/gamePlay6.png)
|
||||
![Project demonstration](img/gamePlay7.png)
|
||||
![Project demonstration](img/opengl.png)
|
||||
More up-to-date server for shooter
|
472
Shooter.cpp
|
@ -1,472 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 22.09.2021.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <animation/Animations.h>
|
||||
#include <io/SoundController.h>
|
||||
#include <utils/EventHandler.h>
|
||||
|
||||
#include "Shooter.h"
|
||||
#include "ShooterConsts.h"
|
||||
#include "network/Chat.h"
|
||||
|
||||
// Read server/client settings and start both.
|
||||
// If client doesn't connect to the localhost - server doesn't start.
|
||||
void Shooter::initNetwork() {
|
||||
std::string clientIp;
|
||||
sf::Uint16 clientPort;
|
||||
sf::Uint16 serverPort;
|
||||
std::string playerName;
|
||||
std::ifstream connectFile("connect.txt", std::ifstream::in);
|
||||
|
||||
// If failed to read client settings
|
||||
if (!connectFile.is_open() || !(connectFile >> clientIp >> clientPort >> playerName) ||
|
||||
sf::IpAddress(clientIp) == sf::IpAddress::None) {
|
||||
connectFile.close();
|
||||
// Create file and write default settings
|
||||
clientIp = "127.0.0.1";
|
||||
clientPort = 54000;
|
||||
playerName = "PlayerName";
|
||||
std::ofstream temp("connect.txt", std::ofstream::out);
|
||||
temp << clientIp << std::endl << clientPort << std::endl << playerName;
|
||||
temp.close();
|
||||
}
|
||||
connectFile.close();
|
||||
|
||||
// If failed to read server settings
|
||||
connectFile.open("server.txt", std::ifstream::in);
|
||||
if (!connectFile.is_open() || !(connectFile >> serverPort)) {
|
||||
connectFile.close();
|
||||
// Create file and write default settings
|
||||
serverPort = 54000;
|
||||
std::ofstream temp("server.txt", std::ofstream::out);
|
||||
temp << serverPort;
|
||||
temp.close();
|
||||
}
|
||||
connectFile.close();
|
||||
|
||||
if (clientIp == sf::IpAddress::LocalHost) {
|
||||
server->start(serverPort);
|
||||
if (server->isWorking())
|
||||
server->generateBonuses();
|
||||
}
|
||||
|
||||
client->requestMap(clientIp, ¤t_map);
|
||||
client->connect(clientIp, clientPort);
|
||||
player->setPlayerNickName(playerName);
|
||||
}
|
||||
|
||||
void Shooter::start() {
|
||||
// connecting to the server
|
||||
initNetwork();
|
||||
|
||||
// This code executed once in the beginning:
|
||||
setUpdateWorld(false);
|
||||
|
||||
screen->setMouseCursorVisible(true);
|
||||
|
||||
world->loadMap(current_map, Vec3D{5, 5, 5});
|
||||
|
||||
EventHandler::listen<void(sf::Uint16)>(
|
||||
Event("spawn_player"),
|
||||
[this](sf::Uint16 targetId) {
|
||||
spawnPlayer(targetId);
|
||||
});
|
||||
EventHandler::listen<void(sf::Uint16)>(
|
||||
Event("remove_player"),
|
||||
[this](sf::Uint16 targetId) {
|
||||
removePlayer(targetId);
|
||||
});
|
||||
EventHandler::listen<void()>(Event("fire"), [this](){ player->fireWeaponAnimation(); });
|
||||
EventHandler::listen<void(const Vec3D&, const Vec3D&)>(
|
||||
Event("your_bullet"),
|
||||
[this](const Vec3D &from, const Vec3D &to) {
|
||||
addFireTrace(from, to);
|
||||
});
|
||||
EventHandler::listen<void(const Vec3D&, const Vec3D&)>(
|
||||
Event("enemy_bullet"),
|
||||
[this](const Vec3D &from, const Vec3D &to) {
|
||||
addFireTrace(from, to);
|
||||
});
|
||||
EventHandler::listen<void(std::shared_ptr<Weapon>)>(
|
||||
Event("add_weapon"),
|
||||
[this](std::shared_ptr<Weapon> weapon) {
|
||||
addWeapon(weapon);
|
||||
});
|
||||
EventHandler::listen<void(std::shared_ptr<Weapon>)>(
|
||||
Event("remove_weapon"),
|
||||
[this](std::shared_ptr<Weapon> weapon) {
|
||||
removeWeapon(weapon);
|
||||
});
|
||||
EventHandler::listen<void(const std::string&, sf::Uint16)>(
|
||||
Event("change_enemy_weapon"),
|
||||
[this](const std::string &weaponName, sf::Uint16 enemyId) {
|
||||
changeEnemyWeapon(weaponName, enemyId);
|
||||
});
|
||||
EventHandler::listen<void(const std::string&, const Vec3D&)>(
|
||||
Event("add_bonus"),
|
||||
[this](const std::string &bonusName, const Vec3D &position) { addBonus(bonusName, position); }
|
||||
);
|
||||
EventHandler::listen<void(const ObjectNameTag &)>(
|
||||
Event("remove_bonus"),
|
||||
[this](const ObjectNameTag &bonusName) { removeBonus(bonusName); }
|
||||
);
|
||||
|
||||
EventHandler::listen<void()>(Event("reload_weapon"), [this](){ player->reloadWeaponAnimation(); });
|
||||
|
||||
player->setRayCastFunction([this](const Vec3D &from, const Vec3D &to) { return world->rayCast(from, to, "Player Weapon fireTrace bulletHole"); });
|
||||
|
||||
camera->translateToPoint(player->position() + Vec3D{0, 1.8, 0});
|
||||
player->attach(camera);
|
||||
world->addBody(player);
|
||||
|
||||
// Waiting for connect and updating server if it's same window
|
||||
while (client->isWorking() && !client->connected()) {
|
||||
client->update();
|
||||
server->update();
|
||||
Time::update();
|
||||
}
|
||||
// If connect fail - return to menu
|
||||
if (!client->isWorking()) {
|
||||
inGame = false;
|
||||
server->stop();
|
||||
}
|
||||
|
||||
player->reInitWeapons();
|
||||
|
||||
// windows init:
|
||||
mainMenu.setTitle("Main menu");
|
||||
mainMenu.setBackgroundTexture(ShooterConsts::MAIN_MENU_BACK, 1.1, 1.1, screen->width(), screen->height());
|
||||
|
||||
mainMenu.addButton(screen->width() / 2, 200, 200, 20, [this]() {
|
||||
this->play();
|
||||
SoundController::loadAndPlay(SoundTag("click"), ShooterConsts::CLICK_SOUND);
|
||||
}, "Server: " + client->serverIp().toString(), 5, 5, ShooterConsts::MAIN_MENU_GUI, {0, 66}, {0, 86}, {0, 46},
|
||||
Consts::MEDIUM_FONT, {255, 255, 255});
|
||||
mainMenu.addButton(screen->width() / 2, 350, 200, 20, [this]() {
|
||||
this->player->translateToPoint(Vec3D{0, 0, 0});
|
||||
this->player->setVelocity({});
|
||||
this->play();
|
||||
SoundController::loadAndPlay(SoundTag("click"), ShooterConsts::CLICK_SOUND);
|
||||
}, "Respawn", 5, 5, ShooterConsts::MAIN_MENU_GUI, {0, 66}, {0, 86}, {0, 46}, Consts::MEDIUM_FONT, {255, 255, 255});
|
||||
|
||||
mainMenu.addButton(screen->width() / 2, 500, 200, 20, [this]() {
|
||||
client->disconnect();
|
||||
server->stop();
|
||||
this->exit();
|
||||
}, "Exit", 5, 5, ShooterConsts::MAIN_MENU_GUI, {0, 66}, {0, 86}, {0, 46}, Consts::MEDIUM_FONT, {255, 255, 255});
|
||||
|
||||
client->setChatManager(chat);
|
||||
}
|
||||
|
||||
void Shooter::update() {
|
||||
// This code executed every time step:
|
||||
server->update();
|
||||
client->update();
|
||||
|
||||
// Check all input after this condition please
|
||||
if (!screen->hasFocus()) {
|
||||
return;
|
||||
}
|
||||
if (keyboard->isKeyTapped(sf::Keyboard::Enter)) {
|
||||
if (isTypingMessage) {
|
||||
client->sendMessage(message);
|
||||
message = "";
|
||||
}
|
||||
isTypingMessage = !isTypingMessage;
|
||||
}
|
||||
if (!isTypingMessage) {
|
||||
if (keyboard->isKeyTapped(sf::Keyboard::Escape)) {
|
||||
inGame = !inGame;
|
||||
screen->setMouseCursorVisible(!inGame);
|
||||
}
|
||||
|
||||
if (keyboard->isKeyTapped(sf::Keyboard::O)) {
|
||||
setGlEnable(!glEnable());
|
||||
}
|
||||
|
||||
if (keyboard->isKeyTapped(sf::Keyboard::Tab)) {
|
||||
setDebugInfo(!showDebugInfo());
|
||||
}
|
||||
|
||||
if (keyboard->isKeyTapped(sf::Keyboard::P)) {
|
||||
screen->startRender();
|
||||
}
|
||||
|
||||
if (keyboard->isKeyTapped(sf::Keyboard::L)) {
|
||||
screen->stopRender();
|
||||
}
|
||||
}
|
||||
|
||||
if (inGame) {
|
||||
screen->setTitle(ShooterConsts::PROJECT_NAME);
|
||||
|
||||
if (isTypingMessage) {
|
||||
std::string symbols = screen->getInputSymbols();
|
||||
for (char s : symbols) {
|
||||
if (s == (char)8) { //backspace
|
||||
message = message.substr(0, message.size() - 1);
|
||||
}
|
||||
else if (s == (char)27) { //escape
|
||||
message = ""; //FIXME: не работает потому что isKeyTapped имеют задержку,
|
||||
isTypingMessage = false; //т. е. этот код выполняется после нажатия на ESC,
|
||||
} // но при следующем цикле при проверке isKeyTapped(ESC) возвращается TRUE
|
||||
else if (message.length() < ShooterConsts::MAX_MESSAGE_LENGTH && s!=(char)13) {//13=enter
|
||||
message += s;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
playerController->update();
|
||||
}
|
||||
|
||||
} else {
|
||||
mainMenu.update();
|
||||
}
|
||||
|
||||
setUpdateWorld(inGame);
|
||||
|
||||
// background sounds and music control
|
||||
if (SoundController::getStatus(SoundTag("background")) != sf::Sound::Status::Playing) {
|
||||
SoundController::loadAndPlay(SoundTag("background"), ShooterConsts::BACK_NOISE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Shooter::drawChat() {
|
||||
sf::Color chatColor = isTypingMessage? sf::Color(50, 50, 50, 255) : sf::Color(50, 50, 50, chat->update(Time::deltaTime()));
|
||||
std::string chatText = isTypingMessage ? chat->getChat() : chat->getChatPreview();
|
||||
|
||||
screen->drawText(chatText, Vec2D{ 10, (double)screen->height()*0.25 }, 20, chatColor);
|
||||
|
||||
if (isTypingMessage){
|
||||
screen->drawTetragon(
|
||||
Vec2D{ (double)screen->width() * 0.05, (double)screen->height() * 0.7},
|
||||
Vec2D{ (double)screen->width() * 0.95, (double)screen->height() * 0.7},
|
||||
Vec2D{ (double)screen->width() * 0.95, (double)screen->height() * 0.7+50 },
|
||||
Vec2D{ (double)screen->width() * 0.05, (double)screen->height() * 0.7+50 }, sf::Color(150, 150, 150, 150));
|
||||
|
||||
screen->drawText(message, Vec2D{(double)screen->width() * 0.05 + 10, (double)screen->height() * 0.7 - 30}, 30, sf::Color(0, 0, 0, 255));
|
||||
}
|
||||
}
|
||||
|
||||
void Shooter::gui() {
|
||||
sf::Sprite sprite;
|
||||
sprite.setTexture(*ResourceManager::loadTexture(ShooterConsts::MAIN_MENU_GUI));
|
||||
sprite.setTextureRect(sf::IntRect(243, 3, 9, 9));
|
||||
sprite.scale(3, 3);
|
||||
sprite.setPosition(static_cast<float>(screen->width()) / 2.0f - 27.0f / 2.0f,
|
||||
static_cast<float>(screen->height()) / 2.0f - 27.0f / 2.0f);
|
||||
sprite.setColor(sf::Color(0, 0, 0, 250));
|
||||
screen->drawSprite(sprite);
|
||||
|
||||
// health player stats
|
||||
drawPlayerStats();
|
||||
drawStatsTable();
|
||||
drawChat();
|
||||
}
|
||||
|
||||
void Shooter::drawStatsTable() {
|
||||
|
||||
int i = 1;
|
||||
|
||||
screen->drawText(client->lastEvent(), Vec2D{10, 10}, 25, sf::Color(0, 0, 0, 100));
|
||||
|
||||
std::vector<std::shared_ptr<Player>>
|
||||
allPlayers;
|
||||
allPlayers.push_back(player);
|
||||
for (auto&[playerId, player] : client->players())
|
||||
allPlayers.push_back(player);
|
||||
|
||||
std::sort(allPlayers.begin(), allPlayers.end(), [](std::shared_ptr<Player> p1, std::shared_ptr<Player> p2) {
|
||||
return p1->kills() - p1->deaths() > p2->kills() - p2->deaths();
|
||||
});
|
||||
|
||||
for (auto &p : allPlayers) {
|
||||
screen->drawText(std::to_string(i) + "\t" + p->playerNickName() + "\t" + std::to_string(p->kills()) + " / " +
|
||||
std::to_string(p->deaths()),
|
||||
Vec2D{10, 15 + 35.0 * i}, 25, p->color());
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Shooter::drawPlayerStats() {
|
||||
// health bar
|
||||
double xPos = 10;
|
||||
double yPos = screen->height() - 20;
|
||||
|
||||
int width = screen->width() / 2 - 20;
|
||||
int height = 10;
|
||||
|
||||
screen->drawTetragon(Vec2D{xPos, yPos},
|
||||
Vec2D{xPos + width * player->health() / ShooterConsts::HEALTH_MAX, yPos},
|
||||
Vec2D{xPos + width * player->health() / ShooterConsts::HEALTH_MAX, yPos + height},
|
||||
Vec2D{xPos, yPos + height},
|
||||
{static_cast<sf::Uint8>((ShooterConsts::HEALTH_MAX - player->health()) /
|
||||
ShooterConsts::HEALTH_MAX * 255),
|
||||
static_cast<sf::Uint8>(player->health() * 255 / ShooterConsts::HEALTH_MAX), 0, 100});
|
||||
|
||||
screen->drawTetragon(Vec2D{xPos, yPos - 15},
|
||||
Vec2D{xPos + width * player->ability() / ShooterConsts::ABILITY_MAX, yPos - 15},
|
||||
Vec2D{xPos + width * player->ability() / ShooterConsts::ABILITY_MAX, yPos - 15 + height},
|
||||
Vec2D{xPos, yPos - 15 + height},
|
||||
{255, 168, 168, 100});
|
||||
|
||||
auto balance = player->weapon()->balance();
|
||||
|
||||
screen->drawText(std::to_string((int) balance.first), Vec2D{150, static_cast<double>(screen->height() - 150)}, 100,
|
||||
sf::Color(0, 0, 0, 100));
|
||||
screen->drawText(std::to_string((int) balance.second), Vec2D{50, static_cast<double>(screen->height() - 100)}, 50,
|
||||
sf::Color(0, 0, 0, 70));
|
||||
}
|
||||
|
||||
void Shooter::play() {
|
||||
inGame = true;
|
||||
screen->setMouseCursorVisible(false);
|
||||
}
|
||||
|
||||
void Shooter::spawnPlayer(sf::Uint16 id) {
|
||||
std::string name = "Enemy_" + std::to_string(id);
|
||||
|
||||
std::shared_ptr<Player> newPlayer = std::make_shared<Player>(ObjectNameTag(name), ShooterConsts::BODY_OBJ, Vec3D{0.4, 0.4, 0.4});
|
||||
|
||||
client->addPlayer(id, newPlayer);
|
||||
world->addBody(newPlayer);
|
||||
newPlayer->setVisible(true);
|
||||
newPlayer->setCollision(false);
|
||||
newPlayer->setAcceleration(Vec3D{0, 0, 0});
|
||||
|
||||
// add head and other stuff:
|
||||
world->loadBody(ObjectNameTag(name + "_head"), ShooterConsts::HEAD_OBJ, Vec3D{0.4, 0.4, 0.4});
|
||||
world->body(ObjectNameTag(name + "_head"))->translate(Vec3D{0, 2.2, 0});
|
||||
newPlayer->attach(world->body(ObjectNameTag(name + "_head")));
|
||||
|
||||
world->loadBody(ObjectNameTag(name + "_foot_1"), ShooterConsts::FOOT_OBJ, Vec3D{0.4, 0.4, 0.4});
|
||||
world->body(ObjectNameTag(name + "_foot_1"))->translate(Vec3D{-0.25, 0, 0});
|
||||
newPlayer->attach(world->body(ObjectNameTag(name + "_foot_1")));
|
||||
|
||||
world->loadBody(ObjectNameTag(name + "_foot_2"), ShooterConsts::FOOT_OBJ, Vec3D{0.4, 0.4, 0.4});
|
||||
world->body(ObjectNameTag(name + "_foot_2"))->translate(Vec3D{0.25, 0, 0});
|
||||
newPlayer->attach(world->body(ObjectNameTag(name + "_foot_2")));
|
||||
|
||||
int colorBodyNum = static_cast<int> (static_cast<double>((rand() - 1)) / RAND_MAX * 5.0);
|
||||
int colorFootNum = static_cast<int> (static_cast<double>((rand() - 1)) / RAND_MAX * 5.0);
|
||||
|
||||
newPlayer->setColor(Consts::WHITE_COLORS[colorBodyNum]);
|
||||
world->body(ObjectNameTag(name + "_foot_1"))->setColor(Consts::DARK_COLORS[colorFootNum]);
|
||||
world->body(ObjectNameTag(name + "_foot_2"))->setColor(Consts::DARK_COLORS[colorFootNum]);
|
||||
|
||||
changeEnemyWeapon("gun", id);
|
||||
}
|
||||
|
||||
void Shooter::removePlayer(sf::Uint16 id) {
|
||||
std::string name = "Enemy_" + std::to_string(id);
|
||||
|
||||
auto playerToRemove = world->body(ObjectNameTag(name));
|
||||
|
||||
Timeline::addAnimation<AScale>(AnimationListTag(name + "_remove"), playerToRemove, Vec3D(0.01, 0.01, 0.01));
|
||||
Timeline::addAnimation<AFunction>(AnimationListTag(name + "_remove"), [this, name](){
|
||||
world->removeBody(ObjectNameTag(name));
|
||||
world->removeBody(ObjectNameTag(name + "_head"));
|
||||
world->removeBody(ObjectNameTag(name + "_weapon"));
|
||||
world->removeBody(ObjectNameTag(name + "_foot_1"));
|
||||
world->removeBody(ObjectNameTag(name + "_foot_2"));
|
||||
});
|
||||
}
|
||||
|
||||
void Shooter::addFireTrace(const Vec3D &from, const Vec3D &to) {
|
||||
std::string traceName = "Client_fireTrace_" + std::to_string(fireTraces++);
|
||||
world->addBody(std::make_shared<RigidBody>(Mesh::LineTo(ObjectNameTag(traceName), from, to, 0.05)));
|
||||
world->body(ObjectNameTag(traceName))->setCollider(false);
|
||||
|
||||
Timeline::addAnimation<AColor>(AnimationListTag(traceName + "_fadeOut"), world->body(ObjectNameTag(traceName)),
|
||||
sf::Color{150, 150, 150, 0});
|
||||
Timeline::addAnimation<AFunction>(AnimationListTag(traceName + "_delete"),
|
||||
[this, traceName]() { removeFireTrace(ObjectNameTag(traceName)); }, 1,
|
||||
1);
|
||||
|
||||
|
||||
std::string bulletHoleName = "Client_bulletHole_" + std::to_string(fireTraces++);
|
||||
auto bulletHole = Mesh::Cube(ObjectNameTag(bulletHoleName), 0.2, sf::Color(70, 70, 70));
|
||||
bulletHole.translate(to);
|
||||
world->addBody(std::make_shared<RigidBody>(bulletHole));
|
||||
world->body(ObjectNameTag(bulletHoleName))->setCollider(false);
|
||||
|
||||
Timeline::addAnimation<AFunction>(AnimationListTag(bulletHoleName + "_delete"),
|
||||
[this, bulletHoleName]() { removeFireTrace(ObjectNameTag(bulletHoleName)); }, 1,
|
||||
7);
|
||||
}
|
||||
|
||||
void Shooter::removeFireTrace(const ObjectNameTag &traceName) {
|
||||
world->removeBody(traceName);
|
||||
}
|
||||
|
||||
void Shooter::addBonus(const std::string &bonusName, const Vec3D &position) {
|
||||
|
||||
std::string name = bonusName.substr(6, bonusName.size() - 3 - 5);
|
||||
|
||||
ObjectNameTag nameTag(bonusName);
|
||||
|
||||
world->addBody(std::make_shared<RigidBody>(ObjectNameTag(bonusName), "obj/items/" + name + ".obj", Vec3D{3, 3, 3}));
|
||||
|
||||
auto bonus = world->body(ObjectNameTag(bonusName));
|
||||
|
||||
bonus->translateToPoint(position);
|
||||
bonus->setCollider(false);
|
||||
bonus->setTrigger(true);
|
||||
bonus->scale(Vec3D(0.01, 0.01, 0.01));
|
||||
Timeline::addAnimation<AScale>(AnimationListTag(bonusName + "_creation"), bonus, Vec3D(100, 100, 100));
|
||||
Timeline::addAnimation<ARotate>(AnimationListTag(bonusName + "_rotation"),
|
||||
bonus, Vec3D{0, 2 * Consts::PI, 0}, 4,
|
||||
Animation::LoopOut::Continue,
|
||||
Animation::InterpolationType::Linear);
|
||||
|
||||
}
|
||||
|
||||
void Shooter::removeBonus(const ObjectNameTag &bonusName) {
|
||||
world->removeBody(bonusName);
|
||||
Timeline::deleteAnimationList(AnimationListTag(bonusName.str() + "_rotation"));
|
||||
}
|
||||
|
||||
void Shooter::addWeapon(std::shared_ptr<Weapon> weapon) {
|
||||
world->addBody(weapon);
|
||||
|
||||
EventHandler::call<void(const std::string&)>(Event("change_weapon"), weapon->name().str());
|
||||
}
|
||||
|
||||
void Shooter::changeEnemyWeapon(const std::string &weaponName, sf::Uint16 enemyId) {
|
||||
ObjectNameTag weaponTag("Enemy_" + std::to_string(enemyId) + "_weapon");
|
||||
auto head = world->body(ObjectNameTag("Enemy_" + std::to_string(enemyId) + "_head"));
|
||||
auto enemy = world->body(ObjectNameTag("Enemy_" + std::to_string(enemyId)));
|
||||
auto weapon = world->body(weaponTag);
|
||||
|
||||
// remove old weapon:
|
||||
world->removeBody(weaponTag);
|
||||
enemy->unattach(weaponTag);
|
||||
|
||||
world->loadBody(weaponTag, "obj/items/" + weaponName + ".obj");
|
||||
world->body(weaponTag)->setCollider(false);
|
||||
world->body(weaponTag)->scale(Vec3D(3, 3, 3));
|
||||
|
||||
world->body(weaponTag)->translateToPoint(head->position() - enemy->left() * 1.0 - enemy->up() * 1.0 + enemy->lookAt());
|
||||
|
||||
world->body(weaponTag)->rotate(Vec3D(0, enemy->angle().y(), 0));
|
||||
world->body(weaponTag)->rotateLeft(head->angleLeftUpLookAt().x());
|
||||
enemy->attach(world->body(weaponTag));
|
||||
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag("select_weapon_" + std::to_string(enemyId)),
|
||||
world->body(weaponTag),
|
||||
-2 * Consts::PI,
|
||||
0.3,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
}
|
||||
|
||||
void Shooter::removeWeapon(std::shared_ptr<Weapon> weapon) {
|
||||
world->removeBody(weapon->name());
|
||||
}
|
61
Shooter.h
|
@ -1,61 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 22.09.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_SHOOTER_H
|
||||
#define SHOOTER_SHOOTER_H
|
||||
|
||||
#include <Engine.h>
|
||||
#include <gui/Window.h>
|
||||
|
||||
#include "player/Player.h"
|
||||
#include "player/PlayerController.h"
|
||||
#include "player/PlayerController.h"
|
||||
#include "network/ShooterClient.h"
|
||||
#include "network/ShooterServer.h"
|
||||
|
||||
class Shooter final : public Engine {
|
||||
private:
|
||||
std::shared_ptr<Player> player = std::make_shared<Player>(ObjectNameTag("Player"),
|
||||
ShooterConsts::CUBE_OBJ,
|
||||
Vec3D{1.5, 1.8, 1.5});
|
||||
std::shared_ptr<PlayerController> playerController = std::make_shared<PlayerController>(player, keyboard, mouse);
|
||||
|
||||
Window mainMenu;
|
||||
|
||||
std::shared_ptr<ShooterServer> server = std::make_shared<ShooterServer>();
|
||||
std::shared_ptr<ShooterClient> client = std::make_shared<ShooterClient>(player);
|
||||
std::shared_ptr<ChatManager> chat = std::make_shared<ChatManager>();
|
||||
bool isTypingMessage = false;
|
||||
std::string message;
|
||||
|
||||
bool inGame = false;
|
||||
int fireTraces = 0;
|
||||
std::string current_map = ShooterConsts::MAP_OBJ;
|
||||
|
||||
void start() override;
|
||||
void update() override;
|
||||
void gui() override;
|
||||
void drawChat();
|
||||
void play();
|
||||
void drawPlayerStats();
|
||||
void drawStatsTable();
|
||||
|
||||
void initNetwork();
|
||||
|
||||
void spawnPlayer(sf::Uint16 id);
|
||||
void removePlayer(sf::Uint16 id);
|
||||
void addFireTrace(const Vec3D &from, const Vec3D &to);
|
||||
void removeFireTrace(const ObjectNameTag &traceName);
|
||||
void addBonus(const std::string &bonusName, const Vec3D &position);
|
||||
void removeBonus(const ObjectNameTag &bonusName);
|
||||
void addWeapon(std::shared_ptr<Weapon> weapon);
|
||||
void removeWeapon(std::shared_ptr<Weapon> weapon);
|
||||
void changeEnemyWeapon(const std::string &weaponName, sf::Uint16 enemyId);
|
||||
|
||||
public:
|
||||
Shooter() : mainMenu(screen, mouse) {};
|
||||
};
|
||||
|
||||
|
||||
#endif //SHOOTER_SHOOTER_H
|
|
@ -1,69 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 10.10.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_SHOOTERCONSTS_H
|
||||
#define SHOOTER_SHOOTERCONSTS_H
|
||||
|
||||
namespace ShooterConsts {
|
||||
|
||||
// Numeric constants
|
||||
const double GRAVITY = 35;
|
||||
const double HEALTH_MAX = 100;
|
||||
const double ABILITY_MAX = 10;
|
||||
const double JUMP_HEIGHT = 3;
|
||||
const double WALK_SPEED = 10;
|
||||
const double MOUSE_SENSITIVITY = 1.0 / 1000.0;
|
||||
const double SLOW_MO_COEFFICIENT = 5;
|
||||
const double FIRE_DISTANCE = 1000;
|
||||
const double BONUS_RECHARGE_TIME = 30;
|
||||
const int MAX_MESSAGE_LENGTH = 70;
|
||||
|
||||
// String constants
|
||||
const std::string PLAYER_NAME = "Player";
|
||||
const std::string PROJECT_NAME = "Shooter";
|
||||
|
||||
const std::string ABILITY_OBJ = "obj/items/ability.obj";
|
||||
const std::string HILL_OBJ = "obj/items/hill.obj";
|
||||
const std::string GUN_OBJ = "obj/items/gun.obj";
|
||||
const std::string GUN_FIRE_SOUND = "sound/weapons/gun.ogg";
|
||||
const std::string GUN_RELOAD_SOUND = "sound/weapons/reload_gun.ogg";
|
||||
const std::string AK47_OBJ = "obj/items/ak47.obj";
|
||||
const std::string AK47_FIRE_SOUND = "sound/weapons/ak47.ogg";
|
||||
const std::string AK47_RELOAD_SOUND = "sound/weapons/reload_ak47.ogg";
|
||||
const std::string GOLD_AK47_OBJ = "obj/items/gold_ak47.obj";
|
||||
const std::string GOLD_AK47_FIRE_SOUND = "sound/weapons/ak47.ogg";
|
||||
const std::string GOLD_AK47_RELOAD_SOUND = "sound/weapons/reload_ak47.ogg";
|
||||
const std::string RIFLE_OBJ = "obj/items/rifle.obj";
|
||||
const std::string RIFLE_FIRE_SOUND = "sound/weapons/shotgun.ogg";
|
||||
const std::string RIFLE_RELOAD_SOUND = "sound/weapons/reload_ak47.ogg";
|
||||
const std::string SHOTGUN_OBJ = "obj/items/shotgun.obj";
|
||||
const std::string SHOTGUN_FIRE_SOUND = "sound/weapons/shotgun.ogg";
|
||||
const std::string SHOTGUN_RELOAD_SOUND = "sound/weapons/reload_shotgun.ogg";
|
||||
|
||||
const std::string CUBE_OBJ = "obj/other/cube.obj";
|
||||
const std::string MAP_OBJ = "obj/maps/map1.obj";
|
||||
const std::string MAR_RAILWAY_OBJ = "obj/maps/railway.obj";
|
||||
const std::string BIG_MAP_OBJ = "obj/maps/map2.obj";
|
||||
const std::string SIMPLE_MAP_OBJ = "obj/maps/map_simple.obj";
|
||||
const std::string PLANE_MAP_OBJ = "obj/maps/plane.obj";
|
||||
const std::string MAIN_MENU_BACK = "textures/back.png";
|
||||
const std::string MAIN_MENU_GUI = "textures/gui.png";
|
||||
|
||||
const std::string HEAD_OBJ = "obj/man/head.obj";
|
||||
const std::string BODY_OBJ = "obj/man/body.obj";
|
||||
const std::string FOOT_OBJ = "obj/man/foot.obj";
|
||||
|
||||
const std::string CLICK_SOUND = "sound/click.ogg";
|
||||
const std::string BACK_NOISE = "sound/backNoise.ogg";
|
||||
const std::string CHANGE_WEAPON_SOUND = "sound/weapons/change_weapon.ogg";
|
||||
const std::string RESTORE_HEALTH_SOUND = "sound/fullHealth.ogg";
|
||||
const std::string RESTORE_ABILITY_SOUND = "sound/fullAbility.ogg";
|
||||
const std::string KILL_SOUND = "sound/kill.ogg";
|
||||
const std::string DEATH_SOUND = "sound/classic_hurt.ogg";
|
||||
const std::string SLOW_MO_SOUND = "sound/slow_mo.ogg";
|
||||
const std::string UN_SLOW_MO_SOUND = "sound/unslow_mo.ogg";
|
||||
const std::string NO_AMMO_SOUND = "sound/weapons/no_ammo.ogg";
|
||||
}
|
||||
|
||||
#endif //SHOOTER_SHOOTERCONSTS_H
|
23
Source.cpp
|
@ -1,23 +0,0 @@
|
|||
//
|
||||
// Created by Ivan Ilin on 06.02.2021.
|
||||
//
|
||||
|
||||
#include "Shooter.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main() {
|
||||
Shooter game;
|
||||
|
||||
// Optimal for standard monitors:
|
||||
//game.create(720, 480, ShooterConsts::PROJECT_NAME, true);
|
||||
game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true);
|
||||
//game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
|
||||
|
||||
// Optimal for MacBook Pro 16 display:
|
||||
//game.create(2048, 1152, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR);
|
||||
//game.create(3072, 1920, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
127.0.0.1
|
||||
54000
|
||||
PlayerName
|
Before Width: | Height: | Size: 466 KiB |
Before Width: | Height: | Size: 543 KiB |
Before Width: | Height: | Size: 430 KiB |
Before Width: | Height: | Size: 465 KiB |
Before Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 419 KiB |
BIN
img/opengl.png
Before Width: | Height: | Size: 789 KiB |
Before Width: | Height: | Size: 296 KiB |
|
@ -1,42 +0,0 @@
|
|||
#include <string>
|
||||
|
||||
#include "Chat.h"
|
||||
|
||||
void ChatManager::addNewMessage(const std::string& author, const std::string& message) {
|
||||
hide = 7.0;
|
||||
messages.push_back(message);
|
||||
authors.push_back(author);
|
||||
isChatUpdate = true;
|
||||
if (messages.size() > 20) {
|
||||
messages.erase(messages.begin());
|
||||
}
|
||||
}
|
||||
int ChatManager::update(double delta) {
|
||||
hide = std::max(hide-delta, 0.0);
|
||||
return std::min((int)(hide * 255.0), 255);
|
||||
|
||||
}
|
||||
std::string ChatManager::getChat() {
|
||||
updateChat();
|
||||
return chatStr;
|
||||
}
|
||||
std::string ChatManager::getChatPreview() {
|
||||
updateChat();
|
||||
return chatStrPrev;
|
||||
}
|
||||
|
||||
void ChatManager::updateChat() {
|
||||
if (isChatUpdate) {
|
||||
isChatUpdate = false;
|
||||
size_t size = messages.size();
|
||||
chatStr = "";
|
||||
chatStrPrev = "";
|
||||
for (int messageIndex = size - 1; messageIndex >= 0; messageIndex--)
|
||||
{
|
||||
if (messageIndex > size - 6) {
|
||||
chatStrPrev += authors[messageIndex] + ": " + messages[messageIndex] + "\n";
|
||||
}
|
||||
chatStr += authors[messageIndex] + ": " + messages[messageIndex] + "\n";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
#ifndef SHOOTER_CHAT_H
|
||||
#define SHOOTER_CHAT_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
class ChatManager final {
|
||||
private:
|
||||
std::vector<std::string> messages;
|
||||
std::vector<std::string> authors;
|
||||
|
||||
bool isChatUpdate = true;
|
||||
std::string chatStr;
|
||||
std::string chatStrPrev;
|
||||
|
||||
double hide = 0.0;
|
||||
|
||||
void updateChat();
|
||||
public:
|
||||
void addNewMessage(const std::string& author, const std::string& message);
|
||||
int update(double delta);
|
||||
|
||||
std::string getChat();
|
||||
std::string getChatPreview();
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -1,359 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 25.05.2021.
|
||||
//
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <SFML/Network/Ftp.hpp>
|
||||
|
||||
#include <animation/Animations.h>
|
||||
#include <animation/Timeline.h>
|
||||
#include <utils/EventHandler.h>
|
||||
#include <utils/Log.h>
|
||||
|
||||
#include "ShooterClient.h"
|
||||
#include "ShooterMsgType.h"
|
||||
|
||||
|
||||
|
||||
ShooterClient::ShooterClient(std::shared_ptr<Player> player) : _player(player) {
|
||||
EventHandler::listen<void(const std::string&)>(
|
||||
Event("take_bonus"),
|
||||
[this](const std::string& name){ this->takeBonus(name); }
|
||||
);
|
||||
|
||||
EventHandler::listen<void(sf::Uint16, double)>(
|
||||
Event("damage_player"),
|
||||
[this](sf::Uint16 targetId, double damage) { damagePlayer(targetId, damage); } );
|
||||
|
||||
EventHandler::listen<void(const Vec3D&, const Vec3D&)>(
|
||||
Event("your_bullet"),
|
||||
[this](const Vec3D &from, const Vec3D &to) {
|
||||
sendTrace(from, to);
|
||||
});
|
||||
|
||||
EventHandler::listen<void(const std::string&)>(
|
||||
Event("change_weapon"),
|
||||
[this](const std::string &name){ changeWeapon(name); }
|
||||
);
|
||||
}
|
||||
|
||||
void ShooterClient::updatePacket() {
|
||||
sf::Packet packet;
|
||||
packet << MsgType::ClientUpdate << _player->position().x() << _player->position().y() << _player->position().z()
|
||||
<< _player->angle().y() << _player->headAngle() << _player->playerNickName();
|
||||
_socket.send(packet, _socket.serverId());
|
||||
}
|
||||
|
||||
void ShooterClient::processInit(sf::Packet &packet) {
|
||||
sf::Uint16 targetId;
|
||||
double x, y, z, health;
|
||||
int kills, deaths;
|
||||
|
||||
while (packet >> targetId >> x >> y >> z >> health >> kills >> deaths) {
|
||||
if (targetId != _socket.ownId()) {
|
||||
EventHandler::call<void(sf::Uint16)>(Event("spawn_player"), targetId);
|
||||
|
||||
_players[targetId]->translateToPoint(Vec3D{x, y, z});
|
||||
_players[targetId]->setHealth(health);
|
||||
_players[targetId]->setKills(kills);
|
||||
_players[targetId]->setDeaths(deaths);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShooterClient::processUpdate(sf::Packet &packet) {
|
||||
sf::Uint16 targetId;
|
||||
double x, y, z, health, bodyAngle, headAngle;
|
||||
std::string playerName;
|
||||
|
||||
while (packet >> targetId >> x >> y >> z >> health >> bodyAngle >> headAngle >> playerName) {
|
||||
if (_players.count(targetId)) {
|
||||
std::string name = "Enemy_" + std::to_string(targetId);
|
||||
|
||||
Vec3D newPosition = Vec3D{x, y, z};
|
||||
|
||||
bool isAnimate = (_players[targetId]->position() - newPosition).sqrAbs() > 0.2;
|
||||
|
||||
_players[targetId]->translateToPoint(newPosition);
|
||||
|
||||
_players[targetId]->setHealth(health);
|
||||
_players[targetId]->rotateToAngle(Vec3D{0, bodyAngle, 0});
|
||||
_players[targetId]->setPlayerNickName(playerName);
|
||||
|
||||
auto head = _players[targetId]->attached(ObjectNameTag(name + "_head"));
|
||||
auto weapon = _players[targetId]->attached(ObjectNameTag("Enemy_" + std::to_string(targetId) + "_weapon"));
|
||||
|
||||
auto foot1 = _players[targetId]->attached(ObjectNameTag(name + "_foot_1"));
|
||||
auto foot2 = _players[targetId]->attached(ObjectNameTag(name + "_foot_2"));
|
||||
|
||||
if (head != nullptr) {
|
||||
head->rotateLeft(headAngle - _players[targetId]->headAngle());
|
||||
}
|
||||
if (weapon != nullptr) {
|
||||
weapon->rotateLeft(headAngle - _players[targetId]->headAngle());
|
||||
}
|
||||
|
||||
if (isAnimate) {
|
||||
if (foot1 != nullptr && foot2 != nullptr &&
|
||||
!Timeline::isInAnimList(AnimationListTag(name + "_foot1_rotation"))) {
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag(name + "_foot1_rotation"),
|
||||
foot1, 0.6, 0.2, Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Linear);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag(name + "_foot1_rotation"), 0);
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag(name + "_foot1_rotation"),
|
||||
foot1, -1.2, 0.2, Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Linear);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag(name + "_foot1_rotation"), 0);
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag(name + "_foot1_rotation"),
|
||||
foot1, 0.6, 0.2, Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Linear);
|
||||
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag(name + "_foot2_rotation"),
|
||||
foot2, -0.6, 0.2, Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Linear);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag(name + "_foot2_rotation"), 0);
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag(name + "_foot2_rotation"),
|
||||
foot2, 1.2, 0.2, Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Linear);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag(name + "_foot2_rotation"), 0);
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag(name + "_foot2_rotation"),
|
||||
foot2, -0.6, 0.2, Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Linear);
|
||||
}
|
||||
}
|
||||
|
||||
_players[targetId]->setHeadAngle(headAngle);
|
||||
} else if (targetId == _socket.ownId()) {
|
||||
_player->setHealth(health);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShooterClient::processNewClient(sf::Packet &packet) {
|
||||
sf::Uint16 targetId;
|
||||
|
||||
packet >> targetId;
|
||||
|
||||
EventHandler::call<void(sf::Uint16)>(Event("spawn_player"), targetId);
|
||||
}
|
||||
|
||||
void ShooterClient::processDisconnect(sf::Uint16 targetId) {
|
||||
if (targetId != _socket.ownId() && _players.count(targetId)) {
|
||||
_players.erase(targetId);
|
||||
EventHandler::call<void(sf::Uint16)>(Event("remove_player"), targetId);
|
||||
}
|
||||
}
|
||||
|
||||
void ShooterClient::sendMessage(const std::string& message){
|
||||
|
||||
if (message.length() == 0)
|
||||
return;
|
||||
chatManager->addNewMessage(_player->playerNickName(), message);
|
||||
sf::Packet packet;
|
||||
packet << MsgType::Custom << ShooterMsgType::newMessage << message;
|
||||
_socket.send(packet, _socket.serverId());
|
||||
}
|
||||
|
||||
void ShooterClient::sendChatMessage(const std::string& message, const std::string& name) {
|
||||
chatManager->addNewMessage(name, message);
|
||||
}
|
||||
|
||||
void ShooterClient::processCustomPacket(sf::Packet &packet) {
|
||||
sf::Uint16 buffId[2];
|
||||
double dbuff[10];
|
||||
std::string tmp, tmp2;
|
||||
|
||||
ShooterMsgType type;
|
||||
packet >> type;
|
||||
std::string name, message;
|
||||
|
||||
switch (type) {
|
||||
case ShooterMsgType::Kill:
|
||||
packet >> buffId[0] >> buffId[1];
|
||||
_lastEvent = "";
|
||||
if (buffId[1] == _socket.ownId()) {
|
||||
_player->addKill();
|
||||
SoundController::loadAndPlay(SoundTag("kill"), ShooterConsts::KILL_SOUND);
|
||||
_lastEvent += _player->playerNickName();
|
||||
} else {
|
||||
_players[buffId[1]]->addKill();
|
||||
_lastEvent += _players[buffId[1]]->playerNickName();
|
||||
}
|
||||
_lastEvent += " ~> ";
|
||||
|
||||
if (buffId[0] == _socket.ownId()) {
|
||||
_player->addDeath();
|
||||
|
||||
auto camera = _player->attached(ObjectNameTag("Camera"));
|
||||
if (camera == nullptr) {
|
||||
break;
|
||||
}
|
||||
|
||||
_player->unattach(ObjectNameTag("Camera"));
|
||||
_player->translateToPoint(Vec3D{10000});
|
||||
camera->rotateLeft(-camera->angleLeftUpLookAt().x());
|
||||
camera->transform(Matrix4x4::Rotation(-_player->angle()));
|
||||
|
||||
Timeline::addAnimation<ATranslateToPoint>(AnimationListTag("camera_anim"),
|
||||
camera, Vec3D(0, 30, -100));
|
||||
Timeline::addAnimation<AWait>(AnimationListTag("camera_anim"), 0);
|
||||
Timeline::addAnimation<ARotateRelativePoint>(AnimationListTag("camera_anim"),
|
||||
camera, Vec3D(0), Vec3D{0, Consts::PI, 0},
|
||||
5, Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Linear);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag("camera_anim"), 0);
|
||||
Timeline::addAnimation<AFunction>(AnimationListTag("camera_anim"), [this, camera]() {
|
||||
// respawn
|
||||
_player->translateToPoint(
|
||||
Vec3D{50.0 * (-1 + 2.0 * (double) rand() / RAND_MAX), 30.0 * (double) rand() / RAND_MAX,
|
||||
50.0 * (-1 + 2.0 * (double) rand() / RAND_MAX)});
|
||||
_player->reInitWeapons();
|
||||
_player->setFullAbility();
|
||||
|
||||
camera->rotateToAngle(Vec3D(0));
|
||||
camera->transform(Matrix4x4::Rotation(Vec3D(_player->angle())));
|
||||
camera->rotateLeft(_player->headAngle());
|
||||
camera->translateToPoint(_player->position() + Vec3D{0, 1.8, 0});
|
||||
_player->attach(camera);
|
||||
|
||||
}, 1, 0.1);
|
||||
|
||||
|
||||
SoundController::loadAndPlay(SoundTag("death"), ShooterConsts::DEATH_SOUND);
|
||||
_lastEvent += _player->playerNickName();
|
||||
} else {
|
||||
_players[buffId[0]]->addDeath();
|
||||
_lastEvent += _players[buffId[0]]->playerNickName();
|
||||
}
|
||||
break;
|
||||
case ShooterMsgType::FireTrace:
|
||||
|
||||
if (buffId[0] != _socket.ownId()) {
|
||||
packet >> dbuff[0] >> dbuff[1] >> dbuff[2] >> dbuff[3] >> dbuff[4] >> dbuff[5];
|
||||
|
||||
EventHandler::call<void(const Vec3D&, const Vec3D&)>(
|
||||
Event("enemy_bullet"),
|
||||
Vec3D(dbuff[0], dbuff[1], dbuff[2]), Vec3D(dbuff[3], dbuff[4], dbuff[5]));
|
||||
}
|
||||
|
||||
break;
|
||||
case ShooterMsgType::InitBonuses:
|
||||
while (packet >> tmp >> dbuff[0] >> dbuff[1] >> dbuff[2]) {
|
||||
EventHandler::call<void(const std::string&, const Vec3D&)>(
|
||||
Event("add_bonus"), tmp, Vec3D(dbuff[0], dbuff[1], dbuff[2]));
|
||||
}
|
||||
break;
|
||||
|
||||
case ShooterMsgType::AddBonus:
|
||||
packet >> tmp >> dbuff[0] >> dbuff[1] >> dbuff[2];
|
||||
EventHandler::call<void(const std::string&, const Vec3D&)>(
|
||||
Event("add_bonus"), tmp, Vec3D(dbuff[0], dbuff[1], dbuff[2]));
|
||||
|
||||
break;
|
||||
case ShooterMsgType::RemoveBonus:
|
||||
packet >> tmp;
|
||||
EventHandler::call<void(const ObjectNameTag &)>(
|
||||
Event("remove_bonus"), ObjectNameTag(tmp));
|
||||
break;
|
||||
case ShooterMsgType::ChangeWeapon:
|
||||
packet >> buffId[0] >> tmp;
|
||||
|
||||
EventHandler::call<void(const std::string&, sf::Uint16)>(
|
||||
Event("change_enemy_weapon"), tmp, buffId[0]);
|
||||
|
||||
break;
|
||||
case ShooterMsgType::newMessage:
|
||||
|
||||
packet >> name >> message;
|
||||
sendChatMessage(message, name);
|
||||
break;
|
||||
default:
|
||||
Log::log("ShooterClient::processCustomPacket: unknown message type " +
|
||||
std::to_string(static_cast<int>(type)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void ShooterClient::processDisconnected() {
|
||||
for (auto it = _players.begin(); it != _players.end();) {
|
||||
processDisconnect(it++->first);
|
||||
}
|
||||
}
|
||||
|
||||
void ShooterClient::damagePlayer(sf::Uint16 targetId, double damage) {
|
||||
sf::Packet packet;
|
||||
|
||||
packet << MsgType::Custom << ShooterMsgType::Damage << targetId << damage;
|
||||
_socket.sendRely(packet, _socket.serverId());
|
||||
|
||||
Log::log("ShooterClient: damagePlayer " + std::to_string(targetId) + " ( -" + std::to_string(damage) + "hp )");
|
||||
}
|
||||
|
||||
void ShooterClient::sendTrace(const Vec3D &from, const Vec3D &to) {
|
||||
sf::Packet packet;
|
||||
|
||||
packet << MsgType::Custom << ShooterMsgType::FireTrace << from.x() << from.y() << from.z() << to.x() << to.y()
|
||||
<< to.z();
|
||||
_socket.send(packet, _socket.serverId());
|
||||
}
|
||||
|
||||
void ShooterClient::takeBonus(const std::string &bonusName) {
|
||||
sf::Packet packet;
|
||||
|
||||
packet << MsgType::Custom << ShooterMsgType::RemoveBonus << bonusName;
|
||||
_socket.sendRely(packet, _socket.serverId());
|
||||
|
||||
EventHandler::call<void(const ObjectNameTag &)>(
|
||||
Event("remove_bonus"), ObjectNameTag(bonusName));
|
||||
}
|
||||
|
||||
void ShooterClient::changeWeapon(const std::string &weaponName) {
|
||||
sf::Packet packet;
|
||||
|
||||
packet << MsgType::Custom << ShooterMsgType::ChangeWeapon << weaponName;
|
||||
_socket.sendRely(packet, _socket.serverId());
|
||||
}
|
||||
|
||||
void ShooterClient::addPlayer(sf::Uint16 id, std::shared_ptr<Player> player) {
|
||||
_players.insert({id, player});
|
||||
}
|
||||
|
||||
void ShooterClient::requestMap(const std::string& clientIp, std::string *current_map) {
|
||||
Log::log("---------[FTP server]---------");
|
||||
sf::Ftp ftp;
|
||||
sf::Ftp::Response connectResponse = ftp.connect(clientIp, 21);
|
||||
if (connectResponse.isOk()) {
|
||||
ftp.login();
|
||||
|
||||
sf::Ftp::ListingResponse dirResponse = ftp.getDirectoryListing("current_map/");
|
||||
Log::log("Response code: "+std::to_string(dirResponse.getStatus())+" | Message: "+dirResponse.getMessage());
|
||||
if (dirResponse.isOk()) {
|
||||
const std::vector<std::string>& listing = dirResponse.getListing();
|
||||
|
||||
|
||||
if (listing.size() != 0) {
|
||||
for (std::vector<std::string>::const_iterator it = listing.begin(); it != listing.end(); ++it)
|
||||
Log::log("- "+*it);
|
||||
|
||||
sf::Ftp::Response downloadResponse = ftp.download(listing.at(0), "./obj/maps/", sf::Ftp::Ascii);
|
||||
Log::log("Response code: "+std::to_string(downloadResponse.getStatus())+" | Message: "+downloadResponse.getMessage());
|
||||
|
||||
if (downloadResponse.isOk()) {
|
||||
std::string map_path = listing.at(0);
|
||||
map_path = "./obj/maps"+map_path.substr(map_path.find("/"));
|
||||
Log::log("Map set to: "+map_path);
|
||||
*current_map = map_path;
|
||||
}
|
||||
} else {
|
||||
Log::log("there is no map file");
|
||||
}
|
||||
}
|
||||
|
||||
ftp.disconnect();
|
||||
} else {
|
||||
Log::log("Couldn't connect to FTP server with ip: "+clientIp+" and port: 21");
|
||||
}
|
||||
Log::log("------------------------------");
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 25.05.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_SHOOTERCLIENT_H
|
||||
#define SHOOTER_SHOOTERCLIENT_H
|
||||
|
||||
#include <SFML/Config.hpp>
|
||||
|
||||
#include <network/ClientUDP.h>
|
||||
|
||||
#include "../player/Player.h"
|
||||
#include "Chat.h"
|
||||
|
||||
class ShooterClient final : public ClientUDP {
|
||||
private:
|
||||
std::string _lastEvent;
|
||||
|
||||
std::map<sf::Uint16, std::shared_ptr<Player>> _players{};
|
||||
std::shared_ptr<Player> _player;
|
||||
|
||||
std::shared_ptr<ChatManager> chatManager;
|
||||
|
||||
void damagePlayer(sf::Uint16 targetId, double damage);
|
||||
|
||||
void takeBonus(const std::string &bonusName);
|
||||
|
||||
void sendTrace(const Vec3D &from, const Vec3D &to);
|
||||
|
||||
void changeWeapon(const std::string &weaponName);
|
||||
|
||||
public:
|
||||
explicit ShooterClient(std::shared_ptr<Player> player);
|
||||
|
||||
void sendMessage(const std::string& message);
|
||||
|
||||
void sendChatMessage(const std::string& message, const std::string& name);
|
||||
|
||||
void updatePacket() override;
|
||||
|
||||
void processInit(sf::Packet &packet) override;
|
||||
|
||||
void processUpdate(sf::Packet &packet) override;
|
||||
|
||||
void processNewClient(sf::Packet &packet) override;
|
||||
|
||||
void processDisconnect(sf::Uint16 targetId) override;
|
||||
|
||||
void processCustomPacket(sf::Packet &packet) override;
|
||||
|
||||
void processDisconnected() override;
|
||||
|
||||
void setChatManager(std::shared_ptr<ChatManager> chat) { chatManager = chat; };
|
||||
|
||||
void addPlayer(sf::Uint16 id, std::shared_ptr<Player> player);
|
||||
|
||||
static void requestMap(const std::string& clientIp, std::string *current_map);
|
||||
|
||||
[[nodiscard]] std::map<sf::Uint16, std::shared_ptr<Player>> const &players() const { return _players; }
|
||||
|
||||
[[nodiscard]] std::string lastEvent() const { return _lastEvent; }
|
||||
};
|
||||
|
||||
|
||||
#endif //MINECRAFT_3DZAVR_CLIENT_H
|
|
@ -1,16 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 27.10.2021.
|
||||
//
|
||||
|
||||
#include "ShooterMsgType.h"
|
||||
|
||||
sf::Packet &operator<<(sf::Packet &packet, ShooterMsgType type) {
|
||||
return packet << (sf::Uint16) type;
|
||||
}
|
||||
|
||||
sf::Packet &operator>>(sf::Packet &packet, ShooterMsgType &type) {
|
||||
sf::Uint16 temp;
|
||||
packet >> temp;
|
||||
type = (ShooterMsgType) temp;
|
||||
return packet;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 27.10.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_SHOOTERMSGTYPE_H
|
||||
#define SHOOTER_SHOOTERMSGTYPE_H
|
||||
|
||||
#include <SFML/Network.hpp>
|
||||
|
||||
enum class ShooterMsgType {
|
||||
Damage,
|
||||
Kill,
|
||||
FireTrace,
|
||||
InitBonuses,
|
||||
AddBonus,
|
||||
RemoveBonus,
|
||||
ChangeWeapon,
|
||||
newMessage
|
||||
};
|
||||
|
||||
sf::Packet &operator<<(sf::Packet &packet, ShooterMsgType type);
|
||||
|
||||
sf::Packet &operator>>(sf::Packet &packet, ShooterMsgType &type);
|
||||
|
||||
#endif //SHOOTER_SHOOTERMSGTYPE_H
|
|
@ -1,223 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 25.05.2021.
|
||||
//
|
||||
|
||||
#include <utils/Log.h>
|
||||
|
||||
#include "ShooterServer.h"
|
||||
#include "ShooterMsgType.h"
|
||||
|
||||
void ShooterServer::broadcast() {
|
||||
sf::Packet updatePacket;
|
||||
updatePacket << MsgType::ServerUpdate;
|
||||
|
||||
for (auto&[playerId, player] : _players) {
|
||||
updatePacket << playerId << player->position().x() << player->position().y() << player->position().z()
|
||||
<< player->health() << player->angle().y() << player->headAngle() << player->playerNickName();
|
||||
}
|
||||
|
||||
for (auto &player : _players) {
|
||||
_socket.send(updatePacket, player.first);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ShooterServer::processConnect(sf::Uint16 targetId) {
|
||||
sf::Packet sendPacket1, sendPacket2;
|
||||
sf::Packet extraPacket;
|
||||
|
||||
// players init
|
||||
extraPacket << MsgType::NewClient << targetId;
|
||||
sendPacket1 << MsgType::Init << targetId;
|
||||
_players.insert({targetId, std::make_shared<Player>(ObjectNameTag("Player_" + std::to_string(targetId)))});
|
||||
for (const auto&[playerId, player] : _players) {
|
||||
sendPacket1 << playerId << player->position().x() << player->position().y() << player->position().z()
|
||||
<< player->health() << player->kills() << player->deaths();
|
||||
if (playerId != targetId)
|
||||
_socket.sendRely(extraPacket, playerId);
|
||||
}
|
||||
_socket.sendRely(sendPacket1, targetId);
|
||||
|
||||
// bonuses init
|
||||
sendPacket2 << MsgType::Custom << ShooterMsgType::InitBonuses;
|
||||
for (auto&[bonusName, bonusInfo] : _bonuses) {
|
||||
if (bonusInfo->onTheMap) {
|
||||
sendPacket2 << bonusName << bonusInfo->position.x() << bonusInfo->position.y() << bonusInfo->position.z();
|
||||
}
|
||||
}
|
||||
_socket.sendRely(sendPacket2, targetId);
|
||||
|
||||
}
|
||||
|
||||
void ShooterServer::processClientUpdate(sf::Uint16 senderId, sf::Packet &packet) {
|
||||
double x, y, z, angleBody, headAngle;
|
||||
|
||||
std::string playerName;
|
||||
|
||||
packet >> x >> y >> z >> angleBody >> headAngle >> playerName;
|
||||
|
||||
_players.at(senderId)->translateToPoint(Vec3D{x, y, z});
|
||||
_players.at(senderId)->rotateToAngle(Vec3D{0, angleBody, 0});
|
||||
_players.at(senderId)->setHeadAngle(headAngle);
|
||||
_players.at(senderId)->setPlayerNickName(playerName);
|
||||
}
|
||||
|
||||
void ShooterServer::processDisconnect(sf::Uint16 senderId) {
|
||||
sf::Packet sendPacket;
|
||||
|
||||
sendPacket << MsgType::Disconnect << senderId;
|
||||
_players.erase(senderId);
|
||||
for (const auto &player : _players) {
|
||||
_socket.sendRely(sendPacket, player.first);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ShooterServer::processCustomPacket(sf::Packet &packet, sf::Uint16 senderId) {
|
||||
sf::Packet sendPacket;
|
||||
double dbuff[10];
|
||||
sf::Uint16 targetId;
|
||||
double damage;
|
||||
std::string tmp;
|
||||
double newHealth;
|
||||
std::string message;
|
||||
|
||||
ShooterMsgType type;
|
||||
packet >> type;
|
||||
|
||||
switch (type) {
|
||||
case ShooterMsgType::Damage:
|
||||
packet >> targetId >> damage;
|
||||
newHealth = _players[targetId]->health() - damage;
|
||||
if (newHealth > 0) {
|
||||
_players[targetId]->setHealth(newHealth);
|
||||
} else {
|
||||
_players[targetId]->setFullHealth();
|
||||
_players[targetId]->setFullAbility();
|
||||
_players[targetId]->addDeath();
|
||||
_players[senderId]->addKill();
|
||||
|
||||
sendPacket << MsgType::Custom << ShooterMsgType::Kill << targetId << senderId;
|
||||
for (auto &player : _players)
|
||||
_socket.sendRely(sendPacket, player.first);
|
||||
}
|
||||
break;
|
||||
case ShooterMsgType::FireTrace:
|
||||
packet >> dbuff[0] >> dbuff[1] >> dbuff[2] >> dbuff[3] >> dbuff[4] >> dbuff[5];
|
||||
sendPacket << MsgType::Custom << ShooterMsgType::FireTrace << dbuff[0] << dbuff[1] << dbuff[2] << dbuff[3]
|
||||
<< dbuff[4] << dbuff[5];
|
||||
for (auto &player : _players) {
|
||||
if (player.first != senderId) {
|
||||
_socket.send(sendPacket, player.first);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case ShooterMsgType::RemoveBonus:
|
||||
packet >> tmp;
|
||||
|
||||
if (tmp.find("Bonus_hill") != std::string::npos) {
|
||||
_players[senderId]->setFullHealth();
|
||||
}
|
||||
if (tmp.find("Bonus_ability") != std::string::npos) {
|
||||
_players[senderId]->setFullAbility();
|
||||
}
|
||||
|
||||
_bonuses[tmp] = std::make_shared<BonusInfo>(BonusInfo{_bonuses[tmp]->position, Time::time(), false});
|
||||
|
||||
sendPacket << MsgType::Custom << ShooterMsgType::RemoveBonus << tmp;
|
||||
for (auto &player : _players) {
|
||||
if (player.first != senderId) {
|
||||
_socket.sendRely(sendPacket, player.first);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ShooterMsgType::ChangeWeapon:
|
||||
packet >> tmp;
|
||||
sendPacket << MsgType::Custom << ShooterMsgType::ChangeWeapon << senderId << tmp;
|
||||
|
||||
for (auto &player : _players) {
|
||||
if (player.first != senderId) {
|
||||
_socket.sendRely(sendPacket, player.first);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case ShooterMsgType::newMessage:
|
||||
|
||||
packet >> message;
|
||||
sendPacket << MsgType::Custom << ShooterMsgType::newMessage << _players[senderId]->playerNickName() << message;
|
||||
if (message.length() == 0)
|
||||
break;
|
||||
for (auto& player : _players) {
|
||||
if (player.first != senderId) {
|
||||
_socket.send(sendPacket, player.first);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Log::log("ShooterServer::processCustomPacket: unknown message type " +
|
||||
std::to_string(static_cast<int>(type)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void ShooterServer::processStop() {
|
||||
_players.clear();
|
||||
_bonuses.clear();
|
||||
}
|
||||
|
||||
void ShooterServer::generateBonuses() {
|
||||
_bonuses.insert({"Bonus_gun_1", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(-10, -2, -15), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
_bonuses.insert({"Bonus_gun_2", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(10, -2, 15), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
|
||||
_bonuses.insert({"Bonus_shotgun_1", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(-10, 13, -24), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
_bonuses.insert({"Bonus_shotgun_2", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(10, 13, 24), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
|
||||
_bonuses.insert({"Bonus_ak47_1", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(-25, 30, 50), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
_bonuses.insert({"Bonus_ak47_2", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(25, 30, -50), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
|
||||
_bonuses.insert({"Bonus_gold_ak47_1", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(-35, 80, 25), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
_bonuses.insert({"Bonus_gold_ak47_2", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(35, 80, -25), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
|
||||
_bonuses.insert({"Bonus_rifle_1", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(40, -2, 45), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
_bonuses.insert({"Bonus_rifle_2", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(-40, -2, -45), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
|
||||
_bonuses.insert({"Bonus_hill_1", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(-40, -2, 45), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
_bonuses.insert({"Bonus_hill_2", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(40, -2, -45), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
|
||||
_bonuses.insert({"Bonus_ability_1", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(25, 18, -33), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
_bonuses.insert({"Bonus_ability_2", std::make_shared<BonusInfo>(
|
||||
BonusInfo{Vec3D(-25, 18, 33), -2 * ShooterConsts::BONUS_RECHARGE_TIME, true})});
|
||||
}
|
||||
|
||||
void ShooterServer::updateInfo() {
|
||||
for (auto&[bonusName, bonusInfo] : _bonuses) {
|
||||
if (!bonusInfo->onTheMap && std::abs(Time::time() - bonusInfo->lastTake) > ShooterConsts::BONUS_RECHARGE_TIME) {
|
||||
sf::Packet sendPacket;
|
||||
sendPacket << MsgType::Custom << ShooterMsgType::AddBonus << bonusName << bonusInfo->position.x()
|
||||
<< bonusInfo->position.y() << bonusInfo->position.z();
|
||||
for (const auto &player : _players) {
|
||||
_socket.sendRely(sendPacket, player.first);
|
||||
}
|
||||
bonusInfo = std::make_shared<BonusInfo>(BonusInfo{bonusInfo->position, bonusInfo->lastTake, true});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ShooterServer::~ShooterServer() {
|
||||
processStop();
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 25.05.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_SHOOTERSERVER_H
|
||||
#define SHOOTER_SHOOTERSERVER_H
|
||||
|
||||
#include <network/ServerUDP.h>
|
||||
|
||||
#include "../player/Player.h"
|
||||
|
||||
struct BonusInfo final {
|
||||
const Vec3D position{};
|
||||
const double lastTake = std::numeric_limits<double>::min();
|
||||
const bool onTheMap = false;
|
||||
};
|
||||
|
||||
class ShooterServer final : public ServerUDP {
|
||||
private:
|
||||
std::map<sf::Uint16, std::shared_ptr<Player>> _players{};
|
||||
std::map<std::string, std::shared_ptr<BonusInfo>> _bonuses{};
|
||||
public:
|
||||
ShooterServer() = default;
|
||||
|
||||
void broadcast() override;
|
||||
|
||||
void processConnect(sf::Uint16 senderId) override;
|
||||
|
||||
void processClientUpdate(sf::Uint16 senderId, sf::Packet &packet) override;
|
||||
|
||||
void processDisconnect(sf::Uint16 senderId) override;
|
||||
|
||||
void processCustomPacket(sf::Packet &packet, sf::Uint16 senderId) override;
|
||||
|
||||
void processStop() override;
|
||||
|
||||
void generateBonuses();
|
||||
|
||||
void updateInfo() override;
|
||||
|
||||
~ShooterServer() override;
|
||||
};
|
||||
|
||||
|
||||
#endif //MINECRAFT_3DZAVR_SERVER_H
|
|
@ -1,49 +0,0 @@
|
|||
m 000 51 19 198 150
|
||||
o Cube
|
||||
v 0.005449 0.446474 -0.361719
|
||||
v 0.005449 0.446546 -0.372617
|
||||
v 0.004566 -0.366134 0.374185
|
||||
v 0.004566 -0.366294 0.365054
|
||||
v -0.005449 0.446474 -0.361719
|
||||
v -0.005449 0.446546 -0.372617
|
||||
v -0.004566 -0.366134 0.374185
|
||||
v -0.004566 -0.366294 0.365054
|
||||
v -0.112195 -0.019100 0.085016
|
||||
v 0.112195 0.200628 0.130515
|
||||
v -0.112195 0.200628 0.130515
|
||||
v 0.112195 -0.019100 0.085016
|
||||
v -0.112195 0.031076 -0.073104
|
||||
v 0.112195 -0.186195 -0.129173
|
||||
v -0.112195 -0.186195 -0.129173
|
||||
v 0.112195 0.031076 -0.073104
|
||||
g Cube_Cube_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 11 3 10
|
||||
f 3 8 4
|
||||
f 13 6 15
|
||||
f 12 8 9
|
||||
f 12 3 4
|
||||
f 5 2 6
|
||||
f 16 12 14
|
||||
f 14 9 15
|
||||
f 7 9 8
|
||||
f 13 10 16
|
||||
f 5 16 1
|
||||
f 2 15 6
|
||||
f 2 16 14
|
||||
f 9 13 15
|
||||
f 11 7 3
|
||||
f 3 7 8
|
||||
f 13 5 6
|
||||
f 12 4 8
|
||||
f 12 10 3
|
||||
f 5 1 2
|
||||
f 16 10 12
|
||||
f 14 12 9
|
||||
f 7 11 9
|
||||
f 13 11 10
|
||||
f 5 13 16
|
||||
f 2 14 15
|
||||
f 2 1 16
|
||||
f 9 11 13
|
|
@ -1,327 +0,0 @@
|
|||
m 001 59 39 34 255
|
||||
m 002 104 105 110 255
|
||||
m 003 64 64 64 255
|
||||
o Cube
|
||||
v -0.024207 -0.071709 -0.159259
|
||||
v -0.024207 0.104802 -0.159259
|
||||
v -0.024407 -0.048306 0.246812
|
||||
v -0.024407 0.077955 0.246812
|
||||
v 0.045930 -0.071709 -0.159259
|
||||
v 0.045930 0.104802 -0.159259
|
||||
v 0.045442 -0.048306 0.246813
|
||||
v 0.045442 0.077955 0.246813
|
||||
g Cube_Cube_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 1 7 3
|
||||
f 3 8 4
|
||||
f 8 5 6
|
||||
f 2 8 6
|
||||
f 1 4 2
|
||||
f 5 2 6
|
||||
f 1 5 7
|
||||
f 3 7 8
|
||||
f 8 7 5
|
||||
f 2 4 8
|
||||
f 1 3 4
|
||||
f 5 1 2
|
||||
o Cube.001
|
||||
v -0.005117 -0.016270 0.516193
|
||||
v -0.005117 0.013209 0.516193
|
||||
v -0.005118 -0.016270 0.604628
|
||||
v -0.005118 0.013209 0.604628
|
||||
v 0.026826 -0.016270 0.516193
|
||||
v 0.026826 0.013209 0.516193
|
||||
v 0.026825 -0.016270 0.604629
|
||||
v 0.026825 0.013209 0.604629
|
||||
g Cube.001_Cube.001_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 13 11 9
|
||||
f 11 16 12
|
||||
f 15 14 16
|
||||
f 10 16 14
|
||||
f 9 12 10
|
||||
f 13 10 14
|
||||
f 13 15 11
|
||||
f 11 15 16
|
||||
f 15 13 14
|
||||
f 10 12 16
|
||||
f 9 11 12
|
||||
f 13 9 10
|
||||
o Cube.002
|
||||
v -0.018558 -0.017699 0.245653
|
||||
v -0.018558 0.044784 0.245653
|
||||
v -0.018561 -0.017699 0.522281
|
||||
v -0.018561 0.044784 0.522281
|
||||
v 0.040273 -0.017699 0.245653
|
||||
v 0.040273 0.044784 0.245653
|
||||
v 0.040270 -0.017699 0.522282
|
||||
v 0.040270 0.044784 0.522282
|
||||
g Cube.002_Cube.002_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 21 19 17
|
||||
f 19 24 20
|
||||
f 23 22 24
|
||||
f 18 24 22
|
||||
f 17 20 18
|
||||
f 21 18 22
|
||||
f 21 23 19
|
||||
f 19 23 24
|
||||
f 23 21 22
|
||||
f 18 20 24
|
||||
f 17 19 20
|
||||
f 21 17 18
|
||||
o Cube.003
|
||||
v 0.044780 -0.350110 0.140219
|
||||
v 0.044781 -0.060851 0.099493
|
||||
v 0.044779 -0.332746 0.278174
|
||||
v 0.044779 -0.055020 0.237449
|
||||
v -0.023064 -0.350110 0.140218
|
||||
v -0.023063 -0.060851 0.099492
|
||||
v -0.023065 -0.332746 0.278174
|
||||
v -0.023065 -0.055020 0.237448
|
||||
g Cube.003_Cube.003_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 29 25 27
|
||||
f 27 28 32
|
||||
f 32 30 29
|
||||
f 26 30 32
|
||||
f 25 26 28
|
||||
f 29 30 26
|
||||
f 29 27 31
|
||||
f 27 32 31
|
||||
f 32 29 31
|
||||
f 26 32 28
|
||||
f 25 28 27
|
||||
f 29 26 25
|
||||
o Cube.004
|
||||
v -0.007564 -0.227337 -0.031552
|
||||
v -0.007565 -0.064152 0.005996
|
||||
v -0.007564 -0.208299 -0.120240
|
||||
v -0.007564 -0.068160 -0.067640
|
||||
v 0.029284 -0.227337 -0.031552
|
||||
v 0.029284 -0.064152 0.005997
|
||||
v 0.029285 -0.208299 -0.120239
|
||||
v 0.029285 -0.068160 -0.067639
|
||||
g Cube.004_Cube.004_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 37 33 35
|
||||
f 35 36 40
|
||||
f 40 38 37
|
||||
f 34 38 40
|
||||
f 33 34 36
|
||||
f 37 38 34
|
||||
f 37 35 39
|
||||
f 35 40 39
|
||||
f 40 37 39
|
||||
f 34 40 36
|
||||
f 33 36 35
|
||||
f 37 34 33
|
||||
o Cube.005
|
||||
v -0.020753 -0.107119 -0.531392
|
||||
v -0.020753 0.141412 -0.544338
|
||||
v -0.003664 -0.021946 -0.158935
|
||||
v -0.003664 0.082729 -0.158876
|
||||
v 0.042483 -0.107119 -0.531391
|
||||
v 0.042483 0.141412 -0.544337
|
||||
v 0.025386 -0.021946 -0.158934
|
||||
v 0.025386 0.082729 -0.158876
|
||||
g Cube.005_Cube.005_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 41 47 43
|
||||
f 43 48 44
|
||||
f 48 45 46
|
||||
f 42 48 46
|
||||
f 41 44 42
|
||||
f 45 42 46
|
||||
f 41 45 47
|
||||
f 43 47 48
|
||||
f 48 47 45
|
||||
f 42 44 48
|
||||
f 41 43 44
|
||||
f 45 41 42
|
||||
o Cube.006
|
||||
v 0.000571 -0.118602 0.107896
|
||||
v -0.002720 -0.121230 -0.009059
|
||||
v 0.000603 -0.135248 0.110277
|
||||
v -0.002688 -0.137877 -0.012546
|
||||
v 0.024406 -0.118562 0.107455
|
||||
v 0.021115 -0.121190 -0.009501
|
||||
v 0.024439 -0.135209 0.109835
|
||||
v 0.021147 -0.137837 -0.012988
|
||||
g Cube.006_Cube.006_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 49 51 55
|
||||
f 51 52 56
|
||||
f 55 56 54
|
||||
f 54 56 52
|
||||
f 50 52 51
|
||||
f 54 50 49
|
||||
f 49 55 53
|
||||
f 51 56 55
|
||||
f 55 54 53
|
||||
f 54 52 50
|
||||
f 50 51 49
|
||||
f 54 49 53
|
||||
o Cube.007
|
||||
v -0.007304 0.044419 0.246262
|
||||
v -0.007304 0.077544 0.246262
|
||||
v -0.007306 0.044419 0.398763
|
||||
v -0.007306 0.077544 0.398763
|
||||
v 0.029018 0.044419 0.246262
|
||||
v 0.029018 0.077544 0.246262
|
||||
v 0.029017 0.044419 0.398763
|
||||
v 0.029017 0.077544 0.398763
|
||||
g Cube.007_Cube.007_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 61 59 57
|
||||
f 59 64 60
|
||||
f 63 62 64
|
||||
f 58 64 62
|
||||
f 57 60 58
|
||||
f 61 58 62
|
||||
f 61 63 59
|
||||
f 59 63 64
|
||||
f 63 61 62
|
||||
f 58 60 64
|
||||
f 57 59 60
|
||||
f 61 57 58
|
||||
o Cube.008
|
||||
v -0.007094 0.103856 -0.148231
|
||||
v -0.007095 0.099831 -0.064245
|
||||
v 0.004551 0.120408 -0.147438
|
||||
v 0.004550 0.116383 -0.063451
|
||||
v 0.028816 0.103856 -0.148230
|
||||
v 0.028815 0.099831 -0.064244
|
||||
v 0.016708 0.120408 -0.147437
|
||||
v 0.016707 0.116383 -0.063451
|
||||
v 0.004876 0.109148 -0.147438
|
||||
v 0.016846 0.109148 -0.147437
|
||||
v 0.016845 0.105123 -0.063451
|
||||
v 0.004875 0.105123 -0.063451
|
||||
g Cube.008_Cube.008_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 65 73 69
|
||||
f 74 75 72
|
||||
f 71 72 70
|
||||
f 70 75 66
|
||||
f 65 66 68
|
||||
f 69 70 66
|
||||
f 68 76 73
|
||||
f 73 76 75
|
||||
f 69 74 71
|
||||
f 73 65 67
|
||||
f 69 73 74
|
||||
f 74 72 71
|
||||
f 71 70 69
|
||||
f 66 76 68
|
||||
f 75 70 72
|
||||
f 66 75 76
|
||||
f 65 68 67
|
||||
f 69 66 65
|
||||
f 68 73 67
|
||||
f 73 75 74
|
||||
o Cube.009
|
||||
v 0.008374 0.012463 0.566580
|
||||
v 0.008374 0.012329 0.580457
|
||||
v 0.008374 0.083038 0.570030
|
||||
v 0.008374 0.082435 0.583906
|
||||
v 0.013334 0.012463 0.566580
|
||||
v 0.013334 0.012329 0.580457
|
||||
v 0.013334 0.083038 0.570030
|
||||
v 0.013334 0.082435 0.583906
|
||||
g Cube.009_Cube.009_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 81 77 79
|
||||
f 79 80 84
|
||||
f 83 84 82
|
||||
f 78 82 84
|
||||
f 78 80 79
|
||||
f 81 82 78
|
||||
f 81 79 83
|
||||
f 79 84 83
|
||||
f 83 82 81
|
||||
f 78 84 80
|
||||
f 78 79 77
|
||||
f 81 78 77
|
||||
o Cube.010
|
||||
v -0.017007 0.054364 0.092651
|
||||
v -0.017007 0.021382 0.092235
|
||||
v -0.017009 0.052611 0.231668
|
||||
v -0.017009 0.019628 0.231252
|
||||
v -0.031851 0.054364 0.092651
|
||||
v -0.031851 0.021382 0.092235
|
||||
v -0.031853 0.052611 0.231668
|
||||
v -0.031853 0.019628 0.231252
|
||||
g Cube.010_Cube.010_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 89 87 85
|
||||
f 87 92 88
|
||||
f 91 90 92
|
||||
f 86 92 90
|
||||
f 85 88 86
|
||||
f 89 86 90
|
||||
f 89 91 87
|
||||
f 87 91 92
|
||||
f 91 89 90
|
||||
f 86 88 92
|
||||
f 85 87 88
|
||||
f 89 85 86
|
||||
o Cube.011
|
||||
v -0.018695 0.017758 -0.097471
|
||||
v -0.018695 -0.013556 -0.105649
|
||||
v -0.022360 -0.037346 0.072602
|
||||
v -0.022360 -0.048649 0.069650
|
||||
v -0.030160 0.017758 -0.097471
|
||||
v -0.030160 -0.013556 -0.105649
|
||||
v -0.026498 -0.037346 0.072601
|
||||
v -0.026498 -0.048649 0.069650
|
||||
g Cube.011_Cube.011_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 97 95 93
|
||||
f 95 100 96
|
||||
f 99 98 100
|
||||
f 98 96 100
|
||||
f 94 95 96
|
||||
f 97 94 98
|
||||
f 97 99 95
|
||||
f 95 99 100
|
||||
f 99 97 98
|
||||
f 98 94 96
|
||||
f 94 93 95
|
||||
f 97 93 94
|
||||
o Cube.012
|
||||
v 0.009382 0.000237 0.595298
|
||||
v 0.009382 -0.002708 0.595298
|
||||
v 0.009382 0.000237 0.592354
|
||||
v 0.009382 -0.002708 0.592354
|
||||
v 0.012326 0.000237 0.595298
|
||||
v 0.012326 -0.002708 0.595298
|
||||
v 0.012326 0.000237 0.592354
|
||||
v 0.012326 -0.002708 0.592354
|
||||
g Cube.012_Cube.012_None
|
||||
usemtl None
|
||||
s off
|
||||
f 102 101 103
|
||||
f 104 103 107
|
||||
f 108 107 105
|
||||
f 106 105 101
|
||||
f 107 103 101
|
||||
f 104 108 106
|
||||
f 102 103 104
|
||||
f 104 107 108
|
||||
f 108 105 106
|
||||
f 106 101 102
|
||||
f 107 101 105
|
||||
f 104 106 102
|
|
@ -1,327 +0,0 @@
|
|||
m 001 59 39 34 255
|
||||
m 002 152 111 22 255
|
||||
m 003 191 154 46 255
|
||||
o Cube
|
||||
v -0.024207 -0.071709 -0.159259
|
||||
v -0.024207 0.104802 -0.159259
|
||||
v -0.024407 -0.048306 0.246812
|
||||
v -0.024407 0.077955 0.246812
|
||||
v 0.045930 -0.071709 -0.159259
|
||||
v 0.045930 0.104802 -0.159259
|
||||
v 0.045442 -0.048306 0.246813
|
||||
v 0.045442 0.077955 0.246813
|
||||
g Cube_Cube_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 1 7 3
|
||||
f 3 8 4
|
||||
f 8 5 6
|
||||
f 2 8 6
|
||||
f 1 4 2
|
||||
f 5 2 6
|
||||
f 1 5 7
|
||||
f 3 7 8
|
||||
f 8 7 5
|
||||
f 2 4 8
|
||||
f 1 3 4
|
||||
f 5 1 2
|
||||
o Cube.001
|
||||
v -0.005117 -0.016270 0.516193
|
||||
v -0.005117 0.013209 0.516193
|
||||
v -0.005118 -0.016270 0.604628
|
||||
v -0.005118 0.013209 0.604628
|
||||
v 0.026826 -0.016270 0.516193
|
||||
v 0.026826 0.013209 0.516193
|
||||
v 0.026825 -0.016270 0.604629
|
||||
v 0.026825 0.013209 0.604629
|
||||
g Cube.001_Cube.001_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 13 11 9
|
||||
f 11 16 12
|
||||
f 15 14 16
|
||||
f 10 16 14
|
||||
f 9 12 10
|
||||
f 13 10 14
|
||||
f 13 15 11
|
||||
f 11 15 16
|
||||
f 15 13 14
|
||||
f 10 12 16
|
||||
f 9 11 12
|
||||
f 13 9 10
|
||||
o Cube.002
|
||||
v -0.018558 -0.017699 0.245653
|
||||
v -0.018558 0.044784 0.245653
|
||||
v -0.018561 -0.017699 0.522281
|
||||
v -0.018561 0.044784 0.522281
|
||||
v 0.040273 -0.017699 0.245653
|
||||
v 0.040273 0.044784 0.245653
|
||||
v 0.040270 -0.017699 0.522282
|
||||
v 0.040270 0.044784 0.522282
|
||||
g Cube.002_Cube.002_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 21 19 17
|
||||
f 19 24 20
|
||||
f 23 22 24
|
||||
f 18 24 22
|
||||
f 17 20 18
|
||||
f 21 18 22
|
||||
f 21 23 19
|
||||
f 19 23 24
|
||||
f 23 21 22
|
||||
f 18 20 24
|
||||
f 17 19 20
|
||||
f 21 17 18
|
||||
o Cube.003
|
||||
v 0.044780 -0.350110 0.140219
|
||||
v 0.044781 -0.060851 0.099493
|
||||
v 0.044779 -0.332746 0.278174
|
||||
v 0.044779 -0.055020 0.237449
|
||||
v -0.023064 -0.350110 0.140218
|
||||
v -0.023063 -0.060851 0.099492
|
||||
v -0.023065 -0.332746 0.278174
|
||||
v -0.023065 -0.055020 0.237448
|
||||
g Cube.003_Cube.003_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 29 25 27
|
||||
f 27 28 32
|
||||
f 32 30 29
|
||||
f 26 30 32
|
||||
f 25 26 28
|
||||
f 29 30 26
|
||||
f 29 27 31
|
||||
f 27 32 31
|
||||
f 32 29 31
|
||||
f 26 32 28
|
||||
f 25 28 27
|
||||
f 29 26 25
|
||||
o Cube.004
|
||||
v -0.007564 -0.227337 -0.031552
|
||||
v -0.007565 -0.064152 0.005996
|
||||
v -0.007564 -0.208299 -0.120240
|
||||
v -0.007564 -0.068160 -0.067640
|
||||
v 0.029284 -0.227337 -0.031552
|
||||
v 0.029284 -0.064152 0.005997
|
||||
v 0.029285 -0.208299 -0.120239
|
||||
v 0.029285 -0.068160 -0.067639
|
||||
g Cube.004_Cube.004_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 37 33 35
|
||||
f 35 36 40
|
||||
f 40 38 37
|
||||
f 34 38 40
|
||||
f 33 34 36
|
||||
f 37 38 34
|
||||
f 37 35 39
|
||||
f 35 40 39
|
||||
f 40 37 39
|
||||
f 34 40 36
|
||||
f 33 36 35
|
||||
f 37 34 33
|
||||
o Cube.005
|
||||
v -0.020753 -0.107119 -0.531392
|
||||
v -0.020753 0.141412 -0.544338
|
||||
v -0.003664 -0.021946 -0.158935
|
||||
v -0.003664 0.082729 -0.158876
|
||||
v 0.042483 -0.107119 -0.531391
|
||||
v 0.042483 0.141412 -0.544337
|
||||
v 0.025386 -0.021946 -0.158934
|
||||
v 0.025386 0.082729 -0.158876
|
||||
g Cube.005_Cube.005_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 41 47 43
|
||||
f 43 48 44
|
||||
f 48 45 46
|
||||
f 42 48 46
|
||||
f 41 44 42
|
||||
f 45 42 46
|
||||
f 41 45 47
|
||||
f 43 47 48
|
||||
f 48 47 45
|
||||
f 42 44 48
|
||||
f 41 43 44
|
||||
f 45 41 42
|
||||
o Cube.006
|
||||
v 0.000571 -0.118602 0.107896
|
||||
v -0.002720 -0.121230 -0.009059
|
||||
v 0.000603 -0.135248 0.110277
|
||||
v -0.002688 -0.137877 -0.012546
|
||||
v 0.024406 -0.118562 0.107455
|
||||
v 0.021115 -0.121190 -0.009501
|
||||
v 0.024439 -0.135209 0.109835
|
||||
v 0.021147 -0.137837 -0.012988
|
||||
g Cube.006_Cube.006_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 49 51 55
|
||||
f 51 52 56
|
||||
f 55 56 54
|
||||
f 54 56 52
|
||||
f 50 52 51
|
||||
f 54 50 49
|
||||
f 49 55 53
|
||||
f 51 56 55
|
||||
f 55 54 53
|
||||
f 54 52 50
|
||||
f 50 51 49
|
||||
f 54 49 53
|
||||
o Cube.007
|
||||
v -0.007304 0.044419 0.246262
|
||||
v -0.007304 0.077544 0.246262
|
||||
v -0.007306 0.044419 0.398763
|
||||
v -0.007306 0.077544 0.398763
|
||||
v 0.029018 0.044419 0.246262
|
||||
v 0.029018 0.077544 0.246262
|
||||
v 0.029017 0.044419 0.398763
|
||||
v 0.029017 0.077544 0.398763
|
||||
g Cube.007_Cube.007_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 61 59 57
|
||||
f 59 64 60
|
||||
f 63 62 64
|
||||
f 58 64 62
|
||||
f 57 60 58
|
||||
f 61 58 62
|
||||
f 61 63 59
|
||||
f 59 63 64
|
||||
f 63 61 62
|
||||
f 58 60 64
|
||||
f 57 59 60
|
||||
f 61 57 58
|
||||
o Cube.008
|
||||
v -0.007094 0.103856 -0.148231
|
||||
v -0.007095 0.099831 -0.064245
|
||||
v 0.004551 0.120408 -0.147438
|
||||
v 0.004550 0.116383 -0.063451
|
||||
v 0.028816 0.103856 -0.148230
|
||||
v 0.028815 0.099831 -0.064244
|
||||
v 0.016708 0.120408 -0.147437
|
||||
v 0.016707 0.116383 -0.063451
|
||||
v 0.004876 0.109148 -0.147438
|
||||
v 0.016846 0.109148 -0.147437
|
||||
v 0.016845 0.105123 -0.063451
|
||||
v 0.004875 0.105123 -0.063451
|
||||
g Cube.008_Cube.008_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 65 73 69
|
||||
f 74 75 72
|
||||
f 71 72 70
|
||||
f 70 75 66
|
||||
f 65 66 68
|
||||
f 69 70 66
|
||||
f 68 76 73
|
||||
f 73 76 75
|
||||
f 69 74 71
|
||||
f 73 65 67
|
||||
f 69 73 74
|
||||
f 74 72 71
|
||||
f 71 70 69
|
||||
f 66 76 68
|
||||
f 75 70 72
|
||||
f 66 75 76
|
||||
f 65 68 67
|
||||
f 69 66 65
|
||||
f 68 73 67
|
||||
f 73 75 74
|
||||
o Cube.009
|
||||
v 0.008374 0.012463 0.566580
|
||||
v 0.008374 0.012329 0.580457
|
||||
v 0.008374 0.083038 0.570030
|
||||
v 0.008374 0.082435 0.583906
|
||||
v 0.013334 0.012463 0.566580
|
||||
v 0.013334 0.012329 0.580457
|
||||
v 0.013334 0.083038 0.570030
|
||||
v 0.013334 0.082435 0.583906
|
||||
g Cube.009_Cube.009_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 81 77 79
|
||||
f 79 80 84
|
||||
f 83 84 82
|
||||
f 78 82 84
|
||||
f 78 80 79
|
||||
f 81 82 78
|
||||
f 81 79 83
|
||||
f 79 84 83
|
||||
f 83 82 81
|
||||
f 78 84 80
|
||||
f 78 79 77
|
||||
f 81 78 77
|
||||
o Cube.010
|
||||
v -0.017007 0.054364 0.092651
|
||||
v -0.017007 0.021382 0.092235
|
||||
v -0.017009 0.052611 0.231668
|
||||
v -0.017009 0.019628 0.231252
|
||||
v -0.031851 0.054364 0.092651
|
||||
v -0.031851 0.021382 0.092235
|
||||
v -0.031853 0.052611 0.231668
|
||||
v -0.031853 0.019628 0.231252
|
||||
g Cube.010_Cube.010_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 89 87 85
|
||||
f 87 92 88
|
||||
f 91 90 92
|
||||
f 86 92 90
|
||||
f 85 88 86
|
||||
f 89 86 90
|
||||
f 89 91 87
|
||||
f 87 91 92
|
||||
f 91 89 90
|
||||
f 86 88 92
|
||||
f 85 87 88
|
||||
f 89 85 86
|
||||
o Cube.011
|
||||
v -0.018695 0.017758 -0.097471
|
||||
v -0.018695 -0.013556 -0.105649
|
||||
v -0.022360 -0.037346 0.072602
|
||||
v -0.022360 -0.048649 0.069650
|
||||
v -0.030160 0.017758 -0.097471
|
||||
v -0.030160 -0.013556 -0.105649
|
||||
v -0.026498 -0.037346 0.072601
|
||||
v -0.026498 -0.048649 0.069650
|
||||
g Cube.011_Cube.011_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 97 95 93
|
||||
f 95 100 96
|
||||
f 99 98 100
|
||||
f 98 96 100
|
||||
f 94 95 96
|
||||
f 97 94 98
|
||||
f 97 99 95
|
||||
f 95 99 100
|
||||
f 99 97 98
|
||||
f 98 94 96
|
||||
f 94 93 95
|
||||
f 97 93 94
|
||||
o Cube.012
|
||||
v 0.009382 0.000237 0.595298
|
||||
v 0.009382 -0.002708 0.595298
|
||||
v 0.009382 0.000237 0.592354
|
||||
v 0.009382 -0.002708 0.592354
|
||||
v 0.012326 0.000237 0.595298
|
||||
v 0.012326 -0.002708 0.595298
|
||||
v 0.012326 0.000237 0.592354
|
||||
v 0.012326 -0.002708 0.592354
|
||||
g Cube.012_Cube.012_None
|
||||
usemtl None
|
||||
s off
|
||||
f 102 101 103
|
||||
f 104 103 107
|
||||
f 108 107 105
|
||||
f 106 105 101
|
||||
f 107 103 101
|
||||
f 104 108 106
|
||||
f 102 103 104
|
||||
f 104 107 108
|
||||
f 108 105 106
|
||||
f 106 101 102
|
||||
f 107 101 105
|
||||
f 104 106 102
|
|
@ -1,561 +0,0 @@
|
|||
m 000 115 115 115 255
|
||||
m 001 186 185 185 255
|
||||
m 002 59 59 59 255
|
||||
o Cube
|
||||
v -0.024252 0.023934 -0.086526
|
||||
v -0.023618 -0.047762 -0.071141
|
||||
v -0.026816 -0.141525 -0.217037
|
||||
v -0.026812 -0.146248 -0.125833
|
||||
v 0.020828 0.025550 -0.086710
|
||||
v 0.021300 -0.048903 -0.071143
|
||||
v 0.025944 -0.141525 -0.217040
|
||||
v 0.025949 -0.146248 -0.125835
|
||||
v -0.030155 -0.011802 -0.077804
|
||||
v 0.025946 -0.145332 -0.172253
|
||||
v -0.026814 -0.145332 -0.167923
|
||||
v 0.027652 -0.012270 -0.077145
|
||||
v -0.000429 -0.063540 -0.068120
|
||||
v -0.000436 -0.141525 -0.217039
|
||||
v -0.000432 -0.146248 -0.125834
|
||||
v -0.000430 0.039735 -0.092054
|
||||
v -0.000429 -0.009761 -0.080915
|
||||
v -0.000434 -0.145332 -0.167925
|
||||
v 0.019666 -0.075621 -0.106346
|
||||
v -0.021522 -0.010121 -0.159039
|
||||
v 0.019466 -0.009502 -0.159326
|
||||
v -0.021254 -0.075167 -0.106494
|
||||
v -0.023994 -0.043008 -0.136460
|
||||
v 0.022326 -0.043107 -0.136138
|
||||
v -0.000488 -0.081045 -0.103217
|
||||
v -0.000491 -0.004563 -0.163317
|
||||
v 0.022759 -0.107398 -0.119066
|
||||
v -0.024129 -0.074246 -0.206445
|
||||
v -0.025383 -0.088212 -0.160993
|
||||
v -0.000460 -0.110152 -0.117477
|
||||
v -0.000465 -0.071424 -0.208618
|
||||
v 0.022654 -0.073932 -0.206592
|
||||
v -0.023990 -0.107168 -0.119140
|
||||
v 0.024108 -0.088262 -0.160830
|
||||
g Cube_Cube_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 32 14 31
|
||||
f 14 10 18
|
||||
f 21 12 24
|
||||
f 33 15 30
|
||||
f 29 3 11
|
||||
f 17 1 9
|
||||
f 17 2 13
|
||||
f 33 11 4
|
||||
f 24 6 19
|
||||
f 18 8 15
|
||||
f 11 15 4
|
||||
f 6 17 13
|
||||
f 5 17 12
|
||||
f 27 15 8
|
||||
f 3 18 11
|
||||
f 28 14 3
|
||||
f 16 20 1
|
||||
f 13 19 6
|
||||
f 34 19 27
|
||||
f 2 23 22
|
||||
f 9 20 23
|
||||
f 13 22 25
|
||||
f 32 24 34
|
||||
f 16 21 26
|
||||
f 7 34 10
|
||||
f 10 27 8
|
||||
f 20 31 28
|
||||
f 19 30 27
|
||||
f 22 29 33
|
||||
f 23 28 29
|
||||
f 22 30 25
|
||||
f 21 31 26
|
||||
f 32 7 14
|
||||
f 14 7 10
|
||||
f 21 5 12
|
||||
f 33 4 15
|
||||
f 29 28 3
|
||||
f 17 16 1
|
||||
f 17 9 2
|
||||
f 33 29 11
|
||||
f 24 12 6
|
||||
f 18 10 8
|
||||
f 11 18 15
|
||||
f 6 12 17
|
||||
f 5 16 17
|
||||
f 27 30 15
|
||||
f 3 14 18
|
||||
f 28 31 14
|
||||
f 16 26 20
|
||||
f 13 25 19
|
||||
f 34 24 19
|
||||
f 2 9 23
|
||||
f 9 1 20
|
||||
f 13 2 22
|
||||
f 32 21 24
|
||||
f 16 5 21
|
||||
f 7 32 34
|
||||
f 10 34 27
|
||||
f 20 26 31
|
||||
f 19 25 30
|
||||
f 22 23 29
|
||||
f 23 20 28
|
||||
f 22 33 30
|
||||
f 21 32 31
|
||||
o Cylinder
|
||||
v -0.000429 -0.066073 -0.070777
|
||||
v -0.025224 -0.050268 -0.074393
|
||||
v -0.031918 -0.012112 -0.081069
|
||||
v -0.025225 0.026045 -0.090815
|
||||
v -0.000430 0.041850 -0.097547
|
||||
v 0.022953 0.026045 -0.090818
|
||||
v 0.029647 -0.012112 -0.081072
|
||||
v 0.022953 -0.050268 -0.074395
|
||||
v -0.000426 -0.042293 -0.022314
|
||||
v -0.038583 -0.026488 -0.022312
|
||||
v -0.039557 0.011669 -0.022312
|
||||
v -0.027496 0.051486 -0.023865
|
||||
v -0.000426 0.062581 -0.023279
|
||||
v 0.037730 0.049826 -0.022315
|
||||
v 0.053535 0.011669 -0.022316
|
||||
v 0.037730 -0.026488 -0.022316
|
||||
g Cylinder_Cylinder_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 45 44 43
|
||||
f 40 41 38
|
||||
f 42 43 35
|
||||
f 41 50 42
|
||||
f 40 49 41
|
||||
f 39 48 40
|
||||
f 46 39 38
|
||||
f 45 38 37
|
||||
f 44 37 36
|
||||
f 43 36 35
|
||||
f 43 50 45
|
||||
f 50 49 45
|
||||
f 49 48 45
|
||||
f 48 47 45
|
||||
f 47 46 45
|
||||
f 42 35 36
|
||||
f 36 37 42
|
||||
f 37 38 41
|
||||
f 42 37 41
|
||||
f 38 39 40
|
||||
f 42 50 43
|
||||
f 41 49 50
|
||||
f 40 48 49
|
||||
f 39 47 48
|
||||
f 46 47 39
|
||||
f 45 46 38
|
||||
f 44 45 37
|
||||
f 43 44 36
|
||||
o Cylinder.001
|
||||
v 0.000680 -0.050063 -0.044457
|
||||
v 0.000686 -0.068082 0.069826
|
||||
v -0.030562 -0.037122 -0.044455
|
||||
v -0.043296 -0.049864 0.069828
|
||||
v -0.043503 -0.005880 -0.044454
|
||||
v -0.061514 -0.005881 0.069829
|
||||
v -0.030562 0.025362 -0.044455
|
||||
v -0.043296 0.038101 0.069829
|
||||
v 0.000680 0.038303 -0.044456
|
||||
v 0.000686 0.056320 0.069827
|
||||
v 0.031923 0.025362 -0.044458
|
||||
v 0.044669 0.038101 0.069824
|
||||
v 0.044864 -0.005880 -0.044459
|
||||
v 0.062887 -0.005881 0.069823
|
||||
v 0.031923 -0.037122 -0.044458
|
||||
v 0.044669 -0.049864 0.069824
|
||||
v 0.000681 -0.068081 -0.025774
|
||||
v -0.043301 -0.049863 -0.025771
|
||||
v -0.061519 -0.005880 -0.025770
|
||||
v -0.043301 0.038102 -0.025771
|
||||
v 0.000681 0.056320 -0.025773
|
||||
v 0.044664 0.038102 -0.025775
|
||||
v 0.062882 -0.005880 -0.025776
|
||||
v 0.044664 -0.049863 -0.025776
|
||||
g Cylinder.001_Cylinder.001_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 52 68 67
|
||||
f 54 69 68
|
||||
f 56 70 69
|
||||
f 58 71 70
|
||||
f 71 62 72
|
||||
f 72 64 73
|
||||
f 56 52 64
|
||||
f 73 66 74
|
||||
f 74 52 67
|
||||
f 63 65 57
|
||||
f 74 51 65
|
||||
f 73 65 63
|
||||
f 72 63 61
|
||||
f 71 61 59
|
||||
f 57 71 59
|
||||
f 55 70 57
|
||||
f 53 69 55
|
||||
f 51 68 53
|
||||
f 52 54 68
|
||||
f 54 56 69
|
||||
f 56 58 70
|
||||
f 58 60 71
|
||||
f 71 60 62
|
||||
f 72 62 64
|
||||
f 56 54 52
|
||||
f 52 66 64
|
||||
f 64 62 60
|
||||
f 60 58 64
|
||||
f 58 56 64
|
||||
f 73 64 66
|
||||
f 74 66 52
|
||||
f 65 51 57
|
||||
f 51 53 57
|
||||
f 53 55 57
|
||||
f 57 59 61
|
||||
f 61 63 57
|
||||
f 74 67 51
|
||||
f 73 74 65
|
||||
f 72 73 63
|
||||
f 71 72 61
|
||||
f 57 70 71
|
||||
f 55 69 70
|
||||
f 53 68 69
|
||||
f 51 67 68
|
||||
o Cylinder.002
|
||||
v -0.000573 -0.016042 -0.024385
|
||||
v -0.000560 -0.016045 0.229626
|
||||
v -0.028713 -0.004386 -0.024383
|
||||
v -0.028700 -0.004389 0.229628
|
||||
v -0.040369 0.023754 -0.024383
|
||||
v -0.040356 0.023751 0.229628
|
||||
v -0.028713 0.051894 -0.024383
|
||||
v -0.028700 0.051891 0.229628
|
||||
v -0.000573 0.063550 -0.024384
|
||||
v -0.000560 0.063547 0.229627
|
||||
v 0.027567 0.051894 -0.024386
|
||||
v 0.027580 0.051891 0.229625
|
||||
v 0.039223 0.023754 -0.024387
|
||||
v 0.039236 0.023751 0.229624
|
||||
v 0.027567 -0.004386 -0.024386
|
||||
v 0.027580 -0.004389 0.229625
|
||||
g Cylinder.002_Cylinder.002_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 75 78 77
|
||||
f 77 80 79
|
||||
f 79 82 81
|
||||
f 81 84 83
|
||||
f 84 85 83
|
||||
f 86 87 85
|
||||
f 80 76 88
|
||||
f 88 89 87
|
||||
f 90 75 89
|
||||
f 81 85 89
|
||||
f 75 76 78
|
||||
f 77 78 80
|
||||
f 79 80 82
|
||||
f 81 82 84
|
||||
f 84 86 85
|
||||
f 86 88 87
|
||||
f 80 78 76
|
||||
f 76 90 88
|
||||
f 88 86 84
|
||||
f 84 82 88
|
||||
f 82 80 88
|
||||
f 88 90 89
|
||||
f 90 76 75
|
||||
f 89 75 77
|
||||
f 77 79 81
|
||||
f 81 83 85
|
||||
f 85 87 89
|
||||
f 89 77 81
|
||||
o Cube.001
|
||||
v 0.011799 -0.050196 0.066325
|
||||
v 0.011799 -0.009981 0.066325
|
||||
v 0.011801 -0.050196 0.101949
|
||||
v 0.011802 -0.009981 0.111867
|
||||
v -0.012643 -0.050196 0.066326
|
||||
v -0.012643 -0.009981 0.066326
|
||||
v -0.012641 -0.050196 0.101951
|
||||
v -0.012641 -0.009981 0.111869
|
||||
v 0.011800 -0.055613 0.078765
|
||||
v 0.011801 -0.009981 0.089096
|
||||
v -0.012642 -0.055613 0.078767
|
||||
v -0.012642 -0.009981 0.089098
|
||||
g Cube.001_Cube.001_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 100 93 99
|
||||
f 94 97 93
|
||||
f 102 95 101
|
||||
f 96 91 95
|
||||
f 101 91 99
|
||||
f 100 96 102
|
||||
f 94 102 98
|
||||
f 97 99 93
|
||||
f 97 102 101
|
||||
f 91 100 99
|
||||
f 100 94 93
|
||||
f 94 98 97
|
||||
f 102 96 95
|
||||
f 96 92 91
|
||||
f 101 95 91
|
||||
f 100 92 96
|
||||
f 94 100 102
|
||||
f 97 101 99
|
||||
f 97 98 102
|
||||
f 91 92 100
|
||||
o Cube.002
|
||||
v 0.008749 -0.050911 0.081093
|
||||
v 0.008742 -0.044649 -0.066548
|
||||
v 0.008749 -0.053230 0.071768
|
||||
v 0.008742 -0.053814 -0.063661
|
||||
v -0.009591 -0.050911 0.081094
|
||||
v -0.009599 -0.044649 -0.066547
|
||||
v -0.009592 -0.053230 0.071769
|
||||
v -0.009599 -0.053814 -0.063660
|
||||
v 0.008748 -0.103724 0.062261
|
||||
v 0.008748 -0.096336 0.056117
|
||||
v -0.009593 -0.096336 0.056118
|
||||
v -0.009592 -0.103724 0.062262
|
||||
v 0.008749 -0.074446 0.071501
|
||||
v -0.009592 -0.074446 0.071502
|
||||
v -0.009592 -0.078461 0.080232
|
||||
v 0.008749 -0.078461 0.080231
|
||||
v 0.008746 -0.121718 0.019546
|
||||
v 0.008746 -0.112126 0.018982
|
||||
v -0.009595 -0.112126 0.018983
|
||||
v -0.009595 -0.121718 0.019547
|
||||
v 0.008741 -0.071969 -0.080498
|
||||
v 0.008742 -0.074470 -0.071221
|
||||
v -0.009599 -0.074470 -0.071220
|
||||
v -0.009600 -0.071969 -0.080497
|
||||
v 0.008742 -0.082089 -0.068848
|
||||
v -0.009599 -0.082089 -0.068847
|
||||
v -0.009600 -0.082304 -0.078308
|
||||
v 0.008741 -0.082304 -0.078308
|
||||
v 0.008742 -0.103777 -0.056970
|
||||
v -0.009599 -0.103777 -0.056969
|
||||
v -0.009599 -0.109410 -0.062400
|
||||
v 0.008742 -0.109410 -0.062401
|
||||
v 0.008744 -0.114815 -0.024823
|
||||
v -0.009597 -0.114815 -0.024822
|
||||
v -0.009597 -0.123457 -0.027256
|
||||
v 0.008744 -0.123457 -0.027257
|
||||
g Cube.002_Cube.002_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 104 124 123
|
||||
f 106 125 124
|
||||
f 125 108 126
|
||||
f 108 123 126
|
||||
f 109 103 105
|
||||
f 106 108 110
|
||||
f 114 118 117
|
||||
f 116 114 117
|
||||
f 112 116 115
|
||||
f 111 115 118
|
||||
f 118 105 103
|
||||
f 115 109 105
|
||||
f 109 117 107
|
||||
f 117 103 107
|
||||
f 122 111 114
|
||||
f 113 122 114
|
||||
f 120 113 112
|
||||
f 119 112 111
|
||||
f 126 130 129
|
||||
f 125 129 128
|
||||
f 124 128 127
|
||||
f 130 124 127
|
||||
f 134 127 131
|
||||
f 127 132 131
|
||||
f 128 133 132
|
||||
f 133 130 134
|
||||
f 133 138 137
|
||||
f 132 137 136
|
||||
f 131 136 135
|
||||
f 138 131 135
|
||||
f 119 135 120
|
||||
f 135 121 120
|
||||
f 136 122 121
|
||||
f 137 119 122
|
||||
f 104 106 124
|
||||
f 106 110 125
|
||||
f 125 110 108
|
||||
f 108 104 123
|
||||
f 109 107 103
|
||||
f 106 104 108
|
||||
f 114 111 118
|
||||
f 116 113 114
|
||||
f 112 113 116
|
||||
f 111 112 115
|
||||
f 118 115 105
|
||||
f 115 116 109
|
||||
f 109 116 117
|
||||
f 117 118 103
|
||||
f 122 119 111
|
||||
f 113 121 122
|
||||
f 120 121 113
|
||||
f 119 120 112
|
||||
f 126 123 130
|
||||
f 125 126 129
|
||||
f 124 125 128
|
||||
f 130 123 124
|
||||
f 134 130 127
|
||||
f 127 128 132
|
||||
f 128 129 133
|
||||
f 133 129 130
|
||||
f 133 134 138
|
||||
f 132 133 137
|
||||
f 131 132 136
|
||||
f 138 134 131
|
||||
f 119 138 135
|
||||
f 135 136 121
|
||||
f 136 137 122
|
||||
f 137 138 119
|
||||
o Cube.003
|
||||
v 0.006236 -0.050323 -0.046138
|
||||
v 0.004583 -0.104634 -0.011012
|
||||
v -0.007090 -0.050324 -0.046139
|
||||
v -0.004588 -0.104635 -0.011012
|
||||
v 0.006235 -0.048151 -0.038315
|
||||
v 0.004582 -0.099372 -0.009133
|
||||
v -0.007090 -0.048151 -0.038315
|
||||
v -0.004588 -0.099373 -0.009132
|
||||
v 0.006659 -0.083864 -0.034361
|
||||
v -0.006666 -0.083865 -0.034361
|
||||
v -0.006667 -0.078845 -0.027979
|
||||
v 0.006659 -0.078844 -0.027979
|
||||
g Cube.003_Cube.003_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 147 142 148
|
||||
f 142 149 148
|
||||
f 146 150 149
|
||||
f 150 140 147
|
||||
f 145 139 141
|
||||
f 142 144 146
|
||||
f 143 147 139
|
||||
f 149 143 145
|
||||
f 148 145 141
|
||||
f 139 148 141
|
||||
f 147 140 142
|
||||
f 142 146 149
|
||||
f 146 144 150
|
||||
f 150 144 140
|
||||
f 145 143 139
|
||||
f 142 140 144
|
||||
f 143 150 147
|
||||
f 149 150 143
|
||||
f 148 149 145
|
||||
f 139 147 148
|
||||
o Cube.004
|
||||
v 0.008641 0.043812 -0.051105
|
||||
v 0.005812 0.072982 -0.104861
|
||||
v -0.009202 0.043813 -0.051103
|
||||
v -0.004953 0.072982 -0.104860
|
||||
v 0.008639 0.035930 -0.064192
|
||||
v 0.005811 0.064529 -0.107332
|
||||
v -0.009204 0.035931 -0.064190
|
||||
v -0.004954 0.064529 -0.107332
|
||||
v 0.009206 0.064448 -0.066805
|
||||
v -0.008636 0.064448 -0.066803
|
||||
v -0.008638 0.056124 -0.079558
|
||||
v 0.009205 0.056124 -0.079561
|
||||
g Cube.004_Cube.004_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 159 154 160
|
||||
f 154 161 160
|
||||
f 158 162 161
|
||||
f 162 152 159
|
||||
f 157 151 153
|
||||
f 154 156 158
|
||||
f 155 159 151
|
||||
f 161 155 157
|
||||
f 160 157 153
|
||||
f 151 160 153
|
||||
f 159 152 154
|
||||
f 154 158 161
|
||||
f 158 156 162
|
||||
f 162 156 152
|
||||
f 157 155 151
|
||||
f 154 152 156
|
||||
f 155 162 159
|
||||
f 161 162 155
|
||||
f 160 161 157
|
||||
f 151 159 160
|
||||
o Cube.005
|
||||
v -0.002470 0.077137 0.216076
|
||||
v -0.009079 0.062662 0.216076
|
||||
v -0.002472 0.077137 0.174878
|
||||
v -0.009082 0.062662 0.174879
|
||||
v 0.001956 0.077137 0.216076
|
||||
v 0.008303 0.062662 0.216075
|
||||
v 0.001954 0.077137 0.174878
|
||||
v 0.008301 0.062662 0.174878
|
||||
v 0.001665 0.070057 0.174878
|
||||
v 0.001665 0.062662 0.174878
|
||||
v 0.001667 0.070057 0.216076
|
||||
v 0.001667 0.062662 0.216076
|
||||
v -0.002681 0.070057 0.174878
|
||||
v -0.002679 0.062662 0.216076
|
||||
v -0.002681 0.062662 0.174878
|
||||
v -0.002679 0.070057 0.216076
|
||||
g Cube.005_Cube.005_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 164 163 165
|
||||
f 171 169 170
|
||||
f 170 169 167
|
||||
f 178 163 164
|
||||
f 169 171 173
|
||||
f 166 177 176
|
||||
f 172 170 168
|
||||
f 171 175 178
|
||||
f 168 167 173
|
||||
f 177 175 171
|
||||
f 166 165 175
|
||||
f 175 165 163
|
||||
f 177 172 174
|
||||
f 174 173 178
|
||||
f 164 165 166
|
||||
f 171 170 172
|
||||
f 170 167 168
|
||||
f 178 164 176
|
||||
f 169 173 167
|
||||
f 166 176 164
|
||||
f 172 168 174
|
||||
f 171 178 173
|
||||
f 168 173 174
|
||||
f 177 171 172
|
||||
f 166 175 177
|
||||
f 175 163 178
|
||||
f 177 174 176
|
||||
f 174 178 176
|
||||
o fire_place_Cube.006
|
||||
v -0.003127 0.028591 0.223943
|
||||
v -0.003127 0.023740 0.223943
|
||||
v -0.003127 0.028591 0.219092
|
||||
v -0.003127 0.023740 0.219092
|
||||
v 0.001724 0.028591 0.223943
|
||||
v 0.001724 0.023740 0.223943
|
||||
v 0.001724 0.028591 0.219091
|
||||
v 0.001724 0.023740 0.219091
|
||||
g fire_place_Cube.006_None
|
||||
usemtl None
|
||||
s off
|
||||
f 180 179 181
|
||||
f 182 181 185
|
||||
f 186 185 183
|
||||
f 184 183 179
|
||||
f 185 181 179
|
||||
f 182 186 184
|
||||
f 180 181 182
|
||||
f 182 185 186
|
||||
f 186 183 184
|
||||
f 184 179 180
|
||||
f 185 179 183
|
||||
f 182 184 180
|
|
@ -1,219 +0,0 @@
|
|||
m 000 255 255 255 255
|
||||
m 001 139 139 139 255
|
||||
m 002 231 92 71 255
|
||||
o Cube
|
||||
v -0.180827 -0.334950 0.425389
|
||||
v -0.180827 0.138945 0.425389
|
||||
v -0.180827 -0.334950 -0.425389
|
||||
v -0.180827 0.138945 -0.425389
|
||||
v 0.180827 -0.334950 0.425389
|
||||
v 0.180827 0.138945 0.425389
|
||||
v 0.180827 -0.334950 -0.425389
|
||||
v 0.180827 0.138945 -0.425389
|
||||
g Cube_Cube_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 5 1 3
|
||||
f 3 4 8
|
||||
f 7 8 6
|
||||
f 2 6 8
|
||||
f 1 2 4
|
||||
f 5 6 2
|
||||
f 5 3 7
|
||||
f 3 8 7
|
||||
f 7 6 5
|
||||
f 2 8 4
|
||||
f 1 4 3
|
||||
f 5 2 1
|
||||
o Cube.001_Cube.014
|
||||
v -0.057016 0.133674 0.270927
|
||||
v -0.057016 0.133700 0.214045
|
||||
v -0.057016 0.134697 -0.271347
|
||||
v -0.057016 0.134697 -0.214466
|
||||
v 0.057016 0.133674 0.270927
|
||||
v 0.057016 0.133700 0.214045
|
||||
v 0.057016 0.134697 -0.271347
|
||||
v 0.057016 0.134697 -0.214466
|
||||
v 0.057016 0.235886 0.159556
|
||||
v -0.057016 0.276102 0.199782
|
||||
v 0.057016 0.276102 0.199782
|
||||
v -0.057016 0.235886 0.159556
|
||||
v 0.057016 0.234873 -0.161984
|
||||
v -0.057016 0.275094 -0.202205
|
||||
v 0.057016 0.275094 -0.202205
|
||||
v -0.057016 0.234873 -0.161984
|
||||
g Cube.001_Cube.014_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 23 11 22
|
||||
f 11 16 12
|
||||
f 17 13 14
|
||||
f 24 16 21
|
||||
f 24 11 12
|
||||
f 13 10 14
|
||||
f 9 20 10
|
||||
f 10 17 14
|
||||
f 23 17 21
|
||||
f 13 18 9
|
||||
f 15 21 16
|
||||
f 20 22 24
|
||||
f 20 21 17
|
||||
f 19 22 18
|
||||
f 23 15 11
|
||||
f 11 15 16
|
||||
f 17 19 13
|
||||
f 24 12 16
|
||||
f 24 22 11
|
||||
f 13 9 10
|
||||
f 9 18 20
|
||||
f 10 20 17
|
||||
f 23 19 17
|
||||
f 13 19 18
|
||||
f 15 23 21
|
||||
f 20 18 22
|
||||
f 20 24 21
|
||||
f 19 23 22
|
||||
o Cube.002_Cube.015
|
||||
v 0.221679 0.007596 0.175239
|
||||
v 0.221679 0.007596 -0.175239
|
||||
v 0.170536 0.007596 -0.175239
|
||||
v 0.170536 0.007596 0.175239
|
||||
v 0.221679 -0.175675 -0.175239
|
||||
v 0.170536 -0.175675 -0.175239
|
||||
v 0.170536 -0.175675 0.175239
|
||||
v 0.221679 -0.175675 0.175239
|
||||
v 0.221679 -0.266031 0.093126
|
||||
v 0.221679 0.084447 0.093126
|
||||
v 0.170536 -0.266031 0.093126
|
||||
v 0.170536 0.084447 0.093126
|
||||
v 0.170536 0.007596 0.093126
|
||||
v 0.221679 0.007596 0.093126
|
||||
v 0.221679 -0.175675 0.093126
|
||||
v 0.170536 -0.175675 0.093126
|
||||
v 0.221679 0.084447 -0.102038
|
||||
v 0.170536 -0.266031 -0.102038
|
||||
v 0.221679 0.007596 -0.102038
|
||||
v 0.221679 -0.175675 -0.102038
|
||||
v 0.221679 -0.266031 -0.102038
|
||||
v 0.170536 0.084447 -0.102038
|
||||
v 0.170536 0.007596 -0.102038
|
||||
v 0.170536 -0.175675 -0.102038
|
||||
g Cube.002_Cube.015_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 46 41 43
|
||||
f 47 43 26
|
||||
f 39 31 40
|
||||
f 28 31 32
|
||||
f 37 40 31
|
||||
f 26 29 30
|
||||
f 43 44 29
|
||||
f 48 42 35
|
||||
f 39 32 31
|
||||
f 25 32 39
|
||||
f 47 48 40
|
||||
f 41 46 36
|
||||
f 42 45 33
|
||||
f 46 47 37
|
||||
f 27 47 26
|
||||
f 43 47 46
|
||||
f 27 30 48
|
||||
f 39 33 45
|
||||
f 38 39 44
|
||||
f 34 38 43
|
||||
f 33 39 35
|
||||
f 40 35 39
|
||||
f 28 25 37
|
||||
f 38 37 25
|
||||
f 36 37 34
|
||||
f 38 34 37
|
||||
f 45 42 44
|
||||
f 42 48 44
|
||||
f 30 29 48
|
||||
f 44 48 29
|
||||
f 28 32 25
|
||||
f 37 31 28
|
||||
f 26 30 27
|
||||
f 43 29 26
|
||||
f 48 35 40
|
||||
f 25 39 38
|
||||
f 47 40 37
|
||||
f 41 36 34
|
||||
f 42 33 35
|
||||
f 46 37 36
|
||||
f 27 48 47
|
||||
f 39 45 44
|
||||
f 38 44 43
|
||||
f 34 43 41
|
||||
o Cube.003_Cube.016
|
||||
v -0.173033 0.007596 0.175239
|
||||
v -0.173033 0.007596 -0.175239
|
||||
v -0.224176 0.007596 -0.175239
|
||||
v -0.224176 0.007596 0.175239
|
||||
v -0.173033 -0.175675 -0.175239
|
||||
v -0.224176 -0.175675 -0.175239
|
||||
v -0.224176 -0.175675 0.175239
|
||||
v -0.173033 -0.175675 0.175239
|
||||
v -0.173033 -0.266031 0.093126
|
||||
v -0.173033 0.084447 0.093126
|
||||
v -0.224176 -0.266031 0.093126
|
||||
v -0.224176 0.084447 0.093126
|
||||
v -0.224176 0.007596 0.093126
|
||||
v -0.173033 0.007596 0.093126
|
||||
v -0.173033 -0.175675 0.093126
|
||||
v -0.224176 -0.175675 0.093126
|
||||
v -0.173033 0.084447 -0.102038
|
||||
v -0.224176 -0.266031 -0.102038
|
||||
v -0.173033 0.007596 -0.102038
|
||||
v -0.173033 -0.175675 -0.102038
|
||||
v -0.173033 -0.266031 -0.102038
|
||||
v -0.224176 0.084447 -0.102038
|
||||
v -0.224176 0.007596 -0.102038
|
||||
v -0.224176 -0.175675 -0.102038
|
||||
g Cube.003_Cube.016_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 70 65 67
|
||||
f 71 67 50
|
||||
f 63 55 64
|
||||
f 52 55 56
|
||||
f 61 64 55
|
||||
f 50 53 54
|
||||
f 67 68 53
|
||||
f 72 66 59
|
||||
f 63 56 55
|
||||
f 49 56 63
|
||||
f 71 72 64
|
||||
f 65 70 60
|
||||
f 66 69 57
|
||||
f 70 71 61
|
||||
f 51 71 50
|
||||
f 67 71 70
|
||||
f 51 54 72
|
||||
f 63 57 69
|
||||
f 62 63 68
|
||||
f 58 62 67
|
||||
f 57 63 59
|
||||
f 64 59 63
|
||||
f 52 49 61
|
||||
f 62 61 49
|
||||
f 60 61 58
|
||||
f 62 58 61
|
||||
f 69 66 68
|
||||
f 66 72 68
|
||||
f 54 53 72
|
||||
f 68 72 53
|
||||
f 52 56 49
|
||||
f 61 55 52
|
||||
f 50 54 51
|
||||
f 67 53 50
|
||||
f 72 59 64
|
||||
f 49 63 62
|
||||
f 71 64 61
|
||||
f 65 60 58
|
||||
f 66 57 59
|
||||
f 70 61 60
|
||||
f 51 72 71
|
||||
f 63 69 68
|
||||
f 62 68 67
|
||||
f 58 67 65
|
|
@ -1,590 +0,0 @@
|
|||
m 000 122 122 122 255
|
||||
m 001 65 65 65 255
|
||||
o Cube
|
||||
v 0.001885 0.082987 0.933810
|
||||
v -0.081111 0.000009 0.933814
|
||||
v 0.001827 -0.054465 -0.286563
|
||||
v -0.022099 -0.053682 -0.304169
|
||||
v 0.084863 -0.000009 0.933807
|
||||
v 0.001867 -0.082987 0.933810
|
||||
v 0.025747 -0.053681 -0.304177
|
||||
v 0.001820 -0.052874 -0.322313
|
||||
v 0.001802 -0.080995 -0.592278
|
||||
v 0.001816 0.086524 -0.709669
|
||||
v 0.084796 -0.022335 -0.650970
|
||||
v -0.081178 -0.022322 -0.650977
|
||||
v 0.001804 -0.178469 -0.553477
|
||||
v 0.001818 -0.266415 -0.673016
|
||||
v 0.084798 -0.227338 -0.608313
|
||||
v -0.081176 -0.227351 -0.608319
|
||||
v 0.084801 -0.000009 -0.553860
|
||||
v -0.081174 0.000009 -0.553853
|
||||
v 0.001804 -0.082987 -0.553857
|
||||
v 0.001823 0.082987 -0.553857
|
||||
v 0.001810 -0.159592 -0.408492
|
||||
v 0.001832 -0.247885 -0.321054
|
||||
v 0.084809 -0.206522 -0.362020
|
||||
v -0.081166 -0.206535 -0.362000
|
||||
g Cube_Cube_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 23 3 22
|
||||
f 3 8 4
|
||||
f 17 6 19
|
||||
f 21 4 8
|
||||
f 24 3 4
|
||||
f 5 2 6
|
||||
f 18 10 12
|
||||
f 19 12 9
|
||||
f 15 9 13
|
||||
f 17 10 20
|
||||
f 23 13 21
|
||||
f 12 14 16
|
||||
f 9 16 13
|
||||
f 11 14 10
|
||||
f 5 20 1
|
||||
f 2 19 6
|
||||
f 1 18 2
|
||||
f 9 17 19
|
||||
f 7 21 8
|
||||
f 16 22 24
|
||||
f 13 24 21
|
||||
f 15 22 14
|
||||
f 23 7 3
|
||||
f 3 7 8
|
||||
f 17 5 6
|
||||
f 21 24 4
|
||||
f 24 22 3
|
||||
f 5 1 2
|
||||
f 18 20 10
|
||||
f 19 18 12
|
||||
f 15 11 9
|
||||
f 17 11 10
|
||||
f 23 15 13
|
||||
f 12 10 14
|
||||
f 9 12 16
|
||||
f 11 15 14
|
||||
f 5 17 20
|
||||
f 2 18 19
|
||||
f 1 20 18
|
||||
f 9 11 17
|
||||
f 7 23 21
|
||||
f 16 14 22
|
||||
f 13 16 24
|
||||
f 15 23 22
|
||||
o Cube.001_Cube.014
|
||||
v -0.057575 -0.022317 0.457073
|
||||
v -0.057576 -0.171069 0.435865
|
||||
v -0.057589 -0.022317 0.127004
|
||||
v -0.057589 -0.212921 0.127004
|
||||
v 0.061287 -0.022317 0.457068
|
||||
v 0.061286 -0.171069 0.435860
|
||||
v 0.061273 -0.022317 0.126999
|
||||
v 0.061273 -0.212921 0.126999
|
||||
g Cube.001_Cube.014_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 26 25 27
|
||||
f 28 27 31
|
||||
f 31 29 30
|
||||
f 30 29 25
|
||||
f 31 27 25
|
||||
f 28 32 30
|
||||
f 26 27 28
|
||||
f 28 31 32
|
||||
f 31 30 32
|
||||
f 30 25 26
|
||||
f 31 25 29
|
||||
f 28 30 26
|
||||
o Cube.002_Cube.015
|
||||
v 0.042829 -0.039642 -0.085369
|
||||
v 0.042830 -0.120081 -0.064718
|
||||
v 0.042824 -0.039642 0.130102
|
||||
v 0.042824 -0.148946 0.130102
|
||||
v -0.039149 -0.039642 -0.085375
|
||||
v -0.039148 -0.120081 -0.064724
|
||||
v -0.039154 -0.039642 0.130096
|
||||
v -0.039154 -0.148946 0.130096
|
||||
g Cube.002_Cube.015_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 34 33 35
|
||||
f 36 35 39
|
||||
f 39 37 38
|
||||
f 38 37 33
|
||||
f 39 35 33
|
||||
f 40 38 34
|
||||
f 34 35 36
|
||||
f 36 39 40
|
||||
f 39 38 40
|
||||
f 38 33 34
|
||||
f 39 33 37
|
||||
f 40 34 36
|
||||
o Cube.003_Cube.016
|
||||
v 0.028564 -0.307684 -0.147592
|
||||
v 0.028568 -0.094102 -0.050945
|
||||
v 0.028569 -0.311346 -0.035781
|
||||
v 0.028573 -0.112165 0.054349
|
||||
v -0.024904 -0.307684 -0.147590
|
||||
v -0.024900 -0.094102 -0.050943
|
||||
v -0.024899 -0.311346 -0.035779
|
||||
v -0.024895 -0.112165 0.054352
|
||||
g Cube.003_Cube.016_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 42 43 41
|
||||
f 44 47 43
|
||||
f 47 46 45
|
||||
f 46 41 45
|
||||
f 47 41 43
|
||||
f 44 46 48
|
||||
f 42 44 43
|
||||
f 44 48 47
|
||||
f 47 48 46
|
||||
f 46 42 41
|
||||
f 47 45 41
|
||||
f 44 42 46
|
||||
o Cube.004_Cube.017
|
||||
v -0.041260 -0.113834 0.421355
|
||||
v -0.041261 -0.290583 0.405969
|
||||
v -0.041272 -0.141307 0.151790
|
||||
v -0.041272 -0.320945 0.151790
|
||||
v 0.044969 -0.113834 0.421352
|
||||
v 0.044968 -0.290583 0.405966
|
||||
v 0.044957 -0.141307 0.151786
|
||||
v 0.044957 -0.320945 0.151786
|
||||
g Cube.004_Cube.017_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 50 49 51
|
||||
f 52 51 55
|
||||
f 55 53 54
|
||||
f 54 53 49
|
||||
f 55 51 49
|
||||
f 52 56 54
|
||||
f 50 51 52
|
||||
f 52 55 56
|
||||
f 55 54 56
|
||||
f 54 49 50
|
||||
f 55 49 53
|
||||
f 52 54 50
|
||||
o Cube.005_Cube.018
|
||||
v 0.001887 0.037245 1.250957
|
||||
v -0.035355 -0.000002 1.250958
|
||||
v 0.001873 0.037245 0.917899
|
||||
v -0.035369 -0.000002 0.917900
|
||||
v 0.039134 0.000002 1.250955
|
||||
v 0.001891 -0.037245 1.250957
|
||||
v 0.039120 0.000002 0.917897
|
||||
v 0.001877 -0.037245 0.917899
|
||||
g Cube.005_Cube.018_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 58 57 59
|
||||
f 60 59 63
|
||||
f 64 63 61
|
||||
f 62 61 57
|
||||
f 63 59 57
|
||||
f 60 64 62
|
||||
f 58 59 60
|
||||
f 60 63 64
|
||||
f 64 61 62
|
||||
f 62 57 58
|
||||
f 63 57 61
|
||||
f 60 62 58
|
||||
o Cube.006_Cube.019
|
||||
v 0.001892 0.053070 1.380614
|
||||
v -0.051175 -0.000003 1.380616
|
||||
v 0.001886 0.053070 1.236989
|
||||
v -0.051181 -0.000003 1.236991
|
||||
v 0.054965 0.000003 1.380612
|
||||
v 0.001897 -0.053070 1.380614
|
||||
v 0.054959 0.000003 1.236987
|
||||
v 0.001891 -0.053070 1.236989
|
||||
g Cube.006_Cube.019_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 66 65 67
|
||||
f 68 67 71
|
||||
f 72 71 69
|
||||
f 70 69 65
|
||||
f 71 67 65
|
||||
f 68 72 70
|
||||
f 66 67 68
|
||||
f 68 71 72
|
||||
f 72 69 70
|
||||
f 70 65 66
|
||||
f 71 65 69
|
||||
f 68 70 66
|
||||
o Cube.007_Cube.020
|
||||
v 0.001861 0.212243 0.653267
|
||||
v -0.059906 0.150470 0.653269
|
||||
v 0.001832 0.195325 -0.057189
|
||||
v -0.043018 0.150471 -0.057187
|
||||
v 0.063634 0.150476 0.653264
|
||||
v 0.001867 0.088703 0.653267
|
||||
v 0.046686 0.150475 -0.057190
|
||||
v 0.001836 0.105621 -0.057189
|
||||
v 0.001841 0.176931 0.145795
|
||||
v -0.024615 0.150472 0.145796
|
||||
v 0.028300 0.150474 0.145794
|
||||
v 0.001844 0.124015 0.145795
|
||||
v 0.001852 0.176931 0.389041
|
||||
v 0.001854 0.124015 0.389041
|
||||
v -0.024605 0.150472 0.389042
|
||||
v 0.028310 0.150474 0.389040
|
||||
v -0.043012 0.150471 0.085227
|
||||
v 0.046692 0.150475 0.085223
|
||||
v 0.001838 0.195325 0.085225
|
||||
v 0.001842 0.105621 0.085225
|
||||
v 0.001853 0.212243 0.454632
|
||||
v 0.001859 0.088703 0.454632
|
||||
v -0.059914 0.150470 0.454635
|
||||
v 0.063626 0.150476 0.454629
|
||||
g Cube.007_Cube.020_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 89 91 75
|
||||
f 76 75 79
|
||||
f 94 96 77
|
||||
f 78 77 73
|
||||
f 96 93 73
|
||||
f 95 94 78
|
||||
f 92 84 82
|
||||
f 90 91 81
|
||||
f 92 90 83
|
||||
f 87 85 81
|
||||
f 95 93 85
|
||||
f 82 84 86
|
||||
f 83 81 85
|
||||
f 84 83 88
|
||||
f 80 79 90
|
||||
f 79 75 91
|
||||
f 76 80 92
|
||||
f 82 81 91
|
||||
f 74 73 93
|
||||
f 86 94 95
|
||||
f 88 85 93
|
||||
f 86 88 96
|
||||
f 89 75 76
|
||||
f 76 79 80
|
||||
f 94 77 78
|
||||
f 78 73 74
|
||||
f 96 73 77
|
||||
f 95 78 74
|
||||
f 92 82 89
|
||||
f 90 81 83
|
||||
f 92 83 84
|
||||
f 87 81 82
|
||||
f 95 85 87
|
||||
f 82 86 87
|
||||
f 83 85 88
|
||||
f 84 88 86
|
||||
f 80 90 92
|
||||
f 79 91 90
|
||||
f 76 92 89
|
||||
f 82 91 89
|
||||
f 74 93 95
|
||||
f 86 95 87
|
||||
f 88 93 96
|
||||
f 86 96 94
|
||||
o Cube.008_Cube.021
|
||||
v 0.010750 0.058733 0.175734
|
||||
v 0.010750 0.136208 0.175734
|
||||
v 0.010751 0.058733 0.193083
|
||||
v 0.010751 0.136208 0.193083
|
||||
v -0.007062 0.058733 0.175735
|
||||
v -0.007062 0.136208 0.175735
|
||||
v -0.007061 0.058733 0.193084
|
||||
v -0.007061 0.136208 0.193084
|
||||
g Cube.008_Cube.021_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 98 99 97
|
||||
f 100 103 99
|
||||
f 104 101 103
|
||||
f 102 97 101
|
||||
f 103 97 99
|
||||
f 100 102 104
|
||||
f 98 100 99
|
||||
f 100 104 103
|
||||
f 104 102 101
|
||||
f 102 98 97
|
||||
f 103 101 97
|
||||
f 100 98 102
|
||||
o Cube.009_Cube.022
|
||||
v 0.010758 0.058733 0.360248
|
||||
v 0.010758 0.136208 0.360248
|
||||
v 0.010757 0.058733 0.345559
|
||||
v 0.010757 0.136208 0.345559
|
||||
v -0.007054 0.058733 0.360249
|
||||
v -0.007054 0.136208 0.360249
|
||||
v -0.007055 0.058733 0.345560
|
||||
v -0.007055 0.136208 0.345560
|
||||
g Cube.009_Cube.022_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 106 105 107
|
||||
f 108 107 111
|
||||
f 112 111 109
|
||||
f 110 109 105
|
||||
f 111 107 105
|
||||
f 108 112 110
|
||||
f 106 107 108
|
||||
f 108 111 112
|
||||
f 112 109 110
|
||||
f 110 105 106
|
||||
f 111 105 109
|
||||
f 108 110 106
|
||||
o Cube.010_Cube.023
|
||||
v -0.029837 0.186333 0.299222
|
||||
v -0.029837 0.122961 0.299222
|
||||
v -0.029839 0.186333 0.235850
|
||||
v -0.029839 0.122961 0.235850
|
||||
v 0.033535 0.186333 0.299219
|
||||
v 0.033535 0.122961 0.299219
|
||||
v 0.033532 0.186333 0.235848
|
||||
v 0.033532 0.122961 0.235848
|
||||
g Cube.010_Cube.023_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 114 113 115
|
||||
f 116 115 119
|
||||
f 120 119 117
|
||||
f 118 117 113
|
||||
f 119 115 113
|
||||
f 116 120 118
|
||||
f 114 115 116
|
||||
f 116 119 120
|
||||
f 120 117 118
|
||||
f 118 113 114
|
||||
f 119 113 117
|
||||
f 116 118 114
|
||||
o Cube.011_Cube.024
|
||||
v -0.011731 0.210064 0.281114
|
||||
v -0.011731 0.182905 0.281114
|
||||
v -0.011732 0.210064 0.253956
|
||||
v -0.011732 0.182905 0.253956
|
||||
v 0.015428 0.210064 0.281113
|
||||
v 0.015428 0.182905 0.281113
|
||||
v 0.015427 0.210064 0.253955
|
||||
v 0.015427 0.182905 0.253955
|
||||
g Cube.011_Cube.024_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 122 121 123
|
||||
f 124 123 127
|
||||
f 128 127 125
|
||||
f 126 125 121
|
||||
f 127 123 121
|
||||
f 124 128 126
|
||||
f 122 123 124
|
||||
f 124 127 128
|
||||
f 128 125 126
|
||||
f 126 121 122
|
||||
f 127 121 125
|
||||
f 124 126 122
|
||||
o Cube.012_Cube.025
|
||||
v 0.053549 0.055509 -0.056592
|
||||
v 0.053549 0.090038 -0.056592
|
||||
v 0.053590 0.055509 0.935856
|
||||
v 0.053590 0.090038 0.935856
|
||||
v -0.049880 0.055509 -0.056588
|
||||
v -0.049880 0.090038 -0.056588
|
||||
v -0.049838 0.055509 0.935860
|
||||
v -0.049838 0.090038 0.935860
|
||||
g Cube.012_Cube.025_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 130 131 129
|
||||
f 132 135 131
|
||||
f 136 133 135
|
||||
f 134 129 133
|
||||
f 135 129 131
|
||||
f 132 134 136
|
||||
f 130 132 131
|
||||
f 132 136 135
|
||||
f 136 134 133
|
||||
f 134 130 129
|
||||
f 135 133 129
|
||||
f 132 130 134
|
||||
o Cube.013_Cube.026
|
||||
v -0.029814 -0.040129 0.826322
|
||||
v -0.029814 -0.103500 0.826322
|
||||
v -0.029817 -0.040129 0.762951
|
||||
v -0.029817 -0.103500 0.762951
|
||||
v 0.033557 -0.040129 0.826319
|
||||
v 0.033557 -0.103500 0.826319
|
||||
v 0.033554 -0.040129 0.762948
|
||||
v 0.033554 -0.103500 0.762948
|
||||
g Cube.013_Cube.026_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 138 137 139
|
||||
f 140 139 143
|
||||
f 144 143 141
|
||||
f 142 141 137
|
||||
f 143 139 137
|
||||
f 140 144 142
|
||||
f 138 139 140
|
||||
f 140 143 144
|
||||
f 144 141 142
|
||||
f 142 137 138
|
||||
f 143 137 141
|
||||
f 140 142 138
|
||||
o Cube.014_Cube.027
|
||||
v -0.022691 -0.091652 0.813067
|
||||
v -0.171917 -0.385605 0.813074
|
||||
v -0.022693 -0.091652 0.776205
|
||||
v -0.171919 -0.385605 0.776211
|
||||
v -0.008738 -0.098735 0.813067
|
||||
v -0.157964 -0.392689 0.813073
|
||||
v -0.008739 -0.098735 0.776204
|
||||
v -0.157965 -0.392689 0.776210
|
||||
g Cube.014_Cube.027_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 146 145 147
|
||||
f 148 147 151
|
||||
f 152 151 149
|
||||
f 150 149 145
|
||||
f 151 147 145
|
||||
f 148 152 150
|
||||
f 146 147 148
|
||||
f 148 151 152
|
||||
f 152 149 150
|
||||
f 150 145 146
|
||||
f 151 145 149
|
||||
f 148 150 146
|
||||
o Cube.015_Cube.028
|
||||
v 0.013195 -0.089756 0.813066
|
||||
v 0.124972 -0.399890 0.813061
|
||||
v 0.013193 -0.089756 0.776203
|
||||
v 0.124970 -0.399890 0.776199
|
||||
v 0.027916 -0.084450 0.813065
|
||||
v 0.139693 -0.394584 0.813060
|
||||
v 0.027915 -0.084450 0.776203
|
||||
v 0.139692 -0.394584 0.776198
|
||||
g Cube.015_Cube.028_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 154 153 155
|
||||
f 156 155 159
|
||||
f 160 159 157
|
||||
f 158 157 153
|
||||
f 159 155 153
|
||||
f 156 160 158
|
||||
f 154 155 156
|
||||
f 156 159 160
|
||||
f 160 157 158
|
||||
f 158 153 154
|
||||
f 159 153 157
|
||||
f 156 158 154
|
||||
o Cube.016_Cube.029
|
||||
v -0.021347 -0.192881 0.137784
|
||||
v -0.021347 -0.206264 0.137784
|
||||
v -0.021352 -0.198527 0.009256
|
||||
v -0.021352 -0.210756 0.003821
|
||||
v 0.025031 -0.192881 0.137782
|
||||
v 0.025031 -0.206264 0.137782
|
||||
v 0.025026 -0.198527 0.009254
|
||||
v 0.025026 -0.210756 0.003819
|
||||
v -0.021349 -0.203531 0.091898
|
||||
v -0.021348 -0.216888 0.092724
|
||||
v 0.025029 -0.203531 0.091896
|
||||
v 0.025029 -0.216888 0.092722
|
||||
v -0.021351 -0.219030 0.027559
|
||||
v 0.025027 -0.205647 0.027557
|
||||
v -0.021351 -0.205647 0.027559
|
||||
v 0.025027 -0.219030 0.027557
|
||||
g Cube.016_Cube.029_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 175 163 164
|
||||
f 164 163 167
|
||||
f 171 165 166
|
||||
f 166 165 161
|
||||
f 171 169 161
|
||||
f 170 172 166
|
||||
f 173 176 172
|
||||
f 174 175 169
|
||||
f 174 171 172
|
||||
f 162 161 169
|
||||
f 168 167 174
|
||||
f 167 163 175
|
||||
f 164 168 176
|
||||
f 170 169 175
|
||||
f 175 164 173
|
||||
f 164 167 168
|
||||
f 171 166 172
|
||||
f 166 161 162
|
||||
f 171 161 165
|
||||
f 170 166 162
|
||||
f 173 172 170
|
||||
f 174 169 171
|
||||
f 174 172 176
|
||||
f 162 169 170
|
||||
f 168 174 176
|
||||
f 167 175 174
|
||||
f 164 176 173
|
||||
f 170 175 173
|
||||
o Cube.017_Cube.030
|
||||
v 0.006002 -0.181480 0.090428
|
||||
v 0.011074 -0.125829 0.050765
|
||||
v 0.006001 -0.186370 0.082835
|
||||
v 0.011073 -0.136682 0.033914
|
||||
v -0.002321 -0.181480 0.090428
|
||||
v -0.007397 -0.125829 0.050766
|
||||
v -0.002321 -0.186370 0.082835
|
||||
v -0.007397 -0.136682 0.033915
|
||||
v 0.011075 -0.154524 0.069247
|
||||
v 0.011074 -0.165377 0.052395
|
||||
v -0.007397 -0.165377 0.052396
|
||||
v -0.007396 -0.154524 0.069247
|
||||
g Cube.017_Cube.030_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 178 185 186
|
||||
f 180 186 187
|
||||
f 184 187 188
|
||||
f 182 188 185
|
||||
f 183 179 177
|
||||
f 180 184 182
|
||||
f 188 181 177
|
||||
f 183 181 188
|
||||
f 186 179 183
|
||||
f 185 177 179
|
||||
f 178 186 180
|
||||
f 180 187 184
|
||||
f 184 188 182
|
||||
f 182 185 178
|
||||
f 183 177 181
|
||||
f 180 182 178
|
||||
f 188 177 185
|
||||
f 183 188 187
|
||||
f 186 183 187
|
||||
f 185 179 186
|
||||
o Cube.018_Cube.031
|
||||
v 0.004020 -0.002128 1.330054
|
||||
v 0.004020 0.002128 1.330054
|
||||
v 0.004020 -0.002128 1.334309
|
||||
v 0.004020 0.002128 1.334309
|
||||
v -0.000235 -0.002128 1.330054
|
||||
v -0.000235 0.002128 1.330054
|
||||
v -0.000235 -0.002128 1.334309
|
||||
v -0.000235 0.002128 1.334309
|
||||
g Cube.018_Cube.031_None
|
||||
usemtl None
|
||||
s off
|
||||
f 190 191 189
|
||||
f 192 195 191
|
||||
f 196 193 195
|
||||
f 194 189 193
|
||||
f 195 189 191
|
||||
f 192 194 196
|
||||
f 190 192 191
|
||||
f 192 196 195
|
||||
f 196 194 193
|
||||
f 194 190 189
|
||||
f 195 193 189
|
||||
f 192 190 194
|
|
@ -1,292 +0,0 @@
|
|||
m 000 169 169 169 255
|
||||
m 001 166 102 74 255
|
||||
m 002 125 125 125 255
|
||||
m 003 77 77 77 255
|
||||
o Cube
|
||||
v -0.030710 0.012938 -0.190583
|
||||
v -0.030710 -0.100172 -0.190583
|
||||
v -0.030710 0.052238 0.156284
|
||||
v -0.030710 -0.100172 0.156284
|
||||
v 0.044140 0.012938 -0.190583
|
||||
v 0.044140 -0.100172 -0.190583
|
||||
v 0.044140 0.052238 0.156284
|
||||
v 0.044140 -0.100172 0.156284
|
||||
v 0.044140 -0.100172 -0.101109
|
||||
v -0.030710 0.052238 -0.101109
|
||||
v 0.044140 0.052238 -0.101109
|
||||
v -0.030710 -0.100172 -0.101109
|
||||
g Cube_Cube_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 3 11 10
|
||||
f 8 3 4
|
||||
f 9 5 11
|
||||
f 8 12 9
|
||||
f 4 10 12
|
||||
f 2 5 6
|
||||
f 12 1 2
|
||||
f 9 2 6
|
||||
f 9 7 8
|
||||
f 10 5 1
|
||||
f 3 7 11
|
||||
f 8 7 3
|
||||
f 9 6 5
|
||||
f 8 4 12
|
||||
f 4 3 10
|
||||
f 2 1 5
|
||||
f 12 10 1
|
||||
f 9 12 2
|
||||
f 9 11 7
|
||||
f 10 11 5
|
||||
o Cube.001_Cube.014
|
||||
v -0.028476 0.051727 0.622690
|
||||
v -0.028476 -0.013340 0.622690
|
||||
v -0.028476 0.051727 0.151723
|
||||
v -0.028476 -0.013340 0.151723
|
||||
v 0.041905 0.051727 0.622690
|
||||
v 0.041905 -0.013340 0.622690
|
||||
v 0.041906 0.051727 0.151723
|
||||
v 0.041906 -0.013340 0.151723
|
||||
g Cube.001_Cube.014_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 14 13 15
|
||||
f 16 15 19
|
||||
f 20 19 17
|
||||
f 18 17 13
|
||||
f 19 15 13
|
||||
f 16 20 18
|
||||
f 14 15 16
|
||||
f 16 19 20
|
||||
f 20 17 18
|
||||
f 18 13 14
|
||||
f 19 13 17
|
||||
f 16 18 14
|
||||
o Cube.002_Cube.015
|
||||
v -0.014664 -0.031104 0.273492
|
||||
v -0.014664 -0.073861 0.273492
|
||||
v -0.014664 -0.031104 0.150758
|
||||
v -0.014664 -0.073861 0.150758
|
||||
v 0.028094 -0.031104 0.273492
|
||||
v 0.028094 -0.073861 0.273492
|
||||
v 0.028094 -0.031104 0.150758
|
||||
v 0.028094 -0.073861 0.150758
|
||||
g Cube.002_Cube.015_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 22 21 23
|
||||
f 24 23 27
|
||||
f 28 27 25
|
||||
f 26 25 21
|
||||
f 27 23 21
|
||||
f 24 28 26
|
||||
f 22 23 24
|
||||
f 24 27 28
|
||||
f 28 25 26
|
||||
f 26 21 22
|
||||
f 27 21 25
|
||||
f 24 26 22
|
||||
o Cube.003_Cube.016
|
||||
v -0.038850 -0.006980 0.508055
|
||||
v -0.038850 -0.095975 0.508055
|
||||
v -0.038850 -0.006980 0.262587
|
||||
v -0.038850 -0.095975 0.262587
|
||||
v 0.052280 -0.006980 0.508055
|
||||
v 0.052280 -0.095975 0.508055
|
||||
v 0.052280 -0.006980 0.262587
|
||||
v 0.052280 -0.095975 0.262587
|
||||
g Cube.003_Cube.016_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 30 29 31
|
||||
f 32 31 35
|
||||
f 36 35 33
|
||||
f 34 33 29
|
||||
f 35 31 29
|
||||
f 32 36 34
|
||||
f 30 31 32
|
||||
f 32 35 36
|
||||
f 36 33 34
|
||||
f 34 29 30
|
||||
f 35 29 33
|
||||
f 32 34 30
|
||||
o Cube.004_Cube.017
|
||||
v -0.014664 -0.031104 0.611678
|
||||
v -0.014664 -0.073861 0.611678
|
||||
v -0.014664 -0.031104 0.498633
|
||||
v -0.014664 -0.073861 0.498633
|
||||
v 0.028093 -0.031104 0.611678
|
||||
v 0.028093 -0.073861 0.611678
|
||||
v 0.028093 -0.031104 0.498633
|
||||
v 0.028093 -0.073861 0.498633
|
||||
g Cube.004_Cube.017_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 38 37 39
|
||||
f 40 39 43
|
||||
f 44 43 41
|
||||
f 42 41 37
|
||||
f 43 39 37
|
||||
f 40 44 42
|
||||
f 38 39 40
|
||||
f 40 43 44
|
||||
f 44 41 42
|
||||
f 42 37 38
|
||||
f 43 37 41
|
||||
f 40 42 38
|
||||
o Cube.005_Cube.018
|
||||
v -0.028018 0.009276 -0.187437
|
||||
v -0.030710 -0.201524 -0.447391
|
||||
v -0.028018 -0.095286 -0.189475
|
||||
v -0.030710 -0.205988 -0.341846
|
||||
v 0.041447 0.009276 -0.187437
|
||||
v 0.044140 -0.201524 -0.447391
|
||||
v 0.041447 -0.095286 -0.189475
|
||||
v 0.044140 -0.205988 -0.341846
|
||||
v -0.030710 -0.072097 -0.339260
|
||||
v 0.044140 -0.131249 -0.276670
|
||||
v -0.030710 -0.131249 -0.276670
|
||||
v 0.044140 -0.072097 -0.339260
|
||||
g Cube.005_Cube.018_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 47 49 45
|
||||
f 54 47 55
|
||||
f 54 49 51
|
||||
f 52 46 50
|
||||
f 55 45 53
|
||||
f 56 45 49
|
||||
f 46 56 50
|
||||
f 46 55 53
|
||||
f 50 54 52
|
||||
f 52 55 48
|
||||
f 47 51 49
|
||||
f 54 51 47
|
||||
f 54 56 49
|
||||
f 52 48 46
|
||||
f 55 47 45
|
||||
f 56 53 45
|
||||
f 46 53 56
|
||||
f 46 48 55
|
||||
f 50 56 54
|
||||
f 52 54 55
|
||||
o Cube.006_Cube.019
|
||||
v -0.038565 0.028561 0.122593
|
||||
v -0.038565 -0.010358 0.122593
|
||||
v -0.038565 0.028561 -0.014314
|
||||
v -0.038565 -0.010358 -0.014314
|
||||
v -0.026746 0.028561 0.122593
|
||||
v -0.026746 -0.010358 0.122593
|
||||
v -0.026746 0.028561 -0.014314
|
||||
v -0.026746 -0.010358 -0.014314
|
||||
g Cube.006_Cube.019_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 58 57 59
|
||||
f 60 59 63
|
||||
f 64 63 61
|
||||
f 62 61 57
|
||||
f 63 59 57
|
||||
f 60 64 62
|
||||
f 58 59 60
|
||||
f 60 63 64
|
||||
f 64 61 62
|
||||
f 62 57 58
|
||||
f 63 57 61
|
||||
f 60 62 58
|
||||
o Cube.007_Cube.020
|
||||
v -0.005722 -0.101077 -0.137020
|
||||
v -0.005722 -0.101584 -0.113633
|
||||
v -0.005721 -0.166865 -0.313548
|
||||
v -0.005721 -0.181229 -0.323349
|
||||
v 0.027696 -0.101077 -0.137020
|
||||
v 0.027696 -0.101584 -0.113633
|
||||
v 0.027696 -0.166865 -0.313548
|
||||
v 0.027696 -0.181229 -0.323349
|
||||
v -0.005722 -0.179786 -0.241980
|
||||
v -0.005722 -0.197009 -0.237788
|
||||
v 0.027696 -0.179786 -0.241980
|
||||
v 0.027696 -0.197009 -0.237788
|
||||
v -0.005722 -0.146774 -0.177205
|
||||
v 0.027696 -0.161731 -0.163688
|
||||
v -0.005722 -0.161731 -0.163688
|
||||
v 0.027696 -0.146774 -0.177205
|
||||
g Cube.007_Cube.020_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 73 67 68
|
||||
f 68 67 71
|
||||
f 80 69 70
|
||||
f 70 69 65
|
||||
f 80 77 65
|
||||
f 79 78 70
|
||||
f 68 72 76
|
||||
f 71 67 73
|
||||
f 72 71 75
|
||||
f 79 77 73
|
||||
f 66 65 77
|
||||
f 74 76 78
|
||||
f 75 73 77
|
||||
f 75 80 78
|
||||
f 73 68 74
|
||||
f 68 71 72
|
||||
f 80 70 78
|
||||
f 70 65 66
|
||||
f 80 65 69
|
||||
f 79 70 66
|
||||
f 68 76 74
|
||||
f 71 73 75
|
||||
f 72 75 76
|
||||
f 79 73 74
|
||||
f 66 77 79
|
||||
f 74 78 79
|
||||
f 75 77 80
|
||||
f 75 78 76
|
||||
o Cube.008_Cube.021
|
||||
v -0.018777 -0.079592 0.580647
|
||||
v -0.018777 -0.079592 0.529664
|
||||
v -0.018777 -0.002804 0.580647
|
||||
v -0.018777 -0.002805 0.529663
|
||||
v 0.032206 -0.079592 0.580647
|
||||
v 0.032206 -0.079592 0.529664
|
||||
v 0.032206 -0.002804 0.580647
|
||||
v 0.032206 -0.002805 0.529663
|
||||
g Cube.008_Cube.021_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 82 81 83
|
||||
f 84 83 87
|
||||
f 88 87 85
|
||||
f 86 85 81
|
||||
f 87 83 81
|
||||
f 84 88 86
|
||||
f 82 83 84
|
||||
f 84 87 88
|
||||
f 88 85 86
|
||||
f 86 81 82
|
||||
f 87 81 85
|
||||
f 84 86 82
|
||||
o Cube.009_Cube.022
|
||||
v 0.003813 0.017297 0.568185
|
||||
v 0.003813 0.012256 0.568185
|
||||
v 0.003813 0.017297 0.563144
|
||||
v 0.003813 0.012256 0.563144
|
||||
v 0.008854 0.017297 0.568185
|
||||
v 0.008854 0.012256 0.568185
|
||||
v 0.008854 0.017297 0.563144
|
||||
v 0.008854 0.012256 0.563144
|
||||
g Cube.009_Cube.022_None
|
||||
usemtl None
|
||||
s off
|
||||
f 90 89 91
|
||||
f 92 91 95
|
||||
f 96 95 93
|
||||
f 94 93 89
|
||||
f 95 91 89
|
||||
f 92 96 94
|
||||
f 90 91 92
|
||||
f 92 95 96
|
||||
f 96 93 94
|
||||
f 94 89 90
|
||||
f 95 89 93
|
||||
f 92 94 90
|
|
@ -1,39 +0,0 @@
|
|||
# Blender v2.91.0 OBJ File: 'body.blend'
|
||||
# www.blender.org
|
||||
mtllib body.mtl
|
||||
o Cube
|
||||
v 1.470880 4.046328 0.990075
|
||||
v 1.227793 -0.007857 0.756304
|
||||
v -1.471015 4.046328 0.989874
|
||||
v -1.227895 -0.007857 0.756137
|
||||
v 1.471015 4.046328 -0.989874
|
||||
v 1.227895 -0.007857 -0.756137
|
||||
v -1.470880 4.046328 -0.990075
|
||||
v -1.227793 -0.007857 -0.756304
|
||||
v -0.362043 4.746272 0.386594
|
||||
v -0.361991 4.746272 -0.386643
|
||||
v 0.361991 4.746272 0.386643
|
||||
v 0.362043 4.746272 -0.386594
|
||||
g Cube_Cube_Material
|
||||
usemtl Material
|
||||
s off
|
||||
f 1 9 3
|
||||
f 3 8 4
|
||||
f 7 6 8
|
||||
f 2 8 6
|
||||
f 1 4 2
|
||||
f 5 2 6
|
||||
f 12 9 11
|
||||
f 5 11 1
|
||||
f 3 10 7
|
||||
f 7 12 5
|
||||
f 1 11 9
|
||||
f 3 7 8
|
||||
f 7 5 6
|
||||
f 2 4 8
|
||||
f 1 3 4
|
||||
f 5 1 2
|
||||
f 12 10 9
|
||||
f 5 12 11
|
||||
f 3 9 10
|
||||
f 7 10 12
|
|
@ -1,27 +0,0 @@
|
|||
# Blender v2.91.0 OBJ File: 'foot.blend'
|
||||
# www.blender.org
|
||||
mtllib foot.mtl
|
||||
o Cube
|
||||
v 0.483757 0.004051 -0.472253
|
||||
v 0.320470 -5.020987 -0.308967
|
||||
v 0.483757 0.004051 0.495260
|
||||
v 0.320470 -5.020987 0.331974
|
||||
v -0.483757 0.004051 -0.472253
|
||||
v -0.320470 -5.020987 -0.308967
|
||||
v -0.483757 0.004051 0.495260
|
||||
v -0.320470 -5.020987 0.331974
|
||||
g Cube_Cube_Material
|
||||
usemtl Material
|
||||
s off
|
||||
f 5 3 1
|
||||
f 3 8 4
|
||||
f 7 6 8
|
||||
f 2 8 6
|
||||
f 1 4 2
|
||||
f 5 2 6
|
||||
f 5 7 3
|
||||
f 3 7 8
|
||||
f 7 5 6
|
||||
f 2 4 8
|
||||
f 1 3 4
|
||||
f 5 1 2
|
582
obj/man/head.obj
|
@ -1,582 +0,0 @@
|
|||
m 000 255 213 196 255
|
||||
m 001 43 64 59 255
|
||||
m 002 255 255 255 255
|
||||
m 003 166 101 103 255
|
||||
m 004 205 157 154 255
|
||||
m 005 0 0 0 255
|
||||
o Cube
|
||||
v 0.907299 1.198761 0.858237
|
||||
v 1.010992 0.696886 0.961946
|
||||
v -0.885299 1.198761 0.858105
|
||||
v -0.989008 0.696886 0.961798
|
||||
v 0.907431 1.198761 -0.934361
|
||||
v 1.011140 0.696886 -1.038054
|
||||
v -0.885167 1.198761 -0.934493
|
||||
v -0.988860 0.696886 -1.038202
|
||||
v 0.967071 0.236114 -1.056951
|
||||
v -0.944742 0.236114 -1.057085
|
||||
v 0.966874 0.236114 0.964204
|
||||
v -0.944939 0.236114 0.964070
|
||||
v 0.749151 -0.298993 -0.874153
|
||||
v -0.726867 -0.298993 -0.874242
|
||||
v 0.748999 -0.298993 0.840097
|
||||
v -0.727019 -0.298993 0.840008
|
||||
v 0.492345 -0.714590 -0.449255
|
||||
v -0.470114 -0.714590 -0.449298
|
||||
v 0.492246 -0.714590 0.523183
|
||||
v -0.470213 -0.714590 0.523139
|
||||
g Cube_Cube_Material.000
|
||||
usemtl Material.000
|
||||
s off
|
||||
f 5 3 1
|
||||
f 4 7 8
|
||||
f 8 5 6
|
||||
f 6 11 9
|
||||
f 2 3 4
|
||||
f 6 1 2
|
||||
f 12 14 16
|
||||
f 8 12 4
|
||||
f 6 10 8
|
||||
f 4 11 2
|
||||
f 14 17 18
|
||||
f 10 13 14
|
||||
f 11 16 15
|
||||
f 11 13 9
|
||||
f 19 18 17
|
||||
f 15 20 19
|
||||
f 15 17 13
|
||||
f 16 18 20
|
||||
f 5 7 3
|
||||
f 4 3 7
|
||||
f 8 7 5
|
||||
f 6 2 11
|
||||
f 2 1 3
|
||||
f 6 5 1
|
||||
f 12 10 14
|
||||
f 8 10 12
|
||||
f 6 9 10
|
||||
f 4 12 11
|
||||
f 14 13 17
|
||||
f 10 9 13
|
||||
f 11 12 16
|
||||
f 11 15 13
|
||||
f 19 20 18
|
||||
f 15 16 20
|
||||
f 15 19 17
|
||||
f 16 14 18
|
||||
o Cube.001
|
||||
v 0.800978 1.910599 0.407931
|
||||
v 1.101399 1.626708 0.813982
|
||||
v -0.778962 1.910564 0.407820
|
||||
v -1.079428 1.626659 0.813828
|
||||
v 0.801094 1.430055 -1.097155
|
||||
v 1.101561 0.963401 -1.263525
|
||||
v -0.778845 1.430019 -1.097266
|
||||
v -1.079267 0.963352 -1.263679
|
||||
v -0.185483 2.063048 -0.263768
|
||||
v -0.185454 1.943495 -0.638215
|
||||
v 0.207587 2.063057 -0.263740
|
||||
v 0.207616 1.943504 -0.638187
|
||||
v 1.232467 0.482932 -1.247517
|
||||
v -1.210154 0.482877 -1.247689
|
||||
v 1.232286 1.225864 1.079380
|
||||
v -1.210334 1.225809 1.079208
|
||||
v -0.809460 1.398426 1.186800
|
||||
v 0.831389 1.398463 1.186915
|
||||
v -0.853770 1.276649 1.222782
|
||||
v 0.875699 1.276688 1.222904
|
||||
v -0.518071 1.609557 1.980855
|
||||
v 0.539879 1.609580 1.980929
|
||||
v -0.546640 1.531040 2.004055
|
||||
v 0.568448 1.531065 2.004133
|
||||
g Cube.001_Cube.001_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 23 30 27
|
||||
f 23 28 24
|
||||
f 27 26 28
|
||||
f 28 36 24
|
||||
f 21 24 22
|
||||
f 25 22 26
|
||||
f 32 29 31
|
||||
f 27 32 25
|
||||
f 21 29 23
|
||||
f 25 31 21
|
||||
f 35 34 33
|
||||
f 26 34 28
|
||||
f 36 37 24
|
||||
f 22 33 26
|
||||
f 37 43 41
|
||||
f 35 39 36
|
||||
f 24 38 22
|
||||
f 35 38 40
|
||||
f 41 44 42
|
||||
f 37 42 38
|
||||
f 38 44 40
|
||||
f 40 43 39
|
||||
f 23 29 30
|
||||
f 23 27 28
|
||||
f 27 25 26
|
||||
f 28 34 36
|
||||
f 21 23 24
|
||||
f 25 21 22
|
||||
f 32 30 29
|
||||
f 27 30 32
|
||||
f 21 31 29
|
||||
f 25 32 31
|
||||
f 35 36 34
|
||||
f 26 33 34
|
||||
f 36 39 37
|
||||
f 22 35 33
|
||||
f 37 39 43
|
||||
f 35 40 39
|
||||
f 24 37 38
|
||||
f 35 22 38
|
||||
f 41 43 44
|
||||
f 37 41 42
|
||||
f 38 42 44
|
||||
f 40 44 43
|
||||
o Cone
|
||||
v 0.409214 0.190070 0.811393
|
||||
v -0.387430 0.190393 0.811365
|
||||
v 0.011172 0.880146 0.811332
|
||||
v 0.010989 0.211125 1.238715
|
||||
g Cone_Cone_Material.004
|
||||
usemtl Material.004
|
||||
s off
|
||||
f 45 48 46
|
||||
f 45 46 47
|
||||
f 46 48 47
|
||||
f 47 48 45
|
||||
o Sphere
|
||||
v -0.511086 0.982705 0.728083
|
||||
v -0.511086 0.832705 0.619102
|
||||
v -0.511086 0.647295 0.619102
|
||||
v -0.511086 0.497295 0.728083
|
||||
v -0.373221 0.982705 0.794475
|
||||
v -0.288016 0.832705 0.726527
|
||||
v -0.288016 0.647295 0.726527
|
||||
v -0.373221 0.497295 0.794476
|
||||
v -0.339171 0.982705 0.943657
|
||||
v -0.232922 0.832705 0.967908
|
||||
v -0.232922 0.647295 0.967908
|
||||
v -0.339171 0.497295 0.943657
|
||||
v -0.434577 0.982705 1.063292
|
||||
v -0.387291 0.832705 1.161481
|
||||
v -0.387291 0.647295 1.161481
|
||||
v -0.434577 0.497295 1.063292
|
||||
v -0.511086 1.040000 0.904419
|
||||
v -0.587595 0.982705 1.063292
|
||||
v -0.634880 0.832705 1.161481
|
||||
v -0.634880 0.647295 1.161481
|
||||
v -0.587595 0.497295 1.063292
|
||||
v -0.511086 0.440000 0.904419
|
||||
v -0.683000 0.982705 0.943657
|
||||
v -0.789249 0.832705 0.967908
|
||||
v -0.789249 0.647295 0.967908
|
||||
v -0.683000 0.497295 0.943657
|
||||
v -0.648951 0.982705 0.794475
|
||||
v -0.734156 0.832705 0.726527
|
||||
v -0.734156 0.647295 0.726527
|
||||
v -0.648951 0.497295 0.794475
|
||||
g Sphere_Sphere_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 70 52 56
|
||||
f 50 55 51
|
||||
f 49 65 53
|
||||
f 51 56 52
|
||||
f 49 54 50
|
||||
f 53 58 54
|
||||
f 70 56 60
|
||||
f 54 59 55
|
||||
f 53 65 57
|
||||
f 55 60 56
|
||||
f 57 62 58
|
||||
f 70 60 64
|
||||
f 58 63 59
|
||||
f 57 65 61
|
||||
f 59 64 60
|
||||
f 61 67 62
|
||||
f 70 64 69
|
||||
f 62 68 63
|
||||
f 61 65 66
|
||||
f 63 69 64
|
||||
f 67 71 72
|
||||
f 70 69 74
|
||||
f 67 73 68
|
||||
f 66 65 71
|
||||
f 69 73 74
|
||||
f 72 75 76
|
||||
f 70 74 78
|
||||
f 72 77 73
|
||||
f 71 65 75
|
||||
f 73 78 74
|
||||
f 76 49 50
|
||||
f 70 78 52
|
||||
f 76 51 77
|
||||
f 75 65 49
|
||||
f 77 52 78
|
||||
f 50 54 55
|
||||
f 51 55 56
|
||||
f 49 53 54
|
||||
f 53 57 58
|
||||
f 54 58 59
|
||||
f 55 59 60
|
||||
f 57 61 62
|
||||
f 58 62 63
|
||||
f 59 63 64
|
||||
f 61 66 67
|
||||
f 62 67 68
|
||||
f 63 68 69
|
||||
f 67 66 71
|
||||
f 67 72 73
|
||||
f 69 68 73
|
||||
f 72 71 75
|
||||
f 72 76 77
|
||||
f 73 77 78
|
||||
f 76 75 49
|
||||
f 76 50 51
|
||||
f 77 51 52
|
||||
o Sphere.001
|
||||
v 0.526424 0.982705 0.728083
|
||||
v 0.526424 0.832705 0.619102
|
||||
v 0.526424 0.647295 0.619102
|
||||
v 0.526424 0.497295 0.728083
|
||||
v 0.664288 0.982705 0.794475
|
||||
v 0.749493 0.832705 0.726527
|
||||
v 0.749493 0.647295 0.726527
|
||||
v 0.664288 0.497295 0.794476
|
||||
v 0.698338 0.982705 0.943657
|
||||
v 0.804587 0.832705 0.967908
|
||||
v 0.804587 0.647295 0.967908
|
||||
v 0.698338 0.497295 0.943657
|
||||
v 0.602933 0.982705 1.063292
|
||||
v 0.650218 0.832705 1.161481
|
||||
v 0.650218 0.647295 1.161481
|
||||
v 0.602933 0.497295 1.063292
|
||||
v 0.526424 1.040000 0.904419
|
||||
v 0.449914 0.982705 1.063292
|
||||
v 0.402629 0.832705 1.161481
|
||||
v 0.402629 0.647295 1.161481
|
||||
v 0.449914 0.497295 1.063292
|
||||
v 0.526424 0.440000 0.904419
|
||||
v 0.354509 0.982705 0.943657
|
||||
v 0.248260 0.832705 0.967908
|
||||
v 0.248260 0.647295 0.967908
|
||||
v 0.354509 0.497295 0.943657
|
||||
v 0.388559 0.982705 0.794475
|
||||
v 0.303354 0.832705 0.726527
|
||||
v 0.303354 0.647295 0.726527
|
||||
v 0.388559 0.497295 0.794475
|
||||
g Sphere.001_Sphere.001_Material.002
|
||||
usemtl Material.002
|
||||
s off
|
||||
f 100 82 86
|
||||
f 80 85 81
|
||||
f 79 95 83
|
||||
f 81 86 82
|
||||
f 79 84 80
|
||||
f 83 88 84
|
||||
f 100 86 90
|
||||
f 84 89 85
|
||||
f 83 95 87
|
||||
f 85 90 86
|
||||
f 87 92 88
|
||||
f 100 90 94
|
||||
f 88 93 89
|
||||
f 87 95 91
|
||||
f 89 94 90
|
||||
f 91 97 92
|
||||
f 100 94 99
|
||||
f 92 98 93
|
||||
f 91 95 96
|
||||
f 93 99 94
|
||||
f 97 101 102
|
||||
f 100 99 104
|
||||
f 97 103 98
|
||||
f 96 95 101
|
||||
f 99 103 104
|
||||
f 102 105 106
|
||||
f 100 104 108
|
||||
f 102 107 103
|
||||
f 101 95 105
|
||||
f 103 108 104
|
||||
f 106 79 80
|
||||
f 100 108 82
|
||||
f 106 81 107
|
||||
f 105 95 79
|
||||
f 107 82 108
|
||||
f 80 84 85
|
||||
f 81 85 86
|
||||
f 79 83 84
|
||||
f 83 87 88
|
||||
f 84 88 89
|
||||
f 85 89 90
|
||||
f 87 91 92
|
||||
f 88 92 93
|
||||
f 89 93 94
|
||||
f 91 96 97
|
||||
f 92 97 98
|
||||
f 93 98 99
|
||||
f 97 96 101
|
||||
f 97 102 103
|
||||
f 99 98 103
|
||||
f 102 101 105
|
||||
f 102 106 107
|
||||
f 103 107 108
|
||||
f 106 105 79
|
||||
f 106 80 81
|
||||
f 107 81 82
|
||||
o Sphere.002
|
||||
v -0.606089 0.904048 1.058318
|
||||
v -0.606089 0.846289 1.016354
|
||||
v -0.606089 0.774896 1.016354
|
||||
v -0.606089 0.717137 1.058318
|
||||
v -0.553003 0.904048 1.083883
|
||||
v -0.520194 0.846289 1.057719
|
||||
v -0.520194 0.774896 1.057719
|
||||
v -0.553003 0.717137 1.083883
|
||||
v -0.539892 0.904048 1.141326
|
||||
v -0.498980 0.846289 1.150664
|
||||
v -0.498980 0.774896 1.150664
|
||||
v -0.539892 0.717137 1.141326
|
||||
v -0.576629 0.904048 1.187392
|
||||
v -0.558421 0.846289 1.225201
|
||||
v -0.558421 0.774896 1.225201
|
||||
v -0.576629 0.717137 1.187392
|
||||
v -0.606089 0.926109 1.126217
|
||||
v -0.635549 0.904048 1.187392
|
||||
v -0.653757 0.846289 1.225201
|
||||
v -0.653757 0.774896 1.225201
|
||||
v -0.635549 0.717137 1.187392
|
||||
v -0.606089 0.695075 1.126217
|
||||
v -0.672286 0.904048 1.141326
|
||||
v -0.713198 0.846289 1.150664
|
||||
v -0.713198 0.774896 1.150664
|
||||
v -0.672286 0.717137 1.141326
|
||||
v -0.659175 0.904048 1.083883
|
||||
v -0.691984 0.846289 1.057719
|
||||
v -0.691984 0.774896 1.057719
|
||||
v -0.659175 0.717137 1.083883
|
||||
g Sphere.002_Sphere.002_Material.005
|
||||
usemtl Material.005
|
||||
s off
|
||||
f 130 112 116
|
||||
f 110 115 111
|
||||
f 109 125 113
|
||||
f 111 116 112
|
||||
f 109 114 110
|
||||
f 113 118 114
|
||||
f 130 116 120
|
||||
f 114 119 115
|
||||
f 113 125 117
|
||||
f 115 120 116
|
||||
f 117 122 118
|
||||
f 130 120 124
|
||||
f 118 123 119
|
||||
f 117 125 121
|
||||
f 119 124 120
|
||||
f 121 127 122
|
||||
f 130 124 129
|
||||
f 122 128 123
|
||||
f 121 125 126
|
||||
f 123 129 124
|
||||
f 127 131 132
|
||||
f 130 129 134
|
||||
f 127 133 128
|
||||
f 126 125 131
|
||||
f 129 133 134
|
||||
f 132 135 136
|
||||
f 130 134 138
|
||||
f 132 137 133
|
||||
f 131 125 135
|
||||
f 133 138 134
|
||||
f 136 109 110
|
||||
f 130 138 112
|
||||
f 136 111 137
|
||||
f 135 125 109
|
||||
f 137 112 138
|
||||
f 110 114 115
|
||||
f 111 115 116
|
||||
f 109 113 114
|
||||
f 113 117 118
|
||||
f 114 118 119
|
||||
f 115 119 120
|
||||
f 117 121 122
|
||||
f 118 122 123
|
||||
f 119 123 124
|
||||
f 121 126 127
|
||||
f 122 127 128
|
||||
f 123 128 129
|
||||
f 127 126 131
|
||||
f 127 132 133
|
||||
f 129 128 133
|
||||
f 132 131 135
|
||||
f 132 136 137
|
||||
f 133 137 138
|
||||
f 136 135 109
|
||||
f 136 110 111
|
||||
f 137 111 112
|
||||
o Sphere.003
|
||||
v 0.643381 0.904048 1.058318
|
||||
v 0.643381 0.846289 1.016354
|
||||
v 0.643381 0.774896 1.016354
|
||||
v 0.643381 0.717137 1.058318
|
||||
v 0.696466 0.904048 1.083883
|
||||
v 0.729275 0.846289 1.057719
|
||||
v 0.729275 0.774896 1.057719
|
||||
v 0.696466 0.717137 1.083883
|
||||
v 0.709578 0.904048 1.141326
|
||||
v 0.750489 0.846289 1.150664
|
||||
v 0.750489 0.774896 1.150664
|
||||
v 0.709578 0.717137 1.141326
|
||||
v 0.672841 0.904048 1.187392
|
||||
v 0.691049 0.846289 1.225201
|
||||
v 0.691049 0.774896 1.225201
|
||||
v 0.672841 0.717137 1.187392
|
||||
v 0.643381 0.926109 1.126217
|
||||
v 0.613920 0.904048 1.187392
|
||||
v 0.595713 0.846289 1.225201
|
||||
v 0.595713 0.774896 1.225201
|
||||
v 0.613920 0.717137 1.187392
|
||||
v 0.643381 0.695075 1.126217
|
||||
v 0.577184 0.904048 1.141326
|
||||
v 0.536272 0.846289 1.150664
|
||||
v 0.536272 0.774896 1.150664
|
||||
v 0.577184 0.717137 1.141326
|
||||
v 0.590295 0.904048 1.083883
|
||||
v 0.557486 0.846289 1.057719
|
||||
v 0.557486 0.774896 1.057719
|
||||
v 0.590295 0.717137 1.083883
|
||||
g Sphere.003_Sphere.003_Material.005
|
||||
usemtl Material.005
|
||||
s off
|
||||
f 160 142 146
|
||||
f 140 145 141
|
||||
f 139 155 143
|
||||
f 141 146 142
|
||||
f 139 144 140
|
||||
f 143 148 144
|
||||
f 160 146 150
|
||||
f 144 149 145
|
||||
f 143 155 147
|
||||
f 145 150 146
|
||||
f 147 152 148
|
||||
f 160 150 154
|
||||
f 148 153 149
|
||||
f 147 155 151
|
||||
f 149 154 150
|
||||
f 151 157 152
|
||||
f 160 154 159
|
||||
f 152 158 153
|
||||
f 151 155 156
|
||||
f 153 159 154
|
||||
f 157 161 162
|
||||
f 160 159 164
|
||||
f 157 163 158
|
||||
f 156 155 161
|
||||
f 159 163 164
|
||||
f 162 165 166
|
||||
f 160 164 168
|
||||
f 162 167 163
|
||||
f 161 155 165
|
||||
f 163 168 164
|
||||
f 166 139 140
|
||||
f 160 168 142
|
||||
f 166 141 167
|
||||
f 165 155 139
|
||||
f 167 142 168
|
||||
f 140 144 145
|
||||
f 141 145 146
|
||||
f 139 143 144
|
||||
f 143 147 148
|
||||
f 144 148 149
|
||||
f 145 149 150
|
||||
f 147 151 152
|
||||
f 148 152 153
|
||||
f 149 153 154
|
||||
f 151 156 157
|
||||
f 152 157 158
|
||||
f 153 158 159
|
||||
f 157 156 161
|
||||
f 157 162 163
|
||||
f 159 158 163
|
||||
f 162 161 165
|
||||
f 162 166 167
|
||||
f 163 167 168
|
||||
f 166 165 139
|
||||
f 166 140 141
|
||||
f 167 141 142
|
||||
o Cube.002
|
||||
v 0.127461 -0.123684 0.783712
|
||||
v 0.127461 -0.256695 0.751703
|
||||
v 0.127461 -0.168855 0.971419
|
||||
v 0.127461 -0.301867 0.939410
|
||||
v -0.127461 -0.123684 0.783712
|
||||
v -0.127461 -0.256695 0.751703
|
||||
v -0.127461 -0.168855 0.971419
|
||||
v -0.127461 -0.301867 0.939410
|
||||
v -0.325082 -0.210565 0.961381
|
||||
v -0.251488 -0.112197 0.985053
|
||||
v -0.251488 -0.067026 0.797346
|
||||
v -0.325082 -0.165394 0.773674
|
||||
v 0.240724 -0.112203 0.985052
|
||||
v 0.240724 -0.067032 0.797345
|
||||
v 0.329399 -0.151580 0.776999
|
||||
v 0.329399 -0.205403 0.962624
|
||||
v -0.376131 0.022724 1.017522
|
||||
v -0.285318 0.021204 1.017156
|
||||
v -0.285318 0.066375 0.829449
|
||||
v -0.376131 0.067895 0.829815
|
||||
v 0.287942 0.020124 1.018650
|
||||
v 0.287942 0.065296 0.830943
|
||||
v 0.381668 0.069207 0.831884
|
||||
v 0.389536 0.019994 1.018618
|
||||
g Cube.002_Cube.002_Material.003
|
||||
usemtl Material.003
|
||||
s off
|
||||
f 171 172 184
|
||||
f 172 171 175
|
||||
f 174 176 177
|
||||
f 174 173 169
|
||||
f 175 171 169
|
||||
f 172 176 174
|
||||
f 180 177 185
|
||||
f 175 178 177
|
||||
f 173 174 180
|
||||
f 175 173 179
|
||||
f 181 184 192
|
||||
f 169 182 183
|
||||
f 170 183 184
|
||||
f 169 171 181
|
||||
f 185 186 187
|
||||
f 178 186 185
|
||||
f 179 180 188
|
||||
f 178 179 187
|
||||
f 191 190 189
|
||||
f 182 190 191
|
||||
f 183 191 192
|
||||
f 181 189 190
|
||||
f 171 184 181
|
||||
f 172 175 176
|
||||
f 174 177 180
|
||||
f 174 169 170
|
||||
f 175 169 173
|
||||
f 172 174 170
|
||||
f 180 185 188
|
||||
f 175 177 176
|
||||
f 173 180 179
|
||||
f 175 179 178
|
||||
f 181 192 189
|
||||
f 169 183 170
|
||||
f 170 184 172
|
||||
f 169 181 182
|
||||
f 185 187 188
|
||||
f 178 185 177
|
||||
f 179 188 187
|
||||
f 178 187 186
|
||||
f 191 189 192
|
||||
f 182 191 183
|
||||
f 183 192 184
|
||||
f 181 190 182
|
3428
obj/maps/map1.obj
5018
obj/maps/map2.obj
|
@ -1,77 +0,0 @@
|
|||
m 000 196 173 255 255
|
||||
m 001 255 255 255 100
|
||||
m 002 179 116 122 255
|
||||
m 003 198 73 231 255
|
||||
m 004 86 81 125 255
|
||||
m 005 126 179 231 255
|
||||
m 006 231 180 162 255
|
||||
m 007 105 148 231 255
|
||||
m 008 231 160 111 255
|
||||
m 009 231 161 90 255
|
||||
m 010 147 231 139 255
|
||||
m 011 255 199 179 100
|
||||
m 012 231 88 85 100
|
||||
m 013 231 66 78 255
|
||||
m 014 198 73 231 255
|
||||
m 016 117 231 150 100
|
||||
m 017 103 79 100 100
|
||||
m 018 198 73 231 255
|
||||
m 019 103 79 231 100
|
||||
m 020 231 30 217 255
|
||||
m 021 117 231 150 100
|
||||
m 022 231 66 78 255
|
||||
m 023 231 30 217 255
|
||||
m 024 231 88 85 100
|
||||
m 025 231 161 90 255
|
||||
m 026 85 231 139 255
|
||||
m 027 255 199 179 100
|
||||
m 028 126 179 231 255
|
||||
m 029 198 73 231 255
|
||||
m 030 105 148 231 255
|
||||
m 031 231 180 162 255
|
||||
m 032 85 231 139 255
|
||||
m 033 231 160 111 255
|
||||
m 034 144 103 84 255
|
||||
m 035 179 116 122 255
|
||||
m 036 196 173 255 255
|
||||
m 037 86 81 125 255
|
||||
m 038 147 231 139 255
|
||||
o Cube.006_Cube
|
||||
v -11.718338 -0.958877 10.910831
|
||||
v -11.718338 -17.776073 10.910831
|
||||
v -11.718338 -0.958877 -10.910831
|
||||
v -11.718338 -17.776073 -10.910831
|
||||
v 11.718338 -0.958877 10.910831
|
||||
v 11.718338 -17.776073 10.910831
|
||||
v 11.718338 -0.958877 -10.910831
|
||||
v 11.718338 -17.776073 -10.910831
|
||||
v -11.718338 -0.958877 0.000000
|
||||
v 0.000000 -0.958877 -10.910831
|
||||
v 11.718338 -0.958877 0.000000
|
||||
v 0.000000 -0.958877 10.910831
|
||||
v 0.000000 -0.958877 0.000000
|
||||
g Cube.006_Cube_Material.001
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 4 9 3
|
||||
f 8 10 7
|
||||
f 6 11 5
|
||||
f 2 12 1
|
||||
f 11 13 12
|
||||
f 4 8 6
|
||||
f 13 9 1
|
||||
f 10 3 9
|
||||
f 7 10 13
|
||||
f 9 2 1
|
||||
f 2 9 4
|
||||
f 10 4 3
|
||||
f 4 10 8
|
||||
f 11 8 7
|
||||
f 8 11 6
|
||||
f 12 6 5
|
||||
f 6 12 2
|
||||
f 11 12 5
|
||||
f 4 6 2
|
||||
f 13 1 12
|
||||
f 10 9 13
|
||||
f 7 13 11
|
|
@ -1,507 +0,0 @@
|
|||
# Blender v2.91.0 OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib XYZ.mtl
|
||||
o Cylinder
|
||||
v 0.000000 -0.037199 -0.030000
|
||||
v 0.000000 2.662802 -0.030000
|
||||
v 0.009271 -0.037199 -0.028532
|
||||
v 0.009271 2.662802 -0.028532
|
||||
v 0.017634 -0.037199 -0.024271
|
||||
v 0.017634 2.662802 -0.024271
|
||||
v 0.024271 -0.037199 -0.017634
|
||||
v 0.024271 2.662802 -0.017634
|
||||
v 0.028532 -0.037199 -0.009271
|
||||
v 0.028532 2.662802 -0.009271
|
||||
v 0.030000 -0.037199 0.000000
|
||||
v 0.030000 2.662802 0.000000
|
||||
v 0.028532 -0.037199 0.009271
|
||||
v 0.028532 2.662802 0.009271
|
||||
v 0.024271 -0.037199 0.017634
|
||||
v 0.024271 2.662802 0.017634
|
||||
v 0.017634 -0.037199 0.024271
|
||||
v 0.017634 2.662802 0.024271
|
||||
v 0.009271 -0.037199 0.028532
|
||||
v 0.009271 2.662802 0.028532
|
||||
v -0.000000 -0.037199 0.030000
|
||||
v -0.000000 2.662802 0.030000
|
||||
v -0.009271 -0.037199 0.028532
|
||||
v -0.009271 2.662802 0.028532
|
||||
v -0.017634 -0.037199 0.024271
|
||||
v -0.017634 2.662802 0.024271
|
||||
v -0.024271 -0.037199 0.017634
|
||||
v -0.024271 2.662802 0.017634
|
||||
v -0.028532 -0.037199 0.009271
|
||||
v -0.028532 2.662802 0.009271
|
||||
v -0.030000 -0.037199 -0.000000
|
||||
v -0.030000 2.662802 -0.000000
|
||||
v -0.028532 -0.037199 -0.009271
|
||||
v -0.028532 2.662802 -0.009271
|
||||
v -0.024271 -0.037199 -0.017634
|
||||
v -0.024271 2.662802 -0.017634
|
||||
v -0.017634 -0.037199 -0.024271
|
||||
v -0.017634 2.662802 -0.024271
|
||||
v -0.009270 -0.037199 -0.028532
|
||||
v -0.009270 2.662802 -0.028532
|
||||
g Cylinder_Cylinder_None
|
||||
usemtl None
|
||||
s off
|
||||
f 2 3 1
|
||||
f 4 5 3
|
||||
f 6 7 5
|
||||
f 8 9 7
|
||||
f 10 11 9
|
||||
f 12 13 11
|
||||
f 14 15 13
|
||||
f 16 17 15
|
||||
f 18 19 17
|
||||
f 20 21 19
|
||||
f 22 23 21
|
||||
f 24 25 23
|
||||
f 26 27 25
|
||||
f 28 29 27
|
||||
f 30 31 29
|
||||
f 32 33 31
|
||||
f 34 35 33
|
||||
f 36 37 35
|
||||
f 30 14 6
|
||||
f 38 39 37
|
||||
f 40 1 39
|
||||
f 15 31 39
|
||||
f 2 4 3
|
||||
f 4 6 5
|
||||
f 6 8 7
|
||||
f 8 10 9
|
||||
f 10 12 11
|
||||
f 12 14 13
|
||||
f 14 16 15
|
||||
f 16 18 17
|
||||
f 18 20 19
|
||||
f 20 22 21
|
||||
f 22 24 23
|
||||
f 24 26 25
|
||||
f 26 28 27
|
||||
f 28 30 29
|
||||
f 30 32 31
|
||||
f 32 34 33
|
||||
f 34 36 35
|
||||
f 36 38 37
|
||||
f 6 4 2
|
||||
f 2 40 38
|
||||
f 38 36 34
|
||||
f 34 32 30
|
||||
f 30 28 26
|
||||
f 26 24 30
|
||||
f 24 22 30
|
||||
f 22 20 18
|
||||
f 18 16 14
|
||||
f 14 12 6
|
||||
f 12 10 6
|
||||
f 10 8 6
|
||||
f 6 2 38
|
||||
f 38 34 6
|
||||
f 34 30 6
|
||||
f 22 18 14
|
||||
f 30 22 14
|
||||
f 38 40 39
|
||||
f 40 2 1
|
||||
f 39 1 3
|
||||
f 3 5 7
|
||||
f 7 9 11
|
||||
f 11 13 7
|
||||
f 13 15 7
|
||||
f 15 17 19
|
||||
f 19 21 15
|
||||
f 21 23 15
|
||||
f 23 25 27
|
||||
f 27 29 31
|
||||
f 31 33 35
|
||||
f 35 37 31
|
||||
f 37 39 31
|
||||
f 39 3 7
|
||||
f 23 27 15
|
||||
f 27 31 15
|
||||
f 39 7 15
|
||||
o Cylinder.001_Cylinder.002
|
||||
v 0.000000 -0.033146 0.030194
|
||||
v 0.000000 -0.033046 -2.669806
|
||||
v 0.009271 -0.031678 0.030194
|
||||
v 0.009271 -0.031578 -2.669806
|
||||
v 0.017634 -0.027416 0.030194
|
||||
v 0.017634 -0.027316 -2.669806
|
||||
v 0.024271 -0.020779 0.030194
|
||||
v 0.024271 -0.020679 -2.669806
|
||||
v 0.028532 -0.012416 0.030195
|
||||
v 0.028532 -0.012316 -2.669806
|
||||
v 0.030000 -0.003146 0.030195
|
||||
v 0.030000 -0.003046 -2.669805
|
||||
v 0.028532 0.006125 0.030195
|
||||
v 0.028532 0.006225 -2.669805
|
||||
v 0.024271 0.014488 0.030196
|
||||
v 0.024271 0.014588 -2.669805
|
||||
v 0.017634 0.021125 0.030196
|
||||
v 0.017634 0.021225 -2.669804
|
||||
v 0.009271 0.025386 0.030196
|
||||
v 0.009271 0.025486 -2.669804
|
||||
v -0.000000 0.026854 0.030196
|
||||
v -0.000000 0.026954 -2.669804
|
||||
v -0.009271 0.025386 0.030196
|
||||
v -0.009271 0.025486 -2.669804
|
||||
v -0.017634 0.021125 0.030196
|
||||
v -0.017634 0.021225 -2.669804
|
||||
v -0.024271 0.014488 0.030196
|
||||
v -0.024271 0.014588 -2.669805
|
||||
v -0.028532 0.006125 0.030195
|
||||
v -0.028532 0.006225 -2.669805
|
||||
v -0.030000 -0.003146 0.030195
|
||||
v -0.030000 -0.003046 -2.669805
|
||||
v -0.028532 -0.012416 0.030195
|
||||
v -0.028532 -0.012316 -2.669806
|
||||
v -0.024271 -0.020779 0.030194
|
||||
v -0.024271 -0.020679 -2.669806
|
||||
v -0.017634 -0.027416 0.030194
|
||||
v -0.017634 -0.027316 -2.669806
|
||||
v -0.009270 -0.031678 0.030194
|
||||
v -0.009270 -0.031578 -2.669806
|
||||
g Cylinder.001_Cylinder.002_None
|
||||
usemtl None
|
||||
s off
|
||||
f 42 43 41
|
||||
f 44 45 43
|
||||
f 46 47 45
|
||||
f 48 49 47
|
||||
f 50 51 49
|
||||
f 52 53 51
|
||||
f 54 55 53
|
||||
f 56 57 55
|
||||
f 58 59 57
|
||||
f 60 61 59
|
||||
f 62 63 61
|
||||
f 64 65 63
|
||||
f 66 67 65
|
||||
f 68 69 67
|
||||
f 70 71 69
|
||||
f 72 73 71
|
||||
f 74 75 73
|
||||
f 76 77 75
|
||||
f 70 54 46
|
||||
f 78 79 77
|
||||
f 80 41 79
|
||||
f 55 71 79
|
||||
f 42 44 43
|
||||
f 44 46 45
|
||||
f 46 48 47
|
||||
f 48 50 49
|
||||
f 50 52 51
|
||||
f 52 54 53
|
||||
f 54 56 55
|
||||
f 56 58 57
|
||||
f 58 60 59
|
||||
f 60 62 61
|
||||
f 62 64 63
|
||||
f 64 66 65
|
||||
f 66 68 67
|
||||
f 68 70 69
|
||||
f 70 72 71
|
||||
f 72 74 73
|
||||
f 74 76 75
|
||||
f 76 78 77
|
||||
f 46 44 42
|
||||
f 42 80 78
|
||||
f 78 76 74
|
||||
f 74 72 70
|
||||
f 70 68 66
|
||||
f 66 64 70
|
||||
f 64 62 70
|
||||
f 62 60 58
|
||||
f 58 56 54
|
||||
f 54 52 46
|
||||
f 52 50 46
|
||||
f 50 48 46
|
||||
f 46 42 78
|
||||
f 78 74 46
|
||||
f 74 70 46
|
||||
f 62 58 54
|
||||
f 70 62 54
|
||||
f 78 80 79
|
||||
f 80 42 41
|
||||
f 79 41 43
|
||||
f 43 45 47
|
||||
f 47 49 51
|
||||
f 51 53 47
|
||||
f 53 55 47
|
||||
f 55 57 59
|
||||
f 59 61 55
|
||||
f 61 63 55
|
||||
f 63 65 67
|
||||
f 67 69 71
|
||||
f 71 73 75
|
||||
f 75 77 71
|
||||
f 77 79 71
|
||||
f 79 43 47
|
||||
f 63 67 55
|
||||
f 67 71 55
|
||||
f 79 47 55
|
||||
o Cylinder.002_Cylinder.003
|
||||
v -0.030214 -0.033641 -0.001049
|
||||
v 2.669786 -0.033541 -0.001185
|
||||
v -0.030213 -0.032173 0.008222
|
||||
v 2.669787 -0.032073 0.008085
|
||||
v -0.030213 -0.027912 0.016585
|
||||
v 2.669787 -0.027812 0.016448
|
||||
v -0.030213 -0.021275 0.023222
|
||||
v 2.669787 -0.021175 0.023085
|
||||
v -0.030213 -0.012912 0.027483
|
||||
v 2.669787 -0.012812 0.027346
|
||||
v -0.030213 -0.003641 0.028951
|
||||
v 2.669787 -0.003541 0.028815
|
||||
v -0.030214 0.005629 0.027483
|
||||
v 2.669786 0.005729 0.027346
|
||||
v -0.030214 0.013992 0.023222
|
||||
v 2.669786 0.014092 0.023085
|
||||
v -0.030215 0.020629 0.016585
|
||||
v 2.669785 0.020729 0.016448
|
||||
v -0.030215 0.024891 0.008222
|
||||
v 2.669785 0.024991 0.008085
|
||||
v -0.030216 0.026359 -0.001049
|
||||
v 2.669784 0.026459 -0.001185
|
||||
v -0.030216 0.024891 -0.010319
|
||||
v 2.669784 0.024991 -0.010456
|
||||
v -0.030216 0.020629 -0.018682
|
||||
v 2.669784 0.020729 -0.018819
|
||||
v -0.030217 0.013992 -0.025319
|
||||
v 2.669784 0.014092 -0.025456
|
||||
v -0.030216 0.005629 -0.029581
|
||||
v 2.669784 0.005729 -0.029717
|
||||
v -0.030216 -0.003641 -0.031049
|
||||
v 2.669784 -0.003541 -0.031186
|
||||
v -0.030216 -0.012912 -0.029581
|
||||
v 2.669784 -0.012812 -0.029717
|
||||
v -0.030215 -0.021275 -0.025319
|
||||
v 2.669785 -0.021175 -0.025456
|
||||
v -0.030215 -0.027912 -0.018682
|
||||
v 2.669785 -0.027812 -0.018819
|
||||
v -0.030214 -0.032173 -0.010319
|
||||
v 2.669786 -0.032073 -0.010456
|
||||
g Cylinder.002_Cylinder.003_None
|
||||
usemtl None
|
||||
s off
|
||||
f 82 83 81
|
||||
f 84 85 83
|
||||
f 86 87 85
|
||||
f 88 89 87
|
||||
f 90 91 89
|
||||
f 92 93 91
|
||||
f 94 95 93
|
||||
f 96 97 95
|
||||
f 98 99 97
|
||||
f 100 101 99
|
||||
f 102 103 101
|
||||
f 104 105 103
|
||||
f 106 107 105
|
||||
f 108 109 107
|
||||
f 110 111 109
|
||||
f 112 113 111
|
||||
f 114 115 113
|
||||
f 116 117 115
|
||||
f 110 94 86
|
||||
f 118 119 117
|
||||
f 120 81 119
|
||||
f 95 111 119
|
||||
f 82 84 83
|
||||
f 84 86 85
|
||||
f 86 88 87
|
||||
f 88 90 89
|
||||
f 90 92 91
|
||||
f 92 94 93
|
||||
f 94 96 95
|
||||
f 96 98 97
|
||||
f 98 100 99
|
||||
f 100 102 101
|
||||
f 102 104 103
|
||||
f 104 106 105
|
||||
f 106 108 107
|
||||
f 108 110 109
|
||||
f 110 112 111
|
||||
f 112 114 113
|
||||
f 114 116 115
|
||||
f 116 118 117
|
||||
f 86 84 82
|
||||
f 82 120 118
|
||||
f 118 116 114
|
||||
f 114 112 110
|
||||
f 110 108 106
|
||||
f 106 104 110
|
||||
f 104 102 110
|
||||
f 102 100 98
|
||||
f 98 96 94
|
||||
f 94 92 86
|
||||
f 92 90 86
|
||||
f 90 88 86
|
||||
f 86 82 118
|
||||
f 118 114 86
|
||||
f 114 110 86
|
||||
f 102 98 94
|
||||
f 110 102 94
|
||||
f 118 120 119
|
||||
f 120 82 81
|
||||
f 119 81 83
|
||||
f 83 85 87
|
||||
f 87 89 91
|
||||
f 91 93 87
|
||||
f 93 95 87
|
||||
f 95 97 99
|
||||
f 99 101 95
|
||||
f 101 103 95
|
||||
f 103 105 107
|
||||
f 107 109 111
|
||||
f 111 113 115
|
||||
f 115 117 111
|
||||
f 117 119 111
|
||||
f 119 83 87
|
||||
f 103 107 95
|
||||
f 107 111 95
|
||||
f 119 87 95
|
||||
o Cone
|
||||
v 0.000000 2.214305 -0.193550
|
||||
v 0.078724 2.214305 -0.176817
|
||||
v 0.143836 2.214305 -0.129510
|
||||
v 0.184077 2.214305 -0.059810
|
||||
v 0.192490 2.214305 0.020232
|
||||
v 0.167619 2.214305 0.096775
|
||||
v 0.113766 2.214305 0.156586
|
||||
v 0.040241 2.214305 0.189321
|
||||
v -0.040241 2.214305 0.189321
|
||||
v -0.113766 2.214305 0.156586
|
||||
v -0.167620 2.214305 0.096775
|
||||
v -0.192490 2.214305 0.020231
|
||||
v -0.184077 2.214305 -0.059810
|
||||
v -0.143836 2.214305 -0.129510
|
||||
v -0.078724 2.214305 -0.176817
|
||||
v 0.000000 2.789091 0.000000
|
||||
g Cone_Cone_None
|
||||
usemtl None
|
||||
s off
|
||||
f 121 136 122
|
||||
f 122 136 123
|
||||
f 123 136 124
|
||||
f 124 136 125
|
||||
f 125 136 126
|
||||
f 126 136 127
|
||||
f 127 136 128
|
||||
f 128 136 129
|
||||
f 129 136 130
|
||||
f 130 136 131
|
||||
f 131 136 132
|
||||
f 132 136 133
|
||||
f 133 136 134
|
||||
f 132 134 126
|
||||
f 134 136 135
|
||||
f 135 136 121
|
||||
f 135 121 134
|
||||
f 121 122 134
|
||||
f 122 123 124
|
||||
f 124 125 126
|
||||
f 126 127 128
|
||||
f 128 129 126
|
||||
f 129 130 126
|
||||
f 130 131 132
|
||||
f 132 133 134
|
||||
f 122 124 134
|
||||
f 124 126 134
|
||||
f 130 132 126
|
||||
o Cone.001
|
||||
v 0.000000 -0.183155 -2.218309
|
||||
v 0.078724 -0.166422 -2.218311
|
||||
v 0.143836 -0.119116 -2.218315
|
||||
v 0.184077 -0.049415 -2.218320
|
||||
v 0.192490 0.030626 -2.218327
|
||||
v 0.167619 0.107170 -2.218333
|
||||
v 0.113766 0.166980 -2.218338
|
||||
v 0.040241 0.199716 -2.218341
|
||||
v -0.040241 0.199716 -2.218341
|
||||
v -0.113766 0.166980 -2.218338
|
||||
v -0.167620 0.107170 -2.218333
|
||||
v -0.192490 0.030626 -2.218327
|
||||
v -0.184077 -0.049415 -2.218320
|
||||
v -0.143836 -0.119116 -2.218315
|
||||
v -0.078724 -0.166422 -2.218311
|
||||
v 0.000000 0.010348 -2.793111
|
||||
g Cone.001_Cone.001_None
|
||||
usemtl None
|
||||
s off
|
||||
f 137 152 138
|
||||
f 138 152 139
|
||||
f 139 152 140
|
||||
f 140 152 141
|
||||
f 141 152 142
|
||||
f 142 152 143
|
||||
f 143 152 144
|
||||
f 144 152 145
|
||||
f 145 152 146
|
||||
f 146 152 147
|
||||
f 147 152 148
|
||||
f 148 152 149
|
||||
f 149 152 150
|
||||
f 148 150 142
|
||||
f 150 152 151
|
||||
f 151 152 137
|
||||
f 151 137 150
|
||||
f 137 138 150
|
||||
f 138 139 140
|
||||
f 140 141 142
|
||||
f 142 143 144
|
||||
f 144 145 142
|
||||
f 145 146 142
|
||||
f 146 147 148
|
||||
f 148 149 150
|
||||
f 138 140 150
|
||||
f 140 142 150
|
||||
f 146 148 142
|
||||
o Cone.002
|
||||
v 2.200030 -0.000605 -0.193550
|
||||
v 2.200028 -0.079329 -0.176817
|
||||
v 2.200026 -0.144441 -0.129510
|
||||
v 2.200025 -0.184683 -0.059810
|
||||
v 2.200024 -0.193096 0.020232
|
||||
v 2.200025 -0.168225 0.096775
|
||||
v 2.200027 -0.114371 0.156586
|
||||
v 2.200029 -0.040847 0.189321
|
||||
v 2.200032 0.039636 0.189321
|
||||
v 2.200034 0.113161 0.156586
|
||||
v 2.200036 0.167014 0.096775
|
||||
v 2.200036 0.191885 0.020231
|
||||
v 2.200036 0.183472 -0.059810
|
||||
v 2.200035 0.143230 -0.129510
|
||||
v 2.200033 0.078119 -0.176817
|
||||
v 2.774816 -0.000623 0.000000
|
||||
g Cone.002_Cone.002_None
|
||||
usemtl None
|
||||
s off
|
||||
f 153 168 154
|
||||
f 154 168 155
|
||||
f 155 168 156
|
||||
f 156 168 157
|
||||
f 157 168 158
|
||||
f 158 168 159
|
||||
f 159 168 160
|
||||
f 160 168 161
|
||||
f 161 168 162
|
||||
f 162 168 163
|
||||
f 163 168 164
|
||||
f 164 168 165
|
||||
f 165 168 166
|
||||
f 164 166 158
|
||||
f 166 168 167
|
||||
f 167 168 153
|
||||
f 167 153 166
|
||||
f 153 154 166
|
||||
f 154 155 156
|
||||
f 156 157 158
|
||||
f 158 159 160
|
||||
f 160 161 158
|
||||
f 161 162 158
|
||||
f 162 163 164
|
||||
f 164 165 166
|
||||
f 154 156 166
|
||||
f 156 158 166
|
||||
f 162 164 158
|
|
@ -1,21 +0,0 @@
|
|||
v 1.000000 -1.000000 -1.000000
|
||||
v 1.000000 -1.000000 1.000000
|
||||
v -1.000000 -1.000000 1.000000
|
||||
v -1.000000 -1.000000 -1.000000
|
||||
v 1.000000 1.000000 -0.999999
|
||||
v 0.999999 1.000000 1.000001
|
||||
v -1.000000 1.000000 1.000000
|
||||
v -1.000000 1.000000 -1.000000
|
||||
s off
|
||||
f 2 4 1
|
||||
f 8 6 5
|
||||
f 5 2 1
|
||||
f 6 3 2
|
||||
f 3 8 4
|
||||
f 1 8 5
|
||||
f 2 3 4
|
||||
f 8 7 6
|
||||
f 5 6 2
|
||||
f 6 7 3
|
||||
f 3 7 8
|
||||
f 1 4 8
|
|
@ -1,159 +0,0 @@
|
|||
# Blender v2.91.0 OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib sphere.mtl
|
||||
o Sphere
|
||||
v 0.000000 -0.500000 -0.866025
|
||||
v 0.000000 -0.866025 -0.500000
|
||||
v -0.000000 1.000000 -0.000000
|
||||
v 0.293893 0.866025 -0.404509
|
||||
v 0.509037 0.500000 -0.700629
|
||||
v 0.587785 -0.000000 -0.809017
|
||||
v 0.509037 -0.500000 -0.700629
|
||||
v 0.293893 -0.866025 -0.404509
|
||||
v 0.475528 0.866025 -0.154509
|
||||
v 0.823639 0.500000 -0.267617
|
||||
v 0.951056 -0.000000 -0.309017
|
||||
v 0.823639 -0.500000 -0.267617
|
||||
v 0.475528 -0.866025 -0.154509
|
||||
v 0.475528 0.866025 0.154508
|
||||
v 0.823639 0.500000 0.267616
|
||||
v 0.951056 -0.000000 0.309017
|
||||
v 0.823639 -0.500000 0.267616
|
||||
v 0.475528 -0.866025 0.154508
|
||||
v 0.293893 0.866025 0.404508
|
||||
v 0.509037 0.500000 0.700629
|
||||
v 0.587785 -0.000000 0.809017
|
||||
v 0.509037 -0.500000 0.700629
|
||||
v 0.293893 -0.866025 0.404508
|
||||
v 0.000000 0.866025 0.500000
|
||||
v 0.000000 0.500000 0.866025
|
||||
v -0.000000 -0.000000 1.000000
|
||||
v -0.000000 -0.500000 0.866025
|
||||
v 0.000000 -0.866025 0.500000
|
||||
v -0.293893 0.866025 0.404508
|
||||
v -0.509037 0.500000 0.700629
|
||||
v -0.587785 -0.000000 0.809017
|
||||
v -0.509037 -0.500000 0.700629
|
||||
v -0.293893 -0.866025 0.404508
|
||||
v 0.000000 -1.000000 -0.000000
|
||||
v -0.475528 0.866025 0.154508
|
||||
v -0.823639 0.500000 0.267616
|
||||
v -0.951056 -0.000000 0.309017
|
||||
v -0.823639 -0.500000 0.267616
|
||||
v -0.475528 -0.866025 0.154508
|
||||
v -0.475528 0.866025 -0.154509
|
||||
v -0.823639 0.500000 -0.267617
|
||||
v -0.951056 -0.000000 -0.309017
|
||||
v -0.823639 -0.500000 -0.267617
|
||||
v -0.475528 -0.866025 -0.154509
|
||||
v -0.293893 0.866025 -0.404508
|
||||
v -0.509037 0.500000 -0.700629
|
||||
v -0.587785 -0.000000 -0.809017
|
||||
v -0.509037 -0.500000 -0.700629
|
||||
v -0.293893 -0.866025 -0.404509
|
||||
v -0.000000 0.866025 -0.500000
|
||||
v -0.000000 0.500000 -0.866025
|
||||
v -0.000000 -0.000000 -1.000000
|
||||
g Sphere_Sphere_None
|
||||
usemtl None
|
||||
s off
|
||||
f 1 8 2
|
||||
f 51 6 52
|
||||
f 50 3 4
|
||||
f 34 2 8
|
||||
f 1 6 7
|
||||
f 50 5 51
|
||||
f 4 3 9
|
||||
f 34 8 13
|
||||
f 6 12 7
|
||||
f 5 9 10
|
||||
f 7 13 8
|
||||
f 6 10 11
|
||||
f 34 13 18
|
||||
f 11 17 12
|
||||
f 9 15 10
|
||||
f 12 18 13
|
||||
f 11 15 16
|
||||
f 9 3 14
|
||||
f 34 18 23
|
||||
f 17 21 22
|
||||
f 15 19 20
|
||||
f 17 23 18
|
||||
f 16 20 21
|
||||
f 14 3 19
|
||||
f 34 23 28
|
||||
f 21 27 22
|
||||
f 19 25 20
|
||||
f 22 28 23
|
||||
f 20 26 21
|
||||
f 19 3 24
|
||||
f 26 32 27
|
||||
f 24 30 25
|
||||
f 28 32 33
|
||||
f 25 31 26
|
||||
f 24 3 29
|
||||
f 34 28 33
|
||||
f 29 36 30
|
||||
f 32 39 33
|
||||
f 30 37 31
|
||||
f 29 3 35
|
||||
f 34 33 39
|
||||
f 31 38 32
|
||||
f 38 44 39
|
||||
f 36 42 37
|
||||
f 35 3 40
|
||||
f 34 39 44
|
||||
f 38 42 43
|
||||
f 36 40 41
|
||||
f 43 49 44
|
||||
f 41 47 42
|
||||
f 40 3 45
|
||||
f 34 44 49
|
||||
f 43 47 48
|
||||
f 41 45 46
|
||||
f 48 2 49
|
||||
f 46 52 47
|
||||
f 45 3 50
|
||||
f 34 49 2
|
||||
f 48 52 1
|
||||
f 46 50 51
|
||||
f 1 7 8
|
||||
f 51 5 6
|
||||
f 1 52 6
|
||||
f 50 4 5
|
||||
f 6 11 12
|
||||
f 5 4 9
|
||||
f 7 12 13
|
||||
f 6 5 10
|
||||
f 11 16 17
|
||||
f 9 14 15
|
||||
f 12 17 18
|
||||
f 11 10 15
|
||||
f 17 16 21
|
||||
f 15 14 19
|
||||
f 17 22 23
|
||||
f 16 15 20
|
||||
f 21 26 27
|
||||
f 19 24 25
|
||||
f 22 27 28
|
||||
f 20 25 26
|
||||
f 26 31 32
|
||||
f 24 29 30
|
||||
f 28 27 32
|
||||
f 25 30 31
|
||||
f 29 35 36
|
||||
f 32 38 39
|
||||
f 30 36 37
|
||||
f 31 37 38
|
||||
f 38 43 44
|
||||
f 36 41 42
|
||||
f 38 37 42
|
||||
f 36 35 40
|
||||
f 43 48 49
|
||||
f 41 46 47
|
||||
f 43 42 47
|
||||
f 41 40 45
|
||||
f 48 1 2
|
||||
f 46 51 52
|
||||
f 48 47 52
|
||||
f 46 45 50
|
|
@ -1,171 +0,0 @@
|
|||
# Blender v2.91.0 OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib vector.mtl
|
||||
o Cylinder.002_Cylinder.003
|
||||
v 2.669786 -0.033541 -0.001185
|
||||
v -0.030213 -0.032173 0.008222
|
||||
v -0.030214 -0.033641 -0.001049
|
||||
v 2.669787 -0.032073 0.008085
|
||||
v -0.030213 -0.027912 0.016585
|
||||
v 2.669787 -0.027812 0.016448
|
||||
v -0.030213 -0.021275 0.023222
|
||||
v 2.669787 -0.021175 0.023085
|
||||
v -0.030213 -0.012912 0.027483
|
||||
v 2.669787 -0.012812 0.027346
|
||||
v -0.030213 -0.003641 0.028951
|
||||
v 2.669787 -0.003541 0.028815
|
||||
v -0.030214 0.005629 0.027483
|
||||
v 2.669786 0.005729 0.027346
|
||||
v -0.030214 0.013992 0.023222
|
||||
v 2.669786 0.014092 0.023085
|
||||
v -0.030215 0.020629 0.016585
|
||||
v 2.669785 0.020729 0.016448
|
||||
v -0.030215 0.024891 0.008222
|
||||
v 2.669785 0.024991 0.008085
|
||||
v -0.030216 0.026359 -0.001049
|
||||
v 2.669784 0.026459 -0.001185
|
||||
v -0.030216 0.024891 -0.010319
|
||||
v 2.669784 0.024991 -0.010456
|
||||
v -0.030216 0.020629 -0.018682
|
||||
v 2.669784 0.020729 -0.018819
|
||||
v -0.030217 0.013992 -0.025319
|
||||
v 2.669784 0.014092 -0.025456
|
||||
v -0.030216 0.005629 -0.029581
|
||||
v 2.669784 0.005729 -0.029717
|
||||
v -0.030216 -0.003641 -0.031049
|
||||
v 2.669784 -0.003541 -0.031186
|
||||
v -0.030216 -0.012912 -0.029581
|
||||
v 2.669784 -0.012812 -0.029717
|
||||
v -0.030215 -0.021275 -0.025319
|
||||
v 2.669785 -0.021175 -0.025456
|
||||
v -0.030215 -0.027912 -0.018682
|
||||
v 2.669785 -0.027812 -0.018819
|
||||
v -0.030214 -0.032173 -0.010319
|
||||
v 2.669786 -0.032073 -0.010456
|
||||
g Cylinder.002_Cylinder.003_Cylinder.002_Cylinder.003_None
|
||||
usemtl None
|
||||
s off
|
||||
f 1 2 3
|
||||
f 4 5 2
|
||||
f 6 7 5
|
||||
f 8 9 7
|
||||
f 10 11 9
|
||||
f 12 13 11
|
||||
f 14 15 13
|
||||
f 16 17 15
|
||||
f 18 19 17
|
||||
f 20 21 19
|
||||
f 22 23 21
|
||||
f 24 25 23
|
||||
f 26 27 25
|
||||
f 28 29 27
|
||||
f 30 31 29
|
||||
f 32 33 31
|
||||
f 34 35 33
|
||||
f 36 37 35
|
||||
f 30 14 6
|
||||
f 38 39 37
|
||||
f 40 3 39
|
||||
f 15 31 39
|
||||
f 1 4 2
|
||||
f 4 6 5
|
||||
f 6 8 7
|
||||
f 8 10 9
|
||||
f 10 12 11
|
||||
f 12 14 13
|
||||
f 14 16 15
|
||||
f 16 18 17
|
||||
f 18 20 19
|
||||
f 20 22 21
|
||||
f 22 24 23
|
||||
f 24 26 25
|
||||
f 26 28 27
|
||||
f 28 30 29
|
||||
f 30 32 31
|
||||
f 32 34 33
|
||||
f 34 36 35
|
||||
f 36 38 37
|
||||
f 6 4 1
|
||||
f 1 40 38
|
||||
f 38 36 34
|
||||
f 34 32 30
|
||||
f 30 28 26
|
||||
f 26 24 30
|
||||
f 24 22 30
|
||||
f 22 20 18
|
||||
f 18 16 14
|
||||
f 14 12 6
|
||||
f 12 10 6
|
||||
f 10 8 6
|
||||
f 6 1 38
|
||||
f 38 34 6
|
||||
f 34 30 6
|
||||
f 22 18 14
|
||||
f 30 22 14
|
||||
f 38 40 39
|
||||
f 40 1 3
|
||||
f 39 3 2
|
||||
f 2 5 7
|
||||
f 7 9 11
|
||||
f 11 13 7
|
||||
f 13 15 7
|
||||
f 15 17 19
|
||||
f 19 21 15
|
||||
f 21 23 15
|
||||
f 23 25 27
|
||||
f 27 29 31
|
||||
f 31 33 35
|
||||
f 35 37 31
|
||||
f 37 39 31
|
||||
f 39 2 7
|
||||
f 23 27 15
|
||||
f 27 31 15
|
||||
f 39 7 15
|
||||
o Cone.002
|
||||
v 2.200030 -0.000605 -0.193550
|
||||
v 2.774816 -0.000623 -0.000000
|
||||
v 2.200028 -0.079329 -0.176817
|
||||
v 2.200026 -0.144441 -0.129510
|
||||
v 2.200025 -0.184683 -0.059810
|
||||
v 2.200024 -0.193096 0.020232
|
||||
v 2.200025 -0.168225 0.096775
|
||||
v 2.200027 -0.114371 0.156586
|
||||
v 2.200029 -0.040847 0.189321
|
||||
v 2.200032 0.039636 0.189321
|
||||
v 2.200034 0.113161 0.156586
|
||||
v 2.200036 0.167014 0.096775
|
||||
v 2.200036 0.191885 0.020231
|
||||
v 2.200036 0.183472 -0.059810
|
||||
v 2.200035 0.143230 -0.129510
|
||||
v 2.200033 0.078119 -0.176817
|
||||
g Cone.002_Cone.002_None
|
||||
usemtl None
|
||||
s off
|
||||
f 41 42 43
|
||||
f 43 42 44
|
||||
f 44 42 45
|
||||
f 45 42 46
|
||||
f 46 42 47
|
||||
f 47 42 48
|
||||
f 48 42 49
|
||||
f 49 42 50
|
||||
f 50 42 51
|
||||
f 51 42 52
|
||||
f 52 42 53
|
||||
f 53 42 54
|
||||
f 54 42 55
|
||||
f 53 55 47
|
||||
f 55 42 56
|
||||
f 56 42 41
|
||||
f 56 41 55
|
||||
f 41 43 55
|
||||
f 43 44 45
|
||||
f 45 46 47
|
||||
f 47 48 49
|
||||
f 49 50 47
|
||||
f 50 51 47
|
||||
f 51 52 53
|
||||
f 53 54 55
|
||||
f 43 45 55
|
||||
f 45 47 55
|
||||
f 51 53 47
|
|
@ -1,199 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 14.03.2021.
|
||||
//
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <animation/Animations.h>
|
||||
#include <utils/EventHandler.h>
|
||||
#include <utils/Log.h>
|
||||
#include <io/Screen.h>
|
||||
|
||||
#include "Player.h"
|
||||
|
||||
Player::Player(ObjectNameTag name, const std::string &filename, const Vec3D &scale) : RigidBody(std::move(name), filename, scale) {
|
||||
setAcceleration(Vec3D{0, -ShooterConsts::GRAVITY, 0});
|
||||
setCollision(true);
|
||||
setVisible(false);
|
||||
setColor(sf::Color(0,0,0));
|
||||
|
||||
setCollisionCallBack([this](const ObjectNameTag &tag, std::shared_ptr<RigidBody> obj) { collisionWithObject(tag, obj); });
|
||||
}
|
||||
|
||||
void Player::rotateWeaponsRelativePoint(const Vec3D &point4D, const Vec3D &v, double val) {
|
||||
for (auto &weapon : _weapons) {
|
||||
weapon->rotateRelativePoint(point4D, v, val);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::collisionWithObject(const ObjectNameTag &tag, std::shared_ptr<RigidBody> obj) {
|
||||
if (tag.str().find("Bonus_gun") != std::string::npos) {
|
||||
addWeapon(std::make_shared<Gun>());
|
||||
}
|
||||
|
||||
if (tag.str().find("Bonus_shotgun") != std::string::npos) {
|
||||
addWeapon(std::make_shared<Shotgun>());
|
||||
}
|
||||
|
||||
if (tag.str().find("Bonus_ak47") != std::string::npos) {
|
||||
addWeapon(std::make_shared<Ak47>());
|
||||
}
|
||||
|
||||
if (tag.str().find("Bonus_gold_ak47") != std::string::npos) {
|
||||
addWeapon(std::make_shared<Gold_Ak47>());
|
||||
}
|
||||
|
||||
if (tag.str().find("Bonus_rifle") != std::string::npos) {
|
||||
addWeapon(std::make_shared<Rifle>());
|
||||
}
|
||||
|
||||
if (tag.str().find("Bonus_hill") != std::string::npos) {
|
||||
setFullHealth();
|
||||
}
|
||||
|
||||
if (tag.str().find("Bonus_ability") != std::string::npos) {
|
||||
setFullAbility();
|
||||
}
|
||||
|
||||
if (tag.str().find("Bonus") != std::string::npos) {
|
||||
EventHandler::call<void(const std::string&)>(Event("take_bonus"), tag.str());
|
||||
}
|
||||
}
|
||||
|
||||
void Player::addWeapon(std::shared_ptr<Weapon> weapon) {
|
||||
SoundController::loadAndPlay(SoundTag("changeWeapon"), ShooterConsts::CHANGE_WEAPON_SOUND);
|
||||
|
||||
for (auto &w : _weapons) {
|
||||
if (w->name() == weapon->name()) {
|
||||
w->addAPack();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_weapons.push_back(weapon);
|
||||
attach(weapon);
|
||||
|
||||
_weapons.back()->translate(position());
|
||||
_weapons.back()->rotateRelativePoint(position() + Vec3D{0, 1.8, 0}, Vec3D{0, 1, 0}, angle().y());
|
||||
_weapons.back()->rotateRelativePoint(position() + Vec3D{0, 1.8, 0}, left(), headAngle());
|
||||
}
|
||||
|
||||
void Player::reInitWeapons() {
|
||||
|
||||
if (!_weapons.empty()) {
|
||||
for (auto weapon : _weapons) {
|
||||
unattach(ObjectNameTag(weapon->name()));
|
||||
}
|
||||
|
||||
EventHandler::call<void(std::shared_ptr<Weapon>)>(Event("remove_weapon"),
|
||||
_weapons[_selectedWeapon]);
|
||||
|
||||
_weapons.clear();
|
||||
}
|
||||
|
||||
_selectedWeapon = 0;
|
||||
addWeapon(std::make_shared<Gun>());
|
||||
|
||||
EventHandler::call<void(std::shared_ptr<Weapon>)>(Event("add_weapon"),
|
||||
_weapons[_selectedWeapon]);
|
||||
}
|
||||
|
||||
void Player::selectNextWeapon() {
|
||||
if (_weapons.size() > 1) {
|
||||
// change '_selectedWeapon'
|
||||
EventHandler::call<void(std::shared_ptr<Weapon>)>(Event("remove_weapon"),
|
||||
_weapons[_selectedWeapon]);
|
||||
|
||||
_selectedWeapon = (_selectedWeapon + 1) % _weapons.size();
|
||||
|
||||
EventHandler::call<void(std::shared_ptr<Weapon>)>(Event("add_weapon"),
|
||||
_weapons[_selectedWeapon]);
|
||||
|
||||
Log::log("selectedWeapon " + std::to_string(_selectedWeapon));
|
||||
SoundController::loadAndPlay(SoundTag("changeWeapon"), ShooterConsts::CHANGE_WEAPON_SOUND);
|
||||
selectWeaponAnimation();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Player::selectPreviousWeapon() {
|
||||
if (_weapons.size() > 1) {
|
||||
// change '_selectedWeapon'
|
||||
EventHandler::call<void(std::shared_ptr<Weapon>)>(Event("remove_weapon"),
|
||||
_weapons[_selectedWeapon]);
|
||||
|
||||
if (_selectedWeapon > 0) {
|
||||
_selectedWeapon = (_selectedWeapon - 1) % _weapons.size();
|
||||
} else {
|
||||
_selectedWeapon = _weapons.size() - 1;
|
||||
}
|
||||
|
||||
EventHandler::call<void(std::shared_ptr<Weapon>)>(Event("add_weapon"),
|
||||
_weapons[_selectedWeapon]);
|
||||
|
||||
Log::log("selectedWeapon " + std::to_string(_selectedWeapon));
|
||||
SoundController::loadAndPlay(SoundTag("changeWeapon"), ShooterConsts::CHANGE_WEAPON_SOUND);
|
||||
selectWeaponAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::fire() {
|
||||
auto camera = attached(ObjectNameTag("Camera"));
|
||||
if (camera != nullptr) {
|
||||
auto fireInfo = _weapons[_selectedWeapon]->fire(_rayCastFunction, camera->position(), camera->lookAt());
|
||||
for (auto&[damagedPlayerName, damage] : fireInfo.damagedPlayers) {
|
||||
sf::Uint16 targetId = std::stoi(damagedPlayerName.str().substr(6));
|
||||
EventHandler::call<void(sf::Uint16, double)>(Event("damage_player"), targetId, damage);
|
||||
}
|
||||
return fireInfo.shot;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Player::reload() {
|
||||
_weapons[_selectedWeapon]->reload();
|
||||
}
|
||||
|
||||
void Player::setFullHealth() {
|
||||
_health = ShooterConsts::HEALTH_MAX;
|
||||
SoundController::loadAndPlay(SoundTag("addHealth"), ShooterConsts::RESTORE_HEALTH_SOUND);
|
||||
}
|
||||
|
||||
void Player::setFullAbility() {
|
||||
_ability = ShooterConsts::ABILITY_MAX;
|
||||
SoundController::loadAndPlay(SoundTag("addAbility"), ShooterConsts::RESTORE_ABILITY_SOUND);
|
||||
}
|
||||
|
||||
void Player::selectWeaponAnimation() {
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag("select_weapon"),
|
||||
_weapons[_selectedWeapon],
|
||||
-2 * Consts::PI,
|
||||
0.3,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
}
|
||||
|
||||
void Player::fireWeaponAnimation() {
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag("fire_weapon"),
|
||||
_weapons[_selectedWeapon],
|
||||
-_weapons[_selectedWeapon]->fireDelay(),
|
||||
_weapons[_selectedWeapon]->fireDelay()/3,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag("fire_weapon"), 0);
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag("fire_weapon"),
|
||||
_weapons[_selectedWeapon],
|
||||
_weapons[_selectedWeapon]->fireDelay(),
|
||||
_weapons[_selectedWeapon]->fireDelay()/3,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
}
|
||||
|
||||
void Player::reloadWeaponAnimation() {
|
||||
Timeline::addAnimation<ARotateLeft>(AnimationListTag("reload_weapon"),
|
||||
_weapons[_selectedWeapon],
|
||||
-2 * Consts::PI,
|
||||
_weapons[_selectedWeapon]->reloadTime() / 2,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
}
|
107
player/Player.h
|
@ -1,107 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 14.03.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_PLAYER_H
|
||||
#define SHOOTER_PLAYER_H
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <SFML/Audio/Sound.hpp>
|
||||
|
||||
#include <utils/ResourceManager.h>
|
||||
#include <Camera.h>
|
||||
#include <World.h>
|
||||
|
||||
#include "../weapon/Ak47.h"
|
||||
#include "../weapon/Shotgun.h"
|
||||
#include "../weapon/Gun.h"
|
||||
#include "../weapon/Gold_Ak47.h"
|
||||
#include "../weapon/Rifle.h"
|
||||
#include "../ShooterConsts.h"
|
||||
|
||||
|
||||
class Player final : public RigidBody {
|
||||
private:
|
||||
double _health = ShooterConsts::HEALTH_MAX;
|
||||
double _ability = ShooterConsts::ABILITY_MAX;
|
||||
|
||||
double _headAngle = 0;
|
||||
|
||||
int _kills = 0;
|
||||
int _deaths = 0;
|
||||
|
||||
std::vector<std::shared_ptr<Weapon>> _weapons;
|
||||
size_t _selectedWeapon = 0;
|
||||
|
||||
std::string _nickName = ShooterConsts::PLAYER_NAME;
|
||||
|
||||
std::function<IntersectionInformation(const Vec3D &, const Vec3D &)> _rayCastFunction;
|
||||
|
||||
void collisionWithObject(const ObjectNameTag &tag, std::shared_ptr<RigidBody> obj);
|
||||
|
||||
public:
|
||||
explicit Player(ObjectNameTag name, const std::string &filename = ShooterConsts::CUBE_OBJ, const Vec3D &scale = Vec3D{1, 1, 1});
|
||||
|
||||
void setHealth(double h) { _health = h; }
|
||||
|
||||
void setAbility(double a) { _ability = a; }
|
||||
|
||||
[[nodiscard]] double health() const { return _health; }
|
||||
|
||||
[[nodiscard]] double ability() const { return _ability; }
|
||||
|
||||
void setFullHealth();
|
||||
|
||||
void setFullAbility();
|
||||
|
||||
void reInitWeapons();
|
||||
|
||||
void addWeapon(std::shared_ptr<Weapon> weapon);
|
||||
|
||||
void selectNextWeapon();
|
||||
|
||||
void selectPreviousWeapon();
|
||||
|
||||
bool fire();
|
||||
|
||||
void reload();
|
||||
|
||||
[[nodiscard]] std::shared_ptr<Weapon> weapon() const { return _weapons[_selectedWeapon]; }
|
||||
|
||||
void rotateWeaponsRelativePoint(const Vec3D &point, const Vec3D &v, double val);
|
||||
|
||||
[[nodiscard]] int kills() const { return _kills; }
|
||||
|
||||
[[nodiscard]] int deaths() const { return _deaths; }
|
||||
|
||||
void addKill() { _kills++; }
|
||||
|
||||
void addDeath() { _deaths++; }
|
||||
|
||||
void setKills(int kills) { _kills = kills; }
|
||||
|
||||
void setDeaths(int deaths) { _deaths = deaths; }
|
||||
|
||||
void setRayCastFunction(std::function<IntersectionInformation(const Vec3D &, const Vec3D &)> rayCastFunction) {
|
||||
_rayCastFunction = std::move(rayCastFunction);
|
||||
}
|
||||
|
||||
// This is for situation when you want to store the position of the head but you dont have attached camera
|
||||
void setHeadAngle(double a) { _headAngle = a; }
|
||||
|
||||
[[nodiscard]] double headAngle() const { return _headAngle; };
|
||||
|
||||
[[nodiscard]] std::string playerNickName() const { return _nickName; }
|
||||
|
||||
void setPlayerNickName(const std::string &name) { _nickName = name; }
|
||||
|
||||
void selectWeaponAnimation();
|
||||
|
||||
void fireWeaponAnimation();
|
||||
|
||||
void reloadWeaponAnimation();
|
||||
};
|
||||
|
||||
|
||||
#endif //MINECRAFT_3DZAVR_PLAYER_H
|
|
@ -1,244 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 19.09.2021.
|
||||
//
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <animation/Animations.h>
|
||||
#include <utils/Log.h>
|
||||
|
||||
#include "PlayerController.h"
|
||||
|
||||
PlayerController::PlayerController(std::shared_ptr<Player> player,
|
||||
std::shared_ptr<Keyboard> keyboard,
|
||||
std::shared_ptr<Mouse> mouse) : _player(player), _keyboard(keyboard),
|
||||
_mouse(mouse) {}
|
||||
|
||||
void PlayerController::update() {
|
||||
// friction
|
||||
if (_player->inCollision()) {
|
||||
_player->setVelocity(_player->velocity() * (1.0 - Time::deltaTime() * 2));
|
||||
}
|
||||
|
||||
if (_isInSlowMo) {
|
||||
if (_player->ability() > 0) {
|
||||
_player->setAbility(_player->ability() - Time::deltaTime());
|
||||
} else {
|
||||
_player->setAbility(0);
|
||||
_isInSlowMo = false;
|
||||
_player->setVelocity(_player->velocity() * ShooterConsts::SLOW_MO_COEFFICIENT);
|
||||
_player->setAcceleration(
|
||||
_player->acceleration() * ShooterConsts::SLOW_MO_COEFFICIENT * ShooterConsts::SLOW_MO_COEFFICIENT);
|
||||
SoundController::stopSound(SoundTag("slowMo"));
|
||||
SoundController::loadAndPlay(SoundTag("unSlowMo"), ShooterConsts::UN_SLOW_MO_SOUND);
|
||||
}
|
||||
}
|
||||
|
||||
double coeff = _isInSlowMo ? 1.0 / ShooterConsts::SLOW_MO_COEFFICIENT : 1.0;
|
||||
|
||||
bool inRunning_old = _inRunning;
|
||||
_inRunning = (Keyboard::isKeyPressed(sf::Keyboard::A) ||
|
||||
Keyboard::isKeyPressed(sf::Keyboard::D) ||
|
||||
Keyboard::isKeyPressed(sf::Keyboard::W) ||
|
||||
Keyboard::isKeyPressed(sf::Keyboard::S));
|
||||
|
||||
std::shared_ptr<Object> camera = _player->attached(ObjectNameTag("Camera"));
|
||||
|
||||
if(camera != nullptr) {
|
||||
// random motion during high speed
|
||||
if (!Timeline::isInAnimList(AnimationListTag("high_speed_motion"))) {
|
||||
double d_alpha = _player->velocity().abs()/2000*rand()/RAND_MAX;
|
||||
double dt = 0.12;
|
||||
|
||||
Timeline::addAnimation<ARotateLeftUpLookAt>(AnimationListTag("high_speed_motion"),
|
||||
camera, Vec3D(0, 0, d_alpha), dt,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag("high_speed_motion"), 0);
|
||||
Timeline::addAnimation<ARotateLeftUpLookAt>(AnimationListTag("high_speed_motion"),
|
||||
camera, Vec3D(0, 0, -d_alpha), dt,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag("high_speed_motion"), 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (camera != nullptr && _inRunning && _player->inCollision()) {
|
||||
if (!Timeline::isInAnimList(AnimationListTag("camera_hor_oscil"))) {
|
||||
Timeline::addAnimation<ATranslate>(AnimationListTag("camera_hor_oscil"),
|
||||
camera, -camera->left() / 6, 0.3,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag("camera_hor_oscil"), 0);
|
||||
Timeline::addAnimation<ATranslate>(AnimationListTag("camera_hor_oscil"),
|
||||
camera, camera->left() / 6, 0.3,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
|
||||
Timeline::addAnimation<ATranslate>(AnimationListTag("camera_vert_oscil"),
|
||||
camera, -Vec3D{0, 1, 0} / 12, 0.15,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag("camera_vert_oscil"), 0);
|
||||
Timeline::addAnimation<ATranslate>(AnimationListTag("camera_vert_oscil"),
|
||||
camera, Vec3D{0, 1, 0} / 12, 0.15,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag("camera_vert_oscil"), 0);
|
||||
Timeline::addAnimation<ATranslate>(AnimationListTag("camera_vert_oscil"),
|
||||
camera, -Vec3D{0, 1, 0} / 12, 0.15,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
Timeline::addAnimation<AWait>(AnimationListTag("camera_vert_oscil"), 0);
|
||||
Timeline::addAnimation<ATranslate>(AnimationListTag("camera_vert_oscil"),
|
||||
camera, Vec3D{0, 1, 0} / 12, 0.15,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
|
||||
Timeline::addAnimation<ATranslateToPoint>(AnimationListTag("camera_init"),
|
||||
camera, _player->position() + Vec3D{0, 1.8, 0},
|
||||
0.3,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
}
|
||||
} else if (camera != nullptr && inRunning_old && !_inRunning) {
|
||||
Timeline::deleteAnimationList(AnimationListTag("camera_hor_oscil"));
|
||||
Timeline::deleteAnimationList(AnimationListTag("camera_vert_oscil"));
|
||||
Timeline::deleteAnimationList(AnimationListTag("camera_init"));
|
||||
Timeline::addAnimation<ATranslateToPoint>(AnimationListTag("camera_init"),
|
||||
camera, _player->position() + Vec3D{0, 1.8, 0}, 0.15,
|
||||
Animation::LoopOut::None,
|
||||
Animation::InterpolationType::Cos);
|
||||
}
|
||||
|
||||
// Left and right
|
||||
|
||||
if (Keyboard::isKeyPressed(sf::Keyboard::A)) {
|
||||
_player->translate(_player->left() * Time::deltaTime() * ShooterConsts::WALK_SPEED * coeff);
|
||||
if (_player->inCollision()) {
|
||||
_player->setVelocity(Vec3D{0, 0, 0});
|
||||
}
|
||||
}
|
||||
if (Keyboard::isKeyPressed(sf::Keyboard::D)) {
|
||||
_player->translate(-_player->left() * Time::deltaTime() * ShooterConsts::WALK_SPEED * coeff);
|
||||
if (_player->inCollision()) {
|
||||
_player->setVelocity(Vec3D{0, 0, 0});
|
||||
}
|
||||
}
|
||||
|
||||
// Forward and backward
|
||||
if (Keyboard::isKeyPressed(sf::Keyboard::W)) {
|
||||
_player->translate(_player->lookAt() * Time::deltaTime() * ShooterConsts::WALK_SPEED * coeff);
|
||||
if (_player->inCollision()) {
|
||||
_player->setVelocity(Vec3D{0, 0, 0});
|
||||
}
|
||||
}
|
||||
|
||||
if (Keyboard::isKeyPressed(sf::Keyboard::S)) {
|
||||
_player->translate(-_player->lookAt() * Time::deltaTime() * ShooterConsts::WALK_SPEED * coeff);
|
||||
|
||||
if (_player->inCollision()) {
|
||||
_player->setVelocity(Vec3D{0, 0, 0});
|
||||
}
|
||||
}
|
||||
|
||||
if (_player->ability() > 0 && !_isInSlowMo && Keyboard::isKeyPressed(sf::Keyboard::LShift)) {
|
||||
// slow mo
|
||||
_isInSlowMo = true;
|
||||
_player->setVelocity(_player->velocity() / ShooterConsts::SLOW_MO_COEFFICIENT);
|
||||
_player->setAcceleration(Vec3D(0, -ShooterConsts::GRAVITY /
|
||||
(ShooterConsts::SLOW_MO_COEFFICIENT * ShooterConsts::SLOW_MO_COEFFICIENT),
|
||||
0));
|
||||
SoundController::stopSound(SoundTag("unSlowMo"));
|
||||
SoundController::loadAndPlay(SoundTag("slowMo"), ShooterConsts::SLOW_MO_SOUND);
|
||||
} else if (_isInSlowMo && !Keyboard::isKeyPressed(sf::Keyboard::LShift)) {
|
||||
_isInSlowMo = false;
|
||||
_player->setVelocity(_player->velocity() * ShooterConsts::SLOW_MO_COEFFICIENT);
|
||||
_player->setAcceleration(Vec3D(0, -ShooterConsts::GRAVITY, 0));
|
||||
SoundController::stopSound(SoundTag("slowMo"));
|
||||
SoundController::loadAndPlay(SoundTag("unSlowMo"), ShooterConsts::UN_SLOW_MO_SOUND);
|
||||
}
|
||||
|
||||
if (Mouse::isButtonPressed(sf::Mouse::Button::Left)) {
|
||||
bool shot = _player->fire();
|
||||
|
||||
if (shot) {
|
||||
if (_player->weapon()->name() == ObjectNameTag("shotgun")) {
|
||||
_player->addVelocity(-camera->lookAt() * 30 * coeff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Keyboard::isKeyPressed(sf::Keyboard::Space) && _player->inCollision()) {
|
||||
// if we just want to jump, we have to add particular speed
|
||||
|
||||
if (!_isSliding) {
|
||||
_player->addVelocity(Vec3D{0, std::abs(_player->collisionNormal().y()) *
|
||||
sqrt(2 * -_player->acceleration().y() * ShooterConsts::JUMP_HEIGHT) * coeff,
|
||||
0});
|
||||
// if we want to slide, we have to add speed * 60/fps to make it independent on frame rate
|
||||
} else {
|
||||
_player->addVelocity(Vec3D{0, std::abs(_player->collisionNormal().y()) *
|
||||
sqrt(2 * -_player->acceleration().y() * ShooterConsts::JUMP_HEIGHT) * coeff *
|
||||
Time::deltaTime() * 60, 0});
|
||||
}
|
||||
_player->translate(Vec3D{0, Time::deltaTime() * ShooterConsts::WALK_SPEED * 2 * coeff, 0});
|
||||
|
||||
//_player->setVelocity(Vec3D{_player->velocity().x(), sqrt(2 * -_player->acceleration().y() * ShooterConsts::JUMP_HEIGHT) * coeff,_player->velocity().z()});
|
||||
_isSliding = true;
|
||||
} else {
|
||||
_isSliding = false;
|
||||
}
|
||||
|
||||
// Mouse movement
|
||||
Vec2D displacement = _mouse->getMouseDisplacement();
|
||||
|
||||
_player->rotate(Vec3D{0, -displacement.x() * ShooterConsts::MOUSE_SENSITIVITY, 0});
|
||||
_player->setVelocity(Matrix4x4::RotationY(-displacement.x() * ShooterConsts::MOUSE_SENSITIVITY) * _player->velocity());
|
||||
|
||||
double rotationLeft = displacement.y() * ShooterConsts::MOUSE_SENSITIVITY;
|
||||
|
||||
// You can only see in range [-90 : 90] grad
|
||||
if (_player->headAngle() + rotationLeft > Consts::PI / 2) {
|
||||
rotationLeft = Consts::PI / 2 - _player->headAngle();
|
||||
}
|
||||
if (_player->headAngle() + rotationLeft < -Consts::PI / 2) {
|
||||
rotationLeft = -Consts::PI / 2 - _player->headAngle();
|
||||
}
|
||||
|
||||
_player->setHeadAngle(_player->headAngle() + rotationLeft);
|
||||
_player->rotateWeaponsRelativePoint(_player->position() + Vec3D{0, 1.8, 0}, _player->left(), rotationLeft);
|
||||
|
||||
if (camera != nullptr) {
|
||||
double lookAtAngle = camera->angleLeftUpLookAt().z();
|
||||
camera->rotateLookAt(-lookAtAngle);
|
||||
camera->rotateLeft(_player->headAngle() - camera->angleLeftUpLookAt().x());
|
||||
camera->rotateLookAt(lookAtAngle);
|
||||
}
|
||||
|
||||
if (_keyboard->isKeyTapped(sf::Keyboard::Right) || _keyboard->isKeyTapped(sf::Keyboard::E)) {
|
||||
_player->selectNextWeapon();
|
||||
}
|
||||
|
||||
if (_keyboard->isKeyTapped(sf::Keyboard::Left) || _keyboard->isKeyTapped(sf::Keyboard::Q)) {
|
||||
_player->selectPreviousWeapon();
|
||||
}
|
||||
|
||||
if (Keyboard::isKeyPressed(sf::Keyboard::R)) {
|
||||
_player->reload();
|
||||
}
|
||||
|
||||
bool walkSoundPlayed = false;
|
||||
for (int k = 1; k < 7; k++) {
|
||||
if (SoundController::getStatus(SoundTag("walkSound_" + std::to_string(k))) == sf::Sound::Status::Playing) {
|
||||
walkSoundPlayed = true;
|
||||
}
|
||||
}
|
||||
if ((_inRunning || _player->velocity().sqrAbs() > 3) && _player->inCollision() && !walkSoundPlayed) {
|
||||
int soundNum = (int) ((double) rand() / RAND_MAX * 6) + 1;
|
||||
SoundController::loadAndPlay(SoundTag("walkSound_" + std::to_string(soundNum)),
|
||||
"sound/stonestep" + std::to_string(soundNum) + ".ogg");
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 19.09.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_PLAYERCONTROLLER_H
|
||||
#define SHOOTER_PLAYERCONTROLLER_H
|
||||
|
||||
#include <io/Keyboard.h>
|
||||
#include <io/Mouse.h>
|
||||
|
||||
#include "Player.h"
|
||||
|
||||
class PlayerController final {
|
||||
private:
|
||||
std::shared_ptr<Player> _player;
|
||||
std::shared_ptr<Keyboard> _keyboard;
|
||||
std::shared_ptr<Mouse> _mouse;
|
||||
|
||||
bool _inRunning = false;
|
||||
bool _isSliding = false;
|
||||
bool _isInSlowMo = false;
|
||||
|
||||
public:
|
||||
PlayerController(std::shared_ptr<Player> player, std::shared_ptr<Keyboard> keyboard, std::shared_ptr<Mouse> mouse);
|
||||
|
||||
void update();
|
||||
};
|
||||
|
||||
|
||||
#endif //SHOOTER_PLAYERCONTROLLER_H
|
|
@ -1 +0,0 @@
|
|||
54000
|
BIN
sound/click.ogg
BIN
sound/kill.ogg
Before Width: | Height: | Size: 820 KiB |
BIN
textures/gui.png
Before Width: | Height: | Size: 21 KiB |
|
@ -1,19 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 02.06.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_AK47_H
|
||||
#define SHOOTER_AK47_H
|
||||
|
||||
#include "Weapon.h"
|
||||
#include "../ShooterConsts.h"
|
||||
|
||||
class Ak47 final : public Weapon {
|
||||
public:
|
||||
explicit Ak47() : Weapon(100, 30, 3.0, 0.1, 50, 2.0,
|
||||
ShooterConsts::AK47_FIRE_SOUND, ShooterConsts::AK47_RELOAD_SOUND,
|
||||
ObjectNameTag("ak47"), ShooterConsts::AK47_OBJ,
|
||||
Vec3D{3, 3, 3}, Vec3D{-2.3, 0.8, 1.8},Vec3D{0, 0, 0}) {}
|
||||
};
|
||||
|
||||
#endif //SHOOTER_3DZAVR_AK47_H
|
|
@ -1,21 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 05.06.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_GOLD_AK47_H
|
||||
#define SHOOTER_GOLD_AK47_H
|
||||
|
||||
#include "Weapon.h"
|
||||
#include "../ShooterConsts.h"
|
||||
|
||||
class Gold_Ak47 final : public Weapon {
|
||||
public:
|
||||
explicit Gold_Ak47() : Weapon(200, 60, 1.5, 0.07, 50, 1.0,
|
||||
ShooterConsts::GOLD_AK47_FIRE_SOUND,
|
||||
ShooterConsts::GOLD_AK47_RELOAD_SOUND, ObjectNameTag("gold_ak47"),
|
||||
ShooterConsts::GOLD_AK47_OBJ, Vec3D{3, 3, 3}, Vec3D{-2.3, 0.8, 1.8},
|
||||
Vec3D{0, 0, 0}) {
|
||||
}
|
||||
};
|
||||
|
||||
#endif //SHOOTER_3DZAVR_GOLD_AK47_H
|
20
weapon/Gun.h
|
@ -1,20 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 03.06.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_GUN_H
|
||||
#define SHOOTER_GUN_H
|
||||
|
||||
#include "Weapon.h"
|
||||
#include "../ShooterConsts.h"
|
||||
|
||||
class Gun final : public Weapon {
|
||||
public:
|
||||
explicit Gun() : Weapon(30, 6, 2.0, 0.3, 150, 3.0,
|
||||
ShooterConsts::GUN_FIRE_SOUND, ShooterConsts::GUN_RELOAD_SOUND, ObjectNameTag("gun"),
|
||||
ShooterConsts::GUN_OBJ, Vec3D{3, 3, 3},
|
||||
Vec3D{-2.2, 1.0, 2.0}, Vec3D{0, 0, 0}) {}
|
||||
};
|
||||
|
||||
|
||||
#endif //SHOOTER_3DZAVR_GUN_H
|
|
@ -1,20 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 06.06.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_RIFLE_H
|
||||
#define SHOOTER_RIFLE_H
|
||||
|
||||
#include "Weapon.h"
|
||||
#include "../ShooterConsts.h"
|
||||
|
||||
class Rifle final : public Weapon {
|
||||
public:
|
||||
explicit Rifle() : Weapon(5, 1, 1.0, 1.0, 10000, 0.5,
|
||||
ShooterConsts::RIFLE_FIRE_SOUND, ShooterConsts::RIFLE_RELOAD_SOUND,
|
||||
ObjectNameTag("rifle"), ShooterConsts::RIFLE_OBJ, Vec3D{3, 3, 3},
|
||||
Vec3D{-2.6, 1, 1.5},Vec3D{0, 0, 0}) {}
|
||||
};
|
||||
|
||||
|
||||
#endif //SHOOTER_3DZAVR_RIFLE_H
|
|
@ -1,36 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 02.06.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_SHOTGUN_H
|
||||
#define SHOOTER_SHOTGUN_H
|
||||
|
||||
#include "Weapon.h"
|
||||
#include "../ShooterConsts.h"
|
||||
|
||||
class Shotgun final : public Weapon {
|
||||
public:
|
||||
explicit Shotgun() : Weapon(15, 1, 1.0, 1.0, 50, 5.0, ShooterConsts::SHOTGUN_FIRE_SOUND,
|
||||
ShooterConsts::SHOTGUN_RELOAD_SOUND, ObjectNameTag("shotgun"),
|
||||
ShooterConsts::SHOTGUN_OBJ,
|
||||
Vec3D{3, 3, 3}, Vec3D{-2.1, 0.8, 1.9}, Vec3D{0, 0, 0}) {}
|
||||
|
||||
std::map<ObjectNameTag, double>
|
||||
processFire(std::function<IntersectionInformation(const Vec3D &, const Vec3D &)> rayCastFunction,
|
||||
const Vec3D &position, const Vec3D &direction) const override {
|
||||
|
||||
std::map<ObjectNameTag, double> damagedPlayers;
|
||||
|
||||
for (int i = 0; i < 15; i++) {
|
||||
std::map<ObjectNameTag, double> damaged = fireABullet(rayCastFunction, position, direction);
|
||||
for (auto &[playerName, damage] : damaged) {
|
||||
damagedPlayers[playerName] += damage;
|
||||
}
|
||||
}
|
||||
|
||||
return damagedPlayers;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif //SHOOTER_3DZAVR_SHOTGUN_H
|
|
@ -1,120 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 01.06.2021.
|
||||
//
|
||||
|
||||
#include <utils/EventHandler.h>
|
||||
#include <utils/Log.h>
|
||||
|
||||
#include "Weapon.h"
|
||||
#include "../ShooterConsts.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
Weapon::Weapon(int initialPack, int clipCapacity, double reloadTime, double fireDelay, double damage, double spreading,
|
||||
std::string fireSound, std::string reloadSound, ObjectNameTag weaponName, const std::string &objFileName,
|
||||
const Vec3D &s, const Vec3D &t, const Vec3D &r) : RigidBody(std::move(weaponName), objFileName),
|
||||
_initialPack(initialPack), _clipCapacity(clipCapacity),
|
||||
_reloadTime(reloadTime), _fireDelay(fireDelay),
|
||||
_damage(damage), _spreading(spreading),
|
||||
_fireSound(std::move(fireSound)),
|
||||
_reloadSound(std::move(reloadSound)) {
|
||||
_stockAmmo = _initialPack - _clipCapacity;
|
||||
_clipAmmo = _clipCapacity;
|
||||
|
||||
loadObj(objFileName, s);
|
||||
setCollider(false);
|
||||
rotate(r);
|
||||
translate(t);
|
||||
}
|
||||
|
||||
FireInformation Weapon::fire(std::function<IntersectionInformation(const Vec3D &, const Vec3D &)> rayCastFunction,
|
||||
const Vec3D &position, const Vec3D &direction) {
|
||||
if (_clipAmmo == 0) {
|
||||
reload();
|
||||
if (_clipAmmo == 0 && SoundController::getStatus(SoundTag("noAmmo")) != sf::Sound::Status::Playing) {
|
||||
SoundController::loadAndPlay(SoundTag("noAmmo"), ShooterConsts::NO_AMMO_SOUND);
|
||||
}
|
||||
}
|
||||
|
||||
if (_clipAmmo <= 0 || std::abs(Time::time() - _lastFireTime) < _fireDelay ||
|
||||
std::abs(Time::time() - _lastReloadTime) < _reloadTime) {
|
||||
return FireInformation{std::map<ObjectNameTag, double>(), false};
|
||||
}
|
||||
|
||||
_lastFireTime = Time::time();
|
||||
_clipAmmo--;
|
||||
|
||||
SoundController::loadAndPlay(SoundTag("fireSound_" + name().str()), _fireSound);
|
||||
Log::log("Weapon::fire (" + std::to_string(_stockAmmo) + " : " + std::to_string(_clipAmmo) + ")");
|
||||
|
||||
EventHandler::call<void()>(Event("fire"));
|
||||
|
||||
return FireInformation{processFire(std::move(rayCastFunction), position, direction), true};
|
||||
}
|
||||
|
||||
void Weapon::reload() {
|
||||
if (_stockAmmo == 0 || std::abs(Time::time() - _lastReloadTime) < _reloadTime || _clipAmmo == _clipCapacity) {
|
||||
return;
|
||||
}
|
||||
if (_clipCapacity - _clipAmmo <= _stockAmmo) {
|
||||
_stockAmmo -= _clipCapacity - _clipAmmo;
|
||||
_clipAmmo = _clipCapacity;
|
||||
} else {
|
||||
_clipAmmo += _stockAmmo;
|
||||
_stockAmmo = 0;
|
||||
}
|
||||
|
||||
SoundController::loadAndPlay(SoundTag("reloadSound_" + name().str()), _reloadSound);
|
||||
Log::log("Weapon::reload (" + std::to_string(_stockAmmo) + " : " + std::to_string(_clipAmmo) + ")");
|
||||
_lastReloadTime = Time::time();
|
||||
|
||||
EventHandler::call<void()>(Event("reload_weapon"));
|
||||
}
|
||||
|
||||
std::map<ObjectNameTag, double>
|
||||
Weapon::processFire(std::function<IntersectionInformation(const Vec3D &, const Vec3D &)> rayCastFunction,
|
||||
const Vec3D &position, const Vec3D &direction) const {
|
||||
// Standard weapon usually fire one bullet at a time
|
||||
// But some types of weapon can fire several bullet at the same time (for ex. shotgun)
|
||||
// That's why processFire() is s virtual function
|
||||
return fireABullet(std::move(rayCastFunction), position, direction);
|
||||
}
|
||||
|
||||
std::map<ObjectNameTag, double>
|
||||
Weapon::fireABullet(std::function<IntersectionInformation(const Vec3D &, const Vec3D &)> rayCastFunction,
|
||||
const Vec3D &cameraPosition, const Vec3D &direction) const {
|
||||
std::map<ObjectNameTag, double> damagedPlayers;
|
||||
|
||||
double spreading = _spreading * ShooterConsts::FIRE_DISTANCE / 100.0;
|
||||
|
||||
//generate random vector
|
||||
Vec3D randV(spreading * (1.0 - 2.0 * static_cast<double>(rand()) / RAND_MAX),
|
||||
spreading * (1.0 - 2.0 * static_cast<double>(rand()) / RAND_MAX),
|
||||
spreading * (1.0 - 2.0 * static_cast<double>(rand()) / RAND_MAX));
|
||||
|
||||
// damage player
|
||||
auto rayCast = rayCastFunction(cameraPosition, cameraPosition + direction * ShooterConsts::FIRE_DISTANCE + randV);
|
||||
if (rayCast.objectName.contains(ObjectNameTag("Enemy"))) {
|
||||
|
||||
damagedPlayers[rayCast.objectName] += _damage / (1.0 + rayCast.distanceToObject);
|
||||
|
||||
// If you hit the head the damage will be doubled
|
||||
if (rayCast.objectName.contains(ObjectNameTag("head"))) {
|
||||
damagedPlayers[rayCast.objectName] += _damage / (1.0 + rayCast.distanceToObject);
|
||||
}
|
||||
// If you hit the foot the damage will be divided by 2
|
||||
if (rayCast.objectName.contains(ObjectNameTag("foot"))) {
|
||||
damagedPlayers[rayCast.objectName] -= 0.5 * _damage / (1.0 + rayCast.distanceToObject);
|
||||
}
|
||||
}
|
||||
|
||||
// add trace line
|
||||
Vec3D lineFrom = position() + model() * Vec3D(triangles().back()[0]);
|
||||
Vec3D lineTo = rayCast.intersected ? rayCast.pointOfIntersection : position() +
|
||||
direction * ShooterConsts::FIRE_DISTANCE +
|
||||
randV;
|
||||
|
||||
EventHandler::call<void(const Vec3D&, const Vec3D&)>(Event("your_bullet"), lineFrom, lineTo);
|
||||
|
||||
return damagedPlayers;
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
//
|
||||
// Created by Иван Ильин on 01.06.2021.
|
||||
//
|
||||
|
||||
#ifndef SHOOTER_WEAPON_H
|
||||
#define SHOOTER_WEAPON_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <SFML/Audio/Sound.hpp>
|
||||
|
||||
#include <io/SoundController.h>
|
||||
#include <geometry/Mesh.h>
|
||||
#include <utils/Time.h>
|
||||
#include <Camera.h>
|
||||
#include <Consts.h>
|
||||
#include <World.h>
|
||||
|
||||
struct FireInformation final {
|
||||
const std::map<ObjectNameTag, double> damagedPlayers;
|
||||
const bool shot;
|
||||
};
|
||||
|
||||
class Weapon : public RigidBody {
|
||||
private:
|
||||
const int _initialPack = 100; // how much ammo do you have when you find the weapon
|
||||
const int _clipCapacity = 30; // how much ammo can be stored in one clip
|
||||
int _stockAmmo; // how much ammo do you have in stock
|
||||
int _clipAmmo; // how much ammo do you have in current clip
|
||||
const double _reloadTime = 3.0;
|
||||
const double _fireDelay = 0.1; // time delay between fires
|
||||
const double _damage = 300;
|
||||
const double _spreading = 2.0;
|
||||
|
||||
const std::string _fireSound;
|
||||
const std::string _reloadSound;
|
||||
|
||||
double _lastFireTime = std::numeric_limits<double>::min();
|
||||
double _lastReloadTime = std::numeric_limits<double>::min();
|
||||
|
||||
protected:
|
||||
std::map<ObjectNameTag, double>
|
||||
fireABullet(std::function<IntersectionInformation(const Vec3D &, const Vec3D &)> rayCastFunction,
|
||||
const Vec3D &position, const Vec3D &direction) const;
|
||||
|
||||
virtual std::map<ObjectNameTag, double>
|
||||
processFire(std::function<IntersectionInformation(const Vec3D &, const Vec3D &)> rayCastFunction,
|
||||
const Vec3D &position, const Vec3D &direction) const;
|
||||
|
||||
public:
|
||||
Weapon(int initialPack, int clipCapacity, double reloadTime, double fireDelay, double damage, double spreading,
|
||||
std::string fireSound, std::string reloadSound, ObjectNameTag weaponName, const std::string &objFileName,
|
||||
const Vec3D &s, const Vec3D &t, const Vec3D &r);
|
||||
|
||||
FireInformation
|
||||
fire(std::function<IntersectionInformation(const Vec3D &, const Vec3D &)> rayCastFunction, const Vec3D &cameraPosition,
|
||||
const Vec3D &direction);
|
||||
|
||||
void reload();
|
||||
[[nodiscard]] double reloadTime() const { return _reloadTime; }
|
||||
[[nodiscard]] double fireDelay() const { return _fireDelay; }
|
||||
|
||||
[[nodiscard]] std::pair<double, double> balance() const { return std::make_pair(_clipAmmo, _stockAmmo); }
|
||||
|
||||
void addAPack() { _stockAmmo += initialPack(); }
|
||||
|
||||
[[nodiscard]] int initialPack() const { return _initialPack; }
|
||||
};
|
||||
|
||||
|
||||
#endif //SHOOTER_3DZAVR_WEAPON_H
|