update drop model
This commit is contained in:
parent
5769be8ec8
commit
1ec5f0b170
@ -1,38 +1,43 @@
|
|||||||
v 0.5 -0.5 -0.5
|
# Blender v2.79 (sub 0) OBJ File: ''
|
||||||
v 0.5 -0.5 0.5
|
# www.blender.org
|
||||||
v -0.5 -0.5 0.5
|
mtllib cube.mtl
|
||||||
v -0.5 -0.5 -0.5
|
o Cube
|
||||||
v 0.5 0.5 -0.5
|
v 0.125000 -0.125000 -0.125000
|
||||||
v 0.5 0.5 0.5
|
v 0.125000 -0.125000 0.125000
|
||||||
v -0.5 0.5 0.5
|
v -0.125000 -0.125000 0.125000
|
||||||
v -0.5 0.5 -0.5
|
v -0.125000 -0.125000 -0.125000
|
||||||
vt 0.0 0.0
|
v 0.125000 0.125000 -0.125000
|
||||||
vt 1.0 0.0
|
v 0.125000 0.125000 0.125000
|
||||||
vt 1.0 1.0
|
v -0.125000 0.125000 0.125000
|
||||||
vt 0.0 1.0
|
v -0.125000 0.125000 -0.125000
|
||||||
vt 0.0 0.0
|
vt 0.000000 0.000000
|
||||||
vt 1.0 0.0
|
vt 1.000000 0.000000
|
||||||
vt 1.0 1.0
|
vt 1.000000 1.000000
|
||||||
vt 0.0 1.0
|
vt 0.000000 1.000000
|
||||||
vt 1.0 0.0
|
vt 0.000000 0.000000
|
||||||
vt 1.0 1.0
|
vt 1.000000 0.000000
|
||||||
vt 0.0 1.0
|
vt 1.000000 1.000000
|
||||||
vt 0.0 0.0
|
vt 0.000000 1.000000
|
||||||
vt 1.0 0.0
|
vt 1.000000 0.000000
|
||||||
vt 0.0 1.0
|
vt 1.000000 1.000000
|
||||||
vt 0.0 0.0
|
vt 0.000000 1.000000
|
||||||
vt 1.0 0.0
|
vt 0.000000 0.000000
|
||||||
vt 1.0 1.0
|
vt 1.000000 0.000000
|
||||||
vt 1.0 0.0
|
vt 0.000000 1.000000
|
||||||
vt 1.0 1.0
|
vt 0.000000 0.000000
|
||||||
vt 0.0 1.0
|
vt 1.000000 0.000000
|
||||||
vn 0.0 -1.0 0.0
|
vt 1.000000 1.000000
|
||||||
vn 0.0 1.0 0.0
|
vt 1.000000 0.000000
|
||||||
vn 1.0 0.0 0.0
|
vt 1.000000 1.000000
|
||||||
vn -0.0 -0.0 1.0
|
vt 0.000000 1.000000
|
||||||
vn -1.0 -0.0 -0.0
|
vn 0.0000 -1.0000 0.0000
|
||||||
vn 0.0 0.0 -1.0
|
vn 0.0000 1.0000 0.0000
|
||||||
usemtl blocks/leaves
|
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 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 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
|
f 1/1/3 5/9/3 6/10/3 2/11/3
|
||||||
|
|||||||
@ -34,9 +34,9 @@ entityid_t Entities::spawn(EntityDef& def, glm::vec3 pos) {
|
|||||||
glm::vec3 size(1);
|
glm::vec3 size(1);
|
||||||
auto id = nextID++;
|
auto id = nextID++;
|
||||||
registry.emplace<EntityId>(entity, static_cast<entityid_t>(id), def);
|
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>{
|
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) {
|
[=](auto entityid, auto index, auto otherid) {
|
||||||
if (auto entity = get(entityid)) {
|
if (auto entity = get(entityid)) {
|
||||||
if (entity->isValid()) {
|
if (entity->isValid()) {
|
||||||
@ -77,7 +77,7 @@ void Entities::clean() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#include "../util/timeutil.hpp"
|
|
||||||
void Entities::updatePhysics(float delta){
|
void Entities::updatePhysics(float delta){
|
||||||
auto view = registry.view<EntityId, Transform, Rigidbody>();
|
auto view = registry.view<EntityId, Transform, Rigidbody>();
|
||||||
auto physics = level->physics.get();
|
auto physics = level->physics.get();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user