63 Commits

Author SHA1 Message Date
4b732c2fe9 add ressources 2023-06-28 22:54:22 +02:00
66b39e1855 multiple mobs render 2023-06-28 22:51:36 +02:00
b985cc7ade make use of TexturedModel 2023-06-28 22:19:18 +02:00
385dcf11d0 load basic 3d model 2023-06-28 21:23:42 +02:00
385626d42b debug spawning 2023-06-28 21:18:02 +02:00
6b9528c2ae add face culling 2023-06-26 09:59:08 +02:00
c9ee8216be add depth 2023-06-26 09:37:23 +02:00
36f37b6548 Revert "Merge branch 'discord'"
This reverts commit e7b9a57723, reversing
changes made to 02b4aa3c91.

Revert "moved rapidjson files"

This reverts commit f5012f770c.
2023-06-21 23:36:20 +02:00
1dde1dbf1e fix vertex cache 2023-06-20 16:27:41 +02:00
f5012f770c moved rapidjson files 2023-06-08 12:30:05 +02:00
e7b9a57723 Merge branch 'discord' 2023-06-08 12:21:54 +02:00
02b4aa3c91 xmake add_files 2023-06-08 12:16:50 +02:00
f184982bc1 change release optimization 2023-06-07 12:39:58 +02:00
1cdc738839 refactor: rename zoom function 2023-06-07 12:36:31 +02:00
368bc450ce better cam controls 2023-06-07 12:33:10 +02:00
148b5f397a more vect operators 2023-06-07 12:32:24 +02:00
f62322752d use of td pi 2023-06-06 17:59:48 +02:00
fb9e125f16 refactor: format 2023-06-06 17:58:27 +02:00
b70e8f7790 approximative cam movement 2023-06-06 17:56:19 +02:00
39bdd0a11e remove useless pi digits 2023-06-06 17:17:00 +02:00
c95c8b7fde clamp camera + pi 2023-06-06 17:15:44 +02:00
e984ed9085 fixed cam distance 2023-06-06 17:04:17 +02:00
92035d7b9e remove useless variable 2023-06-06 13:09:02 +02:00
48841fa4e9 camera fixing 2023-06-06 13:07:42 +02:00
83ab8c70f0 cache transpose 2023-06-06 12:45:34 +02:00
ccdcdac7c6 working mouse picking 2023-06-06 12:36:05 +02:00
a2b5424888 fix inverse assert 2023-06-05 18:06:02 +02:00
a4fb56b549 camera yaw and pitch 2023-06-05 13:50:45 +02:00
22e62df04d remove unused variables 2023-06-05 13:17:04 +02:00
faf544f997 basic camera movement 2023-06-05 13:15:27 +02:00
b72f4a7673 fix inverted zoom 2023-06-05 13:12:43 +02:00
19c03010cb remove useless computation 2023-06-05 13:07:56 +02:00
41f8c152eb really bad controls 2023-06-04 13:02:41 +02:00
051c9d8744 fix format error 2023-06-04 12:42:58 +02:00
193e4db651 fix mouse picking 2023-06-03 20:43:40 +02:00
cb5f5a4cf8 fixing transpose 2023-06-03 19:46:37 +02:00
bc7e5914ce invert assert 2023-06-03 19:44:05 +02:00
0365902971 moved Mat4 definition 2023-06-03 19:40:50 +02:00
f2fcc348d7 more maths 2023-06-03 18:22:01 +02:00
95c92ec6c9 rename lookat function 2023-06-03 17:54:59 +02:00
721f15b601 fix tower rendering 2023-06-03 17:49:00 +02:00
3970103b01 kinda 3d 2023-06-03 17:41:46 +02:00
4e866c1032 shaders to 3d 2023-06-03 16:35:17 +02:00
ca268781fd shader better logging 2023-06-03 16:30:32 +02:00
a2d8984199 shader matrix support 2023-06-03 16:30:23 +02:00
e7f9ca2b6c fix maths warning 2023-06-03 16:23:56 +02:00
deb0075aac add maths utils 2023-06-02 17:54:58 +02:00
28b8659e16 fix linux compiling 2023-06-02 16:26:17 +02:00
0b9fc0520e fix compiling mingw 2023-06-02 16:19:42 +02:00
c54017c7be update presence 2023-06-02 13:34:01 +02:00
bbfe341d23 base discord rpc 2023-06-02 13:18:09 +02:00
14efe2cc39 simplified health bar display 2023-01-02 16:58:31 +01:00
fcda12e321 add hit "animation" 2023-01-02 16:37:18 +01:00
1200a6e087 moved TowerUpgradePopop into its own file 2023-01-02 15:56:20 +01:00
512fb23d0e add server mspt (+procotol format) 2023-01-02 15:07:34 +01:00
5a547b6514 move towers implementations 2023-01-02 14:47:02 +01:00
ed45995645 add mob send cooldown 2023-01-02 14:32:37 +01:00
0b6d826eba remove unused glm package 2023-01-02 13:55:54 +01:00
6d0c6be166 server side safe checks 2023-01-02 13:18:49 +01:00
222b79b40a indent with tabs 2023-01-02 13:05:43 +01:00
8f95b1a750 remove format warning 2023-01-02 12:27:08 +01:00
7d30017742 moved Color to Defines.h 2023-01-02 12:21:27 +01:00
386ea5b6ad forward declare Updater 2023-01-02 12:05:20 +01:00
149 changed files with 10803 additions and 4973 deletions

View File

