Skip to content

Fix wrong preprocessor macro in orthographic projection#127

Open
CodeReclaimers wants to merge 1 commit intodavideberly:masterfrom
CodeReclaimers:fix/viewvolume-ortho-macro
Open

Fix wrong preprocessor macro in orthographic projection#127
CodeReclaimers wants to merge 1 commit intodavideberly:masterfrom
CodeReclaimers:fix/viewvolume-ortho-macro

Conversation

@CodeReclaimers
Copy link
Contributor

The orthographic section of SetProjectionMatrix checks GTE_USE_MAT_VEC while every other #if defined in the codebase checks GTE_USE_VEC_MAT. In the default build (neither macro defined), orthographic uses VEC_MAT convention while perspective uses MAT_VEC — producing inconsistent projection matrices. Fixed the macro and swapped branches. Also fixed a missing 2.0f factor in the VEC_MAT depth [-1,1] branch.

🤖 Generated with Claude Code

The orthographic section checked GTE_USE_MAT_VEC while every other
usage in the codebase checks GTE_USE_VEC_MAT. In the default build
(neither macro defined), this caused the orthographic projection to
use VEC_MAT convention while perspective used MAT_VEC. Fixed by
changing to GTE_USE_VEC_MAT and swapping the branch bodies. Also
fixed missing 2.0f factor in VEC_MAT depth [-1,1] branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant