Some time ago, in the beginning of ZScript, I said that once we get user-readable lumps I'm going to implement walkable models. Apparently, now's the time
Current link: https://www.mediafire.com/file/ycggvsx6 ... 2.pk3/file
Video:
(the video is a bit old: it's not as buggy now)
As of now, as far as I know, it should not noclip or apply stupid velocity values, unless you try to walk between map geometry and a model (this is not implemented yet).
Things left to implement:
- Walking between map model and non-model (essentially this algorithm: https://i.imgur.com/sJRrFgS.png)
- Stepping up with MaxStepHeight
- Optimization of lookup (AABB tree or just two-level 3D AABB structure, 64x64x64 boxes containing inner triangles) (using blockmap greatly reduced the list of triangles to check)
- Moving along with actor attached to the model (i.e.: elevators, platforms..)
- Optionally: NETMODEL lump to make sure all clients share the same version to avoid desyncs
- ...maybe fix slopes? It still slides.
Before every Tick(), it checks if actor's movement along it's velocity is going to hit a model, and if it does, it checks for all triangles that were intersected, finds the best triangle (the one that will lowest remaining intersections after inverted velocity is applied), and does this:
Code: Select all
double diff = max(0, mostopposingnormal dot C3DCollision.NormalizeVector(parent.vel));
double dst = max(0, FindBoxToPlaneDist(tp_c, tp_n, b_start, b_end));
vector3 fac = mostopposingnormal * diff * parent.vel.Length() + mostopposingnormal * dst;
Then if actor is blocked by anything below it, it will mark it as standing on another actor to fix up bobbing and stuff.
Once this is more complete, I'm also planning to make a compatible hitscan and A_Chase.
Then it will be possible to have some actor like StaticDecoration which will have model name and orientation as properties as opposed to having to specify it in the code.