From 1ec5f0b170117cb07130c074ba3bd06aa38b73e4 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 30 Jun 2024 17:23:35 +0300 Subject: [PATCH] update drop model --- res/content/base/models/cube.obj | 75 +++++++++++++++++--------------- src/objects/Entities.cpp | 6 +-- 2 files changed, 43 insertions(+), 38 deletions(-) diff --git a/res/content/base/models/cube.obj b/res/content/base/models/cube.obj index 8beb020e..26e6ba76 100644 --- a/res/content/base/models/cube.obj +++ b/res/content/base/models/cube.obj @@ -1,38 +1,43 @@ -v 0.5 -0.5 -0.5 -v 0.5 -0.5 0.5 -v -0.5 -0.5 0.5 -v -0.5 -0.5 -0.5 -v 0.5 0.5 -0.5 -v 0.5 0.5 0.5 -v -0.5 0.5 0.5 -v -0.5 0.5 -0.5 -vt 0.0 0.0 -vt 1.0 0.0 -vt 1.0 1.0 -vt 0.0 1.0 -vt 0.0 0.0 -vt 1.0 0.0 -vt 1.0 1.0 -vt 0.0 1.0 -vt 1.0 0.0 -vt 1.0 1.0 -vt 0.0 1.0 -vt 0.0 0.0 -vt 1.0 0.0 -vt 0.0 1.0 -vt 0.0 0.0 -vt 1.0 0.0 -vt 1.0 1.0 -vt 1.0 0.0 -vt 1.0 1.0 -vt 0.0 1.0 -vn 0.0 -1.0 0.0 -vn 0.0 1.0 0.0 -vn 1.0 0.0 0.0 -vn -0.0 -0.0 1.0 -vn -1.0 -0.0 -0.0 -vn 0.0 0.0 -1.0 -usemtl blocks/leaves +# Blender v2.79 (sub 0) OBJ File: '' +# www.blender.org +mtllib cube.mtl +o Cube +v 0.125000 -0.125000 -0.125000 +v 0.125000 -0.125000 0.125000 +v -0.125000 -0.125000 0.125000 +v -0.125000 -0.125000 -0.125000 +v 0.125000 0.125000 -0.125000 +v 0.125000 0.125000 0.125000 +v -0.125000 0.125000 0.125000 +v -0.125000 0.125000 -0.125000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 1.0000 0.0000 +vn 1.0000 -0.0000 0.0000 +vn -0.0000 -0.0000 1.0000 +vn -1.0000 -0.0000 -0.0000 +vn 0.0000 0.0000 -1.0000 +usemtl blocks/lamp +s off f 1/1/1 2/2/1 3/3/1 4/4/1 f 5/5/2 8/6/2 7/7/2 6/8/2 f 1/1/3 5/9/3 6/10/3 2/11/3 diff --git a/src/objects/Entities.cpp b/src/objects/Entities.cpp index 95ace4a6..3feb9db7 100644 --- a/src/objects/Entities.cpp +++ b/src/objects/Entities.cpp @@ -34,9 +34,9 @@ entityid_t Entities::spawn(EntityDef& def, glm::vec3 pos) { glm::vec3 size(1); auto id = nextID++; registry.emplace(entity, static_cast(id), def); - registry.emplace(entity, pos, size/4.0f, glm::mat3(1.0f)); + registry.emplace(entity, pos, size, glm::mat3(1.0f)); registry.emplace(entity, true, Hitbox {pos, def.hitbox}, std::vector{ - {true, id, AABB {glm::vec3{-1.0f, -1.0f, -1.0f}, glm::vec3{1.0f, 1.0f, 1.0f}}, {}, {}, {}, + {true, id, AABB {glm::vec3{-0.2f, -0.2f, -0.2f}, glm::vec3{0.2f, 0.2f, 0.2f}}, {}, {}, {}, [=](auto entityid, auto index, auto otherid) { if (auto entity = get(entityid)) { if (entity->isValid()) { @@ -77,7 +77,7 @@ void Entities::clean() { } } } -#include "../util/timeutil.hpp" + void Entities::updatePhysics(float delta){ auto view = registry.view(); auto physics = level->physics.get();