本文整理汇总了C++中Matrix4::Multiply4x3方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4::Multiply4x3方法的具体用法?C++ Matrix4::Multiply4x3怎么用?C++ Matrix4::Multiply4x3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4
的用法示例。
在下文中一共展示了Matrix4::Multiply4x3方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetRenderMatrix
Matrix4* BMaxObject::GetRenderMatrix(Matrix4& mxWorld, int nRenderNumber /*= 0*/)
{
mxWorld.identity();
// order of rotation: roll * pitch * yaw , where roll is applied first.
bool bIsIdentity = true;
float fScaling = GetScaling();
if (fScaling != 1.f)
{
Matrix4 matScale;
ParaMatrixScaling((Matrix4*)&matScale, fScaling, fScaling, fScaling);
mxWorld = (bIsIdentity) ? matScale : matScale.Multiply4x3(mxWorld);
bIsIdentity = false;
}
float fYaw = GetYaw();
if (fYaw != 0.f)
{
Matrix4 matYaw;
ParaMatrixRotationY((Matrix4*)&matYaw, fYaw);
mxWorld = (bIsIdentity) ? matYaw : matYaw.Multiply4x3(mxWorld);
bIsIdentity = false;
}
if (GetPitch() != 0.f)
{
Matrix4 matPitch;
ParaMatrixRotationX(&matPitch, GetPitch());
mxWorld = (bIsIdentity) ? matPitch : matPitch.Multiply4x3(mxWorld);
bIsIdentity = false;
}
if (GetRoll() != 0.f)
{
Matrix4 matRoll;
ParaMatrixRotationZ(&matRoll, GetRoll());
mxWorld = (bIsIdentity) ? matRoll : matRoll.Multiply4x3(mxWorld);
bIsIdentity = false;
}
// world translation
Vector3 vPos = GetRenderOffset();
mxWorld._41 += vPos.x;
mxWorld._42 += vPos.y;
mxWorld._43 += vPos.z;
return &mxWorld;
}
示例2:
void ParaEngine::CPainter::ScaleMatrix(float x, float y, float z)
{
Matrix4 mat;
mat.makeScale(x, y, z);
m_curMatrix = mat.Multiply4x3(m_curMatrix);
engine->transformChanged();
}
示例3: mAfterRot
void ParaEngine::CBoneChain::RotateBoneChain(const Vector3& vAxis, Bone* allBones, int nMaxBoneNum, float fAngle, const AnimIndex& CurrentAnim, const AnimIndex& BlendingAnim, float blendingFactor, IAttributeFields* pAnimInstance /*= NULL*/)
{
for (int i = 0; i < m_nBoneCount; i++)
{
int nBoneID = m_boneChain[i].nBoneID;
if (nBoneID < nMaxBoneNum && nBoneID >= 0)
{
Bone & bone = allBones[nBoneID];
bone.calcMatrix(allBones, CurrentAnim, BlendingAnim, blendingFactor, pAnimInstance);
// just rotate one bone at most.
Matrix4 mAfterRot(Quaternion(vAxis, fAngle));
if (bone.bUsePivot)
{
Matrix4 M;
// use pivot point
M.makeTrans(bone.pivot*-1.0f);
mAfterRot = M.Multiply4x3(mAfterRot);
mAfterRot.offsetTrans(bone.pivot);
}
bone.mat = mAfterRot.Multiply4x3(bone.mat);
bone.mrot = mAfterRot.Multiply4x3(bone.mrot);
break;
}
}
}