MCPcopy Create free account
hub / github.com/OGRECave/ogre / _convertProjectionMatrix

Method _convertProjectionMatrix

RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp:1228–1258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1226 }
1227
1228 void VulkanRenderSystem::_convertProjectionMatrix(const Matrix4& matrix, Matrix4& dest, bool)
1229 {
1230 dest = matrix;
1231
1232 if (auto win = dynamic_cast<VulkanWindow*>(mActiveRenderTarget))
1233 {
1234 int transform = win->getSurfaceTransform();
1235 if (transform != VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR)
1236 {
1237 auto angle = Degree(90) * (transform - 1);
1238 dest = Matrix4(Quaternion(angle, Vector3::UNIT_Z)) * dest;
1239 }
1240 }
1241
1242 if (mIsReverseDepthBufferEnabled)
1243 {
1244 // Convert depth range from [-1,+1] to [1,0]
1245 dest[2][0] = (dest[2][0] - dest[3][0]) * -0.5f;
1246 dest[2][1] = (dest[2][1] - dest[3][1]) * -0.5f;
1247 dest[2][2] = (dest[2][2] - dest[3][2]) * -0.5f;
1248 dest[2][3] = (dest[2][3] - dest[3][3]) * -0.5f;
1249 }
1250 else
1251 {
1252 // Convert depth range from [-1,+1] to [0,1]
1253 dest[2][0] = (dest[2][0] + dest[3][0]) / 2;
1254 dest[2][1] = (dest[2][1] + dest[3][1]) / 2;
1255 dest[2][2] = (dest[2][2] + dest[3][2]) / 2;
1256 dest[2][3] = (dest[2][3] + dest[3][3]) / 2;
1257 }
1258 }
1259
1260 void VulkanRenderSystem::_setCullingMode(CullingMode mode)
1261 {

Callers 2

getProjectionMatrixMethod · 0.45
updateFrustumImplMethod · 0.45

Calls 4

getSurfaceTransformMethod · 0.80
DegreeFunction · 0.50
Matrix4Class · 0.50
QuaternionFunction · 0.50

Tested by

no test coverage detected