diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-09-05 10:34:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 10:34:44 +0200 |
commit | 81aebf952893555a48441c4ac5516ac869741bb0 (patch) | |
tree | b0fd7bd1ee9116f6472ea48b6e7695e82b1f4b72 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 6dae2df502995679bbd7742ac919d9ee467db9d8 (diff) | |
download | skyhanni-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.kt | 4 |
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 { |