Skip to content

Commit b01816f

Browse files
author
Patrick Meehan
committed
fixed default camera and viewport projection regression
1 parent 21006a5 commit b01816f

5 files changed

Lines changed: 2 additions & 46 deletions

File tree

samples/transform-pin/moai.png

-15.8 KB
Binary file not shown.

samples/transform-pin/run.bat

Lines changed: 0 additions & 24 deletions
This file was deleted.

samples/transform-pin/run.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/moai-sim/MOAICamera.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ ZLMatrix4x4 MOAICamera::GetProjMtx ( const MOAIViewport& viewport ) const {
415415
float xScale = ( 2.0f / viewport.Width ()) * viewScale.mX;
416416
float yScale = ( 2.0f / viewport.Height ()) * viewScale.mY;
417417

418-
mtx.Scale ( xScale, yScale, 0.0 );
418+
mtx.Scale ( xScale, yScale, -1.0 ); // Z must be non-zero to produce invertible projection matrix
419419
}
420420
}
421421
}

src/moai-sim/MOAIViewport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ ZLMatrix4x4 MOAIViewport::GetProjMtx () const {
200200
float xScale = ( 2.0f / rect.Width ()) * viewScale.mX;
201201
float yScale = ( 2.0f / rect.Height ()) * viewScale.mY;
202202

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

206206
// offset

0 commit comments

Comments
 (0)