Skip to content

Commit

Permalink
fixed default camera and viewport projection regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Meehan committed Dec 18, 2018
1 parent 21006a5 commit b01816f
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 46 deletions.
Binary file removed samples/transform-pin/moai.png
Binary file not shown.
24 changes: 0 additions & 24 deletions samples/transform-pin/run.bat

This file was deleted.

20 changes: 0 additions & 20 deletions samples/transform-pin/run.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/moai-sim/MOAICamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ ZLMatrix4x4 MOAICamera::GetProjMtx ( const MOAIViewport& viewport ) const {
float xScale = ( 2.0f / viewport.Width ()) * viewScale.mX;
float yScale = ( 2.0f / viewport.Height ()) * viewScale.mY;

mtx.Scale ( xScale, yScale, 0.0 );
mtx.Scale ( xScale, yScale, -1.0 ); // Z must be non-zero to produce invertible projection matrix
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/moai-sim/MOAIViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ ZLMatrix4x4 MOAIViewport::GetProjMtx () const {
float xScale = ( 2.0f / rect.Width ()) * viewScale.mX;
float yScale = ( 2.0f / rect.Height ()) * viewScale.mY;

mtx.Scale ( xScale, yScale, -1.0f );
mtx.Scale ( xScale, yScale, -1.0f ); // Z must be non-zero to produce invertible projection matrix
proj.Append ( mtx );

// offset
Expand Down

0 comments on commit b01816f

Please sign in to comment.