@Override
public void render(Vector3 cameraPos) {
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buf = tessellator.getBuffer();
double xPos = this.centreX - cameraPos.getX();
double zPos = this.centreZ - cameraPos.getZ();
for (LineStyle line : this.style.getLines()) {
if (!line.prepare(this.style.getRenderType())) {
continue;
}
double twoPi = Math.PI * 2;
for (int yBlock : new int[] { this.minY, this.maxY + 1 }) {
buf.begin(GL_LINE_LOOP, DefaultVertexFormats.POSITION);
line.applyColour();
for (int i = 0; i <= 75; i++) {
double tempTheta = i * twoPi / 75;
double tempX = this.radX * Math.cos(tempTheta);
double tempZ = this.radZ * Math.sin(tempTheta);
buf.pos(xPos + tempX, yBlock - cameraPos.getY(), zPos + tempZ).endVertex();
}
tessellator.draw();
}
}
}
RenderCylinderBox.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:HardVox
作者:
评论列表
文章目录