PM_CatagorizePosition.
()
| 561 | * PM_CatagorizePosition. |
| 562 | */ |
| 563 | public static void PM_CatagorizePosition() { |
| 564 | float[] point = { 0, 0, 0 }; |
| 565 | int cont; |
| 566 | trace_t trace; |
| 567 | int sample1; |
| 568 | int sample2; |
| 569 | |
| 570 | // if the player hull point one unit down is solid, the player |
| 571 | // is on ground |
| 572 | |
| 573 | // see if standing on something solid |
| 574 | point[0] = pml.origin[0]; |
| 575 | point[1] = pml.origin[1]; |
| 576 | point[2] = pml.origin[2] - 0.25f; |
| 577 | if (pml.velocity[2] > 180) //!!ZOID changed from 100 to 180 (ramp |
| 578 | // accel) |
| 579 | { |
| 580 | pm.s.pm_flags &= ~Defines.PMF_ON_GROUND; |
| 581 | pm.groundentity = null; |
| 582 | } else { |
| 583 | trace = pm.trace.trace(pml.origin, pm.mins, |
| 584 | pm.maxs, point); |
| 585 | pml.groundsurface = trace.surface; |
| 586 | pml.groundcontents = trace.contents; |
| 587 | |
| 588 | if (null == trace.ent |
| 589 | || (trace.plane.normal[2] < 0.7 && !trace.startsolid)) { |
| 590 | pm.groundentity = null; |
| 591 | pm.s.pm_flags &= ~Defines.PMF_ON_GROUND; |
| 592 | } else { |
| 593 | pm.groundentity = trace.ent; |
| 594 | // hitting solid ground will end a waterjump |
| 595 | if ((pm.s.pm_flags & Defines.PMF_TIME_WATERJUMP) != 0) { |
| 596 | pm.s.pm_flags &= ~(Defines.PMF_TIME_WATERJUMP |
| 597 | | Defines.PMF_TIME_LAND | Defines.PMF_TIME_TELEPORT); |
| 598 | pm.s.pm_time = 0; |
| 599 | } |
| 600 | |
| 601 | if (0 == (pm.s.pm_flags & Defines.PMF_ON_GROUND)) { |
| 602 | |
| 603 | // just hit the ground |
| 604 | pm.s.pm_flags |= Defines.PMF_ON_GROUND; |
| 605 | // don't do landing time if we were just going down a slope |
| 606 | if (pml.velocity[2] < -200) { |
| 607 | pm.s.pm_flags |= Defines.PMF_TIME_LAND; |
| 608 | // don't allow another jump for a little while |
| 609 | if (pml.velocity[2] < -400) |
| 610 | pm.s.pm_time = 25; |
| 611 | else |
| 612 | pm.s.pm_time = 18; |
| 613 | } |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | if (pm.numtouch < Defines.MAXTOUCH && trace.ent != null) { |
| 618 | pm.touchents[pm.numtouch] = trace.ent; |
| 619 | pm.numtouch++; |
| 620 | } |
no test coverage detected