@@ -1,7 +1,11 @@
#pragma once
#include <cstdint>
namespace td {
static constexpr float PI = 3.141592653f;
template<typename T>
struct Vec2 {
union {
@@ -14,11 +18,14 @@ struct Vec2 {
T g;
};
Vec2(T X = 0, T Y = 0) : x(X), y(Y) {}
friend bool operator==(const Vec2& vec2, const Vec2& other) { return vec2.x == other.x && vec2.y == other.y; }
constexpr Vec2(T X = 0, T Y = 0) : x(X), y(Y) {}
};
template<typename T>
inline bool operator==(const Vec2<T>& vec2, const Vec2<T>& other) {
return vec2.x == other.x && vec2.y == other.y;
}
template<typename T>
struct Vec3 {
union {
@@ -36,9 +43,45 @@ struct Vec3 {
T b;
};
Vec3(T X = 0, T Y = 0, T Z = 0) : x(X), y(Y), z(Z) {}
constexpr Vec3(T X = 0, T Y = 0, T Z = 0) : x(X), y(Y), z(Z) {}
};
template<typename T>
inline bool operator==(const Vec3<T>& vec3, const Vec3<T>& other) {
return vec3.x == other.x && vec3.y == other.y && vec3.z == other.z;
}
template<typename T>
struct Vec4 {
union {
T x;
T r;
};
union {
T y;
T g;
};
union {
T z;
T b;
};
union {
T w;
T a;
};
constexpr Vec4(Vec3<T> vec, T W = 1) : x(vec.x), y(vec.y), z(vec.z), w(W) {}
constexpr Vec4(T X = 0, T Y = 0, T Z = 0, T W = 0) : x(X), y(Y), z(Z), w(W) {}
};
template<typename T>
inline bool operator==(const Vec4<T>& vec4, const Vec4<T>& other) {
return vec4.x == other.x && vec4.y == other.y && vec4.z == other.z && vec4.w = other.w;
}
using Vec2i = Vec2<int>;
using Vec2u = Vec2<unsigned int>;
using Vec2f = Vec2<float>;
@@ -49,4 +92,57 @@ using Vec3u = Vec3<unsigned int>;
using Vec3f = Vec3<float>;
using Vec3d = Vec3<double>;
using Vec4i = Vec4<int>;
using Vec4u = Vec4<unsigned int>;
using Vec4f = Vec4<float>;
using Vec4d = Vec4<double>;
using Color = Vec3<unsigned char>;
template<typename T>
struct Mat4 {
static const std::size_t MATRIX_SIZE = 4;
T x0, x1, x2, x3;
T y0, y1, y2, y3;
T z0, z1, z2, z3;
T w0, w1, w2, w3;
T operator[] (std::size_t offset) const {
return reinterpret_cast<const T*>(this)[offset];
}
T& operator[] (std::size_t offset) {
return reinterpret_cast<T*>(this)[offset];
}
T* data() {
return reinterpret_cast<T*>(this);
}
const T* data() const{
return reinterpret_cast<const T*>(this);
}
T at(std::size_t row, std::size_t column) const {
return operator[](row * MATRIX_SIZE + column);
}
T& at(std::size_t row, std::size_t column) {
return operator[](row * MATRIX_SIZE + column);
}
};
typedef Mat4<float> Mat4f;
typedef Mat4<int> Mat4i;
typedef Mat4<double> Mat4d;
template<typename T>
inline bool operator==(const Mat4<T>& mat, const Mat4<T>& other) {
return mat.x0 == other.x0 && mat.y0 == other.y0 && mat.z0 == other.z0 && mat.w0 == other.w0 &&
mat.x1 == other.x1 && mat.y1 == other.y1 && mat.z1 == other.z1 && mat.w1 == other.w1 &&
mat.x2 == other.x2 && mat.y2 == other.y2 && mat.z2 == other.z2 && mat.w2 == other.w2 &&
mat.x3 == other.x3 && mat.y3 == other.y3 && mat.z3 == other.z3 && mat.w3 == other.w3;
}
} // namespace td

View File

@@ -89,6 +89,7 @@ private:
Direction m_Direction;
std::vector<EffectDuration> m_Effects;
const Tower* m_LastDamage; // the last tower that damaged the mob
float m_HitCooldown;
utils::Timer m_EffectFireTimer;
utils::Timer m_EffectPoisonTimer;
@@ -99,7 +100,7 @@ private:
public:
Mob(MobID id, MobLevel level, PlayerID sender) : m_Sender(sender), m_Level(level),
m_EffectFireTimer(1000), m_EffectPoisonTimer(1000),
m_HitCooldown(0), m_EffectFireTimer(1000), m_EffectPoisonTimer(1000),
m_EffectHealTimer(1000), m_CastleTarget(nullptr), m_AttackTimer(1000) {
}
@@ -123,8 +124,16 @@ public:
const Tower* GetLastDamageTower() { return m_LastDamage; }
bool HasReachedEnemyCastle() { return m_CastleTarget != nullptr; }
void Damage(float dmg, const Tower* damager) { m_Health = std::max(0.0f, m_Health - dmg); m_LastDamage = damager; }
void Heal(float heal) { m_Health = std::min(static_cast<float>(GetStats()->GetMaxLife()), m_Health + heal); }
void Damage(float dmg, const Tower* damager) {
m_Health = std::max(0.0f, m_Health - dmg);
m_LastDamage = damager;
m_HitCooldown = 0.1;
}
void Heal(float heal) {
m_Health = std::min(static_cast<float>(GetStats()->GetMaxLife()), m_Health + heal);
}
void SetMobReachedCastle(TeamCastle* castle) { m_CastleTarget = castle; } // used when mob is in front of the castle
bool IsImmuneTo(TowerType type);
@@ -133,6 +142,8 @@ public:
void AddEffect(EffectType type, float durationSec, Tower* tower);
bool HasEffect(EffectType type);
bool HasTakenDamage() { return m_HitCooldown > 0; }
float GetTileX() { return GetCenterX() - static_cast<float>(static_cast<std::int32_t>(GetCenterX())); } // returns a float between 0 and 1 excluded
float GetTileY() { return GetCenterY() - static_cast<float>(static_cast<std::int32_t>(GetCenterY())); } // returns a float between 0 and 1 excluded

View File

@@ -136,7 +136,8 @@ private:
bool m_IsBigTower;
public:
TowerInfo(std::string&& name, std::string&& description, bool big) : m_Name(std::move(name)),
m_Description(std::move(description)), m_IsBigTower(big) {}
m_Description(std::move(description)), m_IsBigTower(big) {
}
const std::string& GetName() const { return m_Name; }
const std::string& GetDescription() const { return m_Description; }

View File

@@ -28,7 +28,7 @@ struct ChunkCoord {
namespace std {
template <>
struct hash<td::game::ChunkCoord> {
std::size_t operator()(const td::game::ChunkCoord& key) const noexcept{
std::size_t operator()(const td::game::ChunkCoord& key) const noexcept {
return std::hash<std::int16_t>()(key.x << 16 | key.y);
}
};
@@ -58,10 +58,6 @@ enum class TileType : std::uint8_t {
Ice,*/
};
struct Color {
std::uint8_t r, g, b;
};
static constexpr Color BLACK{ 0, 0, 0 };
static constexpr Color WHITE{ 255, 255, 255 };

View File

@@ -12,6 +12,7 @@ private:
std::uint8_t m_ConnectionID;
std::string m_DisconnectReason;
float m_ServerTPS;
float m_ServerMSPT;
int m_Ping = 0;
public:
ClientConnexion();
@@ -25,6 +26,7 @@ public:
const std::string& GetDisconnectReason() const { return m_DisconnectReason; }
float GetServerTPS() const { return m_ServerTPS; }
float GetServerMSPT() const { return m_ServerMSPT; }
int GetServerPing() const { return m_Ping; }
REMOVE_COPY(ClientConnexion);

View File

@@ -22,6 +22,7 @@ typedef std::map<std::uint8_t, ServerConnexion> ConnexionMap;
class TickCounter {
private:
float m_TPS;
float m_MSPT;
std::uint64_t m_LastTPSTime;
std::uint8_t m_TickCount;
public:
@@ -46,6 +47,9 @@ public:
}
float GetTPS() const { return m_TPS; }
float GetMSPT() const { return m_MSPT; }
void SetMSPT(float mspt) { m_MSPT = mspt; }
};
class Server {

View File

@@ -11,8 +11,7 @@ namespace server {
class Server;
struct KeepAlive
{
struct KeepAlive {
std::uint64_t keepAliveID = 0;
std::uint64_t sendTime;
bool recievedResponse = false;

View File

@@ -8,13 +8,13 @@ namespace td {
namespace utils {
template <typename... Args>
std::string format(const std::string& format, Args... args){
std::string format(const std::string& format, Args... args) {
int size = snprintf(nullptr, 0, format.c_str(), args...) + 1; // Extra space for '\0'
if (size <= 0){
if (size <= 0) {
throw std::runtime_error("Error during formatting.");
}
std::unique_ptr<char[]> buf(new char[size]);
snprintf(buf.get(), size, format.c_str(), args...);
snprintf(buf.get(), static_cast<std::size_t>(size), format.c_str(), args...);
return std::string(buf.get(), buf.get() + size - 1); // We don't want the '\0' inside
}

177
include/misc/Maths.h Normal file
View File

@@ -0,0 +1,177 @@
#pragma once
#include "Defines.h"
#include <cmath>
namespace td {
//////////////////////////////////////////////////////////////////
// Operators //
//////////////////////////////////////////////////////////////////
template<typename T>
Vec2<T> operator+(const Vec2<T>& vect, const Vec2<T>& other) {
return {vect.x + other.x, vect.y + other.y};
}
template<typename T>
Vec2<T> operator- (const Vec2<T>& vect) {
return { -vect.x, -vect.y };
}
template<typename T>
Vec2<T> operator- (const Vec2<T>& vect, const Vec2<T>& other) {
return vect + (-other);
}
template<typename T>
Vec3<T> operator- (const Vec3<T>& vect) {
return { -vect.x, -vect.y, -vect.z };
}
template<typename T>
Vec3<T> operator+ (const Vec3<T>& vect, const Vec3<T>& other) {
return { vect.x + other.x, vect.y + other.y, vect.z + other.y };
}
template<typename T>
Vec3<T> operator- (const Vec3<T>& vect, const Vec3<T>& other) {
return vect + (-other);
}
template<typename T>
Vec4<T> operator- (const Vec4<T>& vect) {
return { -vect.x, -vect.y, -vect.z, -vect.w };
}
template<typename T>
Vec4<T> operator+ (const Vec4<T>& vect, const Vec4<T>& other) {
return { vect.x + other.x, vect.y + other.y, vect.z + other.y, vect.w + other.w };
}
template<typename T>
Vec4<T> operator- (const Vec4<T>& vect, const Vec4<T>& other) {
return vect + (-other);
}
//////////////////////////////////////////////////////////////////
// Vectors //
//////////////////////////////////////////////////////////////////
namespace maths {
template<typename T>
T Length(const Vec3<T>& vect) {
return std::sqrt(vect.x * vect.x + vect.y * vect.y + vect.z * vect.z);
}
template<typename T>
Vec3<T> Normalize(const Vec3<T>& vect) {
T length = Length(vect);
return { vect.x / length, vect.y / length, vect.z / length };
}
template<typename T>
Vec4<T> Normalize(const Vec4<T>& vect) {
T length = std::sqrt(vect.x * vect.x + vect.y * vect.y + vect.z * vect.z + vect.w * vect.w);
return { vect.x / length, vect.y / length, vect.z / length, vect.w / length };
}
template<typename T>
T Dot(const Vec3<T>& vect, const Vec3<T>& other) {
return vect.x * other.x + vect.y * other.y + vect.z * other.z;
}
template<typename T>
Vec3<T> Cross(const Vec3<T>& vect, const Vec3<T>& other) {
return {
vect.y * other.z - vect.z * other.y,
vect.z * other.x - vect.x * other.z,
vect.x * other.y - vect.y * other.x,
};
}
template<typename T>
T Dot(const Vec4<T>& vect, const Vec4<T>& other) {
return vect.x * other.x + vect.y * other.y + vect.z * other.z + vect.w * other.w;
}
template<typename T>
T Distance(const Vec3<T>& vect, const Vec3<T>& other) {
return Length(vect - other);
}
//////////////////////////////////////////////////////////////////
// Matricies //
//////////////////////////////////////////////////////////////////
template<typename T>
Vec4<T> Dot(const Mat4<T>& mat, const Vec4<T>& vect) {
return {
mat.x0 * vect.x + mat.x1 * vect.y + mat.x2 * vect.z + mat.x3 * vect.w,
mat.y0 * vect.x + mat.y1 * vect.y + mat.y2 * vect.z + mat.y3 * vect.w,
mat.z0 * vect.x + mat.z1 * vect.y + mat.z2 * vect.z + mat.z3 * vect.w,
mat.w0 * vect.x + mat.w1 * vect.y + mat.w2 * vect.z + mat.w3 * vect.w
};
}
template<typename T>
Mat4<T> Dot(const Mat4<T>& mat, const Mat4<T>& other) {
Mat4<T> result {};
for (std::size_t i = 0; i < Mat4<T>::MATRIX_SIZE; i++) {
for (std::size_t j = 0; j < Mat4<T>::MATRIX_SIZE; j++) {
for (std::size_t k = 0; k < Mat4<T>::MATRIX_SIZE; k++) {
result.at(i, j) += mat.at(i, k) * other.at(k, j);
}
}
}
return result;
}
template<typename T>
Mat4<T> Identity() {
Mat4<T> result{};
result.x0 = static_cast<T>(1);
result.y1 = static_cast<T>(1);
result.z2 = static_cast<T>(1);
result.w3 = static_cast<T>(1);
return result;
}
template<typename T>
Mat4<T> Transpose(const Mat4<T>& mat) {
Mat4<T> result;
result.x1 = mat.y0;
result.x2 = mat.z0;
result.x3 = mat.w0;
result.y0 = mat.x1;
result.y2 = mat.z1;
result.y3 = mat.w1;
result.z0 = mat.x2;
result.z1 = mat.y2;
result.z3 = mat.w2;
result.w0 = mat.x3;
result.w1 = mat.y3;
result.w2 = mat.z3;
result.x0 = mat.x0;
result.y1 = mat.y1;
result.z2 = mat.z2;
result.w3 = mat.w3;
return result;
}
Mat4f Perspective(float fovY, float aspectRatio, float zNear, float zFar);
Mat4f Look(const Vec3f& eye, const Vec3f& center, const Vec3f& up);
Mat4f Inverse(const Mat4f& mat);
} // namespace maths
} // namespace td

View File

@@ -49,9 +49,9 @@ enum class PacketType : std::uint8_t {
struct WorldHeader {
game::TowerTileColorPalette m_TowerPlacePalette;
game::Color m_WalkablePalette;
std::vector<game::Color> m_DecorationPalette;
game::Color m_Background;
Color m_WalkablePalette;
std::vector<Color> m_DecorationPalette;
Color m_Background;
game::SpawnColorPalette m_SpawnColorPalette;
@@ -135,9 +135,9 @@ public:
virtual PacketType GetType() const { return PacketType::WorldBeginData; }
const game::TowerTileColorPalette& GetTowerTilePalette() const { return m_Header.m_TowerPlacePalette; }
const game::Color& GetWalkableTileColor() const { return m_Header.m_WalkablePalette; }
const std::vector<game::Color>& GetDecorationPalette() const { return m_Header.m_DecorationPalette; }
const game::Color& GetBackgroundColor() const { return m_Header.m_Background; }
const Color& GetWalkableTileColor() const { return m_Header.m_WalkablePalette; }
const std::vector<Color>& GetDecorationPalette() const { return m_Header.m_DecorationPalette; }
const Color& GetBackgroundColor() const { return m_Header.m_Background; }
const game::Spawn& GetRedSpawn() const { return m_Header.m_RedSpawn; }
const game::Spawn& GetBlueSpawn() const { return m_Header.m_BlueSpawn; }
@@ -373,10 +373,11 @@ public:
class ServerTpsPacket : public Packet {
private:
float m_TPS;
float m_MSPT;
std::uint64_t m_PacketSendTime; // used to calculate ping
public:
ServerTpsPacket() {}
ServerTpsPacket(float tps, std::uint64_t sendTime) : m_TPS(tps), m_PacketSendTime(sendTime) {}
ServerTpsPacket(float tps, float mspt, std::uint64_t sendTime) : m_TPS(tps), m_MSPT(mspt), m_PacketSendTime(sendTime) {}
virtual ~ServerTpsPacket() {}
virtual DataBuffer Serialize(bool packetID = true) const;
@@ -384,6 +385,7 @@ public:
virtual void Dispatch(PacketHandler* handler) const;
float GetTPS() const { return m_TPS; }
float GetMSPT() const { return m_MSPT; }
std::uint64_t GetPacketSendTime() const { return m_PacketSendTime; }
virtual PacketType GetType() const { return PacketType::ServerTps; }
@@ -424,7 +426,8 @@ public:
SpawnMobPacket() {}
SpawnMobPacket(game::MobID id, game::MobType type, std::uint8_t level, game::PlayerID sender,
float x, float y, game::Direction dir) : m_MobID(id), m_MobType(type), m_MobLevel(level),
m_MobDirection(dir), m_Sender(sender), m_MobX(x), m_MobY(y) {}
m_MobDirection(dir), m_Sender(sender), m_MobX(x), m_MobY(y) {
}
virtual ~SpawnMobPacket() {}
virtual DataBuffer Serialize(bool packetID = true) const;
@@ -449,7 +452,8 @@ private:
public:
PlaceTowerPacket() {}
PlaceTowerPacket(std::int32_t x, std::int32_t y, game::TowerType type) :
m_TowerX(x), m_TowerY(y), m_TowerType(type) {}
m_TowerX(x), m_TowerY(y), m_TowerType(type) {
}
virtual ~PlaceTowerPacket() {}
virtual DataBuffer Serialize(bool packetID = true) const;
@@ -472,7 +476,8 @@ private:
public:
WorldAddTowerPacket() {}
WorldAddTowerPacket(game::TowerID id, std::int32_t x, std::int32_t y, game::TowerType type, game::PlayerID player) :
m_TowerID(id), m_TowerX(x), m_TowerY(y), m_TowerType(type), m_Builder(player) {}
m_TowerID(id), m_TowerX(x), m_TowerY(y), m_TowerType(type), m_Builder(player) {
}
virtual ~WorldAddTowerPacket() {}
virtual DataBuffer Serialize(bool packetID = true) const;
@@ -534,7 +539,8 @@ private:
public:
MobState() {}
MobState(game::MobID id, const Point& position, float life, game::Direction direction) :
m_MobID(id), m_MobPosition(position), m_MobLife(life), m_MobDirection(direction) {}
m_MobID(id), m_MobPosition(position), m_MobLife(life), m_MobDirection(direction) {
}
game::MobID GetMobId() const { return m_MobID; }
Point GetMobPosition() const { return m_MobPosition; }

View File

@@ -9,23 +9,64 @@
namespace td {
namespace render {
struct Camera {
Mat4f viewMatrix;
Mat4f projectionMatrix;
Mat4f InvViewMatrix;
Mat4f InvProjectionMatrix;
float CamDistance = 25.0f;
Vec3f CamPos{ 0, CamDistance, 0 };
Vec2f CamLook{};
float m_Yaw = -PI / 2.0f;
float m_Pitch = -PI / 2.0f + 0.0000001f;
};
struct Model {
std::unique_ptr<GL::VertexArray> vao;
Vec3f positon;
Vec3f color = { 1, 1, 1 };
};
class TexturedModel {
private:
std::unique_ptr<GL::VertexArray> m_Vao;
std::unique_ptr<GL::Texture> m_Texture;
Vec3f m_Positon;
Vec3f m_Color = { 1, 1, 1 };
public:
REMOVE_COPY(TexturedModel);
TexturedModel(GL::VertexArray&& vao, GL::Texture&& texture);
TexturedModel(TexturedModel&& other);
~TexturedModel() {}
const GL::VertexArray& GetVao() const { return *m_Vao; }
const GL::Texture& GetTexture() const { return *m_Texture; }
Vec3f GetPosition() const { return m_Positon; }
Vec3f GetColor() const { return m_Color; }
void SetPosition(Vec3f newPos) { m_Positon = newPos; }
void SetColor(Vec3f newColor) { m_Color = newColor; }
};
class Renderer {
public:
static constexpr float m_AnimationSpeed = 2.0f;
static constexpr float m_MouseSensitivity = 200.0f;
struct Model {
GL::VertexArray* vao;
Vec2f positon;
};
private:
std::unique_ptr<shader::WorldShader> m_WorldShader;
std::unique_ptr<shader::EntityShader> m_EntityShader;
Vec2i m_WindowSize;
Vec3f m_BackgroundColor;
bool m_IsometricView = true;
float m_IsometricShade = m_IsometricView;
Vec2f m_CamPos{};
Camera m_Camera{};
public:
Renderer();
~Renderer();
@@ -37,19 +78,19 @@ public:
void RenderVAO(const GL::VertexArray& vao);
void RenderModel(const Model& model);
void RenderModel(const TexturedModel& model);
void SetZoom(float zoom);
void SetCamMovement(const Vec2f& mov);
void SetCamPos(const Vec2f& newPos);
void SetIsometricView(bool isometric); // false = 2D true = Isometric
void AddZoom(float zoom);
void SetCamAngularMovement(const Vec2f& mov);
void SetCamMovement(const Vec2f& lastCursorPos, const Vec2f& currentCursorPos);
void SetCamLook(const Vec2f& worldPos);
void SetBackgroundColor(const Vec3f& color) { m_BackgroundColor = color; }
Vec2f GetCursorWorldPos(const Vec2f& cursorPos, float aspectRatio, float zoom, float windowWidth, float windowHeight);
Vec2f GetCursorWorldPos(const Vec2f& cursorPos, float windowWidth, float windowHeight);
private:
void UpdateIsometricView();
void UpdateIsometricFade();
void InitShaders();
void SetCamPos(const Vec3f& newPos);
};
} // namespace render

View File

@@ -6,6 +6,7 @@
#include "render/VertexCache.h"
#include "render/gui/TowerPlacePopup.h"
#include "render/gui/TowerUpgradePopup.h"
#include "render/gui/MobTooltip.h"
#include "render/gui/CastleTooltip.h"
@@ -27,7 +28,9 @@ private:
client::ClientGame* m_Client;
Renderer* m_Renderer;
game::World* m_World;
std::unique_ptr<GL::VertexArray> m_WorldVao, m_MobVao, m_SelectTileVao;
std::unique_ptr<GL::VertexArray> m_WorldVao;
std::unique_ptr<Model> m_SelectTileModel;
std::vector<TexturedModel> m_MobModels;
Vec2f m_CamPos;
Vec2f m_CursorPos;
Vec2f m_HoldCursorPos;
@@ -38,6 +41,7 @@ private:
VertexCache m_TowersCache;
std::unique_ptr<gui::TowerPlacePopup> m_TowerPlacePopup;
std::unique_ptr<gui::TowerUpgradePopup> m_TowerUpgradePopup;
std::unique_ptr<gui::MobTooltip> m_MobTooltip;
std::unique_ptr<gui::CastleTooltip> m_CastleTooltip;
public:
@@ -53,7 +57,7 @@ public:
void SetCamPos(float camX, float camY);
void MoveCam(float relativeX, float relativeY, float aspectRatio);
void MoveCam(float relativeX, float relativeY);
void ChangeZoom(float zoom);
// WorldListener
@@ -64,10 +68,9 @@ private:
void Click();
void RenderWorld() const;
void RenderTowers() const;
void RenderMobs() const;
void RenderMobs();
void RenderTileSelect() const;
void RenderPopups();
void RenderTowerUpgradePopup();
void RenderMobTooltip() const;
void RenderCastleTooltip() const;
void DetectClick();

View File

@@ -0,0 +1,9 @@
#pragma once
namespace td {
namespace gui {
extern void RenderLifeProgress(float progress);
} // namespace gui
} // namespace td

View File

@@ -12,11 +12,15 @@ class SummonMenu : public GuiWidget {
private:
bool m_MenuOpened;
int m_ImageWidth = 100;
float m_Cooldown;
float m_LastCooldown;
static constexpr int m_MobTypeCount = static_cast<std::size_t>(td::game::MobType::MOB_COUNT);
std::array<int, static_cast<std::size_t>(m_MobTypeCount)> m_Values;
public:
SummonMenu(client::Client* client);
void SetCooldown(float cooldown);
virtual void Render();
private:
void SetSummonMax(int valueIndex);

View File

@@ -0,0 +1,32 @@
#pragma once
#include "GuiWidget.h"
#include "Defines.h"
namespace td {
namespace gui {
class TowerUpgradePopup : public GuiWidget {
private:
Vec2f m_ClickWorldPos;
bool m_ShouldBeClosed;
bool m_Opened;
public:
TowerUpgradePopup(client::Client* client);
virtual void Render();
void SetClickPos(const Vec2f& worldPos);
bool IsPopupOpened();
private:
static constexpr float m_TowerPopupTileWidth = 200.0f;
static constexpr float m_TowerPopupTileHeight = 200.0f;
static constexpr float m_PlaceTowerButtonWidth = 150.0f;
static constexpr float m_PlaceTowerButtonHeight = 35.0f;
};
} // namespace gui
} // namespace td

View File

@@ -2,21 +2,28 @@
#include "GuiWidget.h"
#include "updater/Updater.h"
#include <future>
#include <memory>
namespace td {
namespace utils {
class Updater;
} // namespace utils
namespace gui {
class UpdateMenu : public GuiWidget {
private:
bool m_Opened;
std::string m_Error;
utils::Updater m_Updater;
std::unique_ptr<utils::Updater> m_Updater;
std::shared_future<bool> m_UpdateAvailable;
public:
UpdateMenu(client::Client* client);
virtual ~UpdateMenu();
virtual void Render();
private:

View File

@@ -70,5 +70,24 @@ public:
void Unbind() const;
};
class Texture {
private:
unsigned int m_ID;
public:
REMOVE_COPY(Texture);
Texture(Texture&& other) {
m_ID = other.m_ID;
other.m_ID = 0;
}
Texture(const char* textureData, int width, int height, int comp);
~Texture();
unsigned int GetTextureID() const { return m_ID; }
void Bind() const;
static void Unbind();
};
}

View File

@@ -0,0 +1,17 @@
#pragma once
#include "GLLoader.h"
#include "render/Renderer.h"
#include "game/Mobs.h"
namespace td {
namespace render {
namespace MobLoader {
TexturedModel LoadMobModel(game::MobType mobType);
} // namespace MobLoader
} // namespace render
} // namespace td

View File

@@ -8,9 +8,12 @@
#ifndef RENDER_LOADER_TEXTURELOADER_H_
#define RENDER_LOADER_TEXTURELOADER_H_
#include "render/loader/GLLoader.h"
#include <string>
namespace TextureLoader {
unsigned int LoadGLTexture(const char* fileName);
GL::Texture LoadTexture(const std::string& fileName);
}

View File

@@ -6,24 +6,22 @@ namespace td {
namespace shader {
class EntityShader : public ShaderProgram {
private:
unsigned int m_LocationCam = 0;
unsigned int m_LocationZoom = 0;
unsigned int m_LocationAspectRatio = 0;
unsigned int m_LocationTranslation = 0;
unsigned int m_LocationViewtype = 0;
unsigned int m_LocationProjectionMatrix = 0;
unsigned int m_LocationViewMatrix = 0;
unsigned int m_LocationPosition = 0;
unsigned int m_LocationColorEffect = 0;
protected:
virtual void GetAllUniformLocation();
public:
EntityShader();
void LoadShader();
void SetCamPos(const Vec2f& camPos);
void SetZoom(float zoom);
void SetAspectRatio(float aspectRatio);
void SetModelPos(const Vec2f& modelPos);
void SetIsometricView(float isometric);
void SetColorEffect(const Vec3f& color);
void SetProjectionMatrix(const Mat4f& proj) const;
void SetViewMatrix(const Mat4f& view) const;
void SetModelPos(const Vec3f& pos) const;
};
} // namespace shader

View File

@@ -27,6 +27,7 @@ protected:
void LoadVector(unsigned int location, const Vec2f& vector) const;
void LoadVector(unsigned int location, const Vec3f& vector) const;
void LoadBoolean(unsigned int location, bool value) const;
void LoadMat4(unsigned int location, const Mat4f& mat) const;
void CleanUp() const;
private:

View File

@@ -7,16 +7,15 @@ namespace shader {
class WorldShader : public ShaderProgram {
private:
unsigned int m_LocationCam = 0, m_LocationZoom = 0, m_LocationAspectRatio = 0, m_LocationViewtype = 0;
unsigned int m_LocationProjection = 0, m_LocationView = 0;
protected:
void GetAllUniformLocation();
public:
WorldShader();
void LoadShader();
void SetCamPos(const Vec2f& camPos);
void SetZoom(float zoom);
void SetAspectRatio(float aspectRatio);
void SetIsometricView(float isometric);
void SetProjectionMatrix(const Mat4f& proj) const;
void SetViewMatrix(const Mat4f& view) const;
};
} // namespace shader

View File

@@ -203,6 +203,7 @@ bool Mob::IsTouchingCastle(const TeamCastle& enemyCastle) const {
}
void Mob::Tick(std::uint64_t delta, World* world) {
m_HitCooldown = std::max(0.0f, m_HitCooldown - static_cast<float>(delta / 1000.0f));
UpdateEffects(delta, world);
Move(delta, world);
AttackCastle(delta, world);

View File

@@ -201,119 +201,5 @@ std::string GetTowerName(TowerType type) {
}
} // namespace TowerFactory
void ArcherTower::Tick(std::uint64_t delta, World* world) {
if (m_Timer.Update(delta)) {
std::uint8_t arrowsShot = 0;
bool explosiveArrows = GetLevel().GetPath() == TowerPath::Bottom;
std::uint8_t arrows = explosiveArrows ? 2 : GetLevel().GetLevel();
for (MobPtr mob : world->GetMobList()) {
if (IsMobInRange(mob)) {
world->GetWorldNotifier().NotifyListeners(&WorldListener::OnArcherTowerShot, mob, this);
m_Timer.ApplyCooldown();
arrowsShot++;
if (arrowsShot >= arrows)
break;
}
}
}
}
void IceTower::Tick(std::uint64_t delta, World* world) {
if (m_Timer.Update(delta)) {
float damage = GetStats()->GetDamage();
for (MobPtr mob : world->GetMobList()) {
if (IsMobInRange(mob)) {
mob->AddEffect(EffectType::Slowness, 1, this); // slowness for 1s every second
if (damage > 0)
world->GetMobNotifier().NotifyListeners(&MobListener::OnMobDamage, mob.get(), damage, this);
m_Timer.ApplyCooldown();
}
}
}
}
void MageTower::Tick(std::uint64_t delta, World* world) {
if (m_Timer.Update(delta)) {
for (MobPtr mob : world->GetMobList()) {
if (IsMobInRange(mob)) {
mob->AddEffect(EffectType::Fire, GetLevel().GetLevel() * 3, this);
m_Timer.ApplyCooldown();
}
}
}
}
void PoisonTower::Tick(std::uint64_t delta, World* world) {
if (m_Timer.Update(delta)) {
for (MobPtr mob : world->GetMobList()) {
if (IsMobInRange(mob)) {
if (GetLevel().GetPath() == TowerPath::Bottom) {
world->GetMobNotifier().NotifyListeners(&MobListener::OnMobDamage, mob.get(), GetStats()->GetDamage(), this);
} else {
float durationSec;
switch (GetLevel().GetLevel()) {
case 1:
durationSec = 5;
break;
case 2:
durationSec = 15;
break;
case 3:
durationSec = 30;
break;
case 4:
durationSec = 1e10; // about 3 million hours. It should be enough
break;
default:
durationSec = 0; // how did we get there ?
break;
}
mob->AddEffect(EffectType::Poison, durationSec, this);
}
m_Timer.ApplyCooldown();
}
}
}
}
void QuakeTower::Tick(std::uint64_t delta, World* world) {
}
void ZeusTower::Tick(std::uint64_t delta, World* world) {
}
void ArtilleryTower::Tick(std::uint64_t delta, World* world) {
}
void SorcererTower::Tick(std::uint64_t delta, World* world) {
}
void LeachTower::Tick(std::uint64_t delta, World* world) {
}
void TurretTower::Tick(std::uint64_t delta, World* world) {
}
void NecromancerTower::Tick(std::uint64_t delta, World* world) {
}
} // namespace game
} // namespace td

View File

@@ -27,6 +27,7 @@ void ClientConnexion::HandlePacket(const protocol::ConnexionInfoPacket* packet)
void ClientConnexion::HandlePacket(const protocol::ServerTpsPacket* packet) {
m_ServerTPS = packet->GetTPS();
m_ServerMSPT = packet->GetMSPT();
m_Ping = utils::GetTime() - packet->GetPacketSendTime();
}

View File

@@ -20,7 +20,7 @@ WorldClient::WorldClient(ClientGame* game) : game::World(game), protocol::Packet
void WorldClient::HandlePacket(const protocol::WorldBeginDataPacket* packet) {
LoadMap(packet);
if (m_Game->GetGameState() == game::GameState::Game) {
const game::Color& backgroundColor = GetBackgroundColor();
const Color& backgroundColor = GetBackgroundColor();
m_Game->GetRenderer()->SetBackgroundColor({ static_cast<float>(backgroundColor.r / 255.0f), static_cast<float>(backgroundColor.g / 255.0f),
static_cast<float>(backgroundColor.b / 255.0f) });
}

View File

@@ -26,6 +26,7 @@ void Server::StartThread() {
if (delta >= SERVER_TICK) {
Tick(delta);
lastTime = td::utils::GetTime();
m_TickCounter.SetMSPT(lastTime - time);
std::uint64_t sleepTime = SERVER_TICK - (delta - SERVER_TICK);
std::this_thread::sleep_for(std::chrono::milliseconds(sleepTime));
}
@@ -85,7 +86,7 @@ void Server::Tick(std::uint64_t delta) {
m_Lobby.Tick();
m_Game.Tick(delta);
if (m_TickCounter.Update()) {
protocol::ServerTpsPacket packet(m_TickCounter.GetTPS(), utils::GetTime());
protocol::ServerTpsPacket packet(m_TickCounter.GetTPS(), m_TickCounter.GetMSPT(), utils::GetTime());
BroadcastPacket(&packet);
}
}

View File

@@ -10,6 +10,8 @@
#define KEEP_ALIVE_TIMEOUT 10 * 1000 // 10s
#define SAFE_CHECK(expr) if(expr) return
namespace td {
namespace server {
@@ -97,8 +99,8 @@ void ServerConnexion::HandlePacket(const protocol::PlayerLoginPacket* packet) {
}
void ServerConnexion::HandlePacket(const protocol::SelectTeamPacket* packet) {
if (m_Server->GetGame().GetGameState() != game::GameState::Lobby)
return;
SAFE_CHECK(m_Server->GetGame().GetGameState() != game::GameState::Lobby);
if (static_cast<std::int8_t>(packet->GetSelectedTeam()) >= -1 || static_cast<std::int8_t>(packet->GetSelectedTeam()) <= 1) {
if (m_Player->GetTeamColor() == game::TeamColor::None) { // join a team
m_Server->GetGame().GetTeam(packet->GetSelectedTeam()).AddPlayer(m_Player);
@@ -138,12 +140,12 @@ void ServerConnexion::InitConnection() {
protocol::ConnexionInfoPacket conPacket(m_ID);
SendPacket(&conPacket);
if (m_Server->GetGame().GetGameState() == game::GameState::Game) {
SAFE_CHECK(m_Server->GetGame().GetGameState() != game::GameState::Game);
protocol::WorldBeginDataPacket headerDataPacket(m_Server->GetGame().GetWorld());
protocol::WorldBeginDataPacket dataPacket(m_Server->GetGame().GetWorld());
SendPacket(&headerDataPacket);
SendPacket(&dataPacket);
}
}
void ServerConnexion::HandlePacket(const protocol::PlaceTowerPacket* packet) {
@@ -153,12 +155,10 @@ void ServerConnexion::HandlePacket(const protocol::PlaceTowerPacket* packet) {
Vec2f towerPos = { static_cast<float>(packet->GetTowerX()), static_cast<float>(packet->GetTowerY()) };
if (!world->CanPlaceLittleTower(towerPos, m_ID))
return;
SAFE_CHECK(!world->CanPlaceLittleTower(towerPos, m_ID));
if (towerInfo.IsBigTower())
if (!world->CanPlaceBigTower(towerPos, m_ID))
return;
SAFE_CHECK(!world->CanPlaceBigTower(towerPos, m_ID));
game::TowerPtr tower = world->PlaceTowerAt(towerType, packet->GetTowerX(), packet->GetTowerY(), m_ID);

View File

@@ -0,0 +1,25 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void ArcherTower::Tick(std::uint64_t delta, World* world) {
if (m_Timer.Update(delta)) {
std::uint8_t arrowsShot = 0;
bool explosiveArrows = GetLevel().GetPath() == TowerPath::Bottom;
std::uint8_t arrows = explosiveArrows ? 2 : GetLevel().GetLevel();
for (MobPtr mob : world->GetMobList()) {
if (IsMobInRange(mob)) {
world->GetWorldNotifier().NotifyListeners(&WorldListener::OnArcherTowerShot, mob, this);
m_Timer.ApplyCooldown();
arrowsShot++;
if (arrowsShot >= arrows)
break;
}
}
}
}
} // namespace game
} // namespace td

View File

@@ -0,0 +1,12 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void ArtilleryTower::Tick(std::uint64_t delta, World* world) {
}
} // namespace game
} // namespace td

View File

@@ -0,0 +1,22 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void IceTower::Tick(std::uint64_t delta, World* world) {
if (m_Timer.Update(delta)) {
float damage = GetStats()->GetDamage();
for (MobPtr mob : world->GetMobList()) {
if (IsMobInRange(mob)) {
mob->AddEffect(EffectType::Slowness, 1, this); // slowness for 1s every second
if (damage > 0)
world->GetMobNotifier().NotifyListeners(&MobListener::OnMobDamage, mob.get(), damage, this);
m_Timer.ApplyCooldown();
}
}
}
}
} // namespace game
} // namespace td

View File

@@ -0,0 +1,12 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void LeachTower::Tick(std::uint64_t delta, World* world) {
}
} // namespace game
} // namespace td

View File

@@ -0,0 +1,19 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void MageTower::Tick(std::uint64_t delta, World* world) {
if (m_Timer.Update(delta)) {
for (MobPtr mob : world->GetMobList()) {
if (IsMobInRange(mob)) {
mob->AddEffect(EffectType::Fire, GetLevel().GetLevel() * 3, this);
m_Timer.ApplyCooldown();
}
}
}
}
} // namespace game
} // namespace td

View File

@@ -0,0 +1,12 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void NecromancerTower::Tick(std::uint64_t delta, World* world) {
}
} // namespace game
} // namespace td

View File

@@ -0,0 +1,45 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void PoisonTower::Tick(std::uint64_t delta, World* world) {
if (m_Timer.Update(delta)) {
for (MobPtr mob : world->GetMobList()) {
if (IsMobInRange(mob)) {
if (GetLevel().GetPath() == TowerPath::Bottom) {
world->GetMobNotifier().NotifyListeners(&MobListener::OnMobDamage, mob.get(), GetStats()->GetDamage(), this);
} else {
float durationSec;
switch (GetLevel().GetLevel()) {
case 1:
durationSec = 5;
break;
case 2:
durationSec = 15;
break;
case 3:
durationSec = 30;
break;
case 4:
durationSec = 1e10; // about 3 million hours. It should be enough
break;
default:
durationSec = 0; // how did we get there ?
break;
}
mob->AddEffect(EffectType::Poison, durationSec, this);
}
m_Timer.ApplyCooldown();
}
}
}
}
} // namespace game
} // namespace td

View File

@@ -0,0 +1,12 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void QuakeTower::Tick(std::uint64_t delta, World* world) {
}
} // namespace game
} // namespace td

View File

@@ -0,0 +1,12 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void SorcererTower::Tick(std::uint64_t delta, World* world) {
}
} // namespace game
} // namespace td

View File

@@ -0,0 +1,12 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void TurretTower::Tick(std::uint64_t delta, World* world) {
}
} // namespace game
} // namespace td

View File

@@ -0,0 +1,12 @@
#include "game/Towers.h"
#include "game/World.h"
namespace td {
namespace game {
void ZeusTower::Tick(std::uint64_t delta, World* world) {
}
} // namespace game
} // namespace td

View File

@@ -7,10 +7,10 @@
namespace td {
DataBuffer::DataBuffer() : m_ReadOffset(0) { }
DataBuffer::DataBuffer(const DataBuffer& other) : m_Buffer(other.m_Buffer), m_ReadOffset(other.m_ReadOffset) { }
DataBuffer::DataBuffer(DataBuffer&& other) : m_Buffer(std::move(other.m_Buffer)), m_ReadOffset(std::move(other.m_ReadOffset)) { }
DataBuffer::DataBuffer(const std::string& str) : m_Buffer(str.begin(), str.end()), m_ReadOffset(0) { }
DataBuffer::DataBuffer() : m_ReadOffset(0) {}
DataBuffer::DataBuffer(const DataBuffer& other) : m_Buffer(other.m_Buffer), m_ReadOffset(other.m_ReadOffset) {}
DataBuffer::DataBuffer(DataBuffer&& other) : m_Buffer(std::move(other.m_Buffer)), m_ReadOffset(std::move(other.m_ReadOffset)) {}
DataBuffer::DataBuffer(const std::string& str) : m_Buffer(str.begin(), str.end()), m_ReadOffset(0) {}
DataBuffer::DataBuffer(const DataBuffer& other, Data::difference_type offset) : m_ReadOffset(0) {
m_Buffer.reserve(other.GetSize() - static_cast<std::size_t>(offset));

90
src/misc/Maths.cpp Normal file
View File

@@ -0,0 +1,90 @@
#include "misc/Maths.h"
#include <cassert>
namespace td {
namespace maths {
Mat4f Perspective(float fovY, float aspectRatio, float zNear, float zFar) {
const float tanHalfFovy = std::tan(fovY / 2.0f);
Mat4f result{};
result.x0 = 1.0f / (aspectRatio * tanHalfFovy);
result.y1 = 1.0f / (tanHalfFovy);
result.z2 = -(zFar + zNear) / (zFar - zNear);
result.z3 = -1.0f;
result.w2 = -(2.0f * zFar * zNear) / (zFar - zNear);
return result;
}
Mat4f Look(const Vec3f& eye, const Vec3f& front, const Vec3f& up) {
const Vec3f f = Normalize(front);
const Vec3f s = Normalize(Cross(f, up));
const Vec3f u = Cross(s, f);
Mat4f result = Identity<float>();
result.x0 = s.x;
result.y0 = s.y;
result.z0 = s.z;
result.x1 = u.x;
result.y1 = u.y;
result.z1 = u.z;
result.x2 = -f.x;
result.y2 = -f.y;
result.z2 = -f.z;
result.w0 = -Dot(s, eye);
result.w1 = -Dot(u, eye);
result.w2 = Dot(f, eye);
return result;
}
Mat4f Inverse(const Mat4f& mat) {
float s0 = mat.at(0, 0) * mat.at(1, 1) - mat.at(1, 0) * mat.at(0, 1);
float s1 = mat.at(0, 0) * mat.at(1, 2) - mat.at(1, 0) * mat.at(0, 2);
float s2 = mat.at(0, 0) * mat.at(1, 3) - mat.at(1, 0) * mat.at(0, 3);
float s3 = mat.at(0, 1) * mat.at(1, 2) - mat.at(1, 1) * mat.at(0, 2);
float s4 = mat.at(0, 1) * mat.at(1, 3) - mat.at(1, 1) * mat.at(0, 3);
float s5 = mat.at(0, 2) * mat.at(1, 3) - mat.at(1, 2) * mat.at(0, 3);
float c5 = mat.at(2, 2) * mat.at(3, 3) - mat.at(3, 2) * mat.at(2, 3);
float c4 = mat.at(2, 1) * mat.at(3, 3) - mat.at(3, 1) * mat.at(2, 3);
float c3 = mat.at(2, 1) * mat.at(3, 2) - mat.at(3, 1) * mat.at(2, 2);
float c2 = mat.at(2, 0) * mat.at(3, 3) - mat.at(3, 0) * mat.at(2, 3);
float c1 = mat.at(2, 0) * mat.at(3, 2) - mat.at(3, 0) * mat.at(2, 2);
float c0 = mat.at(2, 0) * mat.at(3, 1) - mat.at(3, 0) * mat.at(2, 1);
float det = s0 * c5 - s1 * c4 + s2 * c3 + s3 * c2 - s4 * c1 + s5 * c0;
assert(det != 0 && "Determinant equals 0 !");
float invdet = 1.0 / det;
Mat4f result;
result.at(0, 0) = ( mat.at(1, 1) * c5 - mat.at(1, 2) * c4 + mat.at(1, 3) * c3) * invdet;
result.at(0, 1) = (-mat.at(0, 1) * c5 + mat.at(0, 2) * c4 - mat.at(0, 3) * c3) * invdet;
result.at(0, 2) = ( mat.at(3, 1) * s5 - mat.at(3, 2) * s4 + mat.at(3, 3) * s3) * invdet;
result.at(0, 3) = (-mat.at(2, 1) * s5 + mat.at(2, 2) * s4 - mat.at(2, 3) * s3) * invdet;
result.at(1, 0) = (-mat.at(1, 0) * c5 + mat.at(1, 2) * c2 - mat.at(1, 3) * c1) * invdet;
result.at(1, 1) = ( mat.at(0, 0) * c5 - mat.at(0, 2) * c2 + mat.at(0, 3) * c1) * invdet;
result.at(1, 2) = (-mat.at(3, 0) * s5 + mat.at(3, 2) * s2 - mat.at(3, 3) * s1) * invdet;
result.at(1, 3) = ( mat.at(2, 0) * s5 - mat.at(2, 2) * s2 + mat.at(2, 3) * s1) * invdet;
result.at(2, 0) = ( mat.at(1, 0) * c4 - mat.at(1, 1) * c2 + mat.at(1, 3) * c0) * invdet;
result.at(2, 1) = (-mat.at(0, 0) * c4 + mat.at(0, 1) * c2 - mat.at(0, 3) * c0) * invdet;
result.at(2, 2) = ( mat.at(3, 0) * s4 - mat.at(3, 1) * s2 + mat.at(3, 3) * s0) * invdet;
result.at(2, 3) = (-mat.at(2, 0) * s4 + mat.at(2, 1) * s2 - mat.at(2, 3) * s0) * invdet;
result.at(3, 0) = (-mat.at(1, 0) * c3 + mat.at(1, 1) * c1 - mat.at(1, 2) * c0) * invdet;
result.at(3, 1) = ( mat.at(0, 0) * c3 - mat.at(0, 1) * c1 + mat.at(0, 2) * c0) * invdet;
result.at(3, 2) = (-mat.at(3, 0) * s3 + mat.at(3, 1) * s1 - mat.at(3, 2) * s0) * invdet;
result.at(3, 3) = ( mat.at(2, 0) * s3 - mat.at(2, 1) * s1 + mat.at(2, 2) * s0) * invdet;
return result;
}
} // namespace maths
} // namespace td

View File

@@ -16,8 +16,7 @@ Socket::Socket(Type type)
: m_Blocking(false),
m_Type(type),
m_Status(Disconnected),
m_Handle(static_cast<SocketHandle>(INVALID_SOCKET))
{
m_Handle(static_cast<SocketHandle>(INVALID_SOCKET)) {
}

View File

@@ -12,8 +12,7 @@ namespace td {
namespace network {
UDPSocket::UDPSocket()
: Socket(Socket::UDP), m_Port(0)
{
: Socket(Socket::UDP), m_Port(0) {
m_Handle = ::socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
}

View File

@@ -96,7 +96,7 @@ void PlayerLoginPacket::Deserialize(DataBuffer& data) {
DataBuffer WorldBeginDataPacket::Serialize(bool packetID) const {
DataBuffer data;
const game::TowerTileColorPalette& towerTilePalette = m_Header.m_World->GetTowerTileColorPalette();
const std::vector<game::Color>& decoTilePalette = m_Header.m_World->GetDecorationPalette();
const std::vector<Color>& decoTilePalette = m_Header.m_World->GetDecorationPalette();
WritePacketID(data, packetID);
@@ -105,9 +105,9 @@ DataBuffer WorldBeginDataPacket::Serialize(bool packetID) const {
// deco color palette
std::size_t bufferSize = data.GetSize();
data.Resize(bufferSize + decoTilePalette.size() * sizeof(game::Color));
data.Resize(bufferSize + decoTilePalette.size() * sizeof(Color));
memcpy(reinterpret_cast<std::uint8_t*>(data.data()) + bufferSize, decoTilePalette.data(), decoTilePalette.size() * sizeof(game::Color));
memcpy(reinterpret_cast<std::uint8_t*>(data.data()) + bufferSize, decoTilePalette.data(), decoTilePalette.size() * sizeof(Color));
data << m_Header.m_World->GetBackgroundColor();
@@ -135,7 +135,7 @@ void WorldBeginDataPacket::Deserialize(DataBuffer& data) {
std::uint16_t decoPaletteSize;
data >> decoPaletteSize;
std::size_t decoPalletteSizeByte = decoPaletteSize * sizeof(game::Color);
std::size_t decoPalletteSizeByte = decoPaletteSize * sizeof(Color);
m_Header.m_DecorationPalette.resize(decoPaletteSize);
@@ -425,12 +425,12 @@ DataBuffer ServerTpsPacket::Serialize(bool packetID) const {
DataBuffer data;
WritePacketID(data, packetID);
data << m_TPS << m_PacketSendTime;
data << m_TPS << m_MSPT << m_PacketSendTime;
return data;
}
void ServerTpsPacket::Deserialize(DataBuffer& data) {
data >> m_TPS >> m_PacketSendTime;
data >> m_TPS >> m_MSPT >> m_PacketSendTime;
}
DataBuffer SpawnMobPacket::Serialize(bool packetID) const {

View File

@@ -10,6 +10,10 @@
#include <stdio.h>
#include "misc/Time.h"
#include "misc/Easing.h"
#include "misc/Maths.h"
#include <misc/Log.h>
#include <misc/Format.h>
namespace td {
namespace render {
@@ -22,21 +26,11 @@ Renderer::~Renderer() {
}
void Renderer::UpdateIsometricView() {
float isometricEased = utils::EaseInOutExpo(m_IsometricShade);
m_WorldShader->Start();
m_WorldShader->SetIsometricView(isometricEased);
m_EntityShader->Start();
m_EntityShader->SetIsometricView(isometricEased);
}
void Renderer::InitShaders() {
m_WorldShader = std::make_unique<shader::WorldShader>();
m_WorldShader->LoadShader();
m_EntityShader = std::make_unique<shader::EntityShader>();
m_EntityShader->LoadShader();
SetIsometricView(true);
UpdateIsometricView();
}
// TODO : change loader check
@@ -55,7 +49,11 @@ bool Renderer::Init() {
#endif
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthFunc(GL_LESS);
glFrontFace(GL_CCW);
InitShaders();
return true;
}
@@ -70,79 +68,110 @@ void Renderer::RenderVAO(const GL::VertexArray& vao) {
void Renderer::RenderModel(const Model& model) {
m_EntityShader->Start();
m_EntityShader->SetModelPos(model.positon);
m_EntityShader->SetColorEffect(model.color);
model.vao->Bind();
glDrawArrays(GL_TRIANGLES, 0, static_cast<GLsizei>(model.vao->GetVertexCount()));
model.vao->Unbind();
}
void Renderer::UpdateIsometricFade() {
static std::uint64_t lastTime = utils::GetTime();
if (m_IsometricShade != static_cast<float>(m_IsometricView)) {
float step = static_cast<float>(utils::GetTime() - lastTime) / 1000.0f * m_AnimationSpeed;
if (m_IsometricShade < m_IsometricView) {
m_IsometricShade += step;
} else {
m_IsometricShade -= step;
}
m_IsometricShade = std::min(m_IsometricShade, 1.0f);
m_IsometricShade = std::max(m_IsometricShade, 0.0f);
UpdateIsometricView();
}
lastTime = utils::GetTime();
void Renderer::RenderModel(const TexturedModel& model) {
m_EntityShader->Start();
m_EntityShader->SetModelPos(model.GetPosition());
m_EntityShader->SetColorEffect(model.GetColor());
model.GetTexture().Bind();
model.GetVao().Bind();
glDrawArrays(GL_TRIANGLES, 0, static_cast<GLsizei>(model.GetVao().GetVertexCount()));
model.GetVao().Unbind();
GL::Texture::Unbind();
}
void Renderer::Prepare() {
glClear(GL_COLOR_BUFFER_BIT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(m_BackgroundColor.r, m_BackgroundColor.g, m_BackgroundColor.b, 0);
UpdateIsometricFade();
}
void Renderer::Resize(int width, int height) {
m_Camera.projectionMatrix = maths::Perspective(80.0f / 180.0f * PI, static_cast<float>(width) / height, 0.1f, 160.0f);
m_Camera.InvProjectionMatrix = maths::Inverse(m_Camera.projectionMatrix);
m_WorldShader->Start();
m_WorldShader->SetAspectRatio(static_cast<float>(width) / height);
m_WorldShader->SetProjectionMatrix(m_Camera.projectionMatrix);
m_EntityShader->Start();
m_EntityShader->SetAspectRatio(static_cast<float>(width) / height);
m_WorldShader->SetProjectionMatrix(m_Camera.projectionMatrix);
m_WindowSize = { width, height };
glViewport(0, 0, width, height);
}
void Renderer::SetZoom(float zoom) {
void Renderer::AddZoom(float zoom) {
m_Camera.CamPos.y = std::max(1.0f, m_Camera.CamPos.y - zoom);
m_Camera.CamDistance = std::max(1.0f, m_Camera.CamDistance - zoom);
SetCamLook(m_Camera.CamLook);
}
void Renderer::SetCamAngularMovement(const Vec2f& mov) {
m_Camera.m_Pitch = std::clamp(m_Camera.m_Pitch - mov.y / m_MouseSensitivity, -PI / 2.0f + 0.0000001f, -PI / 12.0f);
m_Camera.m_Yaw += mov.x / m_MouseSensitivity;
SetCamLook(m_Camera.CamLook);
}
void Renderer::SetCamMovement(const Vec2f& lastCursorPos, const Vec2f& currentCursorPos) {
Vec2f worldLastCursorPos = GetCursorWorldPos(lastCursorPos, m_WindowSize.x, m_WindowSize.y);
Vec2f worldCurrentCursorPos = GetCursorWorldPos(currentCursorPos, m_WindowSize.x, m_WindowSize.y);
Vec2f movement = worldCurrentCursorPos - worldLastCursorPos;
SetCamLook(m_Camera.CamLook - movement);
}
void Renderer::SetCamPos(const Vec3f& newPos) {
Vec3f front = {
std::cos(m_Camera.m_Yaw) * std::cos(m_Camera.m_Pitch),
std::sin(m_Camera.m_Pitch),
std::sin(m_Camera.m_Yaw) * std::cos(m_Camera.m_Pitch)
};
m_Camera.CamPos = newPos;
m_Camera.viewMatrix = maths::Look(m_Camera.CamPos, front, { 0, 1, 0 });
m_Camera.InvViewMatrix = maths::Transpose(maths::Inverse(m_Camera.viewMatrix)); // why transpose ? I don't know
m_WorldShader->Start();
m_WorldShader->SetZoom(zoom);
m_WorldShader->SetViewMatrix(m_Camera.viewMatrix);
m_EntityShader->Start();
m_EntityShader->SetZoom(zoom);
m_EntityShader->SetViewMatrix(m_Camera.viewMatrix);
}
void Renderer::SetCamMovement(const Vec2f& mov) {
m_CamPos.x += mov.x * (1 - m_IsometricView) + (0.5 * mov.x - mov.y) * m_IsometricView;
m_CamPos.y += -mov.y * (1 - m_IsometricView) + (-0.5 * mov.x - mov.y) * m_IsometricView;
SetCamPos(m_CamPos);
void Renderer::SetCamLook(const Vec2f& worldPos) {
static const float WORLD_HEIGHT = 0;
m_Camera.CamLook = worldPos;
Vec3f front = {
std::cos(m_Camera.m_Yaw) * std::cos(m_Camera.m_Pitch),
std::sin(m_Camera.m_Pitch),
std::sin(m_Camera.m_Yaw) * std::cos(m_Camera.m_Pitch)
};
SetCamPos({
-m_Camera.CamDistance * front.x + m_Camera.CamLook.x,
-m_Camera.CamDistance * front.y + WORLD_HEIGHT,
-m_Camera.CamDistance * front.z + m_Camera.CamLook.y
});
}
void Renderer::SetCamPos(const Vec2f& newPos) {
m_CamPos = newPos;
m_WorldShader->Start();
m_WorldShader->SetCamPos(newPos);
m_EntityShader->Start();
m_EntityShader->SetCamPos(newPos);
}
Vec2f Renderer::GetCursorWorldPos(const Vec2f& cursorPos, float windowWidth, float windowHeight) {
void Renderer::SetIsometricView(bool isometric) {
m_IsometricView = isometric;
}
float relativeX = (cursorPos.x / windowWidth * 2) - 1.0f;
float relativeY = 1.0f - (cursorPos.y / windowHeight * 2);
Vec2f Renderer::GetCursorWorldPos(const Vec2f& cursorPos, float aspectRatio, float zoom, float windowWidth, float windowHeight) {
float isometricEased = utils::EaseInOutExpo(m_IsometricShade);
Vec4f rayClip{ relativeX, relativeY, -1.0f, 1.0f };
float relativeX = (cursorPos.x / windowWidth * 2) - 1;
float relativeY = (cursorPos.y / windowHeight * 2) - 1;
Vec4f rayEye = maths::Dot(m_Camera.InvProjectionMatrix, rayClip);
float deltaX = relativeX * aspectRatio / zoom;
float deltaY = relativeY / zoom;
rayEye = { rayEye.x, rayEye.y, -1.0f, 0.0f };
float worldX = m_CamPos.x + deltaX * (1 - isometricEased) + (0.5 * deltaX + deltaY) * isometricEased;
float worldY = m_CamPos.y + deltaY * (1 - isometricEased) + (-0.5 * deltaX + deltaY) * isometricEased;
Vec4f rayWorld = maths::Dot(m_Camera.InvViewMatrix, rayEye);
return { worldX, worldY };
float lambda = -m_Camera.CamPos.y / rayWorld.y;
return { lambda * rayWorld.x + m_Camera.CamPos.x, lambda * rayWorld.z + m_Camera.CamPos.z };
}

View File

@@ -4,6 +4,8 @@
namespace td {
namespace render {
const static int VERTEX_SIZE = 3;
void VertexCache::AddData(std::uint64_t index, std::vector<float> positions, std::vector<float> colors) {
m_Indexes.insert({ index, {positions, colors} });
m_VertexCount += colors.size(); // one color per vertex
@@ -12,8 +14,8 @@ void VertexCache::AddData(std::uint64_t index, std::vector<float> positions, std
void VertexCache::RemoveData(std::uint64_t index) {
auto it = m_Indexes.find(index);
if (it != m_Indexes.end()) {
m_Indexes.erase(it);
m_VertexCount -= it->second.color.size(); // one color per vertex
m_Indexes.erase(it);
}
}
@@ -26,7 +28,7 @@ void VertexCache::UpdateVertexArray() {
m_VertexArray = std::make_unique<GL::VertexArray>(m_VertexCount); // one color per vertex
Vector positions;
positions.reserve(m_VertexCount * 2);
positions.reserve(m_VertexCount * VERTEX_SIZE);
Vector colors;
colors.reserve(m_VertexCount);
@@ -38,8 +40,8 @@ void VertexCache::UpdateVertexArray() {
colors.insert(colors.end(), data.color.begin(), data.color.end());
}
GL::VertexBuffer positionsBuffer(positions, 2);
positionsBuffer.AddVertexAttribPointer(0, 2, 0);
GL::VertexBuffer positionsBuffer(positions, VERTEX_SIZE);
positionsBuffer.AddVertexAttribPointer(0, VERTEX_SIZE, 0);
GL::VertexBuffer colorsBuffer(colors, 1);
colorsBuffer.AddVertexAttribPointer(1, 1, 0);

View File

@@ -1,5 +1,7 @@
#include "render/WorldRenderer.h"
#include "render/loader/WorldLoader.h"
#include "render/loader/TextureLoader.h"
#include "render/loader/MobLoader.h"
#include "render/Renderer.h"
#include "render/gui/imgui/imgui.h"
#include "gui/imgui/imgui_internal.h"
@@ -25,16 +27,21 @@ ImVec4 WorldRenderer::GetImGuiTeamColor(game::TeamColor color) {
void WorldRenderer::LoadModels() {
utils::LOGD("World Created !");
m_WorldVao = std::make_unique<GL::VertexArray>(std::move(WorldLoader::LoadWorldModel(m_World)));
m_MobVao = std::make_unique<GL::VertexArray>(std::move(WorldLoader::LoadMobModel()));
m_SelectTileVao = std::make_unique<GL::VertexArray>(std::move(WorldLoader::LoadTileSelectModel()));
m_WorldVao = std::make_unique<GL::VertexArray>(WorldLoader::LoadWorldModel(m_World));
m_SelectTileModel = std::make_unique<Model>();
m_SelectTileModel->vao = std::make_unique<GL::VertexArray>(WorldLoader::LoadTileSelectModel());
for (std::size_t i = 0; i < static_cast<std::size_t>(game::MobType::MOB_COUNT); i++) {
m_MobModels.push_back(MobLoader::LoadMobModel(game::MobType(i)));
}
utils::LOGD(utils::format("Vertex Count : %u", m_WorldVao->GetVertexCount()));
}
WorldRenderer::WorldRenderer(game::World* world, client::ClientGame* client) : m_Client(client), m_Renderer(m_Client->GetRenderer()), m_World(world), m_Zoom(0.1) {
m_Renderer->SetZoom(m_Zoom);
m_Renderer->SetCamMovement({});
m_TowerPlacePopup = std::make_unique<gui::TowerPlacePopup>(m_Client->GetClient());
m_TowerUpgradePopup = std::make_unique<gui::TowerUpgradePopup>(m_Client->GetClient());
m_MobTooltip = std::make_unique<gui::MobTooltip>(m_Client->GetClient());
m_CastleTooltip = std::make_unique<gui::CastleTooltip>(m_Client->GetClient());
m_Client->GetWorldClient().GetWorldNotifier().BindListener(this);
@@ -47,22 +54,29 @@ void WorldRenderer::UpdateCursorPos() {
void WorldRenderer::Update() {
if (m_WorldVao == nullptr)
return;
ImGuiIO& io = ImGui::GetIO();
if (io.MouseDown[0] && !ImGui::IsAnyItemActive()) {
if (io.MouseDown[0] && !ImGui::IsAnyItemActive() && !ImGui::IsAnyItemHovered()) {
ImVec2 mousePos = ImGui::GetIO().MousePos;
ImVec2 mouseDelta = ImGui::GetIO().MouseDelta;
const float relativeX = mouseDelta.x / (float)Display::GetWindowWidth() * 2;
const float relativeY = mouseDelta.y / (float)Display::GetWindowHeight() * 2;
MoveCam(relativeX, relativeY, Display::GetAspectRatio());
m_Renderer->SetCamMovement({mousePos.x - mouseDelta.x, mousePos.y - mouseDelta.y}, { mousePos.x, mousePos.y });
}
if (io.MouseDown[1] && !ImGui::IsAnyItemActive() && !ImGui::IsAnyItemHovered()) {
ImVec2 mouseDelta = ImGui::GetIO().MouseDelta;
m_Renderer->SetCamAngularMovement({ mouseDelta.x, mouseDelta.y });
}
if (io.MouseWheel != 0) {
ChangeZoom(io.MouseWheel);
}
UpdateCursorPos();
if (ImGui::IsMouseClicked(0)) {
if (!m_PopupOpened) {
if (!m_TowerUpgradePopup->IsPopupOpened()) {
m_HoldCursorPos = { io.MousePos.x, io.MousePos.y };
} else {
m_PopupOpened = false;
}
}
@@ -83,12 +97,13 @@ void WorldRenderer::RenderWorld() const {
m_Renderer->RenderVAO(*m_WorldVao);
}
void WorldRenderer::RenderMobs() const {
void WorldRenderer::RenderMobs() {
for (game::MobPtr mob : m_World->GetMobList()) {
Renderer::Model model;
model.vao = m_MobVao.get();
model.positon = { mob->GetCenterX(), mob->GetCenterY() };
m_Renderer->RenderModel(model);
TexturedModel& mobModel = m_MobModels.at(static_cast<std::size_t>(mob->GetType()));
mobModel.SetPosition({ mob->GetCenterX(), 0, mob->GetCenterY() });
mobModel.SetColor(mob->HasTakenDamage() ? Vec3f{ 1, 0.5, 0.5 } : Vec3f{ 1, 1, 1 });
m_Renderer->RenderModel(mobModel);
}
}
@@ -102,16 +117,14 @@ void WorldRenderer::RenderTileSelect() const {
if (m_MobTooltip->IsShown() || m_CastleTooltip->IsShown()) return;
Renderer::Model tileSelectModel;
tileSelectModel.vao = m_SelectTileVao.get();
tileSelectModel.positon = { std::floor(m_CursorPos.x), std::floor(m_CursorPos.y) };
m_SelectTileModel->positon = { std::floor(m_CursorPos.x), 0, std::floor(m_CursorPos.y) };
m_Renderer->RenderModel(tileSelectModel);
m_Renderer->RenderModel(*m_SelectTileModel);
}
void WorldRenderer::RenderPopups() {
m_TowerPlacePopup->Render();
RenderTowerUpgradePopup();
m_TowerUpgradePopup->Render();
}
void WorldRenderer::Render() {
@@ -135,30 +148,23 @@ void WorldRenderer::RenderTooltips() const {
RenderCastleTooltip();
}
void WorldRenderer::MoveCam(float relativeX, float relativeY, float aspectRatio) {
void WorldRenderer::MoveCam(float relativeX, float relativeY) {
if (m_WorldVao == nullptr)
return;
float movementX = -relativeX / m_Zoom * aspectRatio;
float movementY = relativeY / m_Zoom;
m_Renderer->SetCamMovement({ movementX, movementY });
}
void WorldRenderer::ChangeZoom(float zoomStep) {
if (m_WorldVao == nullptr)
return;
static float sensibility = 1.5f;
if (zoomStep < 0) {
m_Zoom /= -zoomStep * sensibility;
} else {
m_Zoom *= zoomStep * sensibility;
}
m_Renderer->SetZoom(m_Zoom);
m_Renderer->SetCamMovement({});
m_Renderer->AddZoom(zoomStep);
}
void WorldRenderer::Click() {
const game::TowerPtr tower = m_Client->GetWorld().GetTower(GetClickWorldPos());
m_TowerPlacePopup->SetClickPos(GetClickWorldPos());
m_TowerUpgradePopup->SetClickPos(GetClickWorldPos());
if (tower != nullptr) { // there is a tower here
ImGui::OpenPopup("TowerUpgrade");
} else if (m_Client->GetWorld().CanPlaceLittleTower(GetClickWorldPos(), m_Client->GetPlayer()->GetID())) {
@@ -168,70 +174,7 @@ void WorldRenderer::Click() {
void WorldRenderer::SetCamPos(float camX, float camY) {
m_CamPos = { camX, camY };
m_Renderer->SetCamPos(m_CamPos);
}
void WorldRenderer::RenderTowerUpgradePopup() {
if (ImGui::BeginPopup("TowerUpgrade")) {
m_PopupOpened = true;
game::TowerPtr tower = m_Client->GetWorld().GetTower(GetClickWorldPos());
if (tower == nullptr) {
ImGui::EndPopup();
return;
}
ImGui::Text("Tower : %s", game::TowerFactory::GetTowerName(tower->GetType()).c_str());
for (int y = 0; y < 3; y++) { // path: 0 -> top 1 -> middle 2 -> bottom
for (int x = 0; x < 4; x++) { // level: 1, 2, 3, 4
if (x > 0)
ImGui::SameLine();
std::uint8_t currentLevel = x + 1;
game::TowerPath currentPath = game::TowerPath(y);
const game::TowerStats* towerStats = game::GetTowerStats(tower->GetType(), { currentLevel, currentPath });
game::TowerPath towerPath = tower->GetLevel().GetPath();
bool disabled = towerStats == nullptr;
int towerLevel = tower->GetLevel().GetLevel();
bool alreadyUpgraded = currentLevel <= towerLevel;
bool canUpgrade = (towerLevel + 1) == currentLevel;
if (canUpgrade && towerPath != game::TowerPath::Base) {
if (currentPath != towerPath) {
canUpgrade = false;
}
}
ImGui::PushID(x * 4 + y);
if (disabled) {
ImGui::BeginDisabled();
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
ImGui::Button("", ImVec2(100, 100));
ImGui::PopStyleColor();
ImGui::EndDisabled();
} else if (alreadyUpgraded) {
ImGui::BeginDisabled();
ImGui::Button("Already", ImVec2(100, 100));
ImGui::EndDisabled();
} else if (canUpgrade) {
if (ImGui::Button("Upgrade", ImVec2(100, 100))) {
m_Client->GetClient()->UpgradeTower(tower->GetID(), { currentLevel, currentPath });
}
} else {
ImGui::BeginDisabled();
ImGui::Button("Locked", ImVec2(100, 100));
ImGui::EndDisabled();
}
ImGui::PopID();
}
}
ImGui::EndPopup();
}
m_Renderer->SetCamLook({ camX, camY });
}
void WorldRenderer::DetectClick() {
@@ -294,11 +237,11 @@ void WorldRenderer::OnTowerRemove(game::TowerPtr tower) {
Vec2f WorldRenderer::GetCursorWorldPos() const {
ImGuiIO& io = ImGui::GetIO();
return m_Renderer->GetCursorWorldPos({ io.MousePos.x, io.MousePos.y }, Display::GetAspectRatio(), m_Zoom, Display::GetWindowWidth(), Display::GetWindowHeight());
return m_Renderer->GetCursorWorldPos({ io.MousePos.x, io.MousePos.y }, Display::GetWindowWidth(), Display::GetWindowHeight());
}
Vec2f WorldRenderer::GetClickWorldPos() const {
return m_Renderer->GetCursorWorldPos(m_LastClicked, Display::GetAspectRatio(), m_Zoom, Display::GetWindowWidth(), Display::GetWindowHeight());
return m_Renderer->GetCursorWorldPos(m_LastClicked, Display::GetWindowWidth(), Display::GetWindowHeight());
}
} // namespace render

View File

@@ -1,5 +1,6 @@
#include "render/gui/CastleTooltip.h"
#include "render/gui/imgui/imgui.h"
#include "render/gui/LifeProgress.h"
#include "render/WorldRenderer.h"
@@ -15,12 +16,18 @@ CastleTooltip::CastleTooltip(client::Client* client) : GuiWidget(client) {
void CastleTooltip::Render() {
if (m_Castle == nullptr) return;
if (ImGui::GetIO().KeyShift) {
ImGui::BeginTooltip();
ImGui::PushStyleColor(ImGuiCol_Text, render::WorldRenderer::GetImGuiTeamColor(m_Castle->GetTeam()->GetColor()));
ImGui::Text("Castle : ");
ImGui::PopStyleColor();
ImGui::Text("\tCastle HP : %i/%i", static_cast<int>(m_Castle->GetLife()), game::TeamCastle::CastleMaxLife);
ImGui::EndTooltip();
} else {
ImGui::BeginTooltip();
RenderLifeProgress(m_Castle->GetLife() / static_cast<float>(game::TeamCastle::CastleMaxLife));
ImGui::EndTooltip();
}
}
} // namespace gui

View File

@@ -18,9 +18,6 @@ void FrameMenu::Render() {
if (ImGui::Checkbox("V-Sync", &m_VSync)) {
SDL_GL_SetSwapInterval(m_VSync);
}
if (ImGui::Checkbox("Vue Isometrique ?", &m_IsometricView)) {
GetClient()->GetRenderer()->SetIsometricView(m_IsometricView);
}
#if !defined(NDEBUG)
ImGui::Checkbox("Demo Window", &m_ShowDemoWindow);

View File

@@ -85,6 +85,7 @@ void GameMenu::ShowLobbyProgress() {
void GameMenu::ShowTPS() {
ImGui::Text("Server TPS : %.1f", GetClient()->GetConnexion().GetServerTPS());
ImGui::Text("Server MSPT : %i", (int)GetClient()->GetConnexion().GetServerMSPT());
ImGui::Text("Server Ping : %i", GetClient()->GetConnexion().GetServerPing());
}

View File

@@ -0,0 +1,15 @@
#include "render/gui/LifeProgress.h"
#include "render/gui/imgui/imgui.h"
namespace td {
namespace gui {
void RenderLifeProgress(float progress) {
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, { 1 - progress, progress, 0, 1 });
ImGui::ProgressBar(progress, { 100, 25 }, "");
ImGui::PopStyleColor();
}
} // namespace gui
} // namespace td

View File

@@ -1,5 +1,6 @@
#include "render/gui/MobTooltip.h"
#include "render/gui/imgui/imgui.h"
#include "render/gui/LifeProgress.h"
#include "render/WorldRenderer.h"
@@ -19,6 +20,7 @@ void MobTooltip::Render() {
// TODO: add sender null check
if (ImGui::GetIO().KeyShift) {
const game::Player* sender = GetClient()->GetGame().GetPlayerById(m_Mob->GetSender());
ImGui::BeginTooltip();
ImGui::Text("Sender :");
@@ -38,6 +40,11 @@ void MobTooltip::Render() {
ImGui::Text("\tEXP cost : %i", m_Mob->GetStats()->GetExpCost());
ImGui::Text("\tEXP reward : %i", m_Mob->GetStats()->GetExpReward());
ImGui::EndTooltip();
} else {
ImGui::BeginTooltip();
RenderLifeProgress(m_Mob->GetHealth() / m_Mob->GetStats()->GetMaxLife());
ImGui::EndTooltip();
}
}
} // namespace gui

View File

@@ -7,9 +7,22 @@ namespace gui {
SummonMenu::SummonMenu(client::Client* client) : GuiWidget(client), m_MenuOpened(true) {
m_Values.fill(0);
#ifdef NDEBUG
SetCooldown(10);
#else
SetCooldown(0);
#endif
}
void SummonMenu::SetCooldown(float cooldown) {
m_LastCooldown = cooldown;
m_Cooldown = cooldown;
}
void SummonMenu::Render() {
if (m_Cooldown > 0)
m_Cooldown = std::max(0.0f, m_Cooldown - ImGui::GetIO().DeltaTime);
if (m_MenuOpened) {
ImGui::Begin("Summon", &m_MenuOpened);
ImTextureID my_tex_id = ImGui::GetIO().Fonts->TexID;
@@ -48,7 +61,9 @@ void SummonMenu::Render() {
ImGui::PopID();
}
ImGui::PopItemWidth();
if (ImGui::Button("Send")) {
if (m_Cooldown > 0) {
ImGui::ProgressBar((m_LastCooldown - m_Cooldown) / m_LastCooldown, {}, std::string{ std::to_string((int)m_Cooldown + 1) + "s" }.c_str());
} else if (ImGui::Button("Send")) {
std::vector<protocol::MobSend> mobSent;
protocol::MobSend mobSend;
for (int i = 0; i < m_MobTypeCount; i++) {
@@ -59,8 +74,11 @@ void SummonMenu::Render() {
mobSent.push_back(mobSend);
}
}
if (mobSent.size() > 0) {
m_Client->SendMobs(mobSent);
m_Values.fill(0);
SetCooldown(10);
}
}
ImGui::End();
}

View File

@@ -27,7 +27,7 @@ void TowerPlacePopup::Render() {
ImGui::BeginChild(std::to_string(i).c_str(), ImVec2(m_TowerPopupTileWidth, m_TowerPopupTileHeight), true);
ImGui::Text(towerInfo.GetName().c_str());
ImGui::Text("%s", towerInfo.GetName().c_str());
ImGui::SameLine();
ImGui::SetCursorPosX(m_TowerPopupTileWidth - 10 - ImGui::CalcTextSize("(?)").x);
@@ -35,7 +35,7 @@ void TowerPlacePopup::Render() {
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text(towerInfo.GetDescription().c_str());
ImGui::Text("%s", towerInfo.GetDescription().c_str());
ImGui::EndTooltip();
}

View File

@@ -0,0 +1,100 @@
#include "render/gui/TowerUpgradePopup.h"
#include "render/gui/imgui/imgui.h"
#include "game/Towers.h"
#include "game/client/Client.h"
namespace td {
namespace gui {
TowerUpgradePopup::TowerUpgradePopup(client::Client* client) : GuiWidget(client), m_ShouldBeClosed(false), m_Opened(false) {
}
void TowerUpgradePopup::SetClickPos(const Vec2f& worldPos) {
m_ClickWorldPos = worldPos;
}
bool TowerUpgradePopup::IsPopupOpened() {
return m_Opened;
}
void TowerUpgradePopup::Render() {
if (ImGui::BeginPopup("TowerUpgrade")) {
ImGui::BeginChild("TowerUpgradePopupChild", { 450, 350 });
if (m_ShouldBeClosed) {
ImGui::CloseCurrentPopup();
ImGui::EndPopup();
return;
}
game::TowerPtr tower = m_Client->GetGame().GetWorld().GetTower(m_ClickWorldPos);
if (tower == nullptr) {
ImGui::EndPopup();
return;
}
ImGui::Text("Tower : %s", game::TowerFactory::GetTowerName(tower->GetType()).c_str());
for (int y = 0; y < 3; y++) { // path: 0 -> top 1 -> middle 2 -> bottom
for (int x = 0; x < 4; x++) { // level: 1, 2, 3, 4
if (x > 0)
ImGui::SameLine();
std::uint8_t currentLevel = x + 1;
game::TowerPath currentPath = game::TowerPath(y);
const game::TowerStats* towerStats = game::GetTowerStats(tower->GetType(), { currentLevel, currentPath });
game::TowerPath towerPath = tower->GetLevel().GetPath();
bool disabled = towerStats == nullptr;
int towerLevel = tower->GetLevel().GetLevel();
bool alreadyUpgraded = currentLevel <= towerLevel;
bool canUpgrade = (towerLevel + 1) == currentLevel;
if (canUpgrade && towerPath != game::TowerPath::Base) {
if (currentPath != towerPath) {
canUpgrade = false;
}
}
ImGui::PushID(x * 4 + y);
if (disabled) {
ImGui::BeginDisabled();
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
ImGui::Button("", ImVec2(100, 100));
ImGui::PopStyleColor();
ImGui::EndDisabled();
} else if (alreadyUpgraded) {
ImGui::BeginDisabled();
ImGui::Button("Already", ImVec2(100, 100));
ImGui::EndDisabled();
} else if (canUpgrade) {
if (ImGui::Button("Upgrade", ImVec2(100, 100))) {
m_Client->UpgradeTower(tower->GetID(), { currentLevel, currentPath });
}
} else {
ImGui::BeginDisabled();
ImGui::Button("Locked", ImVec2(100, 100));
ImGui::EndDisabled();
}
ImGui::PopID();
}
}
ImGui::EndChild();
ImGui::EndPopup();
m_Opened = true;
return;
}
m_Opened = false;
}
} // namespace gui
} // namespace td

View File

@@ -1,5 +1,7 @@
#include "render/gui/UpdateMenu.h"
#include "updater/Updater.h"
#include "render/gui/imgui/imgui.h"
#include <chrono>
@@ -7,10 +9,12 @@
namespace td {
namespace gui {
UpdateMenu::UpdateMenu(client::Client* client) : GuiWidget(client), m_Opened(true) {
UpdateMenu::UpdateMenu(client::Client* client) : GuiWidget(client), m_Opened(true), m_Updater(std::make_unique<utils::Updater>()) {
CheckUpdates();
}
UpdateMenu::~UpdateMenu() {}
void UpdateMenu::Render() {
RenderErrorPopup();
if (m_Opened) {
@@ -20,40 +24,40 @@ void UpdateMenu::Render() {
bool updateAvailable = m_UpdateAvailable.get();
if (updateAvailable) {
if (m_Updater.IsFileWrited()) {
if (m_Updater->IsFileWrited()) {
ImGui::Text("The update is now installed");
ImGui::Text("The game needs to be restarted");
} else if (m_Updater.IsDownloadComplete()) {
} else if (m_Updater->IsDownloadComplete()) {
ImGui::Text("Download done!");
if (ImGui::Button("Install")) {
if (!m_Updater.WriteFile()) {
if (!m_Updater->WriteFile()) {
m_Error = "Failed to write file !\n";
ImGui::OpenPopup("UpdateError");
}
}
if (ImGui::Button("Cancel")) {
m_Updater.CancelDownload();
m_Updater.ClearCache();
m_Updater->CancelDownload();
m_Updater->ClearCache();
}
} else {
if (m_Updater.GetDownloadProgress() > 0) {
if (m_Updater->GetDownloadProgress() > 0) {
ImGui::Text("Downloading ...");
ImGui::ProgressBar(m_Updater.GetDownloadProgress());
ImGui::ProgressBar(m_Updater->GetDownloadProgress());
if (ImGui::Button("Cancel")) {
m_Updater.CancelDownload();
m_Updater->CancelDownload();
}
} else {
ImGui::Text("An update is available!");
ImGui::Separator();
ImGui::Text("Current version : %s", m_Updater.GetCurrentVersion().c_str());
ImGui::Text("Last version : %s", m_Updater.GetLastVersion().c_str());
ImGui::Text("Current version : %s", m_Updater->GetCurrentVersion().c_str());
ImGui::Text("Last version : %s", m_Updater->GetLastVersion().c_str());
bool canDownloadFile = m_Updater.CanUpdate();
bool canDownloadFile = m_Updater->CanUpdate();
if (!canDownloadFile) ImGui::BeginDisabled();
if (ImGui::Button("Download")) {
m_Updater.DownloadUpdate();
m_Updater->DownloadUpdate();
}
if (!canDownloadFile) ImGui::EndDisabled();
@@ -67,8 +71,8 @@ void UpdateMenu::Render() {
} else {
ImGui::Text("No update available!");
ImGui::Separator();
ImGui::Text("Current version : %s", m_Updater.GetCurrentVersion().c_str());
ImGui::Text("Last version : %s", m_Updater.GetLastVersion().c_str());
ImGui::Text("Current version : %s", m_Updater->GetCurrentVersion().c_str());
ImGui::Text("Last version : %s", m_Updater->GetLastVersion().c_str());
}
} else {
ImGui::Text("Checking updates ...");
@@ -89,7 +93,7 @@ bool UpdateMenu::IsUpdateChecked() {
}
void UpdateMenu::CheckUpdates() {
m_UpdateAvailable = std::async(std::launch::async, [&]() { return m_Updater.CheckUpdate();});
m_UpdateAvailable = std::async(std::launch::async, [&]() { return m_Updater->CheckUpdate();});
}
} // namespace gui

View File

@@ -8,6 +8,7 @@
#include "render/loader/GLLoader.h"
#include "render/GL.h"
#include <cassert>
namespace GL {
@@ -69,4 +70,37 @@ void VertexBuffer::BindVertexAttribs() const {
glVertexAttribPointer(pointer.m_Index, static_cast<GLint>(pointer.m_Size), GL_FLOAT, false, m_DataStride * sizeof(float), reinterpret_cast<void*>(pointer.m_Offset));
}
}
Texture::Texture(const char* textureData, int width, int height, int comp) {
glGenTextures(1, &m_ID);
Bind();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
assert(comp == 3 || comp == 4);
if (comp == 3)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB,
GL_UNSIGNED_BYTE, textureData);
else
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA,
GL_UNSIGNED_BYTE, textureData);
Unbind();
}
Texture::~Texture() {
glDeleteTextures(1, &m_ID);
}
void Texture::Bind() const {
glBindTexture(GL_TEXTURE_2D, m_ID);
}
void Texture::Unbind() {
glBindTexture(GL_TEXTURE_2D, 0);
}
}

View File

@@ -0,0 +1,216 @@
#include "Defines.h"
#include "render/loader/MobLoader.h"
#include "render/loader/TextureLoader.h"
#include <fstream>
#include <map>
#include <sstream>
#include <algorithm>
namespace td {
namespace render {
TexturedModel::TexturedModel(GL::VertexArray&& vao, GL::Texture&& texture) {
m_Vao = std::make_unique<GL::VertexArray>(std::move(vao));
m_Texture = std::make_unique<GL::Texture>(std::move(texture));
}
TexturedModel::TexturedModel(TexturedModel&& other) {
m_Vao = std::move(other.m_Vao);
m_Texture = std::move(other.m_Texture);
m_Positon = other.m_Positon;
m_Color = other.m_Color;
}
namespace MobLoader {
const static int POSITION_VERTEX_SIZE = 3;
const static int TEXTURE_VERTEX_SIZE = 2;
typedef Vec3f Vertex;
typedef Vec2f TextureUV;
typedef Vec3f Normal;
struct Index {
std::size_t vertexIndex;
std::size_t textureIndex;
std::size_t normalIndex;
};
enum DataType : std::uint8_t {
dt_Vertex,
dt_Texture,
dt_Normal,
dt_Index,
dt_None
};
static DataType GetDataType(const std::string& type) {
static const std::map<std::string, DataType> Types = {
{"v", dt_Vertex},
{"vt", dt_Texture},
{"vn", dt_Normal},
{"f", dt_Index}
};
auto it = Types.find(type);
return it != Types.end() ? it->second : dt_None;
}
static GL::VertexArray LoadMobVao(const std::string& objFile) {
std::ifstream fileStream{ objFile };
std::string line;
std::vector<Vertex> tempVertecies;
std::vector<TextureUV> tempTextureUvs;
std::vector<Normal> tempNormals;
std::vector<float> vertecies;
std::vector<float> textureUvs;
std::vector<float> normals;
while (getline(fileStream, line)) {
std::replace(line.begin(), line.end(), '/', ' ');
std::stringstream ss;
ss << line;
std::string typeStr;
ss >> typeStr;
DataType dataType = GetDataType(typeStr);
switch (dataType) {
case dt_Vertex: {
Vertex vertex;
ss >> vertex.x;
ss >> vertex.y;
ss >> vertex.z;
tempVertecies.push_back(vertex);
break;
}
case dt_Texture: {
TextureUV texture;
ss >> texture.x;
ss >> texture.y;
tempTextureUvs.push_back(texture);
break;
}
case dt_Normal: {
Normal normal;
ss >> normal.x;
ss >> normal.y;
ss >> normal.z;
tempNormals.push_back(normal);
break;
}
case dt_Index: {
Index tempIndicies[4];
for (std::size_t i = 0; i < 4; i++){
ss >> tempIndicies[i].vertexIndex;
ss >> tempIndicies[i].textureIndex;
ss >> tempIndicies[i].normalIndex;
}
static const std::vector<std::size_t> vertexOrder = {0, 1, 2, 0, 2, 3};
for(std::size_t i = 0; i < vertexOrder.size(); i++) {
Index& index = tempIndicies[vertexOrder[i]];
std::size_t vertexIndex = index.vertexIndex - 1;
std::size_t textureIndex = index.textureIndex - 1;
std::size_t normalIndex = index.normalIndex - 1;
Vertex vertex = tempVertecies[vertexIndex];
TextureUV texture = tempTextureUvs[textureIndex];
Normal normal = tempNormals[normalIndex];
vertecies.push_back(vertex.x);
vertecies.push_back(vertex.y);
vertecies.push_back(vertex.z);
textureUvs.push_back(texture.x);
textureUvs.push_back(1.0f - texture.y);
normals.push_back(normal.x);
normals.push_back(normal.y);
normals.push_back(normal.z);
}
break;
}
default:
break;
}
}
GL::VertexBuffer positionVBO(vertecies, POSITION_VERTEX_SIZE);
positionVBO.AddVertexAttribPointer(0, POSITION_VERTEX_SIZE, 0);
GL::VertexBuffer textureVBO(textureUvs, TEXTURE_VERTEX_SIZE);
textureVBO.AddVertexAttribPointer(1, TEXTURE_VERTEX_SIZE, 0);
GL::VertexArray mobVao(vertecies.size() / POSITION_VERTEX_SIZE); // each pos = 1 color
mobVao.Bind();
mobVao.BindVertexBuffer(positionVBO);
mobVao.BindVertexBuffer(textureVBO);
mobVao.Unbind();
return mobVao;
}
TexturedModel LoadMobModel(game::MobType mobType) {
switch (mobType){
case game::MobType::Blaze:
return {LoadMobVao("Assets/blaze.obj"), TextureLoader::LoadTexture("Assets/blaze.png")};
case game::MobType::Creeper:
return {LoadMobVao("Assets/creeper.obj"), TextureLoader::LoadTexture("Assets/creeper.png")};
case game::MobType::Giant:
return {LoadMobVao("Assets/giant.obj"), TextureLoader::LoadTexture("Assets/giant.png")};
case game::MobType::Pigman:
return {LoadMobVao("Assets/zombified_piglin.obj"), TextureLoader::LoadTexture("Assets/zombified_piglin.png")};
case game::MobType::Silverfish:
return {LoadMobVao("Assets/silverfish.obj"), TextureLoader::LoadTexture("Assets/silverfish.png")};
case game::MobType::Skeleton:
return {LoadMobVao("Assets/skeleton.obj"), TextureLoader::LoadTexture("Assets/skeleton.png")};
case game::MobType::Slime:
return {LoadMobVao("Assets/slime.obj"), TextureLoader::LoadTexture("Assets/slime.png")};
case game::MobType::Spider :
return {LoadMobVao("Assets/spider.obj"), TextureLoader::LoadTexture("Assets/spider.png")};
case game::MobType::Witch :
return {LoadMobVao("Assets/witch.obj"), TextureLoader::LoadTexture("Assets/witch.png")};
case game::MobType::Zombie :
return {LoadMobVao("Assets/zombie.obj"), TextureLoader::LoadTexture("Assets/zombie.png")};
default:
return {LoadMobVao("Assets/armor_stand.obj"), TextureLoader::LoadTexture("Assets/armor_stand.png")};
}
}
} // namespace MobLoader
} // namespace render
} // namespace td

View File

@@ -10,37 +10,29 @@
#include "render/loader/stb_image.h"
#include <iostream>
#include "render/GL.h"
#include "misc/Log.h"
#include "misc/Format.h"
namespace TextureLoader {
unsigned int LoadGLTexture(const char* fileName) {
GL::Texture LoadTexture(const std::string& fileName) {
int width, height, comp;
const unsigned char* image = stbi_load(fileName, &width, &height, &comp, STBI_rgb_alpha);
const unsigned char* image = stbi_load(fileName.c_str(), &width, &height, &comp, STBI_rgb_alpha);
if (image == nullptr) {
std::cerr << "Erreur lors du chargement de la texture !" << std::endl;
td::utils::LOGE("Erreur lors du chargement de la texture !");
throw(std::runtime_error("Failed to load texture"));
}
GLuint textureID;
glGenTextures(1, &textureID);
glBindTexture(GL_TEXTURE_2D, textureID);
GL::Texture texture {reinterpret_cast<const char*>(image), width, height, comp};
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
delete image;
if (comp == 3)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB,
GL_UNSIGNED_BYTE, image);
else if (comp == 4)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA,
GL_UNSIGNED_BYTE, image);
td::utils::LOGD(td::utils::format("Texture %s chargée !", fileName.c_str()));
glBindTexture(GL_TEXTURE_2D, 0);
stbi_image_free((void*)image);
return textureID;
return texture;
}
}

View File

@@ -5,48 +5,15 @@
#include "game/BaseGame.h"
#include "misc/Random.h"
namespace td {
namespace render {
namespace WorldLoader {
GL::VertexArray LoadMobModel() {
std::vector<float> positions = {
-0.5, -0.5,
0.5, -0.5,
-0.5, 0.5,
0.5, -0.5,
-0.5, 0.5,
0.5, 0.5
};
float yellowFloat;
int yellow = 255 << 24 | 255 << 16 | 255;
memcpy(&yellowFloat, &yellow, sizeof(int));
std::vector<float> colors = {
yellowFloat,
yellowFloat,
yellowFloat,
yellowFloat,
yellowFloat,
yellowFloat
};
GL::VertexBuffer positionVBO(positions, 2);
positionVBO.AddVertexAttribPointer(0, 2, 0);
GL::VertexBuffer colorVBO(colors, 1);
colorVBO.AddVertexAttribPointer(1, 1, 0);
GL::VertexArray mobVao(colors.size()); // each pos = 1 color
mobVao.Bind();
mobVao.BindVertexBuffer(positionVBO);
mobVao.BindVertexBuffer(colorVBO);
mobVao.Unbind();
return mobVao;
}
const static int POSITION_VERTEX_SIZE = 3;
const static int TEXTURE_VERTEX_SIZE = 2;
GL::VertexArray LoadWorldModel(const td::game::World* world) {
std::vector<float> positions;
@@ -69,16 +36,16 @@ GL::VertexArray LoadWorldModel(const td::game::World* world) {
continue;
positions.insert(positions.end(), {
static_cast<float>(chunkX + tileX), static_cast<float>(chunkY + tileY),
static_cast<float>(chunkX + tileX + 1), static_cast<float>(chunkY + tileY),
static_cast<float>(chunkX + tileX), static_cast<float>(chunkY + tileY + 1),
static_cast<float>(chunkX + tileX + 1), 0, static_cast<float>(chunkY + tileY),
static_cast<float>(chunkX + tileX), 0, static_cast<float>(chunkY + tileY),
static_cast<float>(chunkX + tileX), 0, static_cast<float>(chunkY + tileY + 1),
static_cast<float>(chunkX + tileX + 1), static_cast<float>(chunkY + tileY),
static_cast<float>(chunkX + tileX), static_cast<float>(chunkY + tileY + 1),
static_cast<float>(chunkX + tileX + 1), static_cast<float>(chunkY + tileY + 1),
static_cast<float>(chunkX + tileX + 1), 0, static_cast<float>(chunkY + tileY),
static_cast<float>(chunkX + tileX), 0, static_cast<float>(chunkY + tileY + 1),
static_cast<float>(chunkX + tileX + 1), 0, static_cast<float>(chunkY + tileY + 1)
});
const td::game::Color* tileColor = world->GetTileColor(tile);
const td::Color* tileColor = world->GetTileColor(tile);
for (int i = 0; i < 6; i++) {
int color = 255;
@@ -101,13 +68,13 @@ GL::VertexArray LoadWorldModel(const td::game::World* world) {
float fromY = spawn.GetTopLeft().GetY(), toY = spawn.GetBottomRight().GetY();
positions.insert(positions.end(), {
fromX, fromY,
fromX, toY,
toX, fromY,
fromX, 0, fromY,
fromX, 0, toY,
toX, 0, fromY,
toX, toY,
fromX, toY,
toX, fromY,
fromX, 0, toY,
toX, 0, toY,
toX, 0, fromY,
});
for (int i = 0; i < 6; i++) {
@@ -129,13 +96,13 @@ GL::VertexArray LoadWorldModel(const td::game::World* world) {
float fromY = castle.GetTopLeft().GetY(), toY = castle.GetBottomRight().GetY();
positions.insert(positions.end(), {
fromX, fromY,
fromX, toY,
toX, fromY,
fromX, 0, fromY,
fromX, 0, toY,
toX, 0, fromY,
toX, toY,
fromX, toY,
toX, fromY,
fromX, 0, toY,
toX, 0, toY,
toX, 0, fromY,
});
for (int i = 0; i < 6; i++) {
@@ -151,12 +118,12 @@ GL::VertexArray LoadWorldModel(const td::game::World* world) {
}
}
GL::VertexBuffer positionVBO(positions, 2);
positionVBO.AddVertexAttribPointer(0, 2, 0);
GL::VertexBuffer positionVBO(positions, POSITION_VERTEX_SIZE);
positionVBO.AddVertexAttribPointer(0, POSITION_VERTEX_SIZE, 0);
GL::VertexBuffer colorVBO(colors, 1);
colorVBO.AddVertexAttribPointer(1, 1, 0);
GL::VertexArray worldVao(positions.size() / 2); // each pos = 2 vertecies
GL::VertexArray worldVao(positions.size() / POSITION_VERTEX_SIZE); // each pos = 3 vertecies
worldVao.Bind();
worldVao.BindVertexBuffer(positionVBO);
worldVao.BindVertexBuffer(colorVBO);
@@ -166,13 +133,13 @@ GL::VertexArray LoadWorldModel(const td::game::World* world) {
GL::VertexArray LoadTileSelectModel() {
std::vector<float> positions = {
0, 0,
1, 0,
0, 1,
1, .01, 0,
0, .01, 0,
0, .01, 1,
1, 0,
0, 1,
1, 1
1, .01, 0,
0, .01, 1,
1, .01, 1
};
int color = 255 << 24 | 255 << 16 | 255 << 8 | 150;
@@ -182,12 +149,12 @@ GL::VertexArray LoadTileSelectModel() {
std::vector<float> colors(6, colorFloat);
GL::VertexBuffer positionVBO(positions, 2);
positionVBO.AddVertexAttribPointer(0, 2, 0);
GL::VertexBuffer positionVBO(positions, POSITION_VERTEX_SIZE);
positionVBO.AddVertexAttribPointer(0, POSITION_VERTEX_SIZE, 0);
GL::VertexBuffer colorVBO(colors, 1);
colorVBO.AddVertexAttribPointer(1, 1, 0);
GL::VertexArray tileSelectVao(positions.size() / 2); // each pos = 2 vertecies
GL::VertexArray tileSelectVao(positions.size() / POSITION_VERTEX_SIZE);
tileSelectVao.Bind();
tileSelectVao.BindVertexBuffer(positionVBO);
tileSelectVao.BindVertexBuffer(colorVBO);
@@ -216,13 +183,13 @@ RenderData LoadTowerModel(game::TowerPtr tower) {
towerDY = tower->GetCenterY() + 2.5f;
}
std::vector<float> positions = {
towerX, towerY,
towerDX, towerY,
towerX, towerDY,
towerDX, 0.001, towerY,
towerX, 0.001, towerY,
towerX, 0.001, towerDY,
towerDX, towerY,
towerX, towerDY,
towerDX, towerDY
towerDX, 0.001, towerY,
towerX, 0.001, towerDY,
towerDX, 0.001, towerDY
};
renderData.positions = positions;

View File

@@ -3,30 +3,26 @@
namespace td {
namespace shader {
// TODO: update ES shaders
#ifdef __ANDROID__
static const char vertexSource[] =
R"(#version 300 es
precision mediump float;
layout(location = 0) in vec2 position;
layout(location = 0) in vec3 position;
layout(location = 1) in int color;
uniform vec2 camPos;
uniform float zoom;
uniform float aspectRatio;
uniform vec2 translation;
uniform float isometricView;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
uniform vec3 modelPosition;
flat out int pass_color;
void main(void){
float modelX = position.x + translation.x;
float modelY = position.y + translation.y;
float x = (modelX - camPos.x - (modelY - camPos.y) * isometricView) / aspectRatio * zoom;
float y = ((0.5 * (modelX - camPos.x) + 0.5 * (modelY - camPos.y)) * isometricView + (modelY - camPos.y) * (1.0 - isometricView)) * zoom;
pass_color = color;
gl_Position = vec4(x, -y, 0.0, 1.0);
gl_Position = projectionMatrix * viewMatrix * vec4(position + modelPosition, 1.0);
}
)";
@@ -39,13 +35,16 @@ flat in int pass_color;
out vec4 out_color;
uniform vec3 ColorEffect;
void main(void){
float r = float(pass_color >> 24 & 0xFF) / 255.0;
float g = float(pass_color >> 16 & 0xFF) / 255.0;
float b = float(pass_color >> 8 & 0xFF) / 255.0;
float a = float(pass_color & 0xFF) / 255.0;
out_color = vec4(r, g, b, a);
vec3 intermediate_color = vec3(r, g, b) * ColorEffect;
out_color = vec4(intermediate_color, a);
}
)";
@@ -53,41 +52,39 @@ void main(void){
static const char vertexSource[] = R"(
#version 330
layout(location = 0) in vec2 position;
layout(location = 1) in int color;
layout(location = 0) in vec3 position;
layout(location = 1) in vec2 textureCoords;
uniform vec2 camPos;
uniform float zoom;
uniform float aspectRatio;
uniform vec2 translation;
uniform float isometricView;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
uniform vec3 modelPosition;
flat out int pass_color;
out vec2 pass_textureCoords;
void main(void){
float modelX = position.x + translation.x;
float modelY = position.y + translation.y;
float x = (modelX - camPos.x - (modelY - camPos.y) * isometricView) / aspectRatio * zoom;
float y = ((0.5 * (modelX - camPos.x) + 0.5 * (modelY - camPos.y)) * isometricView + (modelY - camPos.y) * (1.0 - isometricView)) * zoom;
pass_color = color;
gl_Position = vec4(x, -y, 0.0, 1.0);
pass_textureCoords = textureCoords;
gl_Position = projectionMatrix * viewMatrix * vec4(position + modelPosition, 1.0);
}
)";
static const char fragmentSource[] = R"(
#version 330
flat in int pass_color;
in vec2 pass_textureCoords;
out vec4 out_color;
uniform vec3 ColorEffect;
uniform sampler2D textureSampler;
void main(void){
float r = float(pass_color >> 24 & 0xFF) / 255.0;
float g = float(pass_color >> 16 & 0xFF) / 255.0;
float b = float(pass_color >> 8 & 0xFF) / 255.0;
float a = float(pass_color & 0xFF) / 255.0;
out_color = vec4(r, g, b, a);
vec4 color = vec4(ColorEffect, 1.0) * texture(textureSampler, pass_textureCoords);
if (color.a <= 0.1)
discard;
out_color = color;
}
)";
@@ -100,29 +97,27 @@ void EntityShader::LoadShader() {
}
void EntityShader::GetAllUniformLocation() {
m_LocationAspectRatio = static_cast<unsigned int>(GetUniformLocation("aspectRatio"));
m_LocationZoom = static_cast<unsigned int>(GetUniformLocation("zoom"));
m_LocationCam = static_cast<unsigned int>(GetUniformLocation("camPos"));
m_LocationTranslation = static_cast<unsigned int>(GetUniformLocation("translation"));
m_LocationViewtype = static_cast<unsigned int>(GetUniformLocation("isometricView"));
m_LocationColorEffect = static_cast<unsigned int>(GetUniformLocation("ColorEffect"));
m_LocationViewMatrix = static_cast<unsigned int>(GetUniformLocation("viewMatrix"));
m_LocationPosition = static_cast<unsigned int>(GetUniformLocation("modelPosition"));
m_LocationProjectionMatrix = static_cast<unsigned int>(GetUniformLocation("projectionMatrix"));
}
void EntityShader::SetCamPos(const Vec2f& camPos) {
LoadVector(m_LocationCam, camPos);
}
void EntityShader::SetZoom(float zoom) {
LoadFloat(m_LocationZoom, zoom);
}
void EntityShader::SetAspectRatio(float aspectRatio) {
LoadFloat(m_LocationAspectRatio, aspectRatio);
}
void EntityShader::SetModelPos(const Vec2f& modelPos) {
LoadVector(m_LocationTranslation, modelPos);
}
void EntityShader::SetIsometricView(float isometric) {
LoadFloat(m_LocationViewtype, isometric);
void EntityShader::SetColorEffect(const Vec3f& color) {
LoadVector(m_LocationColorEffect, color);
}
void EntityShader::SetProjectionMatrix(const Mat4f& proj) const {
LoadMat4(m_LocationProjectionMatrix, proj);
}
void EntityShader::SetViewMatrix(const Mat4f& view) const {
LoadMat4(m_LocationViewMatrix, view);
}
void EntityShader::SetModelPos(const Vec3f& pos) const {
LoadVector(m_LocationPosition, pos);
}
} // namespace shader
} // namespace td

View File

@@ -67,6 +67,10 @@ void ShaderProgram::LoadBoolean(unsigned int location, bool value) const {
glUniform1i(static_cast<GLint>(location), value);
}
void ShaderProgram::LoadMat4(unsigned int location, const Mat4f& mat) const {
glUniformMatrix4fv(static_cast<GLint>(location), 1, false, reinterpret_cast<const float*>(&mat));
}
void ShaderProgram::CleanUp() const {
Stop();
glDetachShader(m_ProgramID, m_VertexShaderID);
@@ -118,6 +122,12 @@ unsigned int ShaderProgram::LoadShader(const std::string& source, GLenum type) {
utils::LOGE("Could not compile shader !");
utils::LOGE(shaderError.data());
utils::LOGD(utils::format("\nShader source : \n"
"------------------------------------------------------------------------------------------------------------------------------------\n"
"%s\n"
"------------------------------------------------------------------------------------------------------------------------------------\n"
, source.c_str()));
}
return shaderID;
}

View File

@@ -3,27 +3,25 @@
namespace td {
namespace shader {
// TODO: GLES Shaders
#ifdef __ANDROID__
static const char vertexSource[] =
R"(#version 300 es
precision mediump float;
layout(location = 0) in vec2 position;
layout(location = 0) in vec3 position;
layout(location = 1) in int color;
uniform vec2 camPos;
uniform float zoom;
uniform float aspectRatio;
uniform float isometricView;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
flat out int pass_color;
void main(void){
float x = (position.x - camPos.x - (position.y - camPos.y) * isometricView) / aspectRatio * zoom;
float y = ((0.5 * (position.x - camPos.x) + 0.5 * (position.y - camPos.y)) * isometricView + (position.y - camPos.y) * (1.0 - isometricView)) * zoom;
pass_color = color;
gl_Position = vec4(x, -y, 0.0, 1.0);
gl_Position = projectionMatrix * viewMatrix * vec4(position, 1.0);
}
)";
@@ -50,21 +48,17 @@ void main(void){
static const char vertexSource[] = R"(
#version 330
layout(location = 0) in vec2 position;
layout(location = 0) in vec3 position;
layout(location = 1) in int color;
uniform vec2 camPos;
uniform float zoom;
uniform float aspectRatio;
uniform float isometricView;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
flat out int pass_color;
void main(void){
float x = (position.x - camPos.x - (position.y - camPos.y) * isometricView) / aspectRatio * zoom;
float y = ((0.5 * (position.x - camPos.x) + 0.5 * (position.y - camPos.y)) * isometricView + (position.y - camPos.y) * (1.0 - isometricView)) * zoom;
pass_color = color;
gl_Position = vec4(x, -y, 0.0, 1.0);
gl_Position = projectionMatrix * viewMatrix * vec4(position, 1.0);
}
)";
@@ -94,23 +88,16 @@ void WorldShader::LoadShader() {
}
void WorldShader::GetAllUniformLocation() {
m_LocationAspectRatio = static_cast<unsigned int>(GetUniformLocation("aspectRatio"));
m_LocationZoom = static_cast<unsigned int>(GetUniformLocation("zoom"));
m_LocationCam = static_cast<unsigned int>(GetUniformLocation("camPos"));
m_LocationViewtype = static_cast<unsigned int>(GetUniformLocation("isometricView"));
m_LocationProjection = static_cast<unsigned int>(GetUniformLocation("projectionMatrix"));
m_LocationView = static_cast<unsigned int>(GetUniformLocation("viewMatrix"));
}
void WorldShader::SetCamPos(const Vec2f& camPos) {
LoadVector(m_LocationCam, camPos);
void WorldShader::SetProjectionMatrix(const Mat4f& proj) const {
LoadMat4(m_LocationProjection, proj);
}
void WorldShader::SetZoom(float zoom) {
LoadFloat(m_LocationZoom, zoom);
}
void WorldShader::SetAspectRatio(float aspectRatio) {
LoadFloat(m_LocationAspectRatio, aspectRatio);
}
void WorldShader::SetIsometricView(float isometric) {
LoadFloat(m_LocationViewtype, isometric);
void WorldShader::SetViewMatrix(const Mat4f& view) const {
LoadMat4(m_LocationView, view);
}
} // namespace shader

463
test/Assets/armor_stand.obj Normal file
View File

@@ -0,0 +1,463 @@
# Made in Blockbench 4.7.4
mtllib armor_stand.mtl
o head
v 0.0625 1.875 0.0625
v 0.0625 1.875 -0.0625
v 0.0625 1.4375 0.0625
v 0.0625 1.4375 -0.0625
v -0.0625 1.875 -0.0625
v -0.0625 1.875 0.0625
v -0.0625 1.4375 -0.0625
v -0.0625 1.4375 0.0625
vt 0.03125 0.96875
vt 0.0625 0.96875
vt 0.0625 0.859375
vt 0.03125 0.859375
vt 0 0.96875
vt 0.03125 0.96875
vt 0.03125 0.859375
vt 0 0.859375
vt 0.09375 0.96875
vt 0.125 0.96875
vt 0.125 0.859375
vt 0.09375 0.859375
vt 0.0625 0.96875
vt 0.09375 0.96875
vt 0.09375 0.859375
vt 0.0625 0.859375
vt 0.0625 0.96875
vt 0.03125 0.96875
vt 0.03125 1
vt 0.0625 1
vt 0.09375 1
vt 0.0625 1
vt 0.0625 0.96875
vt 0.09375 0.96875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_008ca971-b56b-ee8d-d41a-6f8b49501f97
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o body
v 0.375 1.5 0.09375
v 0.375 1.5 -0.09375
v 0.375 1.3125 0.09375
v 0.375 1.3125 -0.09375
v -0.375 1.5 -0.09375
v -0.375 1.5 0.09375
v -0.375 1.3125 -0.09375
v -0.375 1.3125 0.09375
vt 0.046875 0.546875
vt 0.234375 0.546875
vt 0.234375 0.5
vt 0.046875 0.5
vt 0 0.546875
vt 0.046875 0.546875
vt 0.046875 0.5
vt 0 0.5
vt 0.28125 0.546875
vt 0.46875 0.546875
vt 0.46875 0.5
vt 0.28125 0.5
vt 0.234375 0.546875
vt 0.28125 0.546875
vt 0.28125 0.5
vt 0.234375 0.5
vt 0.234375 0.546875
vt 0.046875 0.546875
vt 0.046875 0.59375
vt 0.234375 0.59375
vt 0.421875 0.59375
vt 0.234375 0.59375
vt 0.234375 0.546875
vt 0.421875 0.546875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_008ca971-b56b-ee8d-d41a-6f8b49501f97
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o left_arm
v -0.3125 1.5 0.0625
v -0.3125 1.5 -0.0625
v -0.3125 0.75 0.0625
v -0.3125 0.75 -0.0625
v -0.4375 1.5 -0.0625
v -0.4375 1.5 0.0625
v -0.4375 0.75 -0.0625
v -0.4375 0.75 0.0625
vt 0.5625 0.71875
vt 0.53125 0.71875
vt 0.53125 0.53125
vt 0.5625 0.53125
vt 0.59375 0.71875
vt 0.5625 0.71875
vt 0.5625 0.53125
vt 0.59375 0.53125
vt 0.625 0.71875
vt 0.59375 0.71875
vt 0.59375 0.53125
vt 0.625 0.53125
vt 0.53125 0.71875
vt 0.5 0.71875
vt 0.5 0.53125
vt 0.53125 0.53125
vt 0.53125 0.71875
vt 0.5625 0.71875
vt 0.5625 0.75
vt 0.53125 0.75
vt 0.5625 0.75
vt 0.59375 0.75
vt 0.59375 0.71875
vt 0.5625 0.71875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_008ca971-b56b-ee8d-d41a-6f8b49501f97
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o right_arm
v 0.4375 1.5 0.0625
v 0.4375 1.5 -0.0625
v 0.4375 0.75 0.0625
v 0.4375 0.75 -0.0625
v 0.3125 1.5 -0.0625
v 0.3125 1.5 0.0625
v 0.3125 0.75 -0.0625
v 0.3125 0.75 0.0625
vt 0.40625 0.96875
vt 0.4375 0.96875
vt 0.4375 0.78125
vt 0.40625 0.78125
vt 0.375 0.96875
vt 0.40625 0.96875
vt 0.40625 0.78125
vt 0.375 0.78125
vt 0.46875 0.96875
vt 0.5 0.96875
vt 0.5 0.78125
vt 0.46875 0.78125
vt 0.4375 0.96875
vt 0.46875 0.96875
vt 0.46875 0.78125
vt 0.4375 0.78125
vt 0.4375 0.96875
vt 0.40625 0.96875
vt 0.40625 1
vt 0.4375 1
vt 0.46875 1
vt 0.4375 1
vt 0.4375 0.96875
vt 0.46875 0.96875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_008ca971-b56b-ee8d-d41a-6f8b49501f97
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o left_leg
v -0.05625000000000002 0.75 0.0625
v -0.05625000000000002 0.75 -0.0625
v -0.05625000000000002 0.0625 0.0625
v -0.05625000000000002 0.0625 -0.0625
v -0.18125000000000002 0.75 -0.0625
v -0.18125000000000002 0.75 0.0625
v -0.18125000000000002 0.0625 -0.0625
v -0.18125000000000002 0.0625 0.0625
vt 0.6875 0.71875
vt 0.65625 0.71875
vt 0.65625 0.546875
vt 0.6875 0.546875
vt 0.71875 0.71875
vt 0.6875 0.71875
vt 0.6875 0.546875
vt 0.71875 0.546875
vt 0.75 0.71875
vt 0.71875 0.71875
vt 0.71875 0.546875
vt 0.75 0.546875
vt 0.65625 0.71875
vt 0.625 0.71875
vt 0.625 0.546875
vt 0.65625 0.546875
vt 0.65625 0.71875
vt 0.6875 0.71875
vt 0.6875 0.75
vt 0.65625 0.75
vt 0.6875 0.75
vt 0.71875 0.75
vt 0.71875 0.71875
vt 0.6875 0.71875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_008ca971-b56b-ee8d-d41a-6f8b49501f97
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30
o right_leg
v 0.19062500000000004 0.75 0.0625
v 0.19062500000000004 0.75 -0.0625
v 0.19062500000000004 0.0625 0.0625
v 0.19062500000000004 0.0625 -0.0625
v 0.06562500000000004 0.75 -0.0625
v 0.06562500000000004 0.75 0.0625
v 0.06562500000000004 0.0625 -0.0625
v 0.06562500000000004 0.0625 0.0625
vt 0.15625 0.96875
vt 0.1875 0.96875
vt 0.1875 0.796875
vt 0.15625 0.796875
vt 0.125 0.96875
vt 0.15625 0.96875
vt 0.15625 0.796875
vt 0.125 0.796875
vt 0.21875 0.96875
vt 0.25 0.96875
vt 0.25 0.796875
vt 0.21875 0.796875
vt 0.1875 0.96875
vt 0.21875 0.96875
vt 0.21875 0.796875
vt 0.1875 0.796875
vt 0.1875 0.96875
vt 0.15625 0.96875
vt 0.15625 1
vt 0.1875 1
vt 0.21875 1
vt 0.1875 1
vt 0.1875 0.96875
vt 0.21875 0.96875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_008ca971-b56b-ee8d-d41a-6f8b49501f97
f 44/124/31 47/123/31 45/122/31 42/121/31
f 43/128/32 44/127/32 42/126/32 41/125/32
f 48/132/33 43/131/33 41/130/33 46/129/33
f 47/136/34 48/135/34 46/134/34 45/133/34
f 46/140/35 41/139/35 42/138/35 45/137/35
f 47/144/36 44/143/36 43/142/36 48/141/36
o right
v -0.0625 1.3125 0.0625
v -0.0625 1.3125 -0.0625
v -0.0625 0.875 0.0625
v -0.0625 0.875 -0.0625
v -0.1875 1.3125 -0.0625
v -0.1875 1.3125 0.0625
v -0.1875 0.875 -0.0625
v -0.1875 0.875 0.0625
vt 0.78125 0.71875
vt 0.8125 0.71875
vt 0.8125 0.609375
vt 0.78125 0.609375
vt 0.75 0.71875
vt 0.78125 0.71875
vt 0.78125 0.609375
vt 0.75 0.609375
vt 0.84375 0.71875
vt 0.875 0.71875
vt 0.875 0.609375
vt 0.84375 0.609375
vt 0.8125 0.71875
vt 0.84375 0.71875
vt 0.84375 0.609375
vt 0.8125 0.609375
vt 0.8125 0.71875
vt 0.78125 0.71875
vt 0.78125 0.75
vt 0.8125 0.75
vt 0.84375 0.75
vt 0.8125 0.75
vt 0.8125 0.71875
vt 0.84375 0.71875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_008ca971-b56b-ee8d-d41a-6f8b49501f97
f 52/148/37 55/147/37 53/146/37 50/145/37
f 51/152/38 52/151/38 50/150/38 49/149/38
f 56/156/39 51/155/39 49/154/39 54/153/39
f 55/160/40 56/159/40 54/158/40 53/157/40
f 54/164/41 49/163/41 50/162/41 53/161/41
f 55/168/42 52/167/42 51/166/42 56/165/42
o left
v 0.1875 1.3125 0.0625
v 0.1875 1.3125 -0.0625
v 0.1875 0.875 0.0625
v 0.1875 0.875 -0.0625
v 0.0625 1.3125 -0.0625
v 0.0625 1.3125 0.0625
v 0.0625 0.875 -0.0625
v 0.0625 0.875 0.0625
vt 0.28125 0.96875
vt 0.3125 0.96875
vt 0.3125 0.859375
vt 0.28125 0.859375
vt 0.25 0.96875
vt 0.28125 0.96875
vt 0.28125 0.859375
vt 0.25 0.859375
vt 0.34375 0.96875
vt 0.375 0.96875
vt 0.375 0.859375
vt 0.34375 0.859375
vt 0.3125 0.96875
vt 0.34375 0.96875
vt 0.34375 0.859375
vt 0.3125 0.859375
vt 0.3125 0.96875
vt 0.28125 0.96875
vt 0.28125 1
vt 0.3125 1
vt 0.34375 1
vt 0.3125 1
vt 0.3125 0.96875
vt 0.34375 0.96875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_008ca971-b56b-ee8d-d41a-6f8b49501f97
f 60/172/43 63/171/43 61/170/43 58/169/43
f 59/176/44 60/175/44 58/174/44 57/173/44
f 64/180/45 59/179/45 57/178/45 62/177/45
f 63/184/46 64/183/46 62/182/46 61/181/46
f 62/188/47 57/187/47 58/186/47 61/185/47
f 63/192/48 60/191/48 59/190/48 64/189/48
o waist
v 0.25 0.875 0.0625
v 0.25 0.875 -0.0625
v 0.25 0.75 0.0625
v 0.25 0.75 -0.0625
v -0.25 0.875 -0.0625
v -0.25 0.875 0.0625
v -0.25 0.75 -0.0625
v -0.25 0.75 0.0625
vt 0.03125 0.21875
vt 0.15625 0.21875
vt 0.15625 0.1875
vt 0.03125 0.1875
vt 0 0.21875
vt 0.03125 0.21875
vt 0.03125 0.1875
vt 0 0.1875
vt 0.1875 0.21875
vt 0.3125 0.21875
vt 0.3125 0.1875
vt 0.1875 0.1875
vt 0.15625 0.21875
vt 0.1875 0.21875
vt 0.1875 0.1875
vt 0.15625 0.1875
vt 0.15625 0.21875
vt 0.03125 0.21875
vt 0.03125 0.25
vt 0.15625 0.25
vt 0.28125 0.25
vt 0.15625 0.25
vt 0.15625 0.21875
vt 0.28125 0.21875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_008ca971-b56b-ee8d-d41a-6f8b49501f97
f 68/196/49 71/195/49 69/194/49 66/193/49
f 67/200/50 68/199/50 66/198/50 65/197/50
f 72/204/51 67/203/51 65/202/51 70/201/51
f 71/208/52 72/207/52 70/206/52 69/205/52
f 70/212/53 65/211/53 66/210/53 69/209/53
f 71/216/54 68/215/54 67/214/54 72/213/54
o base
v 0.375 0.0625 0.375
v 0.375 0.0625 -0.375
v 0.375 0 0.375
v 0.375 0 -0.375
v -0.375 0.0625 -0.375
v -0.375 0.0625 0.375
v -0.375 0 -0.375
v -0.375 0 0.375
vt 0.1875 0.3125
vt 0.375 0.3125
vt 0.375 0.296875
vt 0.1875 0.296875
vt 0 0.3125
vt 0.1875 0.3125
vt 0.1875 0.296875
vt 0 0.296875
vt 0.5625 0.3125
vt 0.75 0.3125
vt 0.75 0.296875
vt 0.5625 0.296875
vt 0.375 0.3125
vt 0.5625 0.3125
vt 0.5625 0.296875
vt 0.375 0.296875
vt 0.375 0.3125
vt 0.1875 0.3125
vt 0.1875 0.5
vt 0.375 0.5
vt 0.5625 0.5
vt 0.375 0.5
vt 0.375 0.3125
vt 0.5625 0.3125
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_008ca971-b56b-ee8d-d41a-6f8b49501f97
f 76/220/55 79/219/55 77/218/55 74/217/55
f 75/224/56 76/223/56 74/222/56 73/221/56
f 80/228/57 75/227/57 73/226/57 78/225/57
f 79/232/58 80/231/58 78/230/58 77/229/58
f 78/236/59 73/235/59 74/234/59 77/233/59
f 79/240/60 76/239/60 75/238/60 80/237/60

BIN
test/Assets/armor_stand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

601
test/Assets/blaze.obj Normal file
View File

@@ -0,0 +1,601 @@
# Made in Blockbench 4.7.4
mtllib blaze.mtl
o head
v 0.25 1.75 0.25
v 0.25 1.75 -0.25
v 0.25 1.25 0.25
v 0.25 1.25 -0.25
v -0.25 1.75 -0.25
v -0.25 1.75 0.25
v -0.25 1.25 -0.25
v -0.25 1.25 0.25
vt 0.125 0.75
vt 0.25 0.75
vt 0.25 0.5
vt 0.125 0.5
vt 0 0.75
vt 0.125 0.75
vt 0.125 0.5
vt 0 0.5
vt 0.375 0.75
vt 0.5 0.75
vt 0.5 0.5
vt 0.375 0.5
vt 0.25 0.75
vt 0.375 0.75
vt 0.375 0.5
vt 0.25 0.5
vt 0.25 0.75
vt 0.125 0.75
vt 0.125 1
vt 0.25 1
vt 0.375 1
vt 0.25 1
vt 0.25 0.75
vt 0.375 0.75
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o stick1
v 0.5 1.625 -0.375
v 0.5 1.625 -0.5
v 0.5 1.125 -0.375
v 0.5 1.125 -0.5
v 0.375 1.625 -0.5
v 0.375 1.625 -0.375
v 0.375 1.125 -0.5
v 0.375 1.125 -0.375
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o stick2
v -0.375 1.625 -0.375
v -0.375 1.625 -0.5
v -0.375 1.125 -0.375
v -0.375 1.125 -0.5
v -0.5 1.625 -0.5
v -0.5 1.625 -0.375
v -0.5 1.125 -0.5
v -0.5 1.125 -0.375
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o stick3
v -0.375 1.625 0.5
v -0.375 1.625 0.375
v -0.375 1.125 0.5
v -0.375 1.125 0.375
v -0.5 1.625 0.375
v -0.5 1.625 0.5
v -0.5 1.125 0.375
v -0.5 1.125 0.5
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o stick4
v 0.5 1.625 0.5
v 0.5 1.625 0.375
v 0.5 1.125 0.5
v 0.5 1.125 0.375
v 0.375 1.625 0.375
v 0.375 1.625 0.5
v 0.375 1.125 0.375
v 0.375 1.125 0.5
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30
o stick5
v 0.375 1.375 -0.25
v 0.375 1.375 -0.375
v 0.375 0.875 -0.25
v 0.375 0.875 -0.375
v 0.25 1.375 -0.375
v 0.25 1.375 -0.25
v 0.25 0.875 -0.375
v 0.25 0.875 -0.25
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 44/124/31 47/123/31 45/122/31 42/121/31
f 43/128/32 44/127/32 42/126/32 41/125/32
f 48/132/33 43/131/33 41/130/33 46/129/33
f 47/136/34 48/135/34 46/134/34 45/133/34
f 46/140/35 41/139/35 42/138/35 45/137/35
f 47/144/36 44/143/36 43/142/36 48/141/36
o stick6
v -0.25 1.375 -0.25
v -0.25 1.375 -0.375
v -0.25 0.875 -0.25
v -0.25 0.875 -0.375
v -0.375 1.375 -0.375
v -0.375 1.375 -0.25
v -0.375 0.875 -0.375
v -0.375 0.875 -0.25
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 52/148/37 55/147/37 53/146/37 50/145/37
f 51/152/38 52/151/38 50/150/38 49/149/38
f 56/156/39 51/155/39 49/154/39 54/153/39
f 55/160/40 56/159/40 54/158/40 53/157/40
f 54/164/41 49/163/41 50/162/41 53/161/41
f 55/168/42 52/167/42 51/166/42 56/165/42
o stick7
v -0.25 1.375 0.375
v -0.25 1.375 0.25
v -0.25 0.875 0.375
v -0.25 0.875 0.25
v -0.375 1.375 0.25
v -0.375 1.375 0.375
v -0.375 0.875 0.25
v -0.375 0.875 0.375
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 60/172/43 63/171/43 61/170/43 58/169/43
f 59/176/44 60/175/44 58/174/44 57/173/44
f 64/180/45 59/179/45 57/178/45 62/177/45
f 63/184/46 64/183/46 62/182/46 61/181/46
f 62/188/47 57/187/47 58/186/47 61/185/47
f 63/192/48 60/191/48 59/190/48 64/189/48
o stick8
v 0.375 1.375 0.375
v 0.375 1.375 0.25
v 0.375 0.875 0.375
v 0.375 0.875 0.25
v 0.25 1.375 0.25
v 0.25 1.375 0.375
v 0.25 0.875 0.25
v 0.25 0.875 0.375
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 68/196/49 71/195/49 69/194/49 66/193/49
f 67/200/50 68/199/50 66/198/50 65/197/50
f 72/204/51 67/203/51 65/202/51 70/201/51
f 71/208/52 72/207/52 70/206/52 69/205/52
f 70/212/53 65/211/53 66/210/53 69/209/53
f 71/216/54 68/215/54 67/214/54 72/213/54
o stick9
v 0.25 0.875 -0.125
v 0.25 0.875 -0.25
v 0.25 0.375 -0.125
v 0.25 0.375 -0.25
v 0.125 0.875 -0.25
v 0.125 0.875 -0.125
v 0.125 0.375 -0.25
v 0.125 0.375 -0.125
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 76/220/55 79/219/55 77/218/55 74/217/55
f 75/224/56 76/223/56 74/222/56 73/221/56
f 80/228/57 75/227/57 73/226/57 78/225/57
f 79/232/58 80/231/58 78/230/58 77/229/58
f 78/236/59 73/235/59 74/234/59 77/233/59
f 79/240/60 76/239/60 75/238/60 80/237/60
o stick10
v -0.125 0.875 -0.125
v -0.125 0.875 -0.25
v -0.125 0.375 -0.125
v -0.125 0.375 -0.25
v -0.25 0.875 -0.25
v -0.25 0.875 -0.125
v -0.25 0.375 -0.25
v -0.25 0.375 -0.125
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 84/244/61 87/243/61 85/242/61 82/241/61
f 83/248/62 84/247/62 82/246/62 81/245/62
f 88/252/63 83/251/63 81/250/63 86/249/63
f 87/256/64 88/255/64 86/254/64 85/253/64
f 86/260/65 81/259/65 82/258/65 85/257/65
f 87/264/66 84/263/66 83/262/66 88/261/66
o stick11
v -0.125 0.875 0.25
v -0.125 0.875 0.125
v -0.125 0.375 0.25
v -0.125 0.375 0.125
v -0.25 0.875 0.125
v -0.25 0.875 0.25
v -0.25 0.375 0.125
v -0.25 0.375 0.25
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 92/268/67 95/267/67 93/266/67 90/265/67
f 91/272/68 92/271/68 90/270/68 89/269/68
f 96/276/69 91/275/69 89/274/69 94/273/69
f 95/280/70 96/279/70 94/278/70 93/277/70
f 94/284/71 89/283/71 90/282/71 93/281/71
f 95/288/72 92/287/72 91/286/72 96/285/72
o stick12
v 0.25 0.875 0.25
v 0.25 0.875 0.125
v 0.25 0.375 0.25
v 0.25 0.375 0.125
v 0.125 0.875 0.125
v 0.125 0.875 0.25
v 0.125 0.375 0.125
v 0.125 0.375 0.25
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.1875
vt 0.03125 0.1875
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.1875
vt 0 0.1875
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.1875
vt 0.09375 0.1875
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.1875
vt 0.0625 0.1875
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_dfbdbb41-abfe-86cc-78e9-f18aaa3f6ee0
f 100/292/73 103/291/73 101/290/73 98/289/73
f 99/296/74 100/295/74 98/294/74 97/293/74
f 104/300/75 99/299/75 97/298/75 102/297/75
f 103/304/76 104/303/76 102/302/76 101/301/76
f 102/308/77 97/307/77 98/306/77 101/305/77
f 103/312/78 100/311/78 99/310/78 104/309/78

BIN
test/Assets/blaze.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

279
test/Assets/creeper.obj Normal file
View File

@@ -0,0 +1,279 @@
# Made in Blockbench 4.7.4
mtllib creeper.mtl
o head
v 0.25 1.625 0.25
v 0.25 1.625 -0.25
v 0.25 1.125 0.25
v 0.25 1.125 -0.25
v -0.25 1.625 -0.25
v -0.25 1.625 0.25
v -0.25 1.125 -0.25
v -0.25 1.125 0.25
vt 0.125 0.75
vt 0.25 0.75
vt 0.25 0.5
vt 0.125 0.5
vt 0 0.75
vt 0.125 0.75
vt 0.125 0.5
vt 0 0.5
vt 0.375 0.75
vt 0.5 0.75
vt 0.5 0.5
vt 0.375 0.5
vt 0.25 0.75
vt 0.375 0.75
vt 0.375 0.5
vt 0.25 0.5
vt 0.25 0.75
vt 0.125 0.75
vt 0.125 1
vt 0.25 1
vt 0.375 1
vt 0.25 1
vt 0.25 0.75
vt 0.375 0.75
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_a9261af0-f547-5510-e36d-58546f0c746f
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o body
v 0.25 1.125 0.125
v 0.25 1.125 -0.125
v 0.25 0.375 0.125
v 0.25 0.375 -0.125
v -0.25 1.125 -0.125
v -0.25 1.125 0.125
v -0.25 0.375 -0.125
v -0.25 0.375 0.125
vt 0.3125 0.375
vt 0.4375 0.375
vt 0.4375 0
vt 0.3125 0
vt 0.25 0.375
vt 0.3125 0.375
vt 0.3125 0
vt 0.25 0
vt 0.5 0.375
vt 0.625 0.375
vt 0.625 0
vt 0.5 0
vt 0.4375 0.375
vt 0.5 0.375
vt 0.5 0
vt 0.4375 0
vt 0.4375 0.375
vt 0.3125 0.375
vt 0.3125 0.5
vt 0.4375 0.5
vt 0.5625 0.5
vt 0.4375 0.5
vt 0.4375 0.375
vt 0.5625 0.375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_a9261af0-f547-5510-e36d-58546f0c746f
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o leg1
v 0.25 0.375 0.375
v 0.25 0.375 0.125
v 0.25 0 0.375
v 0.25 0 0.125
v 0 0.375 0.125
v 0 0.375 0.375
v 0 0 0.125
v 0 0 0.375
vt 0.0625 0.375
vt 0.125 0.375
vt 0.125 0.1875
vt 0.0625 0.1875
vt 0 0.375
vt 0.0625 0.375
vt 0.0625 0.1875
vt 0 0.1875
vt 0.1875 0.375
vt 0.25 0.375
vt 0.25 0.1875
vt 0.1875 0.1875
vt 0.125 0.375
vt 0.1875 0.375
vt 0.1875 0.1875
vt 0.125 0.1875
vt 0.125 0.375
vt 0.0625 0.375
vt 0.0625 0.5
vt 0.125 0.5
vt 0.1875 0.5
vt 0.125 0.5
vt 0.125 0.375
vt 0.1875 0.375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_a9261af0-f547-5510-e36d-58546f0c746f
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o leg2
v 0 0.375 0.375
v 0 0.375 0.125
v 0 0 0.375
v 0 0 0.125
v -0.25 0.375 0.125
v -0.25 0.375 0.375
v -0.25 0 0.125
v -0.25 0 0.375
vt 0.0625 0.375
vt 0.125 0.375
vt 0.125 0.1875
vt 0.0625 0.1875
vt 0 0.375
vt 0.0625 0.375
vt 0.0625 0.1875
vt 0 0.1875
vt 0.1875 0.375
vt 0.25 0.375
vt 0.25 0.1875
vt 0.1875 0.1875
vt 0.125 0.375
vt 0.1875 0.375
vt 0.1875 0.1875
vt 0.125 0.1875
vt 0.125 0.375
vt 0.0625 0.375
vt 0.0625 0.5
vt 0.125 0.5
vt 0.1875 0.5
vt 0.125 0.5
vt 0.125 0.375
vt 0.1875 0.375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_a9261af0-f547-5510-e36d-58546f0c746f
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o leg3
v 0.25 0.375 -0.125
v 0.25 0.375 -0.375
v 0.25 0 -0.125
v 0.25 0 -0.375
v 0 0.375 -0.375
v 0 0.375 -0.125
v 0 0 -0.375
v 0 0 -0.125
vt 0.0625 0.375
vt 0.125 0.375
vt 0.125 0.1875
vt 0.0625 0.1875
vt 0 0.375
vt 0.0625 0.375
vt 0.0625 0.1875
vt 0 0.1875
vt 0.1875 0.375
vt 0.25 0.375
vt 0.25 0.1875
vt 0.1875 0.1875
vt 0.125 0.375
vt 0.1875 0.375
vt 0.1875 0.1875
vt 0.125 0.1875
vt 0.125 0.375
vt 0.0625 0.375
vt 0.0625 0.5
vt 0.125 0.5
vt 0.1875 0.5
vt 0.125 0.5
vt 0.125 0.375
vt 0.1875 0.375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_a9261af0-f547-5510-e36d-58546f0c746f
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30
o leg4
v 0 0.375 -0.125
v 0 0.375 -0.375
v 0 0 -0.125
v 0 0 -0.375
v -0.25 0.375 -0.375
v -0.25 0.375 -0.125
v -0.25 0 -0.375
v -0.25 0 -0.125
vt 0.0625 0.375
vt 0.125 0.375
vt 0.125 0.1875
vt 0.0625 0.1875
vt 0 0.375
vt 0.0625 0.375
vt 0.0625 0.1875
vt 0 0.1875
vt 0.1875 0.375
vt 0.25 0.375
vt 0.25 0.1875
vt 0.1875 0.1875
vt 0.125 0.375
vt 0.1875 0.375
vt 0.1875 0.1875
vt 0.125 0.1875
vt 0.125 0.375
vt 0.0625 0.375
vt 0.0625 0.5
vt 0.125 0.5
vt 0.1875 0.5
vt 0.125 0.5
vt 0.125 0.375
vt 0.1875 0.375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_a9261af0-f547-5510-e36d-58546f0c746f
f 44/124/31 47/123/31 45/122/31 42/121/31
f 43/128/32 44/127/32 42/126/32 41/125/32
f 48/132/33 43/131/33 41/130/33 46/129/33
f 47/136/34 48/135/34 46/134/34 45/133/34
f 46/140/35 41/139/35 42/138/35 45/137/35
f 47/144/36 44/143/36 43/142/36 48/141/36

BIN
test/Assets/creeper.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

325
test/Assets/giant.obj Normal file
View File

@@ -0,0 +1,325 @@
# Made in Blockbench 4.7.4
mtllib giant.mtl
o head
v 0.25 2 0.25
v 0.25 2 -0.25
v 0.25 1.5 0.25
v 0.25 1.5 -0.25
v -0.25 2 -0.25
v -0.25 2 0.25
v -0.25 1.5 -0.25
v -0.25 1.5 0.25
vt 0.125 0.875
vt 0.25 0.875
vt 0.25 0.75
vt 0.125 0.75
vt 0 0.875
vt 0.125 0.875
vt 0.125 0.75
vt 0 0.75
vt 0.375 0.875
vt 0.5 0.875
vt 0.5 0.75
vt 0.375 0.75
vt 0.25 0.875
vt 0.375 0.875
vt 0.375 0.75
vt 0.25 0.75
vt 0.25 0.875
vt 0.125 0.875
vt 0.125 1
vt 0.25 1
vt 0.375 1
vt 0.25 1
vt 0.25 0.875
vt 0.375 0.875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4f713d88-ddbc-dda2-ab2d-ab4dd8d59032
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o headwear
v 0.28125 2.03125 0.28125
v 0.28125 2.03125 -0.28125
v 0.28125 1.46875 0.28125
v 0.28125 1.46875 -0.28125
v -0.28125 2.03125 -0.28125
v -0.28125 2.03125 0.28125
v -0.28125 1.46875 -0.28125
v -0.28125 1.46875 0.28125
vt 0.625 0.875
vt 0.75 0.875
vt 0.75 0.75
vt 0.625 0.75
vt 0.5 0.875
vt 0.625 0.875
vt 0.625 0.75
vt 0.5 0.75
vt 0.875 0.875
vt 1 0.875
vt 1 0.75
vt 0.875 0.75
vt 0.75 0.875
vt 0.875 0.875
vt 0.875 0.75
vt 0.75 0.75
vt 0.75 0.875
vt 0.625 0.875
vt 0.625 1
vt 0.75 1
vt 0.875 1
vt 0.75 1
vt 0.75 0.875
vt 0.875 0.875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4f713d88-ddbc-dda2-ab2d-ab4dd8d59032
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o body
v 0.25 1.5 0.125
v 0.25 1.5 -0.125
v 0.25 0.75 0.125
v 0.25 0.75 -0.125
v -0.25 1.5 -0.125
v -0.25 1.5 0.125
v -0.25 0.75 -0.125
v -0.25 0.75 0.125
vt 0.3125 0.6875
vt 0.4375 0.6875
vt 0.4375 0.5
vt 0.3125 0.5
vt 0.25 0.6875
vt 0.3125 0.6875
vt 0.3125 0.5
vt 0.25 0.5
vt 0.5 0.6875
vt 0.625 0.6875
vt 0.625 0.5
vt 0.5 0.5
vt 0.4375 0.6875
vt 0.5 0.6875
vt 0.5 0.5
vt 0.4375 0.5
vt 0.4375 0.6875
vt 0.3125 0.6875
vt 0.3125 0.75
vt 0.4375 0.75
vt 0.5625 0.75
vt 0.4375 0.75
vt 0.4375 0.6875
vt 0.5625 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4f713d88-ddbc-dda2-ab2d-ab4dd8d59032
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o left_arm
v -0.25 1.5 0.125
v -0.25 1.5 -0.125
v -0.25 0.75 0.125
v -0.25 0.75 -0.125
v -0.5 1.5 -0.125
v -0.5 1.5 0.125
v -0.5 0.75 -0.125
v -0.5 0.75 0.125
vt 0.75 0.6875
vt 0.6875 0.6875
vt 0.6875 0.5
vt 0.75 0.5
vt 0.8125 0.6875
vt 0.75 0.6875
vt 0.75 0.5
vt 0.8125 0.5
vt 0.875 0.6875
vt 0.8125 0.6875
vt 0.8125 0.5
vt 0.875 0.5
vt 0.6875 0.6875
vt 0.625 0.6875
vt 0.625 0.5
vt 0.6875 0.5
vt 0.6875 0.6875
vt 0.75 0.6875
vt 0.75 0.75
vt 0.6875 0.75
vt 0.75 0.75
vt 0.8125 0.75
vt 0.8125 0.6875
vt 0.75 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4f713d88-ddbc-dda2-ab2d-ab4dd8d59032
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o right_arm
v 0.5 1.5 0.125
v 0.5 1.5 -0.125
v 0.5 0.75 0.125
v 0.5 0.75 -0.125
v 0.25 1.5 -0.125
v 0.25 1.5 0.125
v 0.25 0.75 -0.125
v 0.25 0.75 0.125
vt 0.6875 0.6875
vt 0.75 0.6875
vt 0.75 0.5
vt 0.6875 0.5
vt 0.625 0.6875
vt 0.6875 0.6875
vt 0.6875 0.5
vt 0.625 0.5
vt 0.8125 0.6875
vt 0.875 0.6875
vt 0.875 0.5
vt 0.8125 0.5
vt 0.75 0.6875
vt 0.8125 0.6875
vt 0.8125 0.5
vt 0.75 0.5
vt 0.75 0.6875
vt 0.6875 0.6875
vt 0.6875 0.75
vt 0.75 0.75
vt 0.8125 0.75
vt 0.75 0.75
vt 0.75 0.6875
vt 0.8125 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4f713d88-ddbc-dda2-ab2d-ab4dd8d59032
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30
o left_leg
v 0 0.75 0.125
v 0 0.75 -0.125
v 0 0 0.125
v 0 0 -0.125
v -0.25 0.75 -0.125
v -0.25 0.75 0.125
v -0.25 0 -0.125
v -0.25 0 0.125
vt 0.125 0.6875
vt 0.0625 0.6875
vt 0.0625 0.5
vt 0.125 0.5
vt 0.1875 0.6875
vt 0.125 0.6875
vt 0.125 0.5
vt 0.1875 0.5
vt 0.25 0.6875
vt 0.1875 0.6875
vt 0.1875 0.5
vt 0.25 0.5
vt 0.0625 0.6875
vt 0 0.6875
vt 0 0.5
vt 0.0625 0.5
vt 0.0625 0.6875
vt 0.125 0.6875
vt 0.125 0.75
vt 0.0625 0.75
vt 0.125 0.75
vt 0.1875 0.75
vt 0.1875 0.6875
vt 0.125 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4f713d88-ddbc-dda2-ab2d-ab4dd8d59032
f 44/124/31 47/123/31 45/122/31 42/121/31
f 43/128/32 44/127/32 42/126/32 41/125/32
f 48/132/33 43/131/33 41/130/33 46/129/33
f 47/136/34 48/135/34 46/134/34 45/133/34
f 46/140/35 41/139/35 42/138/35 45/137/35
f 47/144/36 44/143/36 43/142/36 48/141/36
o right_leg
v 0.25 0.75 0.125
v 0.25 0.75 -0.125
v 0.25 0 0.125
v 0.25 0 -0.125
v 0 0.75 -0.125
v 0 0.75 0.125
v 0 0 -0.125
v 0 0 0.125
vt 0.0625 0.6875
vt 0.125 0.6875
vt 0.125 0.5
vt 0.0625 0.5
vt 0 0.6875
vt 0.0625 0.6875
vt 0.0625 0.5
vt 0 0.5
vt 0.1875 0.6875
vt 0.25 0.6875
vt 0.25 0.5
vt 0.1875 0.5
vt 0.125 0.6875
vt 0.1875 0.6875
vt 0.1875 0.5
vt 0.125 0.5
vt 0.125 0.6875
vt 0.0625 0.6875
vt 0.0625 0.75
vt 0.125 0.75
vt 0.1875 0.75
vt 0.125 0.75
vt 0.125 0.6875
vt 0.1875 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4f713d88-ddbc-dda2-ab2d-ab4dd8d59032
f 52/148/37 55/147/37 53/146/37 50/145/37
f 51/152/38 52/151/38 50/150/38 49/149/38
f 56/156/39 51/155/39 49/154/39 54/153/39
f 55/160/40 56/159/40 54/158/40 53/157/40
f 54/164/41 49/163/41 50/162/41 53/161/41
f 55/168/42 52/167/42 51/166/42 56/165/42

BIN
test/Assets/giant.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

463
test/Assets/silverfish.obj Normal file
View File

@@ -0,0 +1,463 @@
# Made in Blockbench 4.7.4
mtllib silverfish.mtl
o body1
v 0.09375 0.125 -0.375
v 0.09375 0.125 -0.5
v 0.09375 0 -0.375
v 0.09375 0 -0.5
v -0.09375 0.125 -0.5
v -0.09375 0.125 -0.375
v -0.09375 0 -0.5
v -0.09375 0 -0.375
vt 0.03125 0.9375
vt 0.078125 0.9375
vt 0.078125 0.875
vt 0.03125 0.875
vt 0 0.9375
vt 0.03125 0.9375
vt 0.03125 0.875
vt 0 0.875
vt 0.109375 0.9375
vt 0.15625 0.9375
vt 0.15625 0.875
vt 0.109375 0.875
vt 0.078125 0.9375
vt 0.109375 0.9375
vt 0.109375 0.875
vt 0.078125 0.875
vt 0.078125 0.9375
vt 0.03125 0.9375
vt 0.03125 1
vt 0.078125 1
vt 0.125 1
vt 0.078125 1
vt 0.078125 0.9375
vt 0.125 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_97e571f3-1c58-7068-758a-c07b2eba7a6a
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o body2
v 0.125 0.1875 -0.25
v 0.125 0.1875 -0.375
v 0.125 0 -0.25
v 0.125 0 -0.375
v -0.125 0.1875 -0.375
v -0.125 0.1875 -0.25
v -0.125 0 -0.375
v -0.125 0 -0.25
vt 0.03125 0.8125
vt 0.09375 0.8125
vt 0.09375 0.71875
vt 0.03125 0.71875
vt 0 0.8125
vt 0.03125 0.8125
vt 0.03125 0.71875
vt 0 0.71875
vt 0.125 0.8125
vt 0.1875 0.8125
vt 0.1875 0.71875
vt 0.125 0.71875
vt 0.09375 0.8125
vt 0.125 0.8125
vt 0.125 0.71875
vt 0.09375 0.71875
vt 0.09375 0.8125
vt 0.03125 0.8125
vt 0.03125 0.875
vt 0.09375 0.875
vt 0.15625 0.875
vt 0.09375 0.875
vt 0.09375 0.8125
vt 0.15625 0.8125
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_97e571f3-1c58-7068-758a-c07b2eba7a6a
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o body3
v 0.1875 0.25 -0.0625
v 0.1875 0.25 -0.25
v 0.1875 0 -0.0625
v 0.1875 0 -0.25
v -0.1875 0.25 -0.25
v -0.1875 0.25 -0.0625
v -0.1875 0 -0.25
v -0.1875 0 -0.0625
vt 0.046875 0.625
vt 0.140625 0.625
vt 0.140625 0.5
vt 0.046875 0.5
vt 0 0.625
vt 0.046875 0.625
vt 0.046875 0.5
vt 0 0.5
vt 0.1875 0.625
vt 0.28125 0.625
vt 0.28125 0.5
vt 0.1875 0.5
vt 0.140625 0.625
vt 0.1875 0.625
vt 0.1875 0.5
vt 0.140625 0.5
vt 0.140625 0.625
vt 0.046875 0.625
vt 0.046875 0.71875
vt 0.140625 0.71875
vt 0.234375 0.71875
vt 0.140625 0.71875
vt 0.140625 0.625
vt 0.234375 0.625
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_97e571f3-1c58-7068-758a-c07b2eba7a6a
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o body4
v 0.09375 0.1875 0.125
v 0.09375 0.1875 -0.0625
v 0.09375 0 0.125
v 0.09375 0 -0.0625
v -0.09375 0.1875 -0.0625
v -0.09375 0.1875 0.125
v -0.09375 0 -0.0625
v -0.09375 0 0.125
vt 0.046875 0.40625
vt 0.09375 0.40625
vt 0.09375 0.3125
vt 0.046875 0.3125
vt 0 0.40625
vt 0.046875 0.40625
vt 0.046875 0.3125
vt 0 0.3125
vt 0.140625 0.40625
vt 0.1875 0.40625
vt 0.1875 0.3125
vt 0.140625 0.3125
vt 0.09375 0.40625
vt 0.140625 0.40625
vt 0.140625 0.3125
vt 0.09375 0.3125
vt 0.09375 0.40625
vt 0.046875 0.40625
vt 0.046875 0.5
vt 0.09375 0.5
vt 0.140625 0.5
vt 0.09375 0.5
vt 0.09375 0.40625
vt 0.140625 0.40625
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_97e571f3-1c58-7068-758a-c07b2eba7a6a
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o body5
v 0.0625 0.125 0.3125
v 0.0625 0.125 0.125
v 0.0625 0 0.3125
v 0.0625 0 0.125
v -0.0625 0.125 0.125
v -0.0625 0.125 0.3125
v -0.0625 0 0.125
v -0.0625 0 0.3125
vt 0.046875 0.21875
vt 0.078125 0.21875
vt 0.078125 0.15625
vt 0.046875 0.15625
vt 0 0.21875
vt 0.046875 0.21875
vt 0.046875 0.15625
vt 0 0.15625
vt 0.125 0.21875
vt 0.15625 0.21875
vt 0.15625 0.15625
vt 0.125 0.15625
vt 0.078125 0.21875
vt 0.125 0.21875
vt 0.125 0.15625
vt 0.078125 0.15625
vt 0.078125 0.21875
vt 0.046875 0.21875
vt 0.046875 0.3125
vt 0.078125 0.3125
vt 0.109375 0.3125
vt 0.078125 0.3125
vt 0.078125 0.21875
vt 0.109375 0.21875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_97e571f3-1c58-7068-758a-c07b2eba7a6a
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30
o body6
v 0.0625 0.0625 0.4375
v 0.0625 0.0625 0.3125
v 0.0625 0 0.4375
v 0.0625 0 0.3125
v -0.0625 0.0625 0.3125
v -0.0625 0.0625 0.4375
v -0.0625 0 0.3125
v -0.0625 0 0.4375
vt 0.203125 0.9375
vt 0.234375 0.9375
vt 0.234375 0.90625
vt 0.203125 0.90625
vt 0.171875 0.9375
vt 0.203125 0.9375
vt 0.203125 0.90625
vt 0.171875 0.90625
vt 0.265625 0.9375
vt 0.296875 0.9375
vt 0.296875 0.90625
vt 0.265625 0.90625
vt 0.234375 0.9375
vt 0.265625 0.9375
vt 0.265625 0.90625
vt 0.234375 0.90625
vt 0.234375 0.9375
vt 0.203125 0.9375
vt 0.203125 1
vt 0.234375 1
vt 0.265625 1
vt 0.234375 1
vt 0.234375 0.9375
vt 0.265625 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_97e571f3-1c58-7068-758a-c07b2eba7a6a
f 44/124/31 47/123/31 45/122/31 42/121/31
f 43/128/32 44/127/32 42/126/32 41/125/32
f 48/132/33 43/131/33 41/130/33 46/129/33
f 47/136/34 48/135/34 46/134/34 45/133/34
f 46/140/35 41/139/35 42/138/35 45/137/35
f 47/144/36 44/143/36 43/142/36 48/141/36
o body7
v 0.03125 0.0625 0.5625
v 0.03125 0.0625 0.4375
v 0.03125 0 0.5625
v 0.03125 0 0.4375
v -0.03125 0.0625 0.4375
v -0.03125 0.0625 0.5625
v -0.03125 0 0.4375
v -0.03125 0 0.5625
vt 0.234375 0.8125
vt 0.25 0.8125
vt 0.25 0.78125
vt 0.234375 0.78125
vt 0.203125 0.8125
vt 0.234375 0.8125
vt 0.234375 0.78125
vt 0.203125 0.78125
vt 0.28125 0.8125
vt 0.296875 0.8125
vt 0.296875 0.78125
vt 0.28125 0.78125
vt 0.25 0.8125
vt 0.28125 0.8125
vt 0.28125 0.78125
vt 0.25 0.78125
vt 0.25 0.8125
vt 0.234375 0.8125
vt 0.234375 0.875
vt 0.25 0.875
vt 0.265625 0.875
vt 0.25 0.875
vt 0.25 0.8125
vt 0.265625 0.8125
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_97e571f3-1c58-7068-758a-c07b2eba7a6a
f 52/148/37 55/147/37 53/146/37 50/145/37
f 51/152/38 52/151/38 50/150/38 49/149/38
f 56/156/39 51/155/39 49/154/39 54/153/39
f 55/160/40 56/159/40 54/158/40 53/157/40
f 54/164/41 49/163/41 50/162/41 53/161/41
f 55/168/42 52/167/42 51/166/42 56/165/42
o wing1
v 0.3125 0.5 -0.0625
v 0.3125 0.5 -0.25
v 0.3125 0 -0.0625
v 0.3125 0 -0.25
v -0.3125 0.5 -0.25
v -0.3125 0.5 -0.0625
v -0.3125 0 -0.25
v -0.3125 0 -0.0625
vt 0.359375 0.90625
vt 0.515625 0.90625
vt 0.515625 0.65625
vt 0.359375 0.65625
vt 0.3125 0.90625
vt 0.359375 0.90625
vt 0.359375 0.65625
vt 0.3125 0.65625
vt 0.5625 0.90625
vt 0.71875 0.90625
vt 0.71875 0.65625
vt 0.5625 0.65625
vt 0.515625 0.90625
vt 0.5625 0.90625
vt 0.5625 0.65625
vt 0.515625 0.65625
vt 0.515625 0.90625
vt 0.359375 0.90625
vt 0.359375 1
vt 0.515625 1
vt 0.671875 1
vt 0.515625 1
vt 0.515625 0.90625
vt 0.671875 0.90625
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_97e571f3-1c58-7068-758a-c07b2eba7a6a
f 60/172/43 63/171/43 61/170/43 58/169/43
f 59/176/44 60/175/44 58/174/44 57/173/44
f 64/180/45 59/179/45 57/178/45 62/177/45
f 63/184/46 64/183/46 62/182/46 61/181/46
f 62/188/47 57/187/47 58/186/47 61/185/47
f 63/192/48 60/191/48 59/190/48 64/189/48
o wing2
v 0.1875 0.25 0.3125
v 0.1875 0.25 0.125
v 0.1875 0 0.3125
v 0.1875 0 0.125
v -0.1875 0.25 0.125
v -0.1875 0.25 0.3125
v -0.1875 0 0.125
v -0.1875 0 0.3125
vt 0.359375 0.5625
vt 0.453125 0.5625
vt 0.453125 0.4375
vt 0.359375 0.4375
vt 0.3125 0.5625
vt 0.359375 0.5625
vt 0.359375 0.4375
vt 0.3125 0.4375
vt 0.5 0.5625
vt 0.59375 0.5625
vt 0.59375 0.4375
vt 0.5 0.4375
vt 0.453125 0.5625
vt 0.5 0.5625
vt 0.5 0.4375
vt 0.453125 0.4375
vt 0.453125 0.5625
vt 0.359375 0.5625
vt 0.359375 0.65625
vt 0.453125 0.65625
vt 0.546875 0.65625
vt 0.453125 0.65625
vt 0.453125 0.5625
vt 0.546875 0.5625
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_97e571f3-1c58-7068-758a-c07b2eba7a6a
f 68/196/49 71/195/49 69/194/49 66/193/49
f 67/200/50 68/199/50 66/198/50 65/197/50
f 72/204/51 67/203/51 65/202/51 70/201/51
f 71/208/52 72/207/52 70/206/52 69/205/52
f 70/212/53 65/211/53 66/210/53 69/209/53
f 71/216/54 68/215/54 67/214/54 72/213/54
o wing3
v 0.1875 0.3125 -0.28125
v 0.1875 0.3125 -0.40625
v 0.1875 0 -0.28125
v 0.1875 0 -0.40625
v -0.1875 0.3125 -0.40625
v -0.1875 0.3125 -0.28125
v -0.1875 0 -0.40625
v -0.1875 0 -0.28125
vt 0.34375 0.375
vt 0.4375 0.375
vt 0.4375 0.21875
vt 0.34375 0.21875
vt 0.3125 0.375
vt 0.34375 0.375
vt 0.34375 0.21875
vt 0.3125 0.21875
vt 0.46875 0.375
vt 0.5625 0.375
vt 0.5625 0.21875
vt 0.46875 0.21875
vt 0.4375 0.375
vt 0.46875 0.375
vt 0.46875 0.21875
vt 0.4375 0.21875
vt 0.4375 0.375
vt 0.34375 0.375
vt 0.34375 0.4375
vt 0.4375 0.4375
vt 0.53125 0.4375
vt 0.4375 0.4375
vt 0.4375 0.375
vt 0.53125 0.375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_97e571f3-1c58-7068-758a-c07b2eba7a6a
f 76/220/55 79/219/55 77/218/55 74/217/55
f 75/224/56 76/223/56 74/222/56 73/221/56
f 80/228/57 75/227/57 73/226/57 78/225/57
f 79/232/58 80/231/58 78/230/58 77/229/58
f 78/236/59 73/235/59 74/234/59 77/233/59
f 79/240/60 76/239/60 75/238/60 80/237/60

BIN
test/Assets/silverfish.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

325
test/Assets/skeleton.obj Normal file
View File

@@ -0,0 +1,325 @@
# Made in Blockbench 4.7.4
mtllib skeleton.mtl
o head
v 0.25 2 0.25
v 0.25 2 -0.25
v 0.25 1.5 0.25
v 0.25 1.5 -0.25
v -0.25 2 -0.25
v -0.25 2 0.25
v -0.25 1.5 -0.25
v -0.25 1.5 0.25
vt 0.125 0.75
vt 0.25 0.75
vt 0.25 0.5
vt 0.125 0.5
vt 0 0.75
vt 0.125 0.75
vt 0.125 0.5
vt 0 0.5
vt 0.375 0.75
vt 0.5 0.75
vt 0.5 0.5
vt 0.375 0.5
vt 0.25 0.75
vt 0.375 0.75
vt 0.375 0.5
vt 0.25 0.5
vt 0.25 0.75
vt 0.125 0.75
vt 0.125 1
vt 0.25 1
vt 0.375 1
vt 0.25 1
vt 0.25 0.75
vt 0.375 0.75
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_71787a2c-953f-372c-0ba8-125703cbb767
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o headwear
v 0.28125 2.03125 0.28125
v 0.28125 2.03125 -0.28125
v 0.28125 1.46875 0.28125
v 0.28125 1.46875 -0.28125
v -0.28125 2.03125 -0.28125
v -0.28125 2.03125 0.28125
v -0.28125 1.46875 -0.28125
v -0.28125 1.46875 0.28125
vt 0.625 0.75
vt 0.75 0.75
vt 0.75 0.5
vt 0.625 0.5
vt 0.5 0.75
vt 0.625 0.75
vt 0.625 0.5
vt 0.5 0.5
vt 0.875 0.75
vt 1 0.75
vt 1 0.5
vt 0.875 0.5
vt 0.75 0.75
vt 0.875 0.75
vt 0.875 0.5
vt 0.75 0.5
vt 0.75 0.75
vt 0.625 0.75
vt 0.625 1
vt 0.75 1
vt 0.875 1
vt 0.75 1
vt 0.75 0.75
vt 0.875 0.75
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_71787a2c-953f-372c-0ba8-125703cbb767
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o body
v 0.25 1.5 0.125
v 0.25 1.5 -0.125
v 0.25 0.75 0.125
v 0.25 0.75 -0.125
v -0.25 1.5 -0.125
v -0.25 1.5 0.125
v -0.25 0.75 -0.125
v -0.25 0.75 0.125
vt 0.3125 0.375
vt 0.4375 0.375
vt 0.4375 0
vt 0.3125 0
vt 0.25 0.375
vt 0.3125 0.375
vt 0.3125 0
vt 0.25 0
vt 0.5 0.375
vt 0.625 0.375
vt 0.625 0
vt 0.5 0
vt 0.4375 0.375
vt 0.5 0.375
vt 0.5 0
vt 0.4375 0
vt 0.4375 0.375
vt 0.3125 0.375
vt 0.3125 0.5
vt 0.4375 0.5
vt 0.5625 0.5
vt 0.4375 0.5
vt 0.4375 0.375
vt 0.5625 0.375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_71787a2c-953f-372c-0ba8-125703cbb767
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o left_arm
v -0.25 1.5 0.0625
v -0.25 1.5 -0.0625
v -0.25 0.75 0.0625
v -0.25 0.75 -0.0625
v -0.375 1.5 -0.0625
v -0.375 1.5 0.0625
v -0.375 0.75 -0.0625
v -0.375 0.75 0.0625
vt 0.6875 0.4375
vt 0.65625 0.4375
vt 0.65625 0.0625
vt 0.6875 0.0625
vt 0.71875 0.4375
vt 0.6875 0.4375
vt 0.6875 0.0625
vt 0.71875 0.0625
vt 0.75 0.4375
vt 0.71875 0.4375
vt 0.71875 0.0625
vt 0.75 0.0625
vt 0.65625 0.4375
vt 0.625 0.4375
vt 0.625 0.0625
vt 0.65625 0.0625
vt 0.65625 0.4375
vt 0.6875 0.4375
vt 0.6875 0.5
vt 0.65625 0.5
vt 0.6875 0.5
vt 0.71875 0.5
vt 0.71875 0.4375
vt 0.6875 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_71787a2c-953f-372c-0ba8-125703cbb767
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o right_arm
v 0.375 1.5 0.0625
v 0.375 1.5 -0.0625
v 0.375 0.75 0.0625
v 0.375 0.75 -0.0625
v 0.25 1.5 -0.0625
v 0.25 1.5 0.0625
v 0.25 0.75 -0.0625
v 0.25 0.75 0.0625
vt 0.65625 0.4375
vt 0.6875 0.4375
vt 0.6875 0.0625
vt 0.65625 0.0625
vt 0.625 0.4375
vt 0.65625 0.4375
vt 0.65625 0.0625
vt 0.625 0.0625
vt 0.71875 0.4375
vt 0.75 0.4375
vt 0.75 0.0625
vt 0.71875 0.0625
vt 0.6875 0.4375
vt 0.71875 0.4375
vt 0.71875 0.0625
vt 0.6875 0.0625
vt 0.6875 0.4375
vt 0.65625 0.4375
vt 0.65625 0.5
vt 0.6875 0.5
vt 0.71875 0.5
vt 0.6875 0.5
vt 0.6875 0.4375
vt 0.71875 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_71787a2c-953f-372c-0ba8-125703cbb767
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30
o left_leg
v -0.0625 0.75 0.0625
v -0.0625 0.75 -0.0625
v -0.0625 0 0.0625
v -0.0625 0 -0.0625
v -0.1875 0.75 -0.0625
v -0.1875 0.75 0.0625
v -0.1875 0 -0.0625
v -0.1875 0 0.0625
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.0625
vt 0.0625 0.0625
vt 0.09375 0.4375
vt 0.0625 0.4375
vt 0.0625 0.0625
vt 0.09375 0.0625
vt 0.125 0.4375
vt 0.09375 0.4375
vt 0.09375 0.0625
vt 0.125 0.0625
vt 0.03125 0.4375
vt 0 0.4375
vt 0 0.0625
vt 0.03125 0.0625
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.5
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.09375 0.4375
vt 0.0625 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_71787a2c-953f-372c-0ba8-125703cbb767
f 44/124/31 47/123/31 45/122/31 42/121/31
f 43/128/32 44/127/32 42/126/32 41/125/32
f 48/132/33 43/131/33 41/130/33 46/129/33
f 47/136/34 48/135/34 46/134/34 45/133/34
f 46/140/35 41/139/35 42/138/35 45/137/35
f 47/144/36 44/143/36 43/142/36 48/141/36
o right_leg
v 0.1875 0.75 0.0625
v 0.1875 0.75 -0.0625
v 0.1875 0 0.0625
v 0.1875 0 -0.0625
v 0.0625 0.75 -0.0625
v 0.0625 0.75 0.0625
v 0.0625 0 -0.0625
v 0.0625 0 0.0625
vt 0.03125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.0625
vt 0.03125 0.0625
vt 0 0.4375
vt 0.03125 0.4375
vt 0.03125 0.0625
vt 0 0.0625
vt 0.09375 0.4375
vt 0.125 0.4375
vt 0.125 0.0625
vt 0.09375 0.0625
vt 0.0625 0.4375
vt 0.09375 0.4375
vt 0.09375 0.0625
vt 0.0625 0.0625
vt 0.0625 0.4375
vt 0.03125 0.4375
vt 0.03125 0.5
vt 0.0625 0.5
vt 0.09375 0.5
vt 0.0625 0.5
vt 0.0625 0.4375
vt 0.09375 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_71787a2c-953f-372c-0ba8-125703cbb767
f 52/148/37 55/147/37 53/146/37 50/145/37
f 51/152/38 52/151/38 50/150/38 49/149/38
f 56/156/39 51/155/39 49/154/39 54/153/39
f 55/160/40 56/159/40 54/158/40 53/157/40
f 54/164/41 49/163/41 50/162/41 53/161/41
f 55/168/42 52/167/42 51/166/42 56/165/42

BIN
test/Assets/skeleton.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

233
test/Assets/slime.obj Normal file
View File

@@ -0,0 +1,233 @@
# Made in Blockbench 4.7.4
mtllib slime.mtl
o right_eye
v -0.08124999999999999 0.375 -0.09375
v -0.08124999999999999 0.375 -0.21875
v -0.08124999999999999 0.25 -0.09375
v -0.08124999999999999 0.25 -0.21875
v -0.20625 0.375 -0.21875
v -0.20625 0.375 -0.09375
v -0.20625 0.25 -0.21875
v -0.20625 0.25 -0.09375
vt 0.53125 0.9375
vt 0.5625 0.9375
vt 0.5625 0.875
vt 0.53125 0.875
vt 0.5 0.9375
vt 0.53125 0.9375
vt 0.53125 0.875
vt 0.5 0.875
vt 0.59375 0.9375
vt 0.625 0.9375
vt 0.625 0.875
vt 0.59375 0.875
vt 0.5625 0.9375
vt 0.59375 0.9375
vt 0.59375 0.875
vt 0.5625 0.875
vt 0.5625 0.9375
vt 0.53125 0.9375
vt 0.53125 1
vt 0.5625 1
vt 0.59375 1
vt 0.5625 1
vt 0.5625 0.9375
vt 0.59375 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl none
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o left_eye
v 0.20625000000000004 0.375 -0.09375
v 0.20625000000000004 0.375 -0.21875
v 0.20625000000000004 0.25 -0.09375
v 0.20625000000000004 0.25 -0.21875
v 0.08125000000000004 0.375 -0.21875
v 0.08125000000000004 0.375 -0.09375
v 0.08125000000000004 0.25 -0.21875
v 0.08125000000000004 0.25 -0.09375
vt 0.53125 0.8125
vt 0.5625 0.8125
vt 0.5625 0.75
vt 0.53125 0.75
vt 0.5 0.8125
vt 0.53125 0.8125
vt 0.53125 0.75
vt 0.5 0.75
vt 0.59375 0.8125
vt 0.625 0.8125
vt 0.625 0.75
vt 0.59375 0.75
vt 0.5625 0.8125
vt 0.59375 0.8125
vt 0.59375 0.75
vt 0.5625 0.75
vt 0.5625 0.8125
vt 0.53125 0.8125
vt 0.53125 0.875
vt 0.5625 0.875
vt 0.59375 0.875
vt 0.5625 0.875
vt 0.5625 0.8125
vt 0.59375 0.8125
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl none
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o mouth
v 0.0625 0.1875 -0.15625
v 0.0625 0.1875 -0.21875
v 0.0625 0.125 -0.15625
v 0.0625 0.125 -0.21875
v 0 0.1875 -0.21875
v 0 0.1875 -0.15625
v 0 0.125 -0.21875
v 0 0.125 -0.15625
vt 0.515625 0.71875
vt 0.53125 0.71875
vt 0.53125 0.6875
vt 0.515625 0.6875
vt 0.5 0.71875
vt 0.515625 0.71875
vt 0.515625 0.6875
vt 0.5 0.6875
vt 0.546875 0.71875
vt 0.5625 0.71875
vt 0.5625 0.6875
vt 0.546875 0.6875
vt 0.53125 0.71875
vt 0.546875 0.71875
vt 0.546875 0.6875
vt 0.53125 0.6875
vt 0.53125 0.71875
vt 0.515625 0.71875
vt 0.515625 0.75
vt 0.53125 0.75
vt 0.546875 0.75
vt 0.53125 0.75
vt 0.53125 0.71875
vt 0.546875 0.71875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl none
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o body
v 0.1875 0.4375 0.1875
v 0.1875 0.4375 -0.1875
v 0.1875 0.0625 0.1875
v 0.1875 0.0625 -0.1875
v -0.1875 0.4375 -0.1875
v -0.1875 0.4375 0.1875
v -0.1875 0.0625 -0.1875
v -0.1875 0.0625 0.1875
vt 0.09375 0.3125
vt 0.1875 0.3125
vt 0.1875 0.125
vt 0.09375 0.125
vt 0 0.3125
vt 0.09375 0.3125
vt 0.09375 0.125
vt 0 0.125
vt 0.28125 0.3125
vt 0.375 0.3125
vt 0.375 0.125
vt 0.28125 0.125
vt 0.1875 0.3125
vt 0.28125 0.3125
vt 0.28125 0.125
vt 0.1875 0.125
vt 0.1875 0.3125
vt 0.09375 0.3125
vt 0.09375 0.5
vt 0.1875 0.5
vt 0.28125 0.5
vt 0.1875 0.5
vt 0.1875 0.3125
vt 0.28125 0.3125
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl none
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o outer
v 0.25 0.5 0.25
v 0.25 0.5 -0.25
v 0.25 0 0.25
v 0.25 0 -0.25
v -0.25 0.5 -0.25
v -0.25 0.5 0.25
v -0.25 0 -0.25
v -0.25 0 0.25
vt 0.125 0.75
vt 0.25 0.75
vt 0.25 0.5
vt 0.125 0.5
vt 0 0.75
vt 0.125 0.75
vt 0.125 0.5
vt 0 0.5
vt 0.375 0.75
vt 0.5 0.75
vt 0.5 0.5
vt 0.375 0.5
vt 0.25 0.75
vt 0.375 0.75
vt 0.375 0.5
vt 0.25 0.5
vt 0.25 0.75
vt 0.125 0.75
vt 0.125 1
vt 0.25 1
vt 0.375 1
vt 0.25 1
vt 0.25 0.75
vt 0.375 0.75
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl none
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30

BIN
test/Assets/slime.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

509
test/Assets/spider.obj Normal file
View File

@@ -0,0 +1,509 @@
# Made in Blockbench 4.7.4
mtllib spider.mtl
o head
v 0.25 0.8125 -0.1875
v 0.25 0.8125 -0.6875
v 0.25 0.3125 -0.1875
v 0.25 0.3125 -0.6875
v -0.25 0.8125 -0.6875
v -0.25 0.8125 -0.1875
v -0.25 0.3125 -0.6875
v -0.25 0.3125 -0.1875
vt 0.625 0.625
vt 0.75 0.625
vt 0.75 0.375
vt 0.625 0.375
vt 0.5 0.625
vt 0.625 0.625
vt 0.625 0.375
vt 0.5 0.375
vt 0.875 0.625
vt 1 0.625
vt 1 0.375
vt 0.875 0.375
vt 0.75 0.625
vt 0.875 0.625
vt 0.875 0.375
vt 0.75 0.375
vt 0.75 0.625
vt 0.625 0.625
vt 0.625 0.875
vt 0.75 0.875
vt 0.875 0.875
vt 0.75 0.875
vt 0.75 0.625
vt 0.875 0.625
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o neck
v 0.1875 0.75 0.1875
v 0.1875 0.75 -0.1875
v 0.1875 0.375 0.1875
v 0.1875 0.375 -0.1875
v -0.1875 0.75 -0.1875
v -0.1875 0.75 0.1875
v -0.1875 0.375 -0.1875
v -0.1875 0.375 0.1875
vt 0.09375 0.8125
vt 0.1875 0.8125
vt 0.1875 0.625
vt 0.09375 0.625
vt 0 0.8125
vt 0.09375 0.8125
vt 0.09375 0.625
vt 0 0.625
vt 0.28125 0.8125
vt 0.375 0.8125
vt 0.375 0.625
vt 0.28125 0.625
vt 0.1875 0.8125
vt 0.28125 0.8125
vt 0.28125 0.625
vt 0.1875 0.625
vt 0.1875 0.8125
vt 0.09375 0.8125
vt 0.09375 1
vt 0.1875 1
vt 0.28125 1
vt 0.1875 1
vt 0.1875 0.8125
vt 0.28125 0.8125
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o body
v 0.3125 0.8125 0.9375
v 0.3125 0.8125 0.1875
v 0.3125 0.3125 0.9375
v 0.3125 0.3125 0.1875
v -0.3125 0.8125 0.1875
v -0.3125 0.8125 0.9375
v -0.3125 0.3125 0.1875
v -0.3125 0.3125 0.9375
vt 0.1875 0.25
vt 0.34375 0.25
vt 0.34375 0
vt 0.1875 0
vt 0 0.25
vt 0.1875 0.25
vt 0.1875 0
vt 0 0
vt 0.53125 0.25
vt 0.6875 0.25
vt 0.6875 0
vt 0.53125 0
vt 0.34375 0.25
vt 0.53125 0.25
vt 0.53125 0
vt 0.34375 0
vt 0.34375 0.25
vt 0.1875 0.25
vt 0.1875 0.625
vt 0.34375 0.625
vt 0.5 0.625
vt 0.34375 0.625
vt 0.34375 0.25
vt 0.5 0.25
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o leg1
v 1.1875 0.625 0.3125
v 1.1875 0.625 0.1875
v 1.1875 0.5 0.3125
v 1.1875 0.5 0.1875
v 0.1875 0.625 0.1875
v 0.1875 0.625 0.3125
v 0.1875 0.5 0.1875
v 0.1875 0.5 0.3125
vt 0.3125 0.9375
vt 0.5625 0.9375
vt 0.5625 0.875
vt 0.3125 0.875
vt 0.28125 0.9375
vt 0.3125 0.9375
vt 0.3125 0.875
vt 0.28125 0.875
vt 0.59375 0.9375
vt 0.84375 0.9375
vt 0.84375 0.875
vt 0.59375 0.875
vt 0.5625 0.9375
vt 0.59375 0.9375
vt 0.59375 0.875
vt 0.5625 0.875
vt 0.5625 0.9375
vt 0.3125 0.9375
vt 0.3125 1
vt 0.5625 1
vt 0.8125 1
vt 0.5625 1
vt 0.5625 0.9375
vt 0.8125 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o leg2
v -0.1875 0.625 0.3125
v -0.1875 0.625 0.1875
v -0.1875 0.5 0.3125
v -0.1875 0.5 0.1875
v -1.1875 0.625 0.1875
v -1.1875 0.625 0.3125
v -1.1875 0.5 0.1875
v -1.1875 0.5 0.3125
vt 0.3125 0.9375
vt 0.5625 0.9375
vt 0.5625 0.875
vt 0.3125 0.875
vt 0.28125 0.9375
vt 0.3125 0.9375
vt 0.3125 0.875
vt 0.28125 0.875
vt 0.59375 0.9375
vt 0.84375 0.9375
vt 0.84375 0.875
vt 0.59375 0.875
vt 0.5625 0.9375
vt 0.59375 0.9375
vt 0.59375 0.875
vt 0.5625 0.875
vt 0.5625 0.9375
vt 0.3125 0.9375
vt 0.3125 1
vt 0.5625 1
vt 0.8125 1
vt 0.5625 1
vt 0.5625 0.9375
vt 0.8125 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30
o leg3
v 1.1875 0.625 0.125
v 1.1875 0.625 0
v 1.1875 0.5 0.125
v 1.1875 0.5 0
v 0.1875 0.625 0
v 0.1875 0.625 0.125
v 0.1875 0.5 0
v 0.1875 0.5 0.125
vt 0.3125 0.9375
vt 0.5625 0.9375
vt 0.5625 0.875
vt 0.3125 0.875
vt 0.28125 0.9375
vt 0.3125 0.9375
vt 0.3125 0.875
vt 0.28125 0.875
vt 0.59375 0.9375
vt 0.84375 0.9375
vt 0.84375 0.875
vt 0.59375 0.875
vt 0.5625 0.9375
vt 0.59375 0.9375
vt 0.59375 0.875
vt 0.5625 0.875
vt 0.5625 0.9375
vt 0.3125 0.9375
vt 0.3125 1
vt 0.5625 1
vt 0.8125 1
vt 0.5625 1
vt 0.5625 0.9375
vt 0.8125 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 44/124/31 47/123/31 45/122/31 42/121/31
f 43/128/32 44/127/32 42/126/32 41/125/32
f 48/132/33 43/131/33 41/130/33 46/129/33
f 47/136/34 48/135/34 46/134/34 45/133/34
f 46/140/35 41/139/35 42/138/35 45/137/35
f 47/144/36 44/143/36 43/142/36 48/141/36
o leg4
v -0.1875 0.625 0.125
v -0.1875 0.625 0
v -0.1875 0.5 0.125
v -0.1875 0.5 0
v -1.1875 0.625 0
v -1.1875 0.625 0.125
v -1.1875 0.5 0
v -1.1875 0.5 0.125
vt 0.3125 0.9375
vt 0.5625 0.9375
vt 0.5625 0.875
vt 0.3125 0.875
vt 0.28125 0.9375
vt 0.3125 0.9375
vt 0.3125 0.875
vt 0.28125 0.875
vt 0.59375 0.9375
vt 0.84375 0.9375
vt 0.84375 0.875
vt 0.59375 0.875
vt 0.5625 0.9375
vt 0.59375 0.9375
vt 0.59375 0.875
vt 0.5625 0.875
vt 0.5625 0.9375
vt 0.3125 0.9375
vt 0.3125 1
vt 0.5625 1
vt 0.8125 1
vt 0.5625 1
vt 0.5625 0.9375
vt 0.8125 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 52/148/37 55/147/37 53/146/37 50/145/37
f 51/152/38 52/151/38 50/150/38 49/149/38
f 56/156/39 51/155/39 49/154/39 54/153/39
f 55/160/40 56/159/40 54/158/40 53/157/40
f 54/164/41 49/163/41 50/162/41 53/161/41
f 55/168/42 52/167/42 51/166/42 56/165/42
o leg5
v 1.1875 0.625 -0.0625
v 1.1875 0.625 -0.1875
v 1.1875 0.5 -0.0625
v 1.1875 0.5 -0.1875
v 0.1875 0.625 -0.1875
v 0.1875 0.625 -0.0625
v 0.1875 0.5 -0.1875
v 0.1875 0.5 -0.0625
vt 0.3125 0.9375
vt 0.5625 0.9375
vt 0.5625 0.875
vt 0.3125 0.875
vt 0.28125 0.9375
vt 0.3125 0.9375
vt 0.3125 0.875
vt 0.28125 0.875
vt 0.59375 0.9375
vt 0.84375 0.9375
vt 0.84375 0.875
vt 0.59375 0.875
vt 0.5625 0.9375
vt 0.59375 0.9375
vt 0.59375 0.875
vt 0.5625 0.875
vt 0.5625 0.9375
vt 0.3125 0.9375
vt 0.3125 1
vt 0.5625 1
vt 0.8125 1
vt 0.5625 1
vt 0.5625 0.9375
vt 0.8125 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 60/172/43 63/171/43 61/170/43 58/169/43
f 59/176/44 60/175/44 58/174/44 57/173/44
f 64/180/45 59/179/45 57/178/45 62/177/45
f 63/184/46 64/183/46 62/182/46 61/181/46
f 62/188/47 57/187/47 58/186/47 61/185/47
f 63/192/48 60/191/48 59/190/48 64/189/48
o leg6
v -0.1875 0.625 -0.0625
v -0.1875 0.625 -0.1875
v -0.1875 0.5 -0.0625
v -0.1875 0.5 -0.1875
v -1.1875 0.625 -0.1875
v -1.1875 0.625 -0.0625
v -1.1875 0.5 -0.1875
v -1.1875 0.5 -0.0625
vt 0.3125 0.9375
vt 0.5625 0.9375
vt 0.5625 0.875
vt 0.3125 0.875
vt 0.28125 0.9375
vt 0.3125 0.9375
vt 0.3125 0.875
vt 0.28125 0.875
vt 0.59375 0.9375
vt 0.84375 0.9375
vt 0.84375 0.875
vt 0.59375 0.875
vt 0.5625 0.9375
vt 0.59375 0.9375
vt 0.59375 0.875
vt 0.5625 0.875
vt 0.5625 0.9375
vt 0.3125 0.9375
vt 0.3125 1
vt 0.5625 1
vt 0.8125 1
vt 0.5625 1
vt 0.5625 0.9375
vt 0.8125 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 68/196/49 71/195/49 69/194/49 66/193/49
f 67/200/50 68/199/50 66/198/50 65/197/50
f 72/204/51 67/203/51 65/202/51 70/201/51
f 71/208/52 72/207/52 70/206/52 69/205/52
f 70/212/53 65/211/53 66/210/53 69/209/53
f 71/216/54 68/215/54 67/214/54 72/213/54
o leg7
v 1.1875 0.625 -0.25
v 1.1875 0.625 -0.375
v 1.1875 0.5 -0.25
v 1.1875 0.5 -0.375
v 0.1875 0.625 -0.375
v 0.1875 0.625 -0.25
v 0.1875 0.5 -0.375
v 0.1875 0.5 -0.25
vt 0.3125 0.9375
vt 0.5625 0.9375
vt 0.5625 0.875
vt 0.3125 0.875
vt 0.28125 0.9375
vt 0.3125 0.9375
vt 0.3125 0.875
vt 0.28125 0.875
vt 0.59375 0.9375
vt 0.84375 0.9375
vt 0.84375 0.875
vt 0.59375 0.875
vt 0.5625 0.9375
vt 0.59375 0.9375
vt 0.59375 0.875
vt 0.5625 0.875
vt 0.5625 0.9375
vt 0.3125 0.9375
vt 0.3125 1
vt 0.5625 1
vt 0.8125 1
vt 0.5625 1
vt 0.5625 0.9375
vt 0.8125 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 76/220/55 79/219/55 77/218/55 74/217/55
f 75/224/56 76/223/56 74/222/56 73/221/56
f 80/228/57 75/227/57 73/226/57 78/225/57
f 79/232/58 80/231/58 78/230/58 77/229/58
f 78/236/59 73/235/59 74/234/59 77/233/59
f 79/240/60 76/239/60 75/238/60 80/237/60
o leg8
v -0.1875 0.625 -0.25
v -0.1875 0.625 -0.375
v -0.1875 0.5 -0.25
v -0.1875 0.5 -0.375
v -1.1875 0.625 -0.375
v -1.1875 0.625 -0.25
v -1.1875 0.5 -0.375
v -1.1875 0.5 -0.25
vt 0.3125 0.9375
vt 0.5625 0.9375
vt 0.5625 0.875
vt 0.3125 0.875
vt 0.28125 0.9375
vt 0.3125 0.9375
vt 0.3125 0.875
vt 0.28125 0.875
vt 0.59375 0.9375
vt 0.84375 0.9375
vt 0.84375 0.875
vt 0.59375 0.875
vt 0.5625 0.9375
vt 0.59375 0.9375
vt 0.59375 0.875
vt 0.5625 0.875
vt 0.5625 0.9375
vt 0.3125 0.9375
vt 0.3125 1
vt 0.5625 1
vt 0.8125 1
vt 0.5625 1
vt 0.5625 0.9375
vt 0.8125 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_d7d56183-3f0b-0dc8-4e40-d26bf80ad79d
f 84/244/61 87/243/61 85/242/61 82/241/61
f 83/248/62 84/247/62 82/246/62 81/245/62
f 88/252/63 83/251/63 81/250/63 86/249/63
f 87/256/64 88/255/64 86/254/64 85/253/64
f 86/260/65 81/259/65 82/258/65 85/257/65
f 87/264/66 84/263/66 83/262/66 88/261/66

BIN
test/Assets/spider.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

647
test/Assets/witch.obj Normal file
View File

@@ -0,0 +1,647 @@
# Made in Blockbench 4.7.4
mtllib witch.mtl
o head
v 0.25 2.125 0.25
v 0.25 2.125 -0.25
v 0.25 1.5 0.25
v 0.25 1.5 -0.25
v -0.25 2.125 -0.25
v -0.25 2.125 0.25
v -0.25 1.5 -0.25
v -0.25 1.5 0.25
vt 0.125 0.9375
vt 0.25 0.9375
vt 0.25 0.859375
vt 0.125 0.859375
vt 0 0.9375
vt 0.125 0.9375
vt 0.125 0.859375
vt 0 0.859375
vt 0.375 0.9375
vt 0.5 0.9375
vt 0.5 0.859375
vt 0.375 0.859375
vt 0.25 0.9375
vt 0.375 0.9375
vt 0.375 0.859375
vt 0.25 0.859375
vt 0.25 0.9375
vt 0.125 0.9375
vt 0.125 1
vt 0.25 1
vt 0.375 1
vt 0.25 1
vt 0.25 0.9375
vt 0.375 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o nose
v 0.0625 1.6875 -0.25
v 0.0625 1.6875 -0.375
v 0.0625 1.4375 -0.25
v 0.0625 1.4375 -0.375
v -0.0625 1.6875 -0.375
v -0.0625 1.6875 -0.25
v -0.0625 1.4375 -0.375
v -0.0625 1.4375 -0.25
vt 0.40625 0.984375
vt 0.4375 0.984375
vt 0.4375 0.953125
vt 0.40625 0.953125
vt 0.375 0.984375
vt 0.40625 0.984375
vt 0.40625 0.953125
vt 0.375 0.953125
vt 0.46875 0.984375
vt 0.5 0.984375
vt 0.5 0.953125
vt 0.46875 0.953125
vt 0.4375 0.984375
vt 0.46875 0.984375
vt 0.46875 0.953125
vt 0.4375 0.953125
vt 0.4375 0.984375
vt 0.40625 0.984375
vt 0.40625 1
vt 0.4375 1
vt 0.46875 1
vt 0.4375 1
vt 0.4375 0.984375
vt 0.46875 0.984375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o headwear
v 0.3125 2.128125 0.3125
v 0.3125 2.128125 -0.3125
v 0.3125 2.003125 0.3125
v 0.3125 2.003125 -0.3125
v -0.3125 2.128125 -0.3125
v -0.3125 2.128125 0.3125
v -0.3125 2.003125 -0.3125
v -0.3125 2.003125 0.3125
vt 0.15625 0.421875
vt 0.3125 0.421875
vt 0.3125 0.40625
vt 0.15625 0.40625
vt 0 0.421875
vt 0.15625 0.421875
vt 0.15625 0.40625
vt 0 0.40625
vt 0.46875 0.421875
vt 0.625 0.421875
vt 0.625 0.40625
vt 0.46875 0.40625
vt 0.3125 0.421875
vt 0.46875 0.421875
vt 0.46875 0.40625
vt 0.3125 0.40625
vt 0.3125 0.421875
vt 0.15625 0.421875
vt 0.15625 0.5
vt 0.3125 0.5
vt 0.46875 0.5
vt 0.3125 0.5
vt 0.3125 0.421875
vt 0.46875 0.421875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o hat2
v 0.20372437308428137 2.3552358653671863 0.24940042145512598
v 0.203125 2.378125 -0.1875
v 0.2102596415117779 2.1056640330286007 0.23631643239439004
v 0.2096602684274964 2.1285531676614142 -0.20058398906073593
v -0.23422507967680634 2.3666725851153054 -0.1875
v -0.2336257065925249 2.343783450482492 0.24940042145512598
v -0.22768981124930981 2.11710075277672 -0.20058398906073593
v -0.22709043816502839 2.0942116181439063 0.23631643239439004
vt 0.109375 0.3515625
vt 0.21875 0.3515625
vt 0.21875 0.3203125
vt 0.109375 0.3203125
vt 0 0.3515625
vt 0.109375 0.3515625
vt 0.109375 0.3203125
vt 0 0.3203125
vt 0.328125 0.3515625
vt 0.4375 0.3515625
vt 0.4375 0.3203125
vt 0.328125 0.3203125
vt 0.21875 0.3515625
vt 0.328125 0.3515625
vt 0.328125 0.3203125
vt 0.21875 0.3203125
vt 0.21875 0.3515625
vt 0.109375 0.3515625
vt 0.109375 0.40625
vt 0.21875 0.40625
vt 0.328125 0.40625
vt 0.21875 0.40625
vt 0.21875 0.3515625
vt 0.328125 0.3515625
vn -0.0013699956212146517 0.052318022017859046 -0.998629534754574
vn 0.9996573249755573 0.026176948307873146 -2.168404344971009e-19
vn 0.0013699956212146517 -0.052318022017859046 0.998629534754574
vn -0.9996573249755573 -0.026176948307873146 2.168404344971009e-19
vn -0.02614107370998589 0.9982873293543426 0.05233595624294382
vn 0.02614107370998589 -0.9982873293543426 -0.05233595624294382
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o hat3
v 0.08981344974850403 2.5792703138557713 0.1973366403696345
v 0.08742346110595378 2.6182939758651793 -0.049587319094942295
v 0.1092760637179142 2.333113621247961 0.15824585703312766
v 0.10688607507536407 2.372137283257369 -0.08867810243144914
v -0.1618063417101745 2.5986971269409396 -0.050272082173908106
v -0.15941635306762436 2.5596734649315316 0.1966518772906687
v -0.14234372774076431 2.3525404343331293 -0.08936286551041495
v -0.13995373909821407 2.3135167723237213 0.15756109395416185
vt 0.0625 0.2890625
vt 0.125 0.2890625
vt 0.125 0.2578125
vt 0.0625 0.2578125
vt 0 0.2890625
vt 0.0625 0.2890625
vt 0.0625 0.2578125
vt 0 0.2578125
vt 0.1875 0.2890625
vt 0.25 0.2890625
vt 0.25 0.2578125
vt 0.1875 0.2578125
vt 0.125 0.2890625
vt 0.1875 0.2890625
vt 0.1875 0.2578125
vt 0.125 0.2578125
vt 0.125 0.2890625
vt 0.0625 0.2890625
vt 0.0625 0.3203125
vt 0.125 0.3203125
vt 0.1875 0.3203125
vt 0.125 0.3203125
vt 0.125 0.2890625
vt 0.1875 0.2890625
vn -0.009559954570200835 0.156094648037632 -0.9876958378583074
vn 0.9969192112645133 0.07838739569696003 0.002739052315863333
vn 0.009559954570200835 -0.156094648037632 0.9876958378583074
vn -0.9969192112645133 -0.07838739569696003 -0.002739052315863333
vn -0.07785045587764094 0.9846267704312412 0.1563631333460272
vn 0.07785045587764094 -0.9846267704312412 -0.1563631333460272
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30
o hat4
v -0.013850619456809932 2.702745857745556 0.17195564532453422
v -0.01826756947611108 2.735987170313404 0.08440812570636547
v 0.013598400761952067 2.559407462410299 0.11614598476524118
v 0.009181450742650976 2.592648774978147 0.028598465147072427
v -0.11045385650719713 2.7190297167621327 0.08262045893689118
v -0.10603690648789604 2.6857884041942848 0.17016797855505994
v -0.08300483628843508 2.5756913214268757 0.026810798377598033
v -0.07858788626913399 2.542450008859028 0.1143583179957669
vt 0.015625 0.25
vt 0.03125 0.25
vt 0.03125 0.234375
vt 0.015625 0.234375
vt 0 0.25
vt 0.015625 0.25
vt 0.015625 0.234375
vt 0 0.234375
vt 0.046875 0.25
vt 0.0625 0.25
vt 0.0625 0.234375
vt 0.046875 0.234375
vt 0.03125 0.25
vt 0.046875 0.25
vt 0.046875 0.234375
vt 0.03125 0.234375
vt 0.03125 0.25
vt 0.015625 0.25
vt 0.015625 0.2578125
vt 0.03125 0.2578125
vt 0.046875 0.2578125
vt 0.03125 0.2578125
vt 0.03125 0.25
vt 0.046875 0.25
vn -0.04711413353921201 0.3545740007237079 -0.9338402092604674
vn 0.9833203949982517 0.18087950454689375 0.019068445541060658
vn 0.04711413353921201 -0.3545740007237079 0.9338402092604674
vn -0.9833203949982517 -0.18087950454689375 -0.019068445541060658
vn -0.17567372940007692 0.9173657301456462 0.3571818275794757
vn 0.17567372940007692 -0.9173657301456462 -0.3571818275794757
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 44/124/31 47/123/31 45/122/31 42/121/31
f 43/128/32 44/127/32 42/126/32 41/125/32
f 48/132/33 43/131/33 41/130/33 46/129/33
f 47/136/34 48/135/34 46/134/34 45/133/34
f 46/140/35 41/139/35 42/138/35 45/137/35
f 47/144/36 44/143/36 43/142/36 48/141/36
o mole
v -0.015625 1.546875 -0.375
v -0.015625 1.546875 -0.40625
v -0.015625 1.515625 -0.375
v -0.015625 1.515625 -0.40625
v -0.046875 1.546875 -0.40625
v -0.046875 1.546875 -0.375
v -0.046875 1.515625 -0.40625
v -0.046875 1.515625 -0.375
vt 0.015625 0.9921875
vt 0.03125 0.9921875
vt 0.03125 0.984375
vt 0.015625 0.984375
vt 0 0.9921875
vt 0.015625 0.9921875
vt 0.015625 0.984375
vt 0 0.984375
vt 0.046875 0.9921875
vt 0.0625 0.9921875
vt 0.0625 0.984375
vt 0.046875 0.984375
vt 0.03125 0.9921875
vt 0.046875 0.9921875
vt 0.046875 0.984375
vt 0.03125 0.984375
vt 0.03125 0.9921875
vt 0.015625 0.9921875
vt 0.015625 1
vt 0.03125 1
vt 0.046875 1
vt 0.03125 1
vt 0.03125 0.9921875
vt 0.046875 0.9921875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 52/148/37 55/147/37 53/146/37 50/145/37
f 51/152/38 52/151/38 50/150/38 49/149/38
f 56/156/39 51/155/39 49/154/39 54/153/39
f 55/160/40 56/159/40 54/158/40 53/157/40
f 54/164/41 49/163/41 50/162/41 53/161/41
f 55/168/42 52/167/42 51/166/42 56/165/42
o body
v 0.25 1.5 0.1875
v 0.25 1.5 -0.1875
v 0.25 0.75 0.1875
v 0.25 0.75 -0.1875
v -0.25 1.5 -0.1875
v -0.25 1.5 0.1875
v -0.25 0.75 -0.1875
v -0.25 0.75 0.1875
vt 0.34375 0.796875
vt 0.46875 0.796875
vt 0.46875 0.703125
vt 0.34375 0.703125
vt 0.25 0.796875
vt 0.34375 0.796875
vt 0.34375 0.703125
vt 0.25 0.703125
vt 0.5625 0.796875
vt 0.6875 0.796875
vt 0.6875 0.703125
vt 0.5625 0.703125
vt 0.46875 0.796875
vt 0.5625 0.796875
vt 0.5625 0.703125
vt 0.46875 0.703125
vt 0.46875 0.796875
vt 0.34375 0.796875
vt 0.34375 0.84375
vt 0.46875 0.84375
vt 0.59375 0.84375
vt 0.46875 0.84375
vt 0.46875 0.796875
vt 0.59375 0.796875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 60/172/43 63/171/43 61/170/43 58/169/43
f 59/176/44 60/175/44 58/174/44 57/173/44
f 64/180/45 59/179/45 57/178/45 62/177/45
f 63/184/46 64/183/46 62/182/46 61/181/46
f 62/188/47 57/187/47 58/186/47 61/185/47
f 63/192/48 60/191/48 59/190/48 64/189/48
o bodywear
v 0.265625 1.515625 0.203125
v 0.265625 1.515625 -0.203125
v 0.265625 0.234375 0.203125
v 0.265625 0.234375 -0.203125
v -0.265625 1.515625 -0.203125
v -0.265625 1.515625 0.203125
v -0.265625 0.234375 -0.203125
v -0.265625 0.234375 0.203125
vt 0.09375 0.65625
vt 0.21875 0.65625
vt 0.21875 0.5
vt 0.09375 0.5
vt 0 0.65625
vt 0.09375 0.65625
vt 0.09375 0.5
vt 0 0.5
vt 0.3125 0.65625
vt 0.4375 0.65625
vt 0.4375 0.5
vt 0.3125 0.5
vt 0.21875 0.65625
vt 0.3125 0.65625
vt 0.3125 0.5
vt 0.21875 0.5
vt 0.21875 0.65625
vt 0.09375 0.65625
vt 0.09375 0.703125
vt 0.21875 0.703125
vt 0.34375 0.703125
vt 0.21875 0.703125
vt 0.21875 0.65625
vt 0.34375 0.65625
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 68/196/49 71/195/49 69/194/49 66/193/49
f 67/200/50 68/199/50 66/198/50 65/197/50
f 72/204/51 67/203/51 65/202/51 70/201/51
f 71/208/52 72/207/52 70/206/52 69/205/52
f 70/212/53 65/211/53 66/210/53 69/209/53
f 71/216/54 68/215/54 67/214/54 72/213/54
o arms
v 0.25 1.1389559922897914 -0.05945558230541603
v 0.25 1.309455582305416 -0.2422940077102086
v 0.25 0.9561175668849988 -0.22995517232104068
v 0.25 1.1266171569006236 -0.41279359772583324
v -0.25 1.309455582305416 -0.2422940077102086
v -0.25 1.1389559922897914 -0.05945558230541603
v -0.25 1.1266171569006236 -0.41279359772583324
v -0.25 0.9561175668849988 -0.22995517232104068
vt 0.6875 0.671875
vt 0.8125 0.671875
vt 0.8125 0.640625
vt 0.6875 0.640625
vt 0.625 0.671875
vt 0.6875 0.671875
vt 0.6875 0.640625
vt 0.625 0.640625
vt 0.875 0.671875
vt 1 0.671875
vt 1 0.640625
vt 0.875 0.640625
vt 0.8125 0.671875
vt 0.875 0.671875
vt 0.875 0.640625
vt 0.8125 0.640625
vt 0.8125 0.671875
vt 0.6875 0.671875
vt 0.6875 0.703125
vt 0.8125 0.703125
vt 0.9375 0.703125
vt 0.8125 0.703125
vt 0.8125 0.671875
vt 0.9375 0.671875
vn 0 0.6819983600624986 -0.7313537016191706
vn 1 0 0
vn 0 -0.6819983600624986 0.7313537016191706
vn -1 0 0
vn 0 0.7313537016191706 0.6819983600624986
vn 0 -0.7313537016191706 -0.6819983600624986
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 76/220/55 79/219/55 77/218/55 74/217/55
f 75/224/56 76/223/56 74/222/56 73/221/56
f 80/228/57 75/227/57 73/226/57 78/225/57
f 79/232/58 80/231/58 78/230/58 77/229/58
f 78/236/59 73/235/59 74/234/59 77/233/59
f 79/240/60 76/239/60 75/238/60 80/237/60
o arms
v 0.5 1.321794417694584 0.11104400771020873
v 0.5 1.4922940077102087 -0.07179441769458395
v 0.5 0.9561175668849988 -0.22995517232104068
v 0.5 1.1266171569006236 -0.41279359772583324
v 0.25 1.4922940077102087 -0.07179441769458395
v 0.25 1.321794417694584 0.11104400771020873
v 0.25 1.1266171569006236 -0.41279359772583324
v 0.25 0.9561175668849988 -0.22995517232104068
vt 0.75 0.796875
vt 0.8125 0.796875
vt 0.8125 0.734375
vt 0.75 0.734375
vt 0.6875 0.796875
vt 0.75 0.796875
vt 0.75 0.734375
vt 0.6875 0.734375
vt 0.875 0.796875
vt 0.9375 0.796875
vt 0.9375 0.734375
vt 0.875 0.734375
vt 0.8125 0.796875
vt 0.875 0.796875
vt 0.875 0.734375
vt 0.8125 0.734375
vt 0.8125 0.796875
vt 0.75 0.796875
vt 0.75 0.828125
vt 0.8125 0.828125
vt 0.875 0.828125
vt 0.8125 0.828125
vt 0.8125 0.796875
vt 0.875 0.796875
vn 0 0.6819983600624986 -0.7313537016191706
vn 1 0 0
vn 0 -0.6819983600624986 0.7313537016191706
vn -1 0 0
vn 0 0.7313537016191706 0.6819983600624986
vn 0 -0.7313537016191706 -0.6819983600624986
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 84/244/61 87/243/61 85/242/61 82/241/61
f 83/248/62 84/247/62 82/246/62 81/245/62
f 88/252/63 83/251/63 81/250/63 86/249/63
f 87/256/64 88/255/64 86/254/64 85/253/64
f 86/260/65 81/259/65 82/258/65 85/257/65
f 87/264/66 84/263/66 83/262/66 88/261/66
o mirrored
v -0.25 1.321794417694584 0.11104400771020873
v -0.25 1.4922940077102087 -0.07179441769458395
v -0.25 0.9561175668849988 -0.22995517232104068
v -0.25 1.1266171569006236 -0.41279359772583324
v -0.5 1.4922940077102087 -0.07179441769458395
v -0.5 1.321794417694584 0.11104400771020873
v -0.5 1.1266171569006236 -0.41279359772583324
v -0.5 0.9561175668849988 -0.22995517232104068
vt 0.8125 0.796875
vt 0.75 0.796875
vt 0.75 0.734375
vt 0.8125 0.734375
vt 0.875 0.796875
vt 0.8125 0.796875
vt 0.8125 0.734375
vt 0.875 0.734375
vt 0.9375 0.796875
vt 0.875 0.796875
vt 0.875 0.734375
vt 0.9375 0.734375
vt 0.75 0.796875
vt 0.6875 0.796875
vt 0.6875 0.734375
vt 0.75 0.734375
vt 0.75 0.796875
vt 0.8125 0.796875
vt 0.8125 0.828125
vt 0.75 0.828125
vt 0.8125 0.828125
vt 0.875 0.828125
vt 0.875 0.796875
vt 0.8125 0.796875
vn 0 0.6819983600624986 -0.7313537016191706
vn 1 0 0
vn 0 -0.6819983600624986 0.7313537016191706
vn -1 0 0
vn 0 0.7313537016191706 0.6819983600624986
vn 0 -0.7313537016191706 -0.6819983600624986
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 92/268/67 95/267/67 93/266/67 90/265/67
f 91/272/68 92/271/68 90/270/68 89/269/68
f 96/276/69 91/275/69 89/274/69 94/273/69
f 95/280/70 96/279/70 94/278/70 93/277/70
f 94/284/71 89/283/71 90/282/71 93/281/71
f 95/288/72 92/287/72 91/286/72 96/285/72
o left_leg
v 0 0.75 0.125
v 0 0.75 -0.125
v 0 0 0.125
v 0 0 -0.125
v -0.25 0.75 -0.125
v -0.25 0.75 0.125
v -0.25 0 -0.125
v -0.25 0 0.125
vt 0.0625 0.796875
vt 0.125 0.796875
vt 0.125 0.703125
vt 0.0625 0.703125
vt 0 0.796875
vt 0.0625 0.796875
vt 0.0625 0.703125
vt 0 0.703125
vt 0.1875 0.796875
vt 0.25 0.796875
vt 0.25 0.703125
vt 0.1875 0.703125
vt 0.125 0.796875
vt 0.1875 0.796875
vt 0.1875 0.703125
vt 0.125 0.703125
vt 0.125 0.796875
vt 0.0625 0.796875
vt 0.0625 0.828125
vt 0.125 0.828125
vt 0.1875 0.828125
vt 0.125 0.828125
vt 0.125 0.796875
vt 0.1875 0.796875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 100/292/73 103/291/73 101/290/73 98/289/73
f 99/296/74 100/295/74 98/294/74 97/293/74
f 104/300/75 99/299/75 97/298/75 102/297/75
f 103/304/76 104/303/76 102/302/76 101/301/76
f 102/308/77 97/307/77 98/306/77 101/305/77
f 103/312/78 100/311/78 99/310/78 104/309/78
o right_leg
v 0.25 0.75 0.125
v 0.25 0.75 -0.125
v 0.25 0 0.125
v 0.25 0 -0.125
v 0 0.75 -0.125
v 0 0.75 0.125
v 0 0 -0.125
v 0 0 0.125
vt 0.125 0.796875
vt 0.0625 0.796875
vt 0.0625 0.703125
vt 0.125 0.703125
vt 0.1875 0.796875
vt 0.125 0.796875
vt 0.125 0.703125
vt 0.1875 0.703125
vt 0.25 0.796875
vt 0.1875 0.796875
vt 0.1875 0.703125
vt 0.25 0.703125
vt 0.0625 0.796875
vt 0 0.796875
vt 0 0.703125
vt 0.0625 0.703125
vt 0.0625 0.796875
vt 0.125 0.796875
vt 0.125 0.828125
vt 0.0625 0.828125
vt 0.125 0.828125
vt 0.1875 0.828125
vt 0.1875 0.796875
vt 0.125 0.796875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_40b32794-4a78-1676-291e-c0f7c4dcf4f5
f 108/316/79 111/315/79 109/314/79 106/313/79
f 107/320/80 108/319/80 106/318/80 105/317/80
f 112/324/81 107/323/81 105/322/81 110/321/81
f 111/328/82 112/327/82 110/326/82 109/325/82
f 110/332/83 105/331/83 106/330/83 109/329/83
f 111/336/84 108/335/84 107/334/84 112/333/84

BIN
test/Assets/witch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

325
test/Assets/zombie.obj Normal file
View File

@@ -0,0 +1,325 @@
# Made in Blockbench 4.7.4
mtllib zombie.mtl
o head
v 0.25 2 0.25
v 0.25 2 -0.25
v 0.25 1.5 0.25
v 0.25 1.5 -0.25
v -0.25 2 -0.25
v -0.25 2 0.25
v -0.25 1.5 -0.25
v -0.25 1.5 0.25
vt 0.125 0.875
vt 0.25 0.875
vt 0.25 0.75
vt 0.125 0.75
vt 0 0.875
vt 0.125 0.875
vt 0.125 0.75
vt 0 0.75
vt 0.375 0.875
vt 0.5 0.875
vt 0.5 0.75
vt 0.375 0.75
vt 0.25 0.875
vt 0.375 0.875
vt 0.375 0.75
vt 0.25 0.75
vt 0.25 0.875
vt 0.125 0.875
vt 0.125 1
vt 0.25 1
vt 0.375 1
vt 0.25 1
vt 0.25 0.875
vt 0.375 0.875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4184772e-6eaa-d410-671b-5149facc089e
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o headwear
v 0.28125 2.03125 0.28125
v 0.28125 2.03125 -0.28125
v 0.28125 1.46875 0.28125
v 0.28125 1.46875 -0.28125
v -0.28125 2.03125 -0.28125
v -0.28125 2.03125 0.28125
v -0.28125 1.46875 -0.28125
v -0.28125 1.46875 0.28125
vt 0.625 0.875
vt 0.75 0.875
vt 0.75 0.75
vt 0.625 0.75
vt 0.5 0.875
vt 0.625 0.875
vt 0.625 0.75
vt 0.5 0.75
vt 0.875 0.875
vt 1 0.875
vt 1 0.75
vt 0.875 0.75
vt 0.75 0.875
vt 0.875 0.875
vt 0.875 0.75
vt 0.75 0.75
vt 0.75 0.875
vt 0.625 0.875
vt 0.625 1
vt 0.75 1
vt 0.875 1
vt 0.75 1
vt 0.75 0.875
vt 0.875 0.875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4184772e-6eaa-d410-671b-5149facc089e
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o body
v 0.25 1.5 0.125
v 0.25 1.5 -0.125
v 0.25 0.75 0.125
v 0.25 0.75 -0.125
v -0.25 1.5 -0.125
v -0.25 1.5 0.125
v -0.25 0.75 -0.125
v -0.25 0.75 0.125
vt 0.3125 0.6875
vt 0.4375 0.6875
vt 0.4375 0.5
vt 0.3125 0.5
vt 0.25 0.6875
vt 0.3125 0.6875
vt 0.3125 0.5
vt 0.25 0.5
vt 0.5 0.6875
vt 0.625 0.6875
vt 0.625 0.5
vt 0.5 0.5
vt 0.4375 0.6875
vt 0.5 0.6875
vt 0.5 0.5
vt 0.4375 0.5
vt 0.4375 0.6875
vt 0.3125 0.6875
vt 0.3125 0.75
vt 0.4375 0.75
vt 0.5625 0.75
vt 0.4375 0.75
vt 0.4375 0.6875
vt 0.5625 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4184772e-6eaa-d410-671b-5149facc089e
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o left_arm
v -0.25 1.5 0.125
v -0.25 1.5 -0.125
v -0.25 0.75 0.125
v -0.25 0.75 -0.125
v -0.5 1.5 -0.125
v -0.5 1.5 0.125
v -0.5 0.75 -0.125
v -0.5 0.75 0.125
vt 0.75 0.6875
vt 0.6875 0.6875
vt 0.6875 0.5
vt 0.75 0.5
vt 0.8125 0.6875
vt 0.75 0.6875
vt 0.75 0.5
vt 0.8125 0.5
vt 0.875 0.6875
vt 0.8125 0.6875
vt 0.8125 0.5
vt 0.875 0.5
vt 0.6875 0.6875
vt 0.625 0.6875
vt 0.625 0.5
vt 0.6875 0.5
vt 0.6875 0.6875
vt 0.75 0.6875
vt 0.75 0.75
vt 0.6875 0.75
vt 0.75 0.75
vt 0.8125 0.75
vt 0.8125 0.6875
vt 0.75 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4184772e-6eaa-d410-671b-5149facc089e
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o right_arm
v 0.5 1.5 0.125
v 0.5 1.5 -0.125
v 0.5 0.75 0.125
v 0.5 0.75 -0.125
v 0.25 1.5 -0.125
v 0.25 1.5 0.125
v 0.25 0.75 -0.125
v 0.25 0.75 0.125
vt 0.6875 0.6875
vt 0.75 0.6875
vt 0.75 0.5
vt 0.6875 0.5
vt 0.625 0.6875
vt 0.6875 0.6875
vt 0.6875 0.5
vt 0.625 0.5
vt 0.8125 0.6875
vt 0.875 0.6875
vt 0.875 0.5
vt 0.8125 0.5
vt 0.75 0.6875
vt 0.8125 0.6875
vt 0.8125 0.5
vt 0.75 0.5
vt 0.75 0.6875
vt 0.6875 0.6875
vt 0.6875 0.75
vt 0.75 0.75
vt 0.8125 0.75
vt 0.75 0.75
vt 0.75 0.6875
vt 0.8125 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4184772e-6eaa-d410-671b-5149facc089e
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30
o left_leg
v 0 0.75 0.125
v 0 0.75 -0.125
v 0 0 0.125
v 0 0 -0.125
v -0.25 0.75 -0.125
v -0.25 0.75 0.125
v -0.25 0 -0.125
v -0.25 0 0.125
vt 0.125 0.6875
vt 0.0625 0.6875
vt 0.0625 0.5
vt 0.125 0.5
vt 0.1875 0.6875
vt 0.125 0.6875
vt 0.125 0.5
vt 0.1875 0.5
vt 0.25 0.6875
vt 0.1875 0.6875
vt 0.1875 0.5
vt 0.25 0.5
vt 0.0625 0.6875
vt 0 0.6875
vt 0 0.5
vt 0.0625 0.5
vt 0.0625 0.6875
vt 0.125 0.6875
vt 0.125 0.75
vt 0.0625 0.75
vt 0.125 0.75
vt 0.1875 0.75
vt 0.1875 0.6875
vt 0.125 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4184772e-6eaa-d410-671b-5149facc089e
f 44/124/31 47/123/31 45/122/31 42/121/31
f 43/128/32 44/127/32 42/126/32 41/125/32
f 48/132/33 43/131/33 41/130/33 46/129/33
f 47/136/34 48/135/34 46/134/34 45/133/34
f 46/140/35 41/139/35 42/138/35 45/137/35
f 47/144/36 44/143/36 43/142/36 48/141/36
o right_leg
v 0.25 0.75 0.125
v 0.25 0.75 -0.125
v 0.25 0 0.125
v 0.25 0 -0.125
v 0 0.75 -0.125
v 0 0.75 0.125
v 0 0 -0.125
v 0 0 0.125
vt 0.0625 0.6875
vt 0.125 0.6875
vt 0.125 0.5
vt 0.0625 0.5
vt 0 0.6875
vt 0.0625 0.6875
vt 0.0625 0.5
vt 0 0.5
vt 0.1875 0.6875
vt 0.25 0.6875
vt 0.25 0.5
vt 0.1875 0.5
vt 0.125 0.6875
vt 0.1875 0.6875
vt 0.1875 0.5
vt 0.125 0.5
vt 0.125 0.6875
vt 0.0625 0.6875
vt 0.0625 0.75
vt 0.125 0.75
vt 0.1875 0.75
vt 0.125 0.75
vt 0.125 0.6875
vt 0.1875 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_4184772e-6eaa-d410-671b-5149facc089e
f 52/148/37 55/147/37 53/146/37 50/145/37
f 51/152/38 52/151/38 50/150/38 49/149/38
f 56/156/39 51/155/39 49/154/39 54/153/39
f 55/160/40 56/159/40 54/158/40 53/157/40
f 54/164/41 49/163/41 50/162/41 53/161/41
f 55/168/42 52/167/42 51/166/42 56/165/42

BIN
test/Assets/zombie.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

View File

@@ -0,0 +1,739 @@
# Made in Blockbench 4.7.4
mtllib zombified_piglin.mtl
o head
v 0.3125 2 0.25
v 0.3125 2 -0.25
v 0.3125 1.5 0.25
v 0.3125 1.5 -0.25
v -0.3125 2 -0.25
v -0.3125 2 0.25
v -0.3125 1.5 -0.25
v -0.3125 1.5 0.25
vt 0.125 0.875
vt 0.28125 0.875
vt 0.28125 0.75
vt 0.125 0.75
vt 0 0.875
vt 0.125 0.875
vt 0.125 0.75
vt 0 0.75
vt 0.40625 0.875
vt 0.5625 0.875
vt 0.5625 0.75
vt 0.40625 0.75
vt 0.28125 0.875
vt 0.40625 0.875
vt 0.40625 0.75
vt 0.28125 0.75
vt 0.28125 0.875
vt 0.125 0.875
vt 0.125 1
vt 0.28125 1
vt 0.4375 1
vt 0.28125 1
vt 0.28125 0.875
vt 0.4375 0.875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o head
v 0.125 1.75 -0.25
v 0.125 1.75 -0.3125
v 0.125 1.5 -0.25
v 0.125 1.5 -0.3125
v -0.125 1.75 -0.3125
v -0.125 1.75 -0.25
v -0.125 1.5 -0.3125
v -0.125 1.5 -0.25
vt 0.5 0.96875
vt 0.5625 0.96875
vt 0.5625 0.90625
vt 0.5 0.90625
vt 0.484375 0.96875
vt 0.5 0.96875
vt 0.5 0.90625
vt 0.484375 0.90625
vt 0.578125 0.96875
vt 0.640625 0.96875
vt 0.640625 0.90625
vt 0.578125 0.90625
vt 0.5625 0.96875
vt 0.578125 0.96875
vt 0.578125 0.90625
vt 0.5625 0.90625
vt 0.5625 0.96875
vt 0.5 0.96875
vt 0.5 0.984375
vt 0.5625 0.984375
vt 0.625 0.984375
vt 0.5625 0.984375
vt 0.5625 0.96875
vt 0.625 0.96875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o head
v -0.125 1.625 -0.25
v -0.125 1.625 -0.3125
v -0.125 1.5 -0.25
v -0.125 1.5 -0.3125
v -0.1875 1.625 -0.3125
v -0.1875 1.625 -0.25
v -0.1875 1.5 -0.3125
v -0.1875 1.5 -0.25
vt 0.046875 0.921875
vt 0.0625 0.921875
vt 0.0625 0.890625
vt 0.046875 0.890625
vt 0.03125 0.921875
vt 0.046875 0.921875
vt 0.046875 0.890625
vt 0.03125 0.890625
vt 0.078125 0.921875
vt 0.09375 0.921875
vt 0.09375 0.890625
vt 0.078125 0.890625
vt 0.0625 0.921875
vt 0.078125 0.921875
vt 0.078125 0.890625
vt 0.0625 0.890625
vt 0.0625 0.921875
vt 0.046875 0.921875
vt 0.046875 0.9375
vt 0.0625 0.9375
vt 0.078125 0.9375
vt 0.0625 0.9375
vt 0.0625 0.921875
vt 0.078125 0.921875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o head
v 0.1875 1.625 -0.25
v 0.1875 1.625 -0.3125
v 0.1875 1.5 -0.25
v 0.1875 1.5 -0.3125
v 0.125 1.625 -0.3125
v 0.125 1.625 -0.25
v 0.125 1.5 -0.3125
v 0.125 1.5 -0.25
vt 0.046875 0.984375
vt 0.0625 0.984375
vt 0.0625 0.953125
vt 0.046875 0.953125
vt 0.03125 0.984375
vt 0.046875 0.984375
vt 0.046875 0.953125
vt 0.03125 0.953125
vt 0.078125 0.984375
vt 0.09375 0.984375
vt 0.09375 0.953125
vt 0.078125 0.953125
vt 0.0625 0.984375
vt 0.078125 0.984375
vt 0.078125 0.953125
vt 0.0625 0.953125
vt 0.0625 0.984375
vt 0.046875 0.984375
vt 0.046875 1
vt 0.0625 1
vt 0.078125 1
vt 0.0625 1
vt 0.0625 0.984375
vt 0.078125 0.984375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24
o left_ear
v -0.28125 1.875 0.125
v -0.28125 1.875 -0.125
v -0.4604926363597017 1.6190149861596899 0.125
v -0.4604926363597017 1.6190149861596899 -0.125
v -0.33244700276806194 1.9108485272719404 -0.125
v -0.33244700276806194 1.9108485272719404 0.125
v -0.5116896391277637 1.6548635134316303 -0.125
v -0.5116896391277637 1.6548635134316303 0.125
vt 0.859375 0.84375
vt 0.875 0.84375
vt 0.875 0.765625
vt 0.859375 0.765625
vt 0.796875 0.84375
vt 0.859375 0.84375
vt 0.859375 0.765625
vt 0.796875 0.765625
vt 0.9375 0.84375
vt 0.953125 0.84375
vt 0.953125 0.765625
vt 0.9375 0.765625
vt 0.875 0.84375
vt 0.9375 0.84375
vt 0.9375 0.765625
vt 0.875 0.765625
vt 0.875 0.84375
vt 0.859375 0.84375
vt 0.859375 0.90625
vt 0.875 0.90625
vt 0.890625 0.90625
vt 0.875 0.90625
vt 0.875 0.84375
vt 0.890625 0.84375
vn 0 0 -1
vn 0.8191520442889918 -0.573576436351046 0
vn 0 0 1
vn -0.8191520442889918 0.573576436351046 0
vn 0.573576436351046 0.8191520442889918 0
vn -0.573576436351046 -0.8191520442889918 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 36/100/25 39/99/25 37/98/25 34/97/25
f 35/104/26 36/103/26 34/102/26 33/101/26
f 40/108/27 35/107/27 33/106/27 38/105/27
f 39/112/28 40/111/28 38/110/28 37/109/28
f 38/116/29 33/115/29 34/114/29 37/113/29
f 39/120/30 36/119/30 35/118/30 40/117/30
o right_ear
v 0.33244700276806194 1.9108485272719404 0.125
v 0.33244700276806194 1.9108485272719404 -0.125
v 0.5116896391277637 1.6548635134316303 0.125
v 0.5116896391277637 1.6548635134316303 -0.125
v 0.28125 1.875 -0.125
v 0.28125 1.875 0.125
v 0.4604926363597017 1.6190149861596899 -0.125
v 0.4604926363597017 1.6190149861596899 0.125
vt 0.671875 0.84375
vt 0.6875 0.84375
vt 0.6875 0.765625
vt 0.671875 0.765625
vt 0.609375 0.84375
vt 0.671875 0.84375
vt 0.671875 0.765625
vt 0.609375 0.765625
vt 0.75 0.84375
vt 0.765625 0.84375
vt 0.765625 0.765625
vt 0.75 0.765625
vt 0.6875 0.84375
vt 0.75 0.84375
vt 0.75 0.765625
vt 0.6875 0.765625
vt 0.6875 0.84375
vt 0.671875 0.84375
vt 0.671875 0.90625
vt 0.6875 0.90625
vt 0.703125 0.90625
vt 0.6875 0.90625
vt 0.6875 0.84375
vt 0.703125 0.84375
vn 0 0 -1
vn 0.8191520442889918 0.573576436351046 0
vn 0 0 1
vn -0.8191520442889918 -0.573576436351046 0
vn -0.573576436351046 0.8191520442889918 0
vn 0.573576436351046 -0.8191520442889918 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 44/124/31 47/123/31 45/122/31 42/121/31
f 43/128/32 44/127/32 42/126/32 41/125/32
f 48/132/33 43/131/33 41/130/33 46/129/33
f 47/136/34 48/135/34 46/134/34 45/133/34
f 46/140/35 41/139/35 42/138/35 45/137/35
f 47/144/36 44/143/36 43/142/36 48/141/36
o body
v 0.25 1.5 0.125
v 0.25 1.5 -0.125
v 0.25 0.75 0.125
v 0.25 0.75 -0.125
v -0.25 1.5 -0.125
v -0.25 1.5 0.125
v -0.25 0.75 -0.125
v -0.25 0.75 0.125
vt 0.3125 0.6875
vt 0.4375 0.6875
vt 0.4375 0.5
vt 0.3125 0.5
vt 0.25 0.6875
vt 0.3125 0.6875
vt 0.3125 0.5
vt 0.25 0.5
vt 0.5 0.6875
vt 0.625 0.6875
vt 0.625 0.5
vt 0.5 0.5
vt 0.4375 0.6875
vt 0.5 0.6875
vt 0.5 0.5
vt 0.4375 0.5
vt 0.4375 0.6875
vt 0.3125 0.6875
vt 0.3125 0.75
vt 0.4375 0.75
vt 0.5625 0.75
vt 0.4375 0.75
vt 0.4375 0.6875
vt 0.5625 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 52/148/37 55/147/37 53/146/37 50/145/37
f 51/152/38 52/151/38 50/150/38 49/149/38
f 56/156/39 51/155/39 49/154/39 54/153/39
f 55/160/40 56/159/40 54/158/40 53/157/40
f 54/164/41 49/163/41 50/162/41 53/161/41
f 55/168/42 52/167/42 51/166/42 56/165/42
o jacket
v 0.265625 1.515625 0.140625
v 0.265625 1.515625 -0.140625
v 0.265625 0.734375 0.140625
v 0.265625 0.734375 -0.140625
v -0.265625 1.515625 -0.140625
v -0.265625 1.515625 0.140625
v -0.265625 0.734375 -0.140625
v -0.265625 0.734375 0.140625
vt 0.3125 0.4375
vt 0.4375 0.4375
vt 0.4375 0.25
vt 0.3125 0.25
vt 0.25 0.4375
vt 0.3125 0.4375
vt 0.3125 0.25
vt 0.25 0.25
vt 0.5 0.4375
vt 0.625 0.4375
vt 0.625 0.25
vt 0.5 0.25
vt 0.4375 0.4375
vt 0.5 0.4375
vt 0.5 0.25
vt 0.4375 0.25
vt 0.4375 0.4375
vt 0.3125 0.4375
vt 0.3125 0.5
vt 0.4375 0.5
vt 0.5625 0.5
vt 0.4375 0.5
vt 0.4375 0.4375
vt 0.5625 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 60/172/43 63/171/43 61/170/43 58/169/43
f 59/176/44 60/175/44 58/174/44 57/173/44
f 64/180/45 59/179/45 57/178/45 62/177/45
f 63/184/46 64/183/46 62/182/46 61/181/46
f 62/188/47 57/187/47 58/186/47 61/185/47
f 63/192/48 60/191/48 59/190/48 64/189/48
o left_arm
v -0.25 1.5 0.125
v -0.25 1.5 -0.125
v -0.25 0.75 0.125
v -0.25 0.75 -0.125
v -0.5 1.5 -0.125
v -0.5 1.5 0.125
v -0.5 0.75 -0.125
v -0.5 0.75 0.125
vt 0.5625 0.1875
vt 0.625 0.1875
vt 0.625 0
vt 0.5625 0
vt 0.5 0.1875
vt 0.5625 0.1875
vt 0.5625 0
vt 0.5 0
vt 0.6875 0.1875
vt 0.75 0.1875
vt 0.75 0
vt 0.6875 0
vt 0.625 0.1875
vt 0.6875 0.1875
vt 0.6875 0
vt 0.625 0
vt 0.625 0.1875
vt 0.5625 0.1875
vt 0.5625 0.25
vt 0.625 0.25
vt 0.6875 0.25
vt 0.625 0.25
vt 0.625 0.1875
vt 0.6875 0.1875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 68/196/49 71/195/49 69/194/49 66/193/49
f 67/200/50 68/199/50 66/198/50 65/197/50
f 72/204/51 67/203/51 65/202/51 70/201/51
f 71/208/52 72/207/52 70/206/52 69/205/52
f 70/212/53 65/211/53 66/210/53 69/209/53
f 71/216/54 68/215/54 67/214/54 72/213/54
o left_sleeve
v -0.234375 1.515625 0.140625
v -0.234375 1.515625 -0.140625
v -0.234375 0.734375 0.140625
v -0.234375 0.734375 -0.140625
v -0.515625 1.515625 -0.140625
v -0.515625 1.515625 0.140625
v -0.515625 0.734375 -0.140625
v -0.515625 0.734375 0.140625
vt 0.8125 0.1875
vt 0.875 0.1875
vt 0.875 0
vt 0.8125 0
vt 0.75 0.1875
vt 0.8125 0.1875
vt 0.8125 0
vt 0.75 0
vt 0.9375 0.1875
vt 1 0.1875
vt 1 0
vt 0.9375 0
vt 0.875 0.1875
vt 0.9375 0.1875
vt 0.9375 0
vt 0.875 0
vt 0.875 0.1875
vt 0.8125 0.1875
vt 0.8125 0.25
vt 0.875 0.25
vt 0.9375 0.25
vt 0.875 0.25
vt 0.875 0.1875
vt 0.9375 0.1875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 76/220/55 79/219/55 77/218/55 74/217/55
f 75/224/56 76/223/56 74/222/56 73/221/56
f 80/228/57 75/227/57 73/226/57 78/225/57
f 79/232/58 80/231/58 78/230/58 77/229/58
f 78/236/59 73/235/59 74/234/59 77/233/59
f 79/240/60 76/239/60 75/238/60 80/237/60
o right_arm
v 0.5 1.5 0.125
v 0.5 1.5 -0.125
v 0.5 0.75 0.125
v 0.5 0.75 -0.125
v 0.25 1.5 -0.125
v 0.25 1.5 0.125
v 0.25 0.75 -0.125
v 0.25 0.75 0.125
vt 0.6875 0.6875
vt 0.75 0.6875
vt 0.75 0.5
vt 0.6875 0.5
vt 0.625 0.6875
vt 0.6875 0.6875
vt 0.6875 0.5
vt 0.625 0.5
vt 0.8125 0.6875
vt 0.875 0.6875
vt 0.875 0.5
vt 0.8125 0.5
vt 0.75 0.6875
vt 0.8125 0.6875
vt 0.8125 0.5
vt 0.75 0.5
vt 0.75 0.6875
vt 0.6875 0.6875
vt 0.6875 0.75
vt 0.75 0.75
vt 0.8125 0.75
vt 0.75 0.75
vt 0.75 0.6875
vt 0.8125 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 84/244/61 87/243/61 85/242/61 82/241/61
f 83/248/62 84/247/62 82/246/62 81/245/62
f 88/252/63 83/251/63 81/250/63 86/249/63
f 87/256/64 88/255/64 86/254/64 85/253/64
f 86/260/65 81/259/65 82/258/65 85/257/65
f 87/264/66 84/263/66 83/262/66 88/261/66
o right_sleeve
v 0.515625 1.515625 0.140625
v 0.515625 1.515625 -0.140625
v 0.515625 0.734375 0.140625
v 0.515625 0.734375 -0.140625
v 0.234375 1.515625 -0.140625
v 0.234375 1.515625 0.140625
v 0.234375 0.734375 -0.140625
v 0.234375 0.734375 0.140625
vt 0.6875 0.4375
vt 0.75 0.4375
vt 0.75 0.25
vt 0.6875 0.25
vt 0.625 0.4375
vt 0.6875 0.4375
vt 0.6875 0.25
vt 0.625 0.25
vt 0.8125 0.4375
vt 0.875 0.4375
vt 0.875 0.25
vt 0.8125 0.25
vt 0.75 0.4375
vt 0.8125 0.4375
vt 0.8125 0.25
vt 0.75 0.25
vt 0.75 0.4375
vt 0.6875 0.4375
vt 0.6875 0.5
vt 0.75 0.5
vt 0.8125 0.5
vt 0.75 0.5
vt 0.75 0.4375
vt 0.8125 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 92/268/67 95/267/67 93/266/67 90/265/67
f 91/272/68 92/271/68 90/270/68 89/269/68
f 96/276/69 91/275/69 89/274/69 94/273/69
f 95/280/70 96/279/70 94/278/70 93/277/70
f 94/284/71 89/283/71 90/282/71 93/281/71
f 95/288/72 92/287/72 91/286/72 96/285/72
o left_leg
v 0 0.75 0.125
v 0 0.75 -0.125
v 0 0 0.125
v 0 0 -0.125
v -0.25 0.75 -0.125
v -0.25 0.75 0.125
v -0.25 0 -0.125
v -0.25 0 0.125
vt 0.3125 0.1875
vt 0.375 0.1875
vt 0.375 0
vt 0.3125 0
vt 0.25 0.1875
vt 0.3125 0.1875
vt 0.3125 0
vt 0.25 0
vt 0.4375 0.1875
vt 0.5 0.1875
vt 0.5 0
vt 0.4375 0
vt 0.375 0.1875
vt 0.4375 0.1875
vt 0.4375 0
vt 0.375 0
vt 0.375 0.1875
vt 0.3125 0.1875
vt 0.3125 0.25
vt 0.375 0.25
vt 0.4375 0.25
vt 0.375 0.25
vt 0.375 0.1875
vt 0.4375 0.1875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 100/292/73 103/291/73 101/290/73 98/289/73
f 99/296/74 100/295/74 98/294/74 97/293/74
f 104/300/75 99/299/75 97/298/75 102/297/75
f 103/304/76 104/303/76 102/302/76 101/301/76
f 102/308/77 97/307/77 98/306/77 101/305/77
f 103/312/78 100/311/78 99/310/78 104/309/78
o left_pants
v 0.015625 0.765625 0.140625
v 0.015625 0.765625 -0.140625
v 0.015625 -0.015625 0.140625
v 0.015625 -0.015625 -0.140625
v -0.265625 0.765625 -0.140625
v -0.265625 0.765625 0.140625
v -0.265625 -0.015625 -0.140625
v -0.265625 -0.015625 0.140625
vt 0.0625 0.1875
vt 0.125 0.1875
vt 0.125 0
vt 0.0625 0
vt 0 0.1875
vt 0.0625 0.1875
vt 0.0625 0
vt 0 0
vt 0.1875 0.1875
vt 0.25 0.1875
vt 0.25 0
vt 0.1875 0
vt 0.125 0.1875
vt 0.1875 0.1875
vt 0.1875 0
vt 0.125 0
vt 0.125 0.1875
vt 0.0625 0.1875
vt 0.0625 0.25
vt 0.125 0.25
vt 0.1875 0.25
vt 0.125 0.25
vt 0.125 0.1875
vt 0.1875 0.1875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 108/316/79 111/315/79 109/314/79 106/313/79
f 107/320/80 108/319/80 106/318/80 105/317/80
f 112/324/81 107/323/81 105/322/81 110/321/81
f 111/328/82 112/327/82 110/326/82 109/325/82
f 110/332/83 105/331/83 106/330/83 109/329/83
f 111/336/84 108/335/84 107/334/84 112/333/84
o right_leg
v 0.25 0.75 0.125
v 0.25 0.75 -0.125
v 0.25 0 0.125
v 0.25 0 -0.125
v 0 0.75 -0.125
v 0 0.75 0.125
v 0 0 -0.125
v 0 0 0.125
vt 0.0625 0.6875
vt 0.125 0.6875
vt 0.125 0.5
vt 0.0625 0.5
vt 0 0.6875
vt 0.0625 0.6875
vt 0.0625 0.5
vt 0 0.5
vt 0.1875 0.6875
vt 0.25 0.6875
vt 0.25 0.5
vt 0.1875 0.5
vt 0.125 0.6875
vt 0.1875 0.6875
vt 0.1875 0.5
vt 0.125 0.5
vt 0.125 0.6875
vt 0.0625 0.6875
vt 0.0625 0.75
vt 0.125 0.75
vt 0.1875 0.75
vt 0.125 0.75
vt 0.125 0.6875
vt 0.1875 0.6875
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 116/340/85 119/339/85 117/338/85 114/337/85
f 115/344/86 116/343/86 114/342/86 113/341/86
f 120/348/87 115/347/87 113/346/87 118/345/87
f 119/352/88 120/351/88 118/350/88 117/349/88
f 118/356/89 113/355/89 114/354/89 117/353/89
f 119/360/90 116/359/90 115/358/90 120/357/90
o right_pants
v 0.265625 0.765625 0.140625
v 0.265625 0.765625 -0.140625
v 0.265625 -0.015625 0.140625
v 0.265625 -0.015625 -0.140625
v -0.015625 0.765625 -0.140625
v -0.015625 0.765625 0.140625
v -0.015625 -0.015625 -0.140625
v -0.015625 -0.015625 0.140625
vt 0.0625 0.4375
vt 0.125 0.4375
vt 0.125 0.25
vt 0.0625 0.25
vt 0 0.4375
vt 0.0625 0.4375
vt 0.0625 0.25
vt 0 0.25
vt 0.1875 0.4375
vt 0.25 0.4375
vt 0.25 0.25
vt 0.1875 0.25
vt 0.125 0.4375
vt 0.1875 0.4375
vt 0.1875 0.25
vt 0.125 0.25
vt 0.125 0.4375
vt 0.0625 0.4375
vt 0.0625 0.5
vt 0.125 0.5
vt 0.1875 0.5
vt 0.125 0.5
vt 0.125 0.4375
vt 0.1875 0.4375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_1c019529-0681-a317-260e-2c92c6ea6f9c
f 124/364/91 127/363/91 125/362/91 122/361/91
f 123/368/92 124/367/92 122/366/92 121/365/92
f 128/372/93 123/371/93 121/370/93 126/369/93
f 127/376/94 128/375/94 126/374/94 125/373/94
f 126/380/95 121/379/95 122/378/95 125/377/95
f 127/384/96 124/383/96 123/382/96 128/381/96

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -6,14 +6,14 @@ add_requires("libsdl >= 2", "zlib", "glew")
target("TowerDefense")
set_kind("binary")
add_includedirs("include")
add_files("src/*.cpp", "src/*/*.cpp", "src/*/*/*.cpp", "src/*/*/*/*.cpp")
add_files("src/**.cpp")
add_cxflags("-pthread")
add_links("pthread")
set_languages("c++17")
add_packages("zlib", "libsdl", "glew", "opengl", "glm")
add_packages("zlib", "libsdl", "glew", "opengl")
if is_os("windows") then
add_links("ws2_32") -- link network stuff
@@ -28,7 +28,7 @@ target("TowerDefense")
set_warnings("all", "error")
set_optimize("smallest")
set_optimize("fastest")
else -- debug stuff
if is_os("linux") then
@@ -37,7 +37,7 @@ target("TowerDefense")
if is_os("windows") then
add_links("dbghelp", "psapi", "kernel32", "msvcr90")
end
add_cxflags("-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused")
add_cxflags("-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=1 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused")
end