mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
Merge branch 'main' into item-models
This commit is contained in:
commit
d3def8e741
11 changed files with 45 additions and 19 deletions
|
|
@ -44,6 +44,8 @@ std::unique_ptr<Content> ContentBuilder::build() {
|
|||
def.rt.hitboxes[i].push_back(aabb);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
def.rt.hitboxes->emplace_back(AABB(glm::vec3(1.0f)));
|
||||
}
|
||||
|
||||
blockDefsIndices.push_back(&def);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,14 @@ static int l_def_name(lua::State* L) {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_def_hitbox(lua::State* L) {
|
||||
if (auto def = require_entity_def(L)) {
|
||||
return lua::pushvec(L, def->hitbox);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_defs_count(lua::State* L) {
|
||||
return lua::pushinteger(L, indices->entities.count());
|
||||
}
|
||||
|
|
@ -202,6 +210,7 @@ const luaL_Reg entitylib[] = {
|
|||
{"exists", lua::wrap<l_exists>},
|
||||
{"def_index", lua::wrap<l_def_index>},
|
||||
{"def_name", lua::wrap<l_def_name>},
|
||||
{"def_hitbox", lua::wrap<l_def_hitbox>},
|
||||
{"get_def", lua::wrap<l_get_def>},
|
||||
{"defs_count", lua::wrap<l_defs_count>},
|
||||
{"spawn", lua::wrap<l_spawn>},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#include "EntityDef.hpp"
|
||||
|
||||
|
||||
void EntityDef::cloneTo(EntityDef& dst) {
|
||||
dst.components = components;
|
||||
dst.bodyType = bodyType;
|
||||
|
|
@ -8,5 +10,4 @@ void EntityDef::cloneTo(EntityDef& dst) {
|
|||
dst.skeletonName = skeletonName;
|
||||
dst.blocking = blocking;
|
||||
dst.save = save;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ struct EntityDef {
|
|||
} skeleton;
|
||||
struct {
|
||||
bool velocity = true;
|
||||
bool settings = false;
|
||||
bool settings = true;
|
||||
} body;
|
||||
} save {};
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ std::unique_ptr<VoxelFragment> VoxelFragment::create(
|
|||
bool entities
|
||||
) {
|
||||
auto start = glm::min(a, b);
|
||||
auto size = glm::abs(a - b);
|
||||
auto size = glm::abs(a - b) + 1;
|
||||
|
||||
if (crop) {
|
||||
VoxelsVolume volume(size.x, size.y, size.z);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue