MCPcopy Create free account
hub / github.com/defold/defold / UpdateRenderContextMatrices

Function UpdateRenderContextMatrices

engine/render/src/render/render.cpp:41–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 using namespace dmVMath;
40
41 static void UpdateRenderContextMatrices(HRenderContext render_context, const Matrix4& view, const Matrix4& projection)
42 {
43 static const Matrix4 adjusted_ndc_matrix = []()
44 {
45 Matrix4 ndc_matrix = Matrix4::identity();
46 ndc_matrix.setElem(2, 2, 0.5f);
47 ndc_matrix.setElem(3, 2, 0.5f);
48 return ndc_matrix;
49 }();
50
51 render_context->m_View = view;
52 render_context->m_Projection = projection;
53 render_context->m_ViewProj = projection * view;
54 render_context->m_ProjectionAdjustedNDC = adjusted_ndc_matrix * projection;
55 render_context->m_ViewProjAdjustedNDC = adjusted_ndc_matrix * render_context->m_ViewProj;
56 }
57
58 const char* RENDER_SOCKET_NAME = "@render";
59

Callers 4

NewRenderContextFunction · 0.85
SetViewMatrixFunction · 0.85
SetProjectionMatrixFunction · 0.85
DrawRenderListFunction · 0.85

Calls 1

identityFunction · 0.85

Tested by

no test coverage detected