Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGuizmo: Support infinite-far-plane reversed-z #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ImGuizmo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ namespace IMGUIZMO_NAMESPACE
const float moy = (1.f - ((io.MousePos.y - position.y) / size.y)) * 2.f - 1.f;

const float zNear = gContext.mReversed ? (1.f - FLT_EPSILON) : 0.f;
const float zFar = gContext.mReversed ? 0.f : (1.f - FLT_EPSILON);
const float zFar = gContext.mReversed ? 0.1f : (1.f - FLT_EPSILON); // for reversed-z, use z = 0.1 for the far plane since the actual far plane may be at infinity

rayOrigin.Transform(makeVect(mox, moy, zNear, 1.f), mViewProjInverse);
rayOrigin *= 1.f / rayOrigin.w;
Expand Down