Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

EMI: Relax height check for bridges between sectors #1127

Merged
merged 1 commit into from Jan 13, 2015

Conversation

chkr-private
Copy link
Contributor

@chkr-private
Copy link
Contributor Author

Although the new margin of 0.1 fixes #992, I'm not sure how we could verify whether the new value is actually meaningful/correct.

@Botje
Copy link
Member

Botje commented Dec 12, 2014

👍 I have a feeling 0.5 is the right number, but I cannot back it up :)

@klusark
Copy link
Member

klusark commented Dec 12, 2014

If 0.01 works in all but 1 case, and 0.1 fixes that case, is there any advantage of raising it to 0.5?

@klusark
Copy link
Member

klusark commented Dec 12, 2014

Actually, is there a case where we actually need this check at all? Are there any sectors that overlap which aren't supposed to be crossed between?

@Botje
Copy link
Member

Botje commented Dec 12, 2014

I think this was inherited from Grim. I can't remember any places where it would cause harm, but it's been a while since I last played through.

@Akz-
Copy link
Contributor

Akz- commented Dec 13, 2014

The height check is there because the intersection tests are done in 2D, so the code may otherwise consider two sectors at different heights as intersecting. This could potentially lead to the character snapping from one floor to another. @tobiaspfaff experienced this in his mouse mod (see #842).

I haven't checked how the sectors are arranged in the boulder area, but if I had to guess, it's possible there are two intersecting sectors that are not parallel with each other. The current bridge building algorithm doesn't handle nonparallel sectors correctly.

For pairs of nonparallel sectors, the bridge should be the intersection (in 3D) between the sector polygons, which is just a single line segment if the polygons are intersecting at all. If my guess is correct, implementing this may fix #992.

@chkr-private
Copy link
Contributor Author

@Akz-: I have checked the problematic sectors: they are indeed not parallel. Even worse, one sector isn't even a plane. Implementing 3D intersection for non-plane polygons would be complicated. Given the minor benefit of such an implementation, I believe that the best way to proceed would still be just to relax the height check.

@somaen
Copy link
Member

somaen commented Jan 9, 2015

I have a hunch we keep coming back to this, so I'd appreciate a comment with a reference to issues here before merging.

@chkr-private
Copy link
Contributor Author

@somaen: I have added some comments to the commit. OK to merge?

somaen added a commit that referenced this pull request Jan 13, 2015
EMI: Relax height check for bridges between sectors
@somaen somaen merged commit fed0118 into residualvm:master Jan 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants