Add intersection with cylinders

This commit is contained in:
2025-10-10 11:21:40 +01:00
parent 3ea14a4646
commit e00bb0b26e
6 changed files with 256 additions and 200 deletions
+5
View File
@@ -2,6 +2,7 @@
module Geometry.Vector where
import Linear
import Geometry.Data
-- | Moves from two to three dimensions, adding zero in z direction.
@@ -218,3 +219,7 @@ xyzV4 (V4 x y z _) = V3 x y z
xyV3 :: V3 a -> V2 a
{-# INLINE xyV3 #-}
xyV3 (V3 x y _) = V2 x y
reflectInNormal :: (Metric v,Fractional a,Num (v a)) => v a -> v a -> v a
{-# INLINE reflectInNormal #-}
reflectInNormal n v = v - (2 * project n v)