second floor hole asset

This commit is contained in:
arthur.jamet
2021-06-07 10:17:53 +02:00
parent c7554c6b97
commit 95761b75b7
4 changed files with 80 additions and 7 deletions

View File

@@ -0,0 +1,13 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl floor
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd upper_floor_hole.png

View File

@@ -0,0 +1,54 @@
# Blender v2.92.0 OBJ File: ''
# www.blender.org
mtllib upper_floor_hole.mtl
o floor
v -0.500000 -0.499144 0.500854
v -0.500000 -0.500854 -0.499144
v 0.500000 -0.499144 0.500855
v 0.500000 -0.500855 -0.499144
v 0.500000 0.500854 0.499144
v 0.500000 0.499144 -0.500854
v -0.500000 0.500855 0.499144
v -0.500000 0.499144 -0.500855
vt 0.000977 0.667790
vt 0.000977 0.333151
vt 0.333659 0.667790
vt 0.333659 0.333151
vt 0.666341 0.667790
vt 0.666341 0.333151
vt 0.333659 0.667790
vt 0.333659 1.002429
vt 0.000977 0.667790
vt 0.000977 1.002429
vt 0.666341 0.667790
vt 0.666341 1.002429
vt 0.333659 0.667790
vt 0.333659 1.002429
vt 0.666341 0.333151
vt 0.999024 0.333151
vt 0.666341 0.667790
vt 0.999024 0.667790
vt 0.999024 1.002429
vt 0.666341 1.002429
vt 0.999024 0.667790
vt 0.666341 0.667790
vn -0.0000 -1.0000 0.0017
vn 1.0000 -0.0000 0.0000
vn 0.0000 1.0000 -0.0017
vn -1.0000 0.0000 -0.0000
vn 0.0000 -0.0017 -1.0000
vn -0.0000 0.0017 1.0000
usemtl floor
s 1
f 1/1/1 2/2/1 3/3/1
f 3/3/1 2/2/1 4/4/1
f 3/3/2 4/4/2 5/5/2
f 5/5/2 4/4/2 6/6/2
f 5/7/3 6/8/3 7/9/3
f 7/9/3 6/8/3 8/10/3
f 7/11/4 8/12/4 1/13/4
f 1/13/4 8/12/4 2/14/4
f 2/15/5 8/16/5 4/17/5
f 4/17/5 8/16/5 6/18/5
f 7/19/6 1/20/6 5/21/6
f 5/21/6 1/20/6 3/22/6

View File

@@ -19,8 +19,8 @@ namespace BBM
const std::string MapGenerator::secondFloorPath = MapGenerator::wallAssetsPath + "upper_floor"; const std::string MapGenerator::secondFloorPath = MapGenerator::wallAssetsPath + "upper_floor";
const std::string MapGenerator::stairsPath = MapGenerator::wallAssetsPath + "stairs"; const std::string MapGenerator::stairsPath = MapGenerator::wallAssetsPath + "stairs";
const std::string MapGenerator::bumperPath = MapGenerator::wallAssetsPath + "bumper"; const std::string MapGenerator::bumperPath = MapGenerator::wallAssetsPath + "bumper";
const std::string MapGenerator::secondFloorPath = MapGenerator::wallAssetsPath + "hole"; const std::string MapGenerator::holePath = MapGenerator::wallAssetsPath + "hole";
const std::string MapGenerator::secondFloorHolePath = secondFloorPath + "_hole"; const std::string MapGenerator::secondFloorHolePath = MapGenerator::secondFloorPath + "_hole";
void MapGenerator::generateUnbreakableBlock(int width, int height, std::shared_ptr<WAL::Scene> scene) void MapGenerator::generateUnbreakableBlock(int width, int height, std::shared_ptr<WAL::Scene> scene)
{ {
@@ -159,11 +159,17 @@ namespace BBM
{ {
static const std::string holeObj = holePath + objExtension; static const std::string holeObj = holePath + objExtension;
static const std::string holePng = holePath + imageExtension; static const std::string holePng = holePath + imageExtension;
static const std::string secondFloor = secondFloorHolePath + imageExtension; static const std::string secondFloorObj = secondFloorHolePath + objExtension;
static const std::string secondFloorPng = secondFloorHolePath + imageExtension;
scene->addEntity("Hole Block") WAL::Entity &holeEntity = scene->addEntity("Hole Block");
.addComponent<PositionComponent>(Vector3f(coords.x, coords.y - 1, coords.z))
.addComponent<Drawable3DComponent, RAY3D::Model>(holeObj, std::make_pair(MAP_DIFFUSE, holePng)); holeEntity.addComponent<PositionComponent>(Vector3f(coords.x, coords.y - 1, coords.z));
if (coords.y == 0)
holeEntity.addComponent<Drawable3DComponent, RAY3D::Model>(holeObj, std::make_pair(MAP_DIFFUSE, holePng));
else
holeEntity.addComponent<Drawable3DComponent, RAY3D::Model>(secondFloorObj, std::make_pair(MAP_DIFFUSE, secondFloorPng));
/*.addComponent<CollisionComponent>([](WAL::Entity &other, const WAL::Entity &entity) { /*.addComponent<CollisionComponent>([](WAL::Entity &other, const WAL::Entity &entity) {
if (other.hasComponent<HealthComponent>()) { if (other.hasComponent<HealthComponent>()) {
auto &health = other.getComponent<HealthComponent>(); auto &health = other.getComponent<HealthComponent>();

View File

@@ -154,7 +154,7 @@ namespace BBM
static const std::string holePath; static const std::string holePath;
static const std::string MapGenerator::secondFloorHolePath; static const std::string secondFloorHolePath;
public: public: