本文整理汇总了C++中VisBaseEntity_cl::SetRotationMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ VisBaseEntity_cl::SetRotationMatrix方法的具体用法?C++ VisBaseEntity_cl::SetRotationMatrix怎么用?C++ VisBaseEntity_cl::SetRotationMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisBaseEntity_cl
的用法示例。
在下文中一共展示了VisBaseEntity_cl::SetRotationMatrix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PerFrameUpdate
void VLineFollowerComponent::PerFrameUpdate()
{
VisBaseEntity_cl* pOwner = (VisBaseEntity_cl *)GetOwner();
if (!pOwner || !m_pFollowPath)
return;
hkvVec3 vPos;
hkvVec3 vDir;
m_pFollowPath->EvalPoint(m_fCurrentPathPos, vPos, &vDir);
vPos.z = pOwner->GetPosition().z;
float fDiff = Vision::GetTimer()->GetTimeDifference();
if((vPos - pOwner->GetPosition()).getLength() < Path_TriggerDistance)
{
if(fDiff>0.1)
m_fCurrentPathPos += (3/Path_NumberSteps);
else
m_fCurrentPathPos += (1/Path_NumberSteps);
if (m_fCurrentPathPos>1.f)
{
if (m_pFollowPath->IsClosed())
m_fCurrentPathPos = hkvMath::mod (m_fCurrentPathPos,1.f);
else
m_fCurrentPathPos = 1.f;
}
m_pFollowPath->EvalPoint(m_fCurrentPathPos, vPos, &vDir);
vPos.z = pOwner->GetPosition().z;
if(Vision::Editor.IsAnimatingOrPlaying() && Debug_DisplayBoxes)
Vision::Game.DrawCube(vPos,80.f);
}
else
{
if(Vision::Editor.IsAnimatingOrPlaying() && Debug_DisplayBoxes)
Vision::Game.DrawCube(vPos,80.f,V_RGBA_YELLOW);
}
// Orient the entity in the right direction
hkvMat3 mRot(hkvNoInitialization);
mRot.setLookInDirectionMatrix (vPos - pOwner->GetPosition());
mRot = mRot.multiply (m_mDeltaRotation);
pOwner->SetRotationMatrix(mRot);
// The animation we are playing should have motion delta which will
// move towards the target position. No animation, well lets add at
// least some motion delta
if (!m_bPlayingAnim)
{
pOwner->SetMotionDeltaLocalSpace( hkvVec3(1.f,0.f,0.f)*(Model_CapsuleRadius*fDiff) );
}
}