mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add BodyType, fix crouching
This commit is contained in:
parent
7e80642ec3
commit
0a14d6220a
13 changed files with 131 additions and 34 deletions
|
|
@ -5,6 +5,31 @@
|
|||
#include "../core_defs.hpp"
|
||||
#include "../util/stringutil.hpp"
|
||||
|
||||
std::string to_string(BlockModel model) {
|
||||
switch (model) {
|
||||
case BlockModel::none: return "none";
|
||||
case BlockModel::block: return "block";
|
||||
case BlockModel::xsprite: return "X";
|
||||
case BlockModel::aabb: return "aabb";
|
||||
case BlockModel::custom: return "custom";
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<BlockModel> BlockModel_from(std::string_view str) {
|
||||
if (str == "none") {
|
||||
return BlockModel::none;
|
||||
} else if (str == "block") {
|
||||
return BlockModel::block;
|
||||
} else if (str == "X") {
|
||||
return BlockModel::xsprite;
|
||||
} else if (str == "aabb") {
|
||||
return BlockModel::aabb;
|
||||
} else if (str == "custom") {
|
||||
return BlockModel::custom;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
CoordSystem::CoordSystem(glm::ivec3 axisX, glm::ivec3 axisY, glm::ivec3 axisZ)
|
||||
: axisX(axisX), axisY(axisY), axisZ(axisZ)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue