Add code for determining item orientation

This commit is contained in:
2025-06-28 21:21:50 +01:00
parent 4f0dc64e72
commit 6af2a8cc36
7 changed files with 197 additions and 138 deletions
+11
View File
@@ -5,8 +5,13 @@ module Dodge.Item.HeldOffset (
heldItemOffset,
heldItemRelativeOrient,
heldItemOrient2D,
itemRelativeOrient,
) where
import Dodge.Item.Orientation
import Dodge.DoubleTree
import Dodge.Data.ComposedItem
import Dodge.Data.DoubleTree
import Dodge.Creature.Radius
import Dodge.Data.AimStance
import Dodge.Item.AimStance
@@ -135,3 +140,9 @@ heldHandlePos = \case
KEYCARD {} -> V2 3 0
BLINKER -> V2 3 0
BLINKERUNSAFE -> V2 3 0
itemRelativeOrient :: LocationLDT ItemLink Item -> Creature
-> (Point3, Q.Quaternion Float) -> (Point3, Q.Quaternion Float)
itemRelativeOrient loc cr
= heldItemRelativeOrient (locToTop loc ^. locLDT . ldtValue) cr
. orientLocation (V3 0 0 0,Q.qID) loc