aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-09-05 10:34:44 +0200
committerGitHub <noreply@github.com>2024-09-05 10:34:44 +0200
commit81aebf952893555a48441c4ac5516ac869741bb0 (patch)
treeb0fd7bd1ee9116f6472ea48b6e7695e82b1f4b72 /src/main/java/at/hannibal2/skyhanni/utils
parent6dae2df502995679bbd7742ac919d9ee467db9d8 (diff)
downloadskyhanni-81aebf952893555a48441c4ac5516ac869741bb0.tar.gz
skyhanni-81aebf952893555a48441c4ac5516ac869741bb0.tar.bz2
skyhanni-81aebf952893555a48441c4ac5516ac869741bb0.zip
Backend: Graph Editor Split & Dissolve (#2466)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt
index 474d6dee5..4a50d79f3 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt
@@ -215,6 +215,10 @@ data class LorenzVec(
return (nearestPointOnLine(startPos, endPos) - this).lengthSquared()
}
+ fun middle(other: LorenzVec): LorenzVec = this.plus(other.minus(this) / 2)
+
+ private operator fun div(i: Number): LorenzVec = LorenzVec(x / i.toDouble(), y / i.toDouble(), z / i.toDouble())
+
companion object {
fun getFromYawPitch(yaw: Double, pitch: Double): LorenzVec {