Enhance item handling and collision detection in remorse
- Introduced new functionality for staging and managing fixed map items, including the ability to build block chains and find candidates for item interactions. - Updated the main application logic to utilize staged item block chains for improved item finding and grabbing mechanics. - Added weight attribute to shape type information, allowing for more nuanced item interactions based on weight. - Enhanced collision tests to cover new item handling scenarios, including gravity sweeps and item grabbing. - Implemented additional tests for entity dispatch entries and fixed map items to ensure robustness of item spawning and movement logic. - Improved type flags loading to validate weight against binary data, ensuring consistency in item attributes.
This commit is contained in:
parent
c346b0e1a7
commit
b99fb59c12
15 changed files with 961 additions and 18 deletions
|
|
@ -4,6 +4,24 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
const auto outsideBounds = remorse::clampAreaSweepBounds({10, 20, 10}, {-3, 0x8000, 252});
|
||||
assert(outsideBounds.destination.x == 0 && outsideBounds.destination.y == 0x7fff &&
|
||||
outsideBounds.destination.z == 250 && outsideBounds.failedDirections == 7 &&
|
||||
outsideBounds.failed);
|
||||
const auto belowFloor = remorse::clampAreaSweepBounds({10, 20, 10}, {10, 20, -3});
|
||||
assert(belowFloor.destination.z == 0 && belowFloor.failedDirections == 4 && !belowFloor.failed);
|
||||
const auto withinBounds = remorse::clampAreaSweepBounds({10, 20, 10}, {12, 23, 11});
|
||||
assert(withinBounds.failedDirections == 0 && !withinBounds.failed);
|
||||
const auto gravityStep = remorse::planGravitySweep({100, 200, 250}, 3, -2, 4, 2, 3);
|
||||
assert(gravityStep.destination.x == 109 && gravityStep.destination.y == 194);
|
||||
assert(gravityStep.destination.z == 6 && gravityStep.nextZSpeed == -2);
|
||||
const auto slowStep = remorse::planGravitySweep({100, 200, 0}, 3, -2, -4, 2, 0);
|
||||
assert(slowStep.destination.x == 103 && slowStep.destination.y == 198);
|
||||
assert(slowStep.destination.z == 252 && slowStep.nextZSpeed == -6);
|
||||
const auto cappedStep = remorse::planGravitySweep({100, 200, 0}, 3, -2, 4, 2, 5);
|
||||
assert(cappedStep.destination.x == 112 && cappedStep.destination.y == 192);
|
||||
assert(cappedStep.destination.z == 16 && cappedStep.nextZSpeed == -4);
|
||||
|
||||
const remorse::CollisionBody actor{{100, 100, 0}, 96, 96, 80};
|
||||
const remorse::CollisionBody wall{{300, 100, 0}, 64, 96, 128};
|
||||
assert(!remorse::collisionBodiesOverlap(actor, wall));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue