oomBodies :: (MonadFix m, Monoid e, HasTime Double s)
    => V3D
    -> [(Body, V3D)]
    -> Integrator
    -> Wire s e m () [Body]
roomBodies grav bodies igr = sequenceA $ map makeWire bodies
  where
    makeWire (b0, v0) = bodyFConstrained wall b0 v0 igr . pure [grav]
    wall (V3 x _ z) | z < 0     = Just (V3 0 0 1)
                    | z > 1     = Just (V3 0 0 (-1))
                    | x < 0     = Just (V3 1 0 0)
                    | x > 1.5   = Just (V3 (-1) 0 0)
                    | otherwise = Nothing

roomBodies :: (MonadFix m, Monoid e, HasTime Double s)
    => V3D
    -> [(Body, V3D)]
    -> Integrator
    -> Wire s e m () [Body]
roomBodies grav bodies igr = sequenceA $ map makeWire bodies
  where
    makeWire (b0, v0) = bodyFConstrained wall b0 v0 igr . pure [grav]
    wall (V3 x _ z) | z < 0     = Just (V3 0 0 1)
                    | z > 1     = Just (V3 0 0 (-1))
                    | x < 0     = Just (V3 1 0 0)
                    | x > 1.5   = Just (V3 (-1) 0 0)
                    | otherwise = Nothing
roomBodies grav bodies igr = sequenceA $ map makeWire bodies
  where
    makeWire (b0, v0) = bodyFConstrained wall b0 v0 igr . pure [grav]
    wall (V3 x _ z) | z < 0     = Just (V3 0 0 1)
                    | z > 1     = Just (V3 0 0 (-1))
                    | x < 0     = Just (V3 1 0 0)
                    | x > 1.5   = Just (V3 (-1) 0 0)
                    | otherwise = Nothing