1717
1818package com.lambda.pathing
1919
20- import com.lambda.graphics.renderer.esp.builders.buildLine
20+ import com.lambda.graphics.renderer.esp.builders.ofBox
2121import com.lambda.graphics.renderer.esp.global.StaticESP
2222import com.lambda.pathing.move.Move
2323import com.lambda.util.collections.updatableLazy
24+ import com.lambda.util.math.component1
25+ import com.lambda.util.math.component2
26+ import com.lambda.util.math.component3
27+ import com.lambda.util.math.setAlpha
2428import com.lambda.util.world.dist
2529import com.lambda.util.world.toBlockPos
30+ import net.minecraft.util.math.Box
2631import java.awt.Color
2732
2833data class Path (
@@ -44,9 +49,25 @@ data class Path(
4449
4550 fun render (renderer : StaticESP , color : Color ) {
4651 moves.zipWithNext { current, next ->
47- val currentPos = current.pos.toBlockPos().toCenterPos()
48- val nextPos = next.pos.toBlockPos().toCenterPos()
49- renderer.buildLine(currentPos, nextPos, color)
52+ val start = current.pos.toBlockPos().toCenterPos()
53+ val end = next.pos.toBlockPos().toCenterPos()
54+ val direction = end.subtract(start)
55+ val distance = direction.length()
56+ if (distance <= 0 ) return @zipWithNext
57+
58+ val stepSize = 0.2
59+ val steps = (distance / stepSize).toInt()
60+ val stepDirection = direction.normalize().multiply(stepSize)
61+
62+ var currentPos = start
63+
64+ (0 until steps).forEach { _ ->
65+ val (x, y, z) = currentPos
66+ val d = 0.03
67+ val box = Box (x - d, y - d, z - d, x + d, y + d, z + d)
68+ renderer.ofBox(box, color.brighter().setAlpha(0.25 ), color.darker())
69+ currentPos = currentPos.add(stepDirection)
70+ }
5071 }
5172 }
5273
0 commit comments