-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes
39 lines (27 loc) · 1.58 KB
/
notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Floor casting -> DONE!!!
get pixel y in projection plane
(tan(field of view/2) * focal length) * 2 = actual length of projection plane (ppl)
ppl/w = converstion factor between pixels and actual distance (cf)
(y - h/2) * cf = distance between projection plane center row and y (dcpp)
sqrt(((w/2 - x) * cf)^2 + focal length^2)) = distance between player and pixel on projection plane (dppp)
dppp/dcpp = tangent of angle from player to floor point (ta)
player height * ta = distance along floor to floor point (df)
player x + df * cos(original angle) = texture x coordinate
player y + df * sin(original angle) = texture y coordinate
Focus to window when starting in fullscreen -> DONE!!!
- investigate
- SDL arg??? -> correct - `WINDOW_FULLSCREEN_DESKTOP`
Scale to fullscreen -> DONE!!!
- investigate why it doesn't scale atm -> solved through use of `WINDOW_FULLSCREEN_DESKTOP`
- hardcoded values?
Make less jarring
- investigate
- is jarring movement related to performance or input handling?
- at a modest resolution (640*480) it's fine so input handling should be improved. <- IMPROVED - runs at a decent (1280*960) resolution now.
- performance can *definitely* be improved though...
- stop drawing pixels individually! <- DONE (for walls)
- utilise harware acceleration via *Sdl.Texture <- DONE (for walls)
- figure out how to draw floor and ceiling using this method...
Fix slowdown when close to wall -> DONE!!! render stripes instead of pixels
- investigate
- may be related to rays cast not stopping at the wall???