Skip to content

Commit

Permalink
Fixed lights registration in Forward3D grid for landscape-oriented ca…
Browse files Browse the repository at this point in the history
…mera
  • Loading branch information
dyunchik authored and eugenegff committed Aug 27, 2024
1 parent 59d366b commit 8abe035
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions OgreMain/src/OgreForward3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,14 @@ namespace Ogre
interpTR[1] = Math::lerp( topRight[0], topRight[1], fW );

// Find the rectangle that encloses both the front and back faces.
const Vector2 finalBL( std::min( interpBL[0].x, interpBL[1].x ),
std::min( interpBL[0].y, interpBL[1].y ) );
const Vector2 finalTR( std::max( interpTR[0].x, interpTR[1].x ),
std::max( interpTR[0].y, interpTR[1].y ) );
const Vector2 finalBL( std::min( std::min( interpBL[0].x, interpBL[1].x ),
std::min( interpTR[0].x, interpTR[1].x ) ),
std::min( std::min( interpBL[0].y, interpBL[1].y ),
std::min( interpTR[0].y, interpTR[1].y ) ) );
const Vector2 finalTR( std::max( std::max( interpTR[0].x, interpTR[1].x ),
std::max( interpBL[0].x, interpBL[1].x ) ),
std::max( std::max( interpTR[0].y, interpTR[1].y ),
std::max( interpBL[0].y, interpBL[1].y ) ) );

This comment has been minimized.

Copy link
@darksylinc

darksylinc Sep 4, 2024

Member

I assume this bug happened because camera->getOrientationMode() returned OR_DEGREE_180 ?

@dyunchik

This comment has been minimized.

Copy link
@dyunchik

dyunchik Sep 5, 2024

Author Contributor

yes, it depends on orientationMode, we've got it on Android phone


uint32 startX, startY, endX, endY;
projectionSpaceToGridSpace( finalBL, slice, startX, startY );
Expand Down

0 comments on commit 8abe035

Please sign in to comment.