-----------------------------------------------------------------------------
| 422 | } |
| 423 | //----------------------------------------------------------------------------- |
| 424 | Matrix4 AutoParamDataSource::getProjectionMatrix(const Camera* cam) const |
| 425 | { |
| 426 | Matrix4 proj; |
| 427 | |
| 428 | // NB use API-independent projection matrix since GPU programs |
| 429 | // bypass the API-specific handedness and use right-handed coords |
| 430 | if (mCurrentRenderable && mCurrentRenderable->getUseIdentityProjection()) |
| 431 | { |
| 432 | // Use identity projection matrix, still need to take RS depth into account. |
| 433 | RenderSystem* rs = Root::getSingleton().getRenderSystem(); |
| 434 | rs->_convertProjectionMatrix(Matrix4::IDENTITY, proj, true); |
| 435 | } |
| 436 | else |
| 437 | { |
| 438 | proj = cam->getProjectionMatrixWithRSDepth(); |
| 439 | } |
| 440 | |
| 441 | if (mCurrentRenderTarget && mCurrentRenderTarget->requiresTextureFlipping()) |
| 442 | { |
| 443 | // Because we're not using setProjectionMatrix, this needs to be done here |
| 444 | // Invert transformed y |
| 445 | proj[1][0] = -proj[1][0]; |
| 446 | proj[1][1] = -proj[1][1]; |
| 447 | proj[1][2] = -proj[1][2]; |
| 448 | proj[1][3] = -proj[1][3]; |
| 449 | } |
| 450 | |
| 451 | return proj; |
| 452 | } |
| 453 | const Matrix4& AutoParamDataSource::getProjectionMatrix(void) const |
| 454 | { |
| 455 | if (mProjMatrixDirty) |