Work on orienting and drawing attachments

This commit is contained in:
2024-09-30 23:02:22 +01:00
parent 48b8cfe7ef
commit 752b568a86
13 changed files with 340 additions and 229 deletions
+7 -6
View File
@@ -7,6 +7,7 @@ module Dodge.Item.Grammar (
invRootMap,
) where
import Dodge.Item.Orientation
import qualified Linear.Quaternion as Q
import Geometry.Data
import Control.Applicative
@@ -38,8 +39,8 @@ useBreakListsLinkTest llist rlist = LTest ltest rtest
basePartiallyComposedItem' :: Item -> PartiallyComposedItem ItemLink
basePartiallyComposedItem' itm = case itm ^. itType of
HELD _ -> (itm, WeaponPlatformSF, useBreakListsLinkTest
(map (\(i,a) -> (AmmoMagSF a, ILink (AmmoInLink i a) (c (V3 7 (-2) 0) rhs
)
--(map (\(i,a) -> (AmmoMagSF a, ILink (AmmoInLink i a) (c (V3 7 (-2) 0) rhs
(map (\(i,a) -> (AmmoMagSF a, ILink (AmmoInLink i a) orientAttachment
))
(IM.toList $ itm ^. itUse . heldAmmoTypes))
[noa WeaponTargetingSF WeaponTargetingLink, noa WeaponScopeSF WeaponScopeLink]
@@ -60,9 +61,9 @@ basePartiallyComposedItem' itm = case itm ^. itType of
CRAFT {} -> isolate
-- _ ->
where
noa x y = (x, ILink y (const (const Nothing)))
c x y _ _ = Just (x,y)
rhs = Q.axisAngle (V3 1 0 0) 0
noa x y = (x, ILink y orientAttachment)
c x y _ _ _ = Just (x,y)
-- rhs = Q.axisAngle (V3 1 0 0) 0
nolinks x = (itm,x, LTest (const Nothing) (const Nothing))
isolate = (itm,UncomposableIsolateSF, LTest (const Nothing) (const Nothing))
@@ -81,7 +82,7 @@ ammoComposedItem' itm = fromMaybe (error "in ammoComposedItem, wrong item") $ do
[]
)
where
noa x y = (x, ILink y (const (const Nothing)))
noa x y = (x, ILink y orientAttachment)
type LDTComb a b = LabelDoubleTree b a -> LabelDoubleTree b a -> Maybe (LabelDoubleTree b a)