diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-12 04:48:34 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-12 04:48:34 +0200 |
| commit | 0344ab23929f77f4f339cb0dc83d84d3f118d679 (patch) | |
| tree | 251ed441be010d365a0c6d5bd3921eca702cdb3a /src/main/java/at/hannibal2/skyhanni/utils | |
| parent | 99f7e28332662f44996e73194b9d5ea0c38e89b3 (diff) | |
| download | skyhanni-0344ab23929f77f4f339cb0dc83d84d3f118d679.tar.gz skyhanni-0344ab23929f77f4f339cb0dc83d84d3f118d679.tar.bz2 skyhanni-0344ab23929f77f4f339cb0dc83d84d3f118d679.zip | |
Added Living Metal Helper
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt | 2 | ||||
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt index 7380c4c37..46f273b2d 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt @@ -96,6 +96,8 @@ data class LorenzVec( fun round(decimals: Int) = LorenzVec(x.round(decimals), y.round(decimals), z.round(decimals)) + fun slope(other: LorenzVec, factor: Double) = add(other.subtract(this).scale(factor)) + fun roundLocation(): LorenzVec { val x = if (this.x < 0) x.toInt().toDouble() - 1 else x.toInt().toDouble() val y = y.toInt().toDouble() - 1 diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt index 73a529cbc..410c29aca 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt @@ -141,7 +141,7 @@ class ParkourHelper( if (LocationUtils.playerLocation().distance(nextPosition) > currentPosition.distance(nextPosition)) return null val factor = LocationUtils.playerLocation().distance(currentPosition) / currentPosition.distance(nextPosition) - val solpeLocation = lookAheadStart.add(lookAheadEnd.subtract(lookAheadStart).scale(factor)) + val solpeLocation = lookAheadStart.slope(lookAheadEnd, factor) return Pair( IndexedValue(current + lookAhead - 1, lookAheadStart), IndexedValue(current + lookAhead, solpeLocation) |
