MCPcopy Create free account
hub / github.com/axmolengine/axmol / updateMVPUniform

Method updateMVPUniform

core/renderer/Pass.cpp:201–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void Pass::updateMVPUniform(const Mat4& modelView)
202{
203 auto& matrixP = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
204 auto mvp = matrixP * modelView;
205 _programState->setUniform(_locMVPMatrix, mvp.m, sizeof(mvp.m));
206 if (_locMVMatrix)
207 {
208 _programState->setUniform(_locMVMatrix, modelView.m, sizeof(modelView.m));
209 }
210
211 if (_locPMatrix)
212 {
213 _programState->setUniform(_locPMatrix, matrixP.m, sizeof(matrixP.m));
214 }
215
216 if (_locNormalMatrix)
217 {
218 auto normalMatrix = utils::getNormalMat3OfMat4(modelView);
219 _programState->setUniform(_locNormalMatrix, &normalMatrix, sizeof(normalMatrix));
220 }
221}
222
223void Pass::onBeforeVisitCmd(MeshCommand* command)
224{

Callers

nothing calls this directly

Calls 3

getInstanceFunction · 0.85
getNormalMat3OfMat4Function · 0.85
setUniformMethod · 0.45

Tested by

no test coverage detected