Try / OpenGothic

Reimplementation of Gothic 2 Notr
MIT License
1.07k stars 78 forks source link

Tree stumps have no collision #579

Closed hwnde closed 2 months ago

hwnde commented 3 months ago

The hero can freely pass through tree stumps. Commit: 26b816e36d05832f90851d2924209f14e6d88050

Screenshot 2024-02-14 002246

hwnde commented 3 months ago

Update: it looks like the issue happens only with this particular stump model. The other tree stump models do have collision. The one on the screenshot is right outside the Xardas tower.

hwnde commented 2 months ago

The VOB name is NW_NATURE_BAUMSTUMPF_02_154P It looks like the reason this vob doesn't have collision is line 161 in objvisual.cpp

    if(vob.show_visual && enableCollision && vob.anim_mode!=zenkit::AnimationType::wind2) {
      mesh.physic = PhysicMesh(*view,*world.physic(),false);
      }

It fails on the last condition vob.anim_mode!=zenkit::AnimationType::wind2 @Try what is the reason for having this check?

Try commented 2 months ago

what is the reason for having this check?

Afair it was done for L'Hvier mod. In this mod trees were recognized as colliders, and anim_mode!=wind2 was added to fix it. It's possible(and likely) that fix was not correct, and root cause of this issue was enableCollision.

enableCollision is vob.cd_dynamic not, but sometime ago it was (vob.cd_dynamic || vob.cd_static)

Try commented 2 months ago

Tested on LH and vanilla: check is still needed, so I've extended it with anim_strength . Vanilla should run correct now