diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/baked/FullCubeBakeTest.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/baked/FullCubeBakeTest.kt index 426d88d5e..ec050e3a3 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/baked/FullCubeBakeTest.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/baked/FullCubeBakeTest.kt @@ -168,7 +168,7 @@ class FullCubeBakeTest { fun x90y180() { val from = Vec3(0.0f) val to = Vec3(1.0f) - val model = SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), x = 1, y = 180) + val model = SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), x = 1, y = 2) val baked = model.bake(createTextureManager("block/test"))!! @@ -181,6 +181,38 @@ class FullCubeBakeTest { baked.assertFace(Directions.EAST, positions(Directions.EAST, from, to), yrbg, 0.6f) } + fun x90y270() { + val from = Vec3(0.0f) + val to = Vec3(1.0f) + val model = SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), x = 1, y = 3) + + val baked = model.bake(createTextureManager("block/test"))!! + + + baked.assertFace(Directions.DOWN, positions(Directions.DOWN, from, to), rbgy, 0.5f) + baked.assertFace(Directions.UP, positions(Directions.UP, from, to), bgyr, 1.0f) + baked.assertFace(Directions.NORTH, positions(Directions.NORTH, from, to), bgyr, 0.8f) + baked.assertFace(Directions.SOUTH, positions(Directions.SOUTH, from, to), rbgy, 0.8f) + baked.assertFace(Directions.WEST, positions(Directions.WEST, from, to), bgyr, 0.6f) + baked.assertFace(Directions.EAST, positions(Directions.EAST, from, to), gyrb, 0.6f) + } + + fun x180y90() { + val from = Vec3(0.0f) + val to = Vec3(1.0f) + val model = SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), x = 2, y = 1) + + val baked = model.bake(createTextureManager("block/test"))!! + + + baked.assertFace(Directions.DOWN, positions(Directions.DOWN, from, to), rbgy, 0.5f) + baked.assertFace(Directions.UP, positions(Directions.UP, from, to), yrbg, 1.0f) + baked.assertFace(Directions.NORTH, positions(Directions.NORTH, from, to), rbgy, 0.8f) + baked.assertFace(Directions.SOUTH, positions(Directions.SOUTH, from, to), bgyr, 0.8f) + baked.assertFace(Directions.WEST, positions(Directions.WEST, from, to), bgyr, 0.6f) + baked.assertFace(Directions.EAST, positions(Directions.EAST, from, to), rbgy, 0.6f) + } + fun x180y180() { val from = Vec3(0.0f) val to = Vec3(1.0f) @@ -196,4 +228,68 @@ class FullCubeBakeTest { baked.assertFace(Directions.WEST, positions(Directions.WEST, from, to), bgyr, 0.6f) baked.assertFace(Directions.EAST, positions(Directions.EAST, from, to), rbgy, 0.6f) } + + fun x180y270() { + val from = Vec3(0.0f) + val to = Vec3(1.0f) + val model = SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), x = 2, y = 3) + + val baked = model.bake(createTextureManager("block/test"))!! + + + baked.assertFace(Directions.DOWN, positions(Directions.DOWN, from, to), gyrb, 0.5f) + baked.assertFace(Directions.UP, positions(Directions.UP, from, to), bgyr, 1.0f) + baked.assertFace(Directions.NORTH, positions(Directions.NORTH, from, to), rbgy, 0.8f) + baked.assertFace(Directions.SOUTH, positions(Directions.SOUTH, from, to), bgyr, 0.8f) + baked.assertFace(Directions.WEST, positions(Directions.WEST, from, to), bgyr, 0.6f) + baked.assertFace(Directions.EAST, positions(Directions.EAST, from, to), rbgy, 0.6f) + } + + fun x270y90() { + val from = Vec3(0.0f) + val to = Vec3(1.0f) + val model = SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), x = 3, y = 1) + + val baked = model.bake(createTextureManager("block/test"))!! + + + baked.assertFace(Directions.DOWN, positions(Directions.DOWN, from, to), rbgy, 0.5f) + baked.assertFace(Directions.UP, positions(Directions.UP, from, to), bgyr, 1.0f) + baked.assertFace(Directions.NORTH, positions(Directions.NORTH, from, to), bgyr, 0.8f) + baked.assertFace(Directions.SOUTH, positions(Directions.SOUTH, from, to), rbgy, 0.8f) + baked.assertFace(Directions.WEST, positions(Directions.WEST, from, to), yrbg, 0.6f) + baked.assertFace(Directions.EAST, positions(Directions.EAST, from, to), rbgy, 0.6f) + } + + fun x270y180() { + val from = Vec3(0.0f) + val to = Vec3(1.0f) + val model = SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), x = 3, y = 2) + + val baked = model.bake(createTextureManager("block/test"))!! + + + baked.assertFace(Directions.DOWN, positions(Directions.DOWN, from, to), bgyr, 0.5f) + baked.assertFace(Directions.UP, positions(Directions.UP, from, to), rbgy, 1.0f) + baked.assertFace(Directions.NORTH, positions(Directions.NORTH, from, to), gyrb, 0.8f) + baked.assertFace(Directions.SOUTH, positions(Directions.SOUTH, from, to), bgyr, 0.8f) + baked.assertFace(Directions.WEST, positions(Directions.WEST, from, to), rbgy, 0.6f) + baked.assertFace(Directions.EAST, positions(Directions.EAST, from, to), bgyr, 0.6f) + } + + fun x270y270() { + val from = Vec3(0.0f) + val to = Vec3(1.0f) + val model = SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), x = 3, y = 3) + + val baked = model.bake(createTextureManager("block/test"))!! + + + baked.assertFace(Directions.DOWN, positions(Directions.DOWN, from, to), gyrb, 0.5f) + baked.assertFace(Directions.UP, positions(Directions.UP, from, to), yrbg, 1.0f) + baked.assertFace(Directions.NORTH, positions(Directions.NORTH, from, to), yrbg, 0.8f) + baked.assertFace(Directions.SOUTH, positions(Directions.SOUTH, from, to), gyrb, 0.8f) + baked.assertFace(Directions.WEST, positions(Directions.WEST, from, to), bgyr, 0.6f) + baked.assertFace(Directions.EAST, positions(Directions.EAST, from, to), gyrb, 0.6f) + } } diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/baked/WeightedModelTest.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/baked/WeightedModelTest.kt index 185c3d1fc..85a640532 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/baked/WeightedModelTest.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/baked/WeightedModelTest.kt @@ -79,8 +79,6 @@ class WeightedModelTest { baked.assert(Vec3i(33, -61, 15), 3) baked.assert(Vec3i(33, -61, 16), 1) baked.assert(Vec3i(33, -61, 17), 2) - - } private fun WeightedBlockRender.assert(position: Vec3i, entry: Int) {