本文整理汇总了C++中CDir::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ CDir::Set方法的具体用法?C++ CDir::Set怎么用?C++ CDir::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDir
的用法示例。
在下文中一共展示了CDir::Set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MemberAutoSynPos
void CMemberAI::MemberAutoSynPos(bool bExtraMove)
{
CDummyAI* pDummyAI = GetGroupLeaderDummyAI();
if (!pDummyAI)
return;
CCharacterDictator* pDummyCharacter = pDummyAI->GetCharacter();
if (!pDummyCharacter)
return;
CFighterDictator* pDummyFighter = pDummyCharacter->GetFighter();
if(!pDummyFighter)
return;
CFPos destPos = GetSelfCorrectPos();
CFPos ownPos;
GetCharacter()->GetPixelPos(ownPos);
bool bWalkState = pDummyAI->m_bDefaultWalkState;
float fSpeed = bWalkState ?pDummyFighter->m_WalkSpeed.Get(pDummyFighter) :
pDummyFighter->m_RunSpeed.Get(pDummyFighter);
if (ownPos.Dist(destPos)<eGridSpanForObj/2)
{
if (bExtraMove)
pDummyAI->CheckMemberSynState();
else
MoveToPixelInLinePath(destPos,fSpeed,bWalkState);
return;
}
CVector2f vecf;
vecf.x = destPos.x - ownPos.x;
vecf.y = destPos.y - ownPos.y;
CDir dir;
dir.Set(vecf);
dir.Get(vecf);
if(bExtraMove)
{
float fLineDst = fSpeed*0.5f*eGridSpanForObj;
destPos.x = destPos.x + fLineDst*vecf.x;
destPos.y = destPos.y + fLineDst*vecf.y;
}
fSpeed += 0.3f;
MoveToPixelInLinePath(destPos,fSpeed,bWalkState);
}
示例2: RenderCallback
bool CTargetDirectionFX::RenderCallback( IEffectUnit* pUnit, CMatrix& matWorld, uint32 uCurTime, RenderObjStyle* pRORS )
{
IEffectUnitProp* pProp = pUnit->GetProp();
if(/* !bAlphaBlend ||*/ !pUnit->IsInRenderTime() )
{
return false;
}
CEntityClient* pEntity = CEntityClientManager::GetInst()->GetEntityByID( CEntityClientManager::GetInst()->GetDirectorID());
CFPos Pos = pEntity->GetPixelPos();
CVector2f vec2f(m_Pos.x-Pos.x,m_Pos.y-Pos.y);
CDir dir;
dir.Set(vec2f);
float fRotate = dir.uDir* CMath::pi *2/256;
CVector3f vec3f =matWorld.GetAxis(3);
matWorld.SetRotateY(fRotate);
matWorld._41 = vec3f.x;
matWorld._42 = vec3f.y;
matWorld._43 = vec3f.z;
return true;
}