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

Function GetNormalMatrix

engine/render/src/render/render.cpp:358–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356 }
357
358 dmVMath::Matrix4 GetNormalMatrix(HRenderContext render_context, const dmVMath::Matrix4& world_matrix)
359 {
360 // normalT = transp(inv(view * world))
361 Matrix4 normalT = render_context->m_View * world_matrix;
362 // The world transform might include non-uniform scaling, which breaks the orthogonality of the combined model-view transform
363 // It is always affine however
364 normalT = affineInverse(normalT);
365 normalT = transpose(normalT);
366 return normalT;
367 }
368
369 void SetViewMatrix(HRenderContext render_context, const Matrix4& view)
370 {

Callers 3

WriteMeshAttributesFunction · 0.85
RenderBatchWorldVSFunction · 0.85

Calls 2

affineInverseFunction · 0.50
transposeFunction · 0.50

Tested by

no test coverage detected