update drop model

This commit is contained in:
MihailRis 2024-06-30 17:23:35 +03:00
parent 5769be8ec8
commit 1ec5f0b170
2 changed files with 43 additions and 38 deletions

View File

@ -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

View File

@ -34,9 +34,9 @@ entityid_t Entities::spawn(EntityDef& def, glm::vec3 pos) {
glm::vec3 size(1);
auto id = nextID++;
registry.emplace<EntityId>(entity, static_cast<entityid_t>(id), def);
registry.emplace<Transform>(entity, pos, size/4.0f, glm::mat3(1.0f));
registry.emplace<Transform>(entity, pos, size, glm::mat3(1.0f));
registry.emplace<Rigidbody>(entity, true, Hitbox {pos, def.hitbox}, std::vector<Trigger>{
{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<EntityId, Transform, Rigidbody>();
auto physics = level->physics.get();