mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
Merge branch 'main' into animation
This commit is contained in:
commit
49e7f2c631
89 changed files with 1050 additions and 687 deletions
|
|
@ -492,10 +492,11 @@ void Entities::render(
|
|||
}
|
||||
|
||||
bool Entities::hasBlockingInside(AABB aabb) {
|
||||
constexpr float eps = 0.05f;
|
||||
auto view = registry->view<EntityId, Rigidbody>();
|
||||
for (auto [entity, eid, body] : view.each()) {
|
||||
AABB bodyAABB(body.hitbox.getAABB());
|
||||
bodyAABB.scale({1, 0.95f, 1});
|
||||
bodyAABB.scale(glm::vec3(1.0f - eps));
|
||||
if (eid.def.blocking && aabb.intersects(bodyAABB)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ Player* Players::getNearest(const glm::vec3& position) const {
|
|||
}
|
||||
|
||||
Player* Players::create(int64_t id) {
|
||||
int64_t& nextPlayerID = level.getWorld()->getInfo().nextPlayerId;
|
||||
int64_t& nextPlayerID = level.getWorld().getInfo().nextPlayerId;
|
||||
if (id == NONE) {
|
||||
id = nextPlayerID++;
|
||||
} else {
|
||||
|
|
@ -146,7 +146,7 @@ void Players::deserialize(const dv::value& src) {
|
|||
auto& inventory = player->getInventory();
|
||||
// invalid inventory id pre 0.25
|
||||
if (inventory->getId() == 0) {
|
||||
inventory->setId(level.getWorld()->getNextInventoryId());
|
||||
inventory->setId(level.getWorld().getNextInventoryId());
|
||||
}
|
||||
level.inventories->store(inventory);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue