void Transpose_note( struct Notes *note, int trans ){ note->note = getTransposed(note->note, trans); if (note->pitch_end > 0) note->pitch_end = getTransposed(note->pitch_end, trans); struct Pitches *pitch = note->pitches; while(pitch!=NULL){ pitch->note = getTransposed(pitch->note, trans); pitch = NextPitch(pitch); } }
virtual void OnSetConstants(irr::video::IMaterialRendererServices* services, irr::s32 userData) { auto driver = services->getVideoDriver(); irr::core::matrix4 mvMatrix; mvMatrix = driver->getTransform(irr::video::ETS_VIEW); mvMatrix = driver->getTransform(irr::video::ETS_WORLD); auto norMat = mvMatrix; norMat.makeInverse(); norMat = norMat.getTransposed(); irr::f32 normalMatrix[9] = {0}; normalMatrix[0] = norMat.pointer()[0]; normalMatrix[1] = norMat.pointer()[1]; normalMatrix[2] = norMat.pointer()[2]; normalMatrix[3] = norMat.pointer()[4]; normalMatrix[4] = norMat.pointer()[5]; normalMatrix[5] = norMat.pointer()[6]; normalMatrix[6] = norMat.pointer()[8]; normalMatrix[7] = norMat.pointer()[9]; normalMatrix[8] = norMat.pointer()[10]; irr::core::vector3df Camera = Smgr_->getActiveCamera()->getAbsolutePosition(); static irr::video::SColorf Whitecol(1.0f,1.0f,1.0f,0.0f); static irr::video::SColorf Blackcol(0.1f,0.1f,0.1f,0.1f); irr::video::SColorf fragColor(CurrentMaterial_.DiffuseColor); services->setVertexShaderConstant("mvMatrix", mvMatrix.pointer(), 16); services->setVertexShaderConstant("normalMatrix", normalMatrix, 9); services->setVertexShaderConstant("vLightPos", &Camera.X, 3); services->setPixelShaderConstant("ambientColor",&Blackcol.r, 4); services->setPixelShaderConstant("diffuseColor",&Whitecol.r, 4); services->setPixelShaderConstant("FragAlpha",&CurrentMaterial_.Shininess, 1); services->setPixelShaderConstant("FragColor",&fragColor.r, 4); irr::s32 pos = 0; irr::s32 hasTexture = CurrentMaterial_.getTexture(0) ? 1 : 0; services->setPixelShaderConstant("colorMap", &pos, 1); services->setPixelShaderConstant("HasTexture", &hasTexture, 1); }
void CMatrix::transpose( ) { *this = getTransposed(); }