diff options
author | syeyoung <cyoung06@naver.com> | 2022-05-07 00:16:43 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2022-05-07 00:16:43 +0900 |
commit | e72b31d22413acf4e6cd87c35340c3dcbf9a3d6a (patch) | |
tree | 416e94c15201005fb041051e710cb03440aa8666 | |
parent | efb389bdad8afe34f746fdbc5328f68aa64aba76 (diff) | |
download | Skyblock-Dungeons-Guide-e72b31d22413acf4e6cd87c35340c3dcbf9a3d6a.tar.gz Skyblock-Dungeons-Guide-e72b31d22413acf4e6cd87c35340c3dcbf9a3d6a.tar.bz2 Skyblock-Dungeons-Guide-e72b31d22413acf4e6cd87c35340c3dcbf9a3d6a.zip |
- Add culling to gui elements that disabled culling.
3 files changed, 17 insertions, 20 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPortableColorEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPortableColorEdit.java index 6b2f162e..f8a7281a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPortableColorEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MPortableColorEdit.java @@ -101,7 +101,6 @@ public class MPortableColorEdit extends MTooltip { GlStateManager.enableBlend(); GlStateManager.disableDepth(); GlStateManager.disableTexture2D(); - GlStateManager.disableCull(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // worldrenderer.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR); @@ -164,7 +163,7 @@ public class MPortableColorEdit extends MTooltip { float g2 = (rgb2 >> 8 & 255) / 255.0f; float b2 = (rgb2 & 255) / 255.0f; GlStateManager.color(r2,g2,b2, alpha); - GL11.glVertex3f(MathHelper.cos(rad) * radius + cx, MathHelper.sin(rad) * radius + cy, 0); + GL11.glVertex3f(MathHelper.sin(rad) * radius + cx, MathHelper.cos(rad) * radius + cy, 0); } GL11.glEnd(); GlStateManager.shadeModel(shademodel); @@ -172,8 +171,8 @@ public class MPortableColorEdit extends MTooltip { GlStateManager.color(1,1,1,1); worldrenderer.begin(GL11.GL_LINE_LOOP, DefaultVertexFormats.POSITION); float rad2 = 2 * 3.141592653f * hsv[0] ; - float x = 5 + radius + (MathHelper.cos(rad2)) * hsv[1] * radius; - float y = 5 + radius + (MathHelper.sin(rad2))* hsv[1] * radius; + float x = 5 + radius + (MathHelper.sin(rad2)) * hsv[1] * radius; + float y = 5 + radius + (MathHelper.cos(rad2))* hsv[1] * radius; for (int i = 0; i < 100; i++) { float rad = 2 * 3.141592653f * (i / 100f); worldrenderer.pos(MathHelper.sin(rad) * 2 + x, MathHelper.cos(rad) * 2 + y, 0).endVertex(); @@ -221,7 +220,7 @@ public class MPortableColorEdit extends MTooltip { float dx = relMouseX - circleX; float dy = circleY - relMouseY; if (dx * dx + dy * dy <= radius * radius) { - double theta = (MathHelper.atan2(dx, dy) / Math.PI * 180 + 270) % 360; + double theta = (MathHelper.atan2(dy, dx) / Math.PI * 180+90) % 360; hsv[0] = (float) theta / 360f; hsv[1] = MathHelper.sqrt_float(dx * dx + dy * dy) / radius; selected = 1; @@ -259,10 +258,10 @@ public class MPortableColorEdit extends MTooltip { float circleY = 5 + radius; { // check circle - float dx = relMouseX - circleX; - float dy = circleY - relMouseY; + float dx = relMouseX - circleX; // sin theta + float dy = circleY - relMouseY; // cos theta if (selected == 1) { - double theta = (MathHelper.atan2(dx, dy) / Math.PI * 180 + 270) % 360; + double theta = (MathHelper.atan2(dy, dx) / Math.PI * 180+90) % 360; hsv[0] = (float) theta / 360f; hsv[1] = MathHelper.clamp_float(MathHelper.sqrt_float(dx * dx + dy * dy) / radius, 0, 1); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditAColor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditAColor.java index 69d0158e..e3e22bf7 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditAColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditAColor.java @@ -157,7 +157,6 @@ public class ValueEditAColor extends MPanel implements ValueEdit<AColor> { GlStateManager.enableBlend(); GlStateManager.disableDepth(); GlStateManager.disableTexture2D(); - GlStateManager.disableCull(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // worldrenderer.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR); @@ -204,7 +203,7 @@ public class ValueEditAColor extends MPanel implements ValueEdit<AColor> { float g2 = (rgb2 >> 8 & 255) / 255.0f; float b2 = (rgb2 & 255) / 255.0f; GlStateManager.color(r2,g2,b2, alpha); - GL11.glVertex3f(MathHelper.cos(rad) * radius + cx, MathHelper.sin(rad) * radius + cy, 0); + GL11.glVertex3f(MathHelper.sin(rad) * radius + cx, MathHelper.cos(rad) * radius + cy, 0); } GL11.glEnd(); GlStateManager.shadeModel(shademodel); @@ -212,8 +211,8 @@ public class ValueEditAColor extends MPanel implements ValueEdit<AColor> { GlStateManager.color(1,1,1,1); worldrenderer.begin(GL11.GL_LINE_LOOP, DefaultVertexFormats.POSITION); float rad2 = 2 * 3.141592653f * hsv[0] ; - float x = 5 + radius + (MathHelper.cos(rad2)) * hsv[1] * radius; - float y = 45 + radius + (MathHelper.sin(rad2))* hsv[1] * radius; + float x = 5 + radius + (MathHelper.sin(rad2)) * hsv[1] * radius; + float y = 45 + radius + (MathHelper.cos(rad2))* hsv[1] * radius; for (int i = 0; i < 100; i++) { float rad = 2 * 3.141592653f * (i / 100f); worldrenderer.pos(MathHelper.sin(rad) * 2 + x, MathHelper.cos(rad) * 2 + y, 0).endVertex(); @@ -249,7 +248,7 @@ public class ValueEditAColor extends MPanel implements ValueEdit<AColor> { float dx = relMouseX - circleX; float dy = circleY - relMouseY; if (dx * dx + dy * dy <= radius * radius) { - double theta = (MathHelper.atan2(dx, dy) / Math.PI * 180 + 270) % 360; + double theta = (MathHelper.atan2(dy, dx) / Math.PI * 180 + 90) % 360; hsv[0] = (float) theta / 360f; hsv[1] = MathHelper.sqrt_float(dx * dx + dy * dy) / radius; selected = 1; @@ -283,7 +282,7 @@ public class ValueEditAColor extends MPanel implements ValueEdit<AColor> { float dx = relMouseX - circleX; float dy = circleY - relMouseY; if (selected == 1) { - double theta = (MathHelper.atan2(dx, dy) / Math.PI * 180 + 270) % 360; + double theta = (MathHelper.atan2(dy, dx) / Math.PI * 180 + 90) % 360; hsv[0] = (float) theta / 360f; hsv[1] = MathHelper.clamp_float(MathHelper.sqrt_float(dx * dx + dy * dy) / radius, 0, 1); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditColor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditColor.java index 04c07a9c..3e59154e 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditColor.java @@ -135,7 +135,6 @@ public class ValueEditColor extends MPanel implements ValueEdit<Color> { GlStateManager.shadeModel(GL11.GL_SMOOTH); GlStateManager.enableBlend(); GlStateManager.disableTexture2D(); - GlStateManager.disableCull(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // worldrenderer.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR); @@ -167,7 +166,7 @@ public class ValueEditColor extends MPanel implements ValueEdit<Color> { float g2 = (rgb2 >> 8 & 255) / 255.0f; float b2 = (rgb2 & 255) / 255.0f; GlStateManager.color(r2,g2,b2, 1); - GL11.glVertex3f(MathHelper.cos(rad) * radius + cx, MathHelper.sin(rad) * radius + cy, 0); + GL11.glVertex3f(MathHelper.sin(rad) * radius + cx, MathHelper.cos(rad) * radius + cy, 0); } GL11.glEnd(); GlStateManager.shadeModel(shademodel); @@ -175,8 +174,8 @@ public class ValueEditColor extends MPanel implements ValueEdit<Color> { GlStateManager.color(1,1,1,1); worldrenderer.begin(GL11.GL_LINE_LOOP, DefaultVertexFormats.POSITION); float rad2 = 2 * 3.141592653f * hsv[0] ; - float x = 5 + radius + (MathHelper.cos(rad2)) * hsv[1] * radius; - float y = 45 + radius + (MathHelper.sin(rad2))* hsv[1] * radius; + float x = 5 + radius + (MathHelper.sin(rad2)) * hsv[1] * radius; + float y = 45 + radius + (MathHelper.cos(rad2))* hsv[1] * radius; for (int i = 0; i < 100; i++) { float rad = 2 * 3.141592653f * (i / 100f); worldrenderer.pos(MathHelper.sin(rad) * 2 + x, MathHelper.cos(rad) * 2 + y, 0).endVertex(); @@ -207,7 +206,7 @@ public class ValueEditColor extends MPanel implements ValueEdit<Color> { float dx = relMouseX - circleX; float dy = circleY - relMouseY; if (dx * dx + dy * dy <= radius * radius) { - double theta = (MathHelper.atan2(dx, dy) / Math.PI * 180 + 270) % 360; + double theta = (MathHelper.atan2(dy, dx) / Math.PI * 180 + 90) % 360; hsv[0] = (float) theta / 360f; hsv[1] = MathHelper.sqrt_float(dx * dx + dy * dy) / radius; selected = 1; @@ -234,7 +233,7 @@ public class ValueEditColor extends MPanel implements ValueEdit<Color> { float dx = relMouseX - circleX; float dy = circleY - relMouseY; if (selected == 1) { - double theta = (MathHelper.atan2(dx, dy) / Math.PI * 180 + 270) % 360; + double theta = (MathHelper.atan2(dy, dx) / Math.PI * 180 + 90) % 360; hsv[0] = (float) theta / 360f; hsv[1] = MathHelper.clamp_float(MathHelper.sqrt_float(dx * dx + dy * dy) / radius, 0, 1); } |