use of net.minecraft.client.render.Tessellator in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawAuraESP.
public static void drawAuraESP(MatrixStack matrices, Vec3d pos, float partialTicks, double rad, double height, int color) {
float lastX = 0;
float lastZ = (float) rad;
for (int angle = 0; angle <= 360; angle += 6) {
float cos = MathHelper.cos((float) Math.toRadians(angle));
float sin = MathHelper.sin((float) Math.toRadians(angle));
float x = (float) (rad * sin);
float z = (float) (rad * cos);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
RenderSystem.enableBlend();
RenderSystem.disableDepthTest();
RenderSystem.disableCull();
RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
RenderSystem.lineWidth(1);
buffer.begin(VertexFormat.DrawMode.TRIANGLE_FAN, VertexFormats.POSITION_COLOR);
Vertexer.vertexTri(matrices, buffer, (float) pos.x + lastX, (float) pos.y, (float) pos.z + lastZ, (float) pos.x + x, (float) pos.y, (float) pos.z + z, (float) pos.x + lastX + 12, (float) pos.y + 12, (float) pos.z + lastZ + 12, Color.WHITE);
tessellator.draw();
RenderSystem.enableCull();
RenderSystem.enableDepthTest();
lastX = x;
lastZ = z;
}
}
use of net.minecraft.client.render.Tessellator in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawGradientFilledCircle.
public static void drawGradientFilledCircle(MatrixStack matrices, final int xx, final int yy, final float radius, int sides, Color color1, Color color2) {
int sections = sides;
double dAngle = 2 * Math.PI / sections;
float x, y, lastX = 0, lastY = 0;
for (int i = -1; i < sections; i++) {
x = (float) (radius * Math.sin((i * dAngle)));
y = (float) (radius * Math.cos((i * dAngle)));
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
RenderSystem.enableBlend();
RenderSystem.disableDepthTest();
RenderSystem.disableCull();
RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
RenderSystem.lineWidth(1);
buffer.begin(VertexFormat.DrawMode.TRIANGLE_FAN, VertexFormats.POSITION_COLOR);
Vertexer.vertexTri(matrices, buffer, xx, yy, 0f, xx + x, yy + y, 0f, xx + lastX, yy + lastY, 0f, color1, color2);
tessellator.draw();
RenderSystem.enableCull();
RenderSystem.enableDepthTest();
lastX = x;
lastY = y;
}
}
use of net.minecraft.client.render.Tessellator in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawFilledCircle.
// took me too long to do this
public static void drawFilledCircle(MatrixStack matrices, float xx, float yy, float radius, int sides, Color color) {
int sections = sides;
double dAngle = 2 * Math.PI / sections;
float x, y, lastX = 0, lastY = 0;
for (int i = -1; i < sections; i++) {
x = (float) (radius * Math.sin((i * dAngle)));
y = (float) (radius * Math.cos((i * dAngle)));
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
RenderSystem.enableBlend();
RenderSystem.disableDepthTest();
RenderSystem.disableCull();
RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
RenderSystem.lineWidth(1);
buffer.begin(VertexFormat.DrawMode.TRIANGLE_FAN, VertexFormats.POSITION_COLOR);
Vertexer.vertexTri(matrices, buffer, xx, yy, 0f, xx + x, yy + y, 0f, xx + lastX, yy + lastY, 0f, color);
tessellator.draw();
RenderSystem.enableCull();
RenderSystem.enableDepthTest();
lastX = x;
lastY = y;
}
}
use of net.minecraft.client.render.Tessellator in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawBoxOutline.
public static void drawBoxOutline(Box box, QuadColor color, float lineWidth, Direction... excludeDirs) {
if (!getFrustum().isVisible(box)) {
return;
}
setup3DRender(true);
MatrixStack matrices = matrixFrom(box.minX, box.minY, box.minZ);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
// Outline
RenderSystem.disableCull();
RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
RenderSystem.lineWidth(lineWidth);
buffer.begin(VertexFormat.DrawMode.LINES, VertexFormats.LINES);
Vertexer.vertexBoxLines(matrices, buffer, Boxes.moveToZero(box), color, excludeDirs);
tessellator.draw();
RenderSystem.enableCull();
end3DRender();
}
use of net.minecraft.client.render.Tessellator in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawFaceFill.
public static void drawFaceFill(BlockPos blockPos, QuadColor color, Direction face) {
Box box = new Box(blockPos);
if (!getFrustum().isVisible(box)) {
return;
}
setup3DRender(true);
MatrixStack matrices = matrixFrom(box.minX, box.minY, box.minZ);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
// Fill
RenderSystem.setShader(GameRenderer::getPositionColorShader);
buffer.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
Vertexer.vertexBoxQuadsFace(matrices, buffer, Boxes.moveToZero(box), color, face);
tessellator.draw();
end3DRender();
}
Aggregations