Differences From Artifact [6e6b41ef3d]:
- File src/physics.m — part of check-in [e8f80b0482] at 2025-03-23 02:03:32 on branch trunk — Convert monster into a class (user: js, size: 12085) [annotate] [blame] [check-ins using]
To Artifact [0149f2d0e3]:
- File
src/physics.m
— part of check-in
[6b85eefc85]
at
2025-03-23 02:47:40
on branch trunk
— Remove loop[ijkl]
They confused clang-format a lot. (user: js, size: 12141) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
354 355 356 357 358 359 360 | pl.timeInAir = 0; } // at high fps, gravity kicks in too fast const float drop = dropf * curtime / gravity / 100 / moveres; // extra smoothness when lifting up stairs const float rise = speed / moveres / 1.2f; | | < > | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | pl.timeInAir = 0; } // at high fps, gravity kicks in too fast const float drop = dropf * curtime / gravity / 100 / moveres; // extra smoothness when lifting up stairs const float rise = speed / moveres / 1.2f; // discrete steps collision detection & sliding for (int i = 0; i < moveres; i++) { // try move forward pl.origin = OFAddVector3D(pl.origin, OFMakeVector3D(f * d.x, f * d.y, f * d.z)); if (collide(pl, false, drop, rise)) continue; // player stuck, try slide along y axis |
︙ | ︙ | |||
437 438 439 440 441 442 443 | } pl.inWater = water; } void moveplayer(DynamicEntity *pl, int moveres, bool local) { | > | | > | | 437 438 439 440 441 442 443 444 445 446 447 448 449 | } pl.inWater = water; } void moveplayer(DynamicEntity *pl, int moveres, bool local) { for (int i = 0; i < physicsrepeat; i++) moveplayer4(pl, moveres, local, i ? curtime / physicsrepeat : curtime - curtime / physicsrepeat * (physicsrepeat - 1)); } |