本文整理汇总了C++中Matrix3x4::GetInverted方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix3x4::GetInverted方法的具体用法?C++ Matrix3x4::GetInverted怎么用?C++ Matrix3x4::GetInverted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix3x4
的用法示例。
在下文中一共展示了Matrix3x4::GetInverted方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCurrentAnchor
/**
* @brief
* Returns the current joint anchor position
*/
void RagdollJoint::GetCurrentAnchor(Vector3 &vPosition) const
{
const Joint *pJoint = static_cast<Joint*>(m_pJointHandler->GetElement());
if (pJoint)
pJoint->GetCurrentPivotPoint(vPosition);
// We need to calculate the current anchor by hand :(
else {
// Get the attached body
const RagdollBody *pAttachedBody = m_pParentRagdoll->GetBody(sAttached);
if (pAttachedBody && pAttachedBody->bEnabled) {
// Get the attached physics body
const Body *pBody = static_cast<Body*>(pAttachedBody->GetBody());
if (pBody) {
// Get initial physics body transform matrix
Matrix3x4 mInitTrans;
mInitTrans.FromQuatTrans(pAttachedBody->qRot, pAttachedBody->vPos);
// Get current physics body transform matrix
Matrix3x4 mTrans;
pBody->GetTransformMatrix(mTrans);
// Get the current joint anchor in local space
const Vector3 vLocalAnchor = mInitTrans.GetInverted()*vJointAnchor;
// Get the current joint anchor in world space
vPosition = vLocalAnchor;
vPosition *= mTrans;
}
}
}
}