Начинающий
- Статус
- Оффлайн
- Регистрация
- 17 Июл 2024
- Сообщения
- 327
- Реакции
- 4
- Выберите загрузчик игры
- Vanilla
- Прочие моды
Килка с фовом как у нурика бупасит слотх
Пожалуйста, авторизуйтесь для просмотра ссылки.
(мб и не обращайте внимания на таргет худ я питаюсь добавлять разные таргет худы а то что меня флагает это моя вина я забыл офнуть NoFall и наверно пришли варнинги и иза этого меня на прову) Первая работа с килками не судите строго и я это выложил потому что я обежай что сделаю вам какой-то подарок на свой др выложил 22 апреля др 23 апреля ну модеры примут 22)
Пожалуйста, авторизуйтесь для просмотра ссылки.
Настройка Фова:
private final SliderSetting fovSnapRadius = new SliderSetting("Фов-Снап радиус", 60.0F, 10.0F, 180.0F, 5.0F);
Рендер круга:
if (e.getType() != EventRenderer2D.Type.POST) return;
if (!this.mode.is("Фов-Снап")) return;
if (mc.player == null || mc.currentScreen != null) return;
com.mojang.blaze3d.matrix.MatrixStack ms = e.getMatrixStack();
float fovDeg = fovSnapRadius.get();
int sw = mc.getMainWindow().getScaledWidth();
int sh = mc.getMainWindow().getScaledHeight();
float cx = sw / 2f;
float cy = sh / 2f;
float gameFov = (float) mc.gameRenderer.getFOVModifier(mc.getRenderManager().info, mc.getRenderPartialTicks(), true);
float radiusPx = (float)(Math.tan(Math.toRadians(fovDeg / 2.0)) / Math.tan(Math.toRadians(gameFov / 2.0))) * (sh / 2f);
int segments = 64;
int color = client.util.display.render.ColorUtil.reAlphaInt(-1, 200); // белый
org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL11.GL_LINE_SMOOTH);
com.mojang.blaze3d.systems.RenderSystem.disableTexture();
com.mojang.blaze3d.systems.RenderSystem.enableBlend();
com.mojang.blaze3d.systems.RenderSystem.lineWidth(1.5f);
net.minecraft.client.renderer.Tessellator tess = net.minecraft.client.renderer.Tessellator.getInstance();
net.minecraft.client.renderer.BufferBuilder buf = tess.getBuffer();
buf.begin(org.lwjgl.opengl.GL11.GL_LINE_LOOP, net.minecraft.client.renderer.vertex.DefaultVertexFormats.POSITION_COLOR);
int r = client.util.display.render.ColorUtil.getRed(color);
int g = client.util.display.render.ColorUtil.getGreen(color);
int b = client.util.display.render.ColorUtil.getBlue(color);
int a = client.util.display.render.ColorUtil.getAlpha(color);
net.minecraft.util.math.vector.Matrix4f mat = ms.getLast().getMatrix();
for (int i = 0; i < segments; i++) {
double angle = 2.0 * Math.PI * i / segments;
float px = cx + (float)(Math.cos(angle) * radiusPx);
float py = cy + (float)(Math.sin(angle) * radiusPx);
buf.pos(mat, px, py, 0).color(r, g, b, a).endVertex();
}
tess.draw();
com.mojang.blaze3d.systems.RenderSystem.enableTexture();
com.mojang.blaze3d.systems.RenderSystem.disableBlend();
org.lwjgl.opengl.GL11.glDisable(org.lwjgl.opengl.GL11.GL_LINE_SMOOTH);
}
Сама Килка:
if (this.mode.is("Фов-Снап") && this.target != null && mc.player != null) {
float fovDeg = fovSnapRadius.get();
float halfFov = fovDeg / 2.0F;
Vector3d eyes = Minecraft.player.getEyePosition(mc.getRenderPartialTicks());
net.minecraft.util.math.AxisAlignedBB box = this.target.getBoundingBox();
boolean inFov = false;
double[] checkY = {box.minY, (box.minY + box.maxY) / 2.0, box.maxY};
double cx = (box.minX + box.maxX) / 2.0;
double cz = (box.minZ + box.maxZ) / 2.0;
for (double y : checkY) {
Vector3d dir = new Vector3d(cx - eyes.x, y - eyes.y, cz - eyes.z).normalize();
float pYaw = (float) Math.toDegrees(Math.atan2(-dir.x, dir.z));
float pPitch = (float)(-Math.toDegrees(Math.atan2(dir.y, Math.hypot(dir.x, dir.z))));
float dYaw = Math.abs(MathHelper.wrapDegrees(pYaw - Minecraft.player.rotationYaw));
float dPitch = Math.abs(pPitch - Minecraft.player.rotationPitch);
if (dYaw <= halfFov && dPitch <= halfFov) { inFov = true; break; }
}
if (!inFov) return false;
}
Ещё что-то:
else if (this.mode.is("Фов-Снап")) {
float fovDeg = fovSnapRadius.get();
float yawDiff = Math.abs(MathHelper.wrapDegrees(rawYaw - Minecraft.player.rotationYaw));
float pitchDiff = Math.abs(MathHelper.wrapDegrees(rawPitch - Minecraft.player.rotationPitch));
float angleDist = (float) Math.hypot(yawDiff, pitchDiff);
if (angleDist <= fovDeg / 2.0F) {
RotationComponent.update(rotation, 40.0F, 40.0F, 0, 1);
}
Последнее редактирование: