Fix Door Object Collision Issue

- simply extended the door quad while checking for rigidbody doorway passing

Fixes #344
This commit is contained in:
westonCoder 2023-10-27 09:55:48 -05:00
parent e9a72bc967
commit 6d4c41d379

View file

@ -28,6 +28,10 @@ int worldCheckDoorwayCrossings(struct World* world, struct Vector3* position, in
for (int i = 0; i < room->doorwayCount; ++i) {
struct Doorway* doorway = &world->doorways[room->doorwayIndices[i]];
// extend the door plane a bit further to guarantee objects make contact
doorway->quad.edgeALength += 1.0f;
doorway->quad.edgeBLength += 1.0f;
int prevSide = (sideMask & (1 << i)) != 0;
int currSide = planePointDistance(&doorway->quad.plane, position) > 0;