diff options
-rw-r--r-- | src/Generating/Prefab.cpp | 9 | ||||
-rw-r--r-- | src/Generating/Prefab.h | 6 | ||||
-rw-r--r-- | src/Generating/Prefabs/NetherFortPrefabs.cpp | 134 |
3 files changed, 138 insertions, 11 deletions
diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp index 7d1762036..c0c9e8a13 100644 --- a/src/Generating/Prefab.cpp +++ b/src/Generating/Prefab.cpp @@ -23,6 +23,10 @@ static const cPrefab::sDef g_TestPrefabDef = // Size: 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 5, 6, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* 0 */ "a:112: 0\n" /* netherbrick */ @@ -115,7 +119,10 @@ static cPrefab g_TestPrefab(g_TestPrefabDef); cPrefab::cPrefab(const cPrefab::sDef & a_Def) : m_Size(a_Def.m_SizeX, a_Def.m_SizeY, a_Def.m_SizeZ), - m_HitBox(0, 0, 0, a_Def.m_SizeX - 1, a_Def.m_SizeY - 1, a_Def.m_SizeZ - 1), + m_HitBox( + a_Def.m_HitboxMinX, a_Def.m_HitboxMinY, a_Def.m_HitboxMinZ, + a_Def.m_HitboxMaxX, a_Def.m_HitboxMaxY, a_Def.m_HitboxMaxZ + ), m_AllowedRotations(a_Def.m_AllowedRotations), m_MergeStrategy(a_Def.m_MergeStrategy), m_ShouldExtendFloor(a_Def.m_ShouldExtendFloor), diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h index dbf882e21..37db2ff16 100644 --- a/src/Generating/Prefab.h +++ b/src/Generating/Prefab.h @@ -38,6 +38,10 @@ public: int m_SizeY; int m_SizeZ; + /** The hitbox used for collision-checking between prefabs. Relative to the bounds. */ + int m_HitboxMinX, m_HitboxMinY, m_HitboxMinZ; + int m_HitboxMaxX, m_HitboxMaxY, m_HitboxMaxZ; + /** The mapping between characters in m_Image and the blocktype / blockmeta. Format: "Char: BlockType: BlockMeta \n Char: BlockType : BlockMeta \n ..." */ const char * m_CharMap; @@ -114,7 +118,7 @@ protected: /** The size of the prefab */ Vector3i m_Size; - /** The hitbox of the prefab. In first version is the same as the m_BlockArea dimensions */ + /** The hitbox used for collision-checking between prefabs. */ cCuboid m_HitBox; /** The connectors through which the piece connects to other pieces */ diff --git a/src/Generating/Prefabs/NetherFortPrefabs.cpp b/src/Generating/Prefabs/NetherFortPrefabs.cpp index 7a46df5d8..61b32378a 100644 --- a/src/Generating/Prefabs/NetherFortPrefabs.cpp +++ b/src/Generating/Prefabs/NetherFortPrefabs.cpp @@ -22,6 +22,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 13, 7, 9, // SizeX = 13, SizeY = 7, SizeZ = 9 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 6, 8, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -160,6 +164,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 13, 7, 11, // SizeX = 13, SizeY = 7, SizeZ = 11 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 6, 10, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -313,6 +321,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 10, 7, 7, // SizeX = 10, SizeY = 7, SizeZ = 7 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 9, 6, 6, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -414,7 +426,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] = 100, // DepthWeight: - "", + "1:0|2:0|3:0|4:0|5:0", // AddWeightIfSame: 0, @@ -429,6 +441,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 14, 9, 7, // SizeX = 14, SizeY = 9, SizeZ = 7 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 13, 18, 6, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -558,7 +574,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] = 100, // DepthWeight: - "", + "1:0|2:0|3:0|4:0|5:0", // AddWeightIfSame: 0, @@ -573,6 +589,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 15, 8, 15, // SizeX = 15, SizeY = 8, SizeZ = 15 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 17, 14, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -769,6 +789,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 15, 8, 15, // SizeX = 15, SizeY = 8, SizeZ = 15 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 17, 14, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -966,6 +990,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 9, 6, 5, // SizeX = 9, SizeY = 6, SizeZ = 5 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 15, 4, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -1041,7 +1069,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] = 100, // DepthWeight: - "1:0", + "1:0|2:0|3:0|4:0|5:0", // AddWeightIfSame: 0, @@ -1056,6 +1084,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 13, 6, 5, // SizeX = 13, SizeY = 6, SizeZ = 5 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 15, 4, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -1137,7 +1169,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] = 100, // DepthWeight: - "1:0", + "1:0|2:0|3:0|4:0|5:0", // AddWeightIfSame: 0, @@ -1152,6 +1184,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 5, 7, 16, // SizeX = 5, SizeY = 7, SizeZ = 16 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 4, 6, 15, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -1327,6 +1363,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 15, 12, 12, // SizeX = 15, SizeY = 12, SizeZ = 12 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 11, 11, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -1563,6 +1603,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 15, 14, 16, // SizeX = 15, SizeY = 14, SizeZ = 16 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 13, 15, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -1885,6 +1929,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 15, 8, 5, // SizeX = 15, SizeY = 8, SizeZ = 5 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 17, 4, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -2000,6 +2048,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 15, 8, 10, // SizeX = 15, SizeY = 8, SizeZ = 10 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 17, 9, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -2156,6 +2208,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 11, 6, 5, // SizeX = 11, SizeY = 6, SizeZ = 5 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 5, 4, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -2251,6 +2307,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 13, 6, 5, // SizeX = 13, SizeY = 6, SizeZ = 5 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 5, 4, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -2346,6 +2406,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 11, 6, 11, // SizeX = 11, SizeY = 6, SizeZ = 11 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 5, 10, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -2479,6 +2543,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 11, 6, 11, // SizeX = 11, SizeY = 6, SizeZ = 11 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 10, 5, 10, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -2613,6 +2681,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 9, 13, 5, // SizeX = 9, SizeY = 13, SizeZ = 5 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 8, 12, 4, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -2759,6 +2831,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 14, 6, 5, // SizeX = 14, SizeY = 6, SizeZ = 5 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 13, 5, 4, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -2854,6 +2930,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 15, 11, 15, // SizeX = 15, SizeY = 11, SizeZ = 15 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 14, 10, 14, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -3086,7 +3166,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] = false, // DefaultWeight: - 100, + 10, // DepthWeight: "", @@ -3104,6 +3184,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 12, 15, 15, // SizeX = 12, SizeY = 15, SizeZ = 15 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 11, 14, 14, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -3411,7 +3495,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] = false, // DefaultWeight: - 100, + 10, // DepthWeight: "", @@ -3429,6 +3513,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 16, 12, 15, // SizeX = 16, SizeY = 12, SizeZ = 15 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 15, 11, 14, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -3685,7 +3773,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] = false, // DefaultWeight: - 100, + 10, // DepthWeight: "", @@ -3703,6 +3791,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 13, 8, 13, // SizeX = 13, SizeY = 8, SizeZ = 13 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 7, 12, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -3885,6 +3977,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 7, 10, 7, // SizeX = 7, SizeY = 10, SizeZ = 7 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 9, 6, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -4009,7 +4105,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] = 100, // DepthWeight: - "", + "1:0|3:0|5:0|7:0|9:0|11:0|13:0|15:0", // AddWeightIfSame: 0, @@ -4024,6 +4120,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 7, 10, 7, // SizeX = 7, SizeY = 10, SizeZ = 7 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 9, 6, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -4148,7 +4248,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] = 100, // DepthWeight: - "", + "1:0|3:0|5:0|7:0|9:0|11:0|13:0|15:0", // AddWeightIfSame: 0, @@ -4163,6 +4263,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 13, 6, 7, // SizeX = 13, SizeY = 6, SizeZ = 7 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 5, 6, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -4273,6 +4377,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 13, 6, 9, // SizeX = 13, SizeY = 6, SizeZ = 9 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 5, 8, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -4395,6 +4503,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] = // Size: 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 6, 5, 6, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ @@ -4502,6 +4614,10 @@ const cPrefab::sDef g_NetherFortStartingPrefabs[] = // Size: 13, 9, 13, // SizeX = 13, SizeY = 9, SizeZ = 13 + // Hitbox (relative to bounding box): + 0, 0, 0, // MinX, MinY, MinZ + 12, 8, 12, // MaxX, MaxY, MaxZ + // Block definitions: ".: 0: 0\n" /* air */ "a:112: 0\n" /* netherbrick */ |