diff --git a/GameEngine/src/main/java/gameEngine/entites/gameComponents/Mesh.java b/GameEngine/src/main/java/gameEngine/entites/gameComponents/Mesh.java index 02cf8b5..911b554 100644 --- a/GameEngine/src/main/java/gameEngine/entites/gameComponents/Mesh.java +++ b/GameEngine/src/main/java/gameEngine/entites/gameComponents/Mesh.java @@ -73,12 +73,15 @@ float rotationX = parent.transform.rotation.x; float rotationY = parent.transform.rotation.y; float rotationZ = parent.transform.rotation.z; + float scaleX = parent.transform.scale.x; + float scaleY = parent.transform.scale.y; + float scaleZ = parent.transform.scale.z; - float scale; + float zScale; if (z >= 0) { - scale = 1.0f + (z * 0.1f); + zScale = 1.0f + (z * 0.1f); } else { - scale = 1.0f / (1.0f + Math.abs(z) * 0.1f); + zScale = 1.0f / (1.0f + Math.abs(z) * 0.1f); } // 回転の適用 @@ -86,7 +89,7 @@ glRotatef(rotationX, 1, 0, 0); // X軸周りの回転 glRotatef(rotationY, 0, 1, 0); // Y軸周りの回転 glRotatef(rotationZ, 0, 0, 1); // Z軸周りの回転 - glScalef(scale, scale, 1.0f); + glScalef(scaleX * zScale, scaleY * zScale, scaleZ); glTranslatef(-(x + spriteWidth / 2.0f), -(y + spriteHeight / 2.0f), z); // 元の位置に戻す // テクスチャの描画