Decrease muzzle flare light time

This commit is contained in:
2021-03-20 18:51:03 +01:00
parent 19fc1f2468
commit 4365185f9f
5 changed files with 34 additions and 25 deletions
+5 -1
View File
@@ -36,6 +36,7 @@ closestPointOnLineParam a b p
rectNESW :: Float -> Float -> Float -> Float -> [Point2]
rectNESW a b c d = [(b,a),(b,c),(d,c),(d,a)
]
rectNSEW :: Float -> Float -> Float -> Float -> [Point2]
rectNSEW n s e w = rectNESW n e s w
rectNSWE :: Float -> Float -> Float -> Float -> [Point2]
@@ -89,6 +90,7 @@ safeNormalizeV p = normalizeV p
-- this has been called somewhere with l1 == l2
isLHS :: Point2 -> Point2 -> Point2 -> Bool
{-# INLINE isLHS #-}
isLHS' :: (Float, Float) -> (Float, Float) -> Point2 -> Bool
isLHS' l1 l2 p | l1 == l2 = False
| otherwise = closestPointOnLineParam l1 (l1 +.+ vNormal (l2 -.- l1)) p < 0
@@ -138,6 +140,7 @@ circOnLine p1 p2 c rad = magV (p1 -.- c) <= rad || magV (p2 -.- c) <= rad
isJustTrue (Just True) = True
isJustTrue _ = False
difference :: (Ord a, Num a) => a -> a -> a
difference x y | x > y = x - y
| otherwise = y - x
@@ -145,6 +148,7 @@ reflectIn :: Point2 -> Point2 -> Point2
reflectIn line vec = let angle = 2 * angleBetween line vec
in rotateV angle vec
angleBetween :: Point2 -> Point2 -> Float
angleBetween v1 v2 = argV v1 - argV v2
doublePair :: (a,a) -> [(a,a)]
@@ -195,7 +199,7 @@ ssaTri :: Float -> Float -> Float -> Float
ssaTri ab bc a
| sin a == 0 = 0
| bc == 0 = ab
| otherwise = let c = asin ( (ab * (sin a))/bc)
| otherwise = let c = asin ( (ab * sin a)/bc)
b = pi - (a + c)
in sin b * bc / sin a