Reenable mid layer rendering, may remove bottom layer rendering

This commit is contained in:
2024-09-30 23:32:01 +01:00
parent 752b568a86
commit c2214dae60
6 changed files with 64 additions and 149 deletions
+12 -6
View File
@@ -59,11 +59,17 @@ ammoMagSPic it = \case
TINMAG -> noPic $ upperPrismPolyTS 1 (reverse $ rectNSWE 0 (- y) (-1) 1)
DRUMMAG -> noPic $ upperPrismPolyTS 1 (reverse $ rectNSWE 0 (- y) (-1) 1)
CHEMFUELPOUCH -> (colorSH yellow (upperPrismPolyST 3 $ polyCirc 3 5)
, mempty)
, setLayer MidLayer . color black $ translate3 (V3 0 0 4) $ circleSolid (5 * am)
)
_ -> noPic $ upperPrismPolyTS 1 (reverse $ rectNSWE 0 (- y) (-1) 1)
where
y = fromIntegral y' * 0.3
y' = fromMaybe 0 $ it ^? itUse . amagLoadStatus . iaLoaded
am = fractionLoadedAmmo2 (it ^?! itUse . amagLoadStatus)
fractionLoadedAmmo2 :: ReloadStatus -> Float
fractionLoadedAmmo2 rs =
1 - (1 - fromIntegral (_iaLoaded rs) / fromIntegral (_iaMax rs)) ** 2
equipItemSPic :: EquipItemType -> Item -> SPic
equipItemSPic et _ = case et of
@@ -452,11 +458,11 @@ flamerPic _ =
--, color black $ translate3 (V3 tx ty (tz + 0.01)) $ circleSolid (r * am)
-- , color black $ translate3 (V3 tx ty (tz + 0.01)) $ circleSolid (r * 0.5)
)
where
tx = 4
ty = - 6
tz = 3
r = 5
-- where
-- tx = 4
-- ty = - 6
-- tz = 3
-- r = 5
-- am = fractionLoadedAmmo2 it
launcherPic :: Item -> SPic
+4 -6
View File
@@ -8,7 +8,7 @@ module Dodge.Item.Grammar (
) where
import Dodge.Item.Orientation
import qualified Linear.Quaternion as Q
--import qualified Linear.Quaternion as Q
import Geometry.Data
import Control.Applicative
import Data.Bifunctor
@@ -39,16 +39,14 @@ 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) orientAttachment
))
(map (\(i,a) -> noa (AmmoMagSF a) (AmmoInLink i a))
(IM.toList $ itm ^. itUse . heldAmmoTypes))
[noa WeaponTargetingSF WeaponTargetingLink, noa WeaponScopeSF WeaponScopeLink]
)
AMMOMAG _ -> ammoComposedItem' itm
TARGETING {} -> (itm,WeaponTargetingSF, useBreakListsLinkTest [noa AugmentedHUDSF AugmentedHUDLink] [])
ATTACH ZOOMSCOPE -> (itm,WeaponScopeSF, LTest (const Nothing) (const Nothing))
ATTACH HOMINGMODULE -> (itm,AmmoTargetingSF ProjectileAmmo, LTest (const Nothing) (const Nothing))
ATTACH ZOOMSCOPE -> nolinks WeaponScopeSF
ATTACH HOMINGMODULE -> nolinks $ AmmoTargetingSF ProjectileAmmo
ATTACH AUGMENTEDHUD -> nolinks AugmentedHUDSF
BULLETMOD BulletModTrajectory {} -> nolinks $ AmmoTargetingSF BulletAmmo
BULLETMOD BulletModPayload {} -> nolinks $ AmmoPayloadSF BulletAmmo
-1
View File
@@ -20,7 +20,6 @@ orientByLink itm lt = case (_itType itm,lt) of
orientAttachment :: Item -> ComposeLinkType -> Item -> Maybe (Point3, Q.Quaternion Float)
orientAttachment par lnk ch = Just (t1 + (Q.rotate q1 t2), q1 * q2)
--orientAttachment par lnk ch = Just (t1 , q1 )
where
(t1,q1) = orientByLink par lnk
(t2,q2) = orientChild ch
+1 -1
View File
@@ -251,7 +251,7 @@ doDrawing' win pdata u = do
GL_COLOR
0
ptr
-- renderLayer MidLayer shadV layerCounts
renderLayer MidLayer shadV layerCounts
glUseProgram (pdata ^. cloudShader . shaderUINT)
glBindVertexArray $ pdata ^. cloudShader . shaderVAO . vaoName
glDrawElements