Skip to content

Preserve rotation and positioning for diagonal ledge hangs#3

Draft
walkawayy wants to merge 10 commits intodevelopfrom
codex/update-code-for-diagonal-ledge-grabs
Draft

Preserve rotation and positioning for diagonal ledge hangs#3
walkawayy wants to merge 10 commits intodevelopfrom
codex/update-code-for-diagonal-ledge-grabs

Conversation

@walkawayy
Copy link
Copy Markdown
Owner

Motivation

  • Diagonal or split ledges were being rejected or causing Lara to snap to cardinal directions, leading to brief grabs and immediate falls.
  • The intent is to detect diagonal/split geometry and let hang/edge flows accept those surfaces while preserving Lara's facing angle and correct placement.

Description

  • Add detection of diagonal/split ledges via Lara_Col_IsDiagonalLedge (declared in col.h and implemented in col.c).
  • Treat diagonal ledges as an edge catch by returning EDGE_CATCH_POS from Lara_Col_TestEdgeCatch when applicable.
  • Relax hang-direction gating by falling back from Math_GetDirectionCone to Math_GetDirection for diagonal ledges and preserve item->rot.y (instead of snapping to Math_DirectionToAngle) during jump and crawl to hang flows, and avoid sector-edge rounding by applying coll->shift.x/coll->shift.z directly for diagonal cases.
  • Update hang test logic in climb.c to use Math_Sin/Math_Cos-based position shifts and allow diagonal slopes in the slope-difference check.

Testing

  • No automated tests were executed for these changes.

Codex Task

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 11, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant