本文整理汇总了C++中core::matrix4::getInverse方法的典型用法代码示例。如果您正苦于以下问题:C++ matrix4::getInverse方法的具体用法?C++ matrix4::getInverse怎么用?C++ matrix4::getInverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::matrix4
的用法示例。
在下文中一共展示了matrix4::getInverse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderGI
void PostProcessing::renderGI(const core::matrix4 &RHMatrix, const core::vector3df &rh_extend, GLuint shr, GLuint shg, GLuint shb)
{
core::matrix4 InvRHMatrix;
RHMatrix.getInverse(InvRHMatrix);
glDisable(GL_DEPTH_TEST);
glUseProgram(FullScreenShader::GlobalIlluminationReconstructionShader::Program);
glBindVertexArray(FullScreenShader::GlobalIlluminationReconstructionShader::vao);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_3D, shr);
{
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_3D, shg);
{
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_3D, shb);
{
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
setTexture(3, irr_driver->getRenderTargetTexture(RTT_NORMAL_AND_DEPTH), GL_NEAREST, GL_NEAREST);
setTexture(4, irr_driver->getDepthStencilTexture(), GL_NEAREST, GL_NEAREST);
FullScreenShader::GlobalIlluminationReconstructionShader::setUniforms(RHMatrix, InvRHMatrix, rh_extend, 3, 4, 0, 1, 2);
glDrawArrays(GL_TRIANGLES, 0, 3);
}
示例2: attachHat
//-----------------------------------------------------------------------------
void KartModel::attachHat()
{
m_hat_node = NULL;
if(m_hat_name.size()>0)
{
scene::IBoneSceneNode *bone = m_animated_node->getJointNode("Head");
if(!bone)
bone = m_animated_node->getJointNode("head");
if(bone)
{
// Till we have all models fixed, accept Head and head as bone name
scene::IMesh *hat_mesh =
irr_driver->getAnimatedMesh(
file_manager->getAsset(FileManager::MODEL, m_hat_name));
m_hat_node = irr_driver->addMesh(hat_mesh, "hat");
bone->addChild(m_hat_node);
m_animated_node->setCurrentFrame((float)m_animation_frame[AF_STRAIGHT]);
m_animated_node->OnAnimate(0);
bone->updateAbsolutePosition();
// With the hat node attached to the head bone, we have to
// reverse the transformation of the bone, so that the hat
// is still properly placed. Esp. the hat offset needs
// to be rotated.
const core::matrix4 mat = bone->getAbsoluteTransformation();
core::matrix4 inv;
mat.getInverse(inv);
core::vector3df rotated_offset;
inv.rotateVect(rotated_offset, m_hat_offset);
m_hat_node->setPosition(rotated_offset);
m_hat_node->setScale(inv.getScale());
m_hat_node->setRotation(inv.getRotationDegrees());
} // if bone
} // if(m_hat_name)
} // attachHat
示例3: renderGI
void PostProcessing::renderGI(const core::matrix4 &RHMatrix, const core::vector3df &rh_extend, GLuint shr, GLuint shg, GLuint shb)
{
core::matrix4 InvRHMatrix;
RHMatrix.getInverse(InvRHMatrix);
glDisable(GL_DEPTH_TEST);
FullScreenShader::GlobalIlluminationReconstructionShader::getInstance()->SetTextureUnits(createVector<GLuint>(
irr_driver->getRenderTargetTexture(RTT_NORMAL_AND_DEPTH), irr_driver->getDepthStencilTexture(), shr, shg, shb));
DrawFullScreenEffect<FullScreenShader::GlobalIlluminationReconstructionShader>(RHMatrix, InvRHMatrix, rh_extend);
}
示例4: setProjMatrix
void setProjMatrix(core::matrix4 matrix) { m_ProjMatrix = matrix; matrix.getInverse(m_InvProjMatrix); }
示例5: setViewMatrix
// ------------------------------------------------------------------------
void setViewMatrix(core::matrix4 matrix) { m_ViewMatrix = matrix; matrix.getInverse(m_InvViewMatrix); }