correct and move logic to world.lua script
This commit is contained in:
parent
6d4c41d379
commit
7a1c9986a5
|
@ -28,10 +28,6 @@ int worldCheckDoorwayCrossings(struct World* world, struct Vector3* position, in
|
||||||
for (int i = 0; i < room->doorwayCount; ++i) {
|
for (int i = 0; i < room->doorwayCount; ++i) {
|
||||||
struct Doorway* doorway = &world->doorways[room->doorwayIndices[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 prevSide = (sideMask & (1 << i)) != 0;
|
||||||
int currSide = planePointDistance(&doorway->quad.plane, position) > 0;
|
int currSide = planePointDistance(&doorway->quad.plane, position) > 0;
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,10 @@ for doorway_index, doorway in pairs(sk_scene.nodes_for_type('@doorway')) do
|
||||||
table.insert(room_doorways[room_a + 1], doorway_index - 1)
|
table.insert(room_doorways[room_a + 1], doorway_index - 1)
|
||||||
table.insert(room_doorways[room_b + 1], doorway_index - 1)
|
table.insert(room_doorways[room_b + 1], doorway_index - 1)
|
||||||
|
|
||||||
|
quad.corner = quad.corner + (-0.5 * quad.edgeA + -0.5 * quad.edgeB)
|
||||||
|
quad.edgeALength = quad.edgeALength + 1.0
|
||||||
|
quad.edgeBLength = quad.edgeBLength + 1.0
|
||||||
|
|
||||||
table.insert(doorways, {
|
table.insert(doorways, {
|
||||||
quad,
|
quad,
|
||||||
room_a,
|
room_a,
|
||||||
|
|
Loading…
Reference in a new issue