Linear Space Program
81 subscribers
170 photos
16 videos
12 files
51 links
Побочные эффекты игростроения на хаскеле.

https://icrbow.itch.io/

Чатик: @HaskellGameDev
Дискорд: https://discord.gg/vxpWtBA
Download Telegram
Linear Space Program
Photo
This media is not supported in the widget
VIEW IN TELEGRAM
AST debugging be like...

HStack ()
[ Frame () (vec2 100 50) Alignment.center $
View () "Fixed 100x50"
, Spacer ()
, View () "Flexible 310x600"
, Frame () (vec2 80 80) Alignment.
center $ View () "Fixed 80x80"
]
And this is how we do ECS, STM, type-safe quantities, FRP, and imgui in Haskell...

DearImGui.withWindowOpen "Orbit" do
stuff <- atomically . Apecs.runWith rsOrbitSim.sWorld $ Apecs.collect Just
for_ stuff \(o@Orbiter.Orbiter{}, Orbiter.MeanAnomaly ma, entity@Apecs.Entity{}) -> do
DearImGui.text $ textShower o
inputDouble "MA" (ma # Radian) (τ/60) (τ/4) "%f rad" \ma' -> do
atomically . Apecs.runWith rsOrbitSim.sWorld $ do
-- XXX: unlikely, but the value may be updated between collecting and UI handling
let change = (ma' % Radian) |-| ma
Apecs.modify entity \(Orbiter.MeanAnomaly current) ->
Orbiter.MeanAnomaly $ current |+| change
1😢1
Linear Space Program
And this is how we do ECS, STM, type-safe quantities, FRP, and imgui in Haskell... DearImGui.withWindowOpen "Orbit" do stuff <- atomically . Apecs.runWith rsOrbitSim.sWorld $ Apecs.collect Just for_ stuff \(o@Orbiter.Orbiter{}, Orbiter.MeanAnomaly ma…
And, after a few passes at sweeping it under a rug...

inputOrbitElem rsOrbitSim entity "Eccentricity" (o.orbit.eccentricity # Number) (1/256) (1/8) "%.5f" \ecc' ->
Orbiter.eccentricity .~ (ecc' % Number)

inputOrbitElem rsOrbitSim entity "Periapsis" ((o.orbit.periapsis # Meter) / 1000) 1 10 "%.1f km" \p' ->
Orbiter.periapsis .~ ((p' * 1000) % Meter)

-- ...
Your orbit evolution when you burn anti-tangent for a while
🔥1
The Moon rises!

After an unscheduled rewrite of the rendering components I can now put arbitrary models on arbitrary local orbits. This also opens up a way to do LODs, daily rotation, and backscatter lighting.
Ah, and crashing into distant surfaces.
🔥31👍1
Fixing will continue until renderer improves.
1
Linear Space Program
The Moon rises! After an unscheduled rewrite of the rendering components I can now put arbitrary models on arbitrary local orbits. This also opens up a way to do LODs, daily rotation, and backscatter lighting. Ah, and crashing into distant surfaces.
Screenshot From 2025-10-21 01-12-49.png
1.7 MB
And now the Sun too. This time without faking the position, in all its 695700 km-radius glory, 148940000000 km away.

32bits of depth precision ought to be enough for everyone.

Since all the elements are stolen from the NASA it should be possible to model a realistic eclipses and transits 🔭🤔🪐
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥21
-- I fixed the normals, I swear! No, this time for real. Yes, I've tested it from multiple directions.
3👍1
Ever wanted to get some real incomprehensible charts that look cool?

I have a new package just for you!

https://hackage.haskell.org/package/tracy-profiler
👍3