| 199 | } |
| 200 | |
| 201 | void 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 | |
| 223 | void Pass::onBeforeVisitCmd(MeshCommand* command) |
| 224 | { |
nothing calls this directly
no test coverage detected