From c71b4f83abb2697781f8e6eafa8ad35f924fbdf7 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Tue, 1 Mar 2022 21:25:13 +0800 Subject: many changes (will list in a bit) --- utils/renderUtils.js | 36 +++++++++++++++++++----------------- utils/utils.js | 14 +++++++------- 2 files changed, 26 insertions(+), 24 deletions(-) (limited to 'utils') diff --git a/utils/renderUtils.js b/utils/renderUtils.js index a91043a..81bd2ea 100644 --- a/utils/renderUtils.js +++ b/utils/renderUtils.js @@ -126,7 +126,7 @@ module.exports = { GL11.glDepthMask(true); GL11.glDisable(GL11.GL_BLEND); }, - drawBoxAtBlockNotVisThruWalls:function (x, y, z, colorR, colorG, colorB){ + drawBoxAtBlockNotVisThruWalls:function (x, y, z, colorR, colorG, colorB, w=1, h=1){ GL11.glBlendFunc(770, 771); GL11.glEnable(GL11.GL_BLEND); GL11.glLineWidth(3); @@ -136,28 +136,30 @@ module.exports = { x -= 0.005 y -= 0.005 z -= 0.005 + w += 0.01 + h += 0.01 Tessellator.begin(3).colorize(colorR, colorG, colorB); - Tessellator.pos(x+1.01,y+1.01,z+1.01); - Tessellator.pos(x+1.01,y+1.01,z); - Tessellator.pos(x,y+1.01,z); - Tessellator.pos(x,y+1.01,z+1.01); - Tessellator.pos(x+1.01,y+1.01,z+1.01); - Tessellator.pos(x+1.01,y,z+1.01); - Tessellator.pos(x+1.01,y,z); + Tessellator.pos(x+w,y+h,z+w); + Tessellator.pos(x+w,y+h,z); + Tessellator.pos(x,y+h,z); + Tessellator.pos(x,y+h,z+w); + Tessellator.pos(x+w,y+h,z+w); + Tessellator.pos(x+w,y,z+w); + Tessellator.pos(x+w,y,z); Tessellator.pos(x,y,z); - Tessellator.pos(x,y,z+1.01); + Tessellator.pos(x,y,z+w); Tessellator.pos(x,y,z); - Tessellator.pos(x,y+1.01,z); + Tessellator.pos(x,y+h,z); Tessellator.pos(x,y,z); - Tessellator.pos(x+1.01,y,z); - Tessellator.pos(x+1.01,y+1.01,z); - Tessellator.pos(x+1.01,y,z); - Tessellator.pos(x+1.01,y,z+1.01); - Tessellator.pos(x,y,z+1.01); - Tessellator.pos(x,y+1.01,z+1.01); - Tessellator.pos(x+1.01,y+1.01,z+1.01); + Tessellator.pos(x+w,y,z); + Tessellator.pos(x+w,y+h,z); + Tessellator.pos(x+w,y,z); + Tessellator.pos(x+w,y,z+w); + Tessellator.pos(x,y,z+w); + Tessellator.pos(x,y+h,z+w); + Tessellator.pos(x+w,y+h,z+w); Tessellator.draw(); diff --git a/utils/utils.js b/utils/utils.js index baae822..48bb569 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -76,23 +76,23 @@ let utils = { let lastOrder = [] let lastOrderLength = Infinity - allOrders.forEach((order)=>{ + for(let i = 0;i{ return points[a] }) let len = 0 - positions.forEach((pos)=>{ - len += utils.calculateDistance(lastPoint,pos) - lastPoint = pos - }) + for(let i = 0;i