本文整理汇总了C++中Mat4::factorize方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat4::factorize方法的具体用法?C++ Mat4::factorize怎么用?C++ Mat4::factorize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat4
的用法示例。
在下文中一共展示了Mat4::factorize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
void JEffectInstance::Render()
{
JAnimation::Render();
if (!IsPlaying())
{
return;
}
// modify transform by "attach-to" bone
if (m_AttachInstance.size() > 0)
{
int boneID = -1;
Mat4 boneTM = Mat4::identity;
if (m_AttachInstance.size() > 0)
{
if (m_AttachInstanceID == -1)
{
JModelInstance* pModelInst = g_pObjectServer->FindObject<JModelInstance>( m_AttachInstance.c_str(), this );
if (pModelInst)
{
m_AttachInstanceID = pModelInst->GetInstanceID();
m_AttachBoneID = g_pModelServer->GetModelBoneID( pModelInst->GetModelID(), m_AttachBone.c_str() );
}
}
g_pModelServer->GetBoneTM( m_AttachInstanceID, m_AttachBoneID, boneTM );
}
Mat3 rot;
Vec3 scale;
boneTM.factorize( scale, rot, m_Position );
if (m_bScreenSpace)
{
Mat4 tm;
ProjToScreenTM( tm, g_pRenderServer->GetViewport() );
if (g_pRenderServer)
{
tm = g_pRenderServer->GetViewTM()*g_pRenderServer->GetProjTM()*tm;
tm.tmproj( m_Position );
}
}
}
float cTime = GetContext().m_Time;
if (m_Stamp == g_pParticleServer->GetStamp())
{
Vec3 pos = m_Position + GetContext().m_Pos;
if (cTime - m_PrevTime > c_RestartTimeout)
{
Stop();
Play();
cTime = 0.0f;
if (GetCurLoop() == 0)
{
cTime += GetStartTime();
}
m_PrevTime = cTime;
}
if (!GetContext().m_bStateOnly)
{
g_pParticleServer->Render( m_InstanceID, cTime, pos, m_Scale, m_Alpha );
}
m_PrevTime = cTime;
}
else
{
Stop();
}
}