本文整理汇总了C++中IView::GetCurrentParams方法的典型用法代码示例。如果您正苦于以下问题:C++ IView::GetCurrentParams方法的具体用法?C++ IView::GetCurrentParams怎么用?C++ IView::GetCurrentParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IView
的用法示例。
在下文中一共展示了IView::GetCurrentParams方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Shake
//----------------------------------------------------------------------
void Shake( SActivationInfo* pActInfo, bool bUpdateOnly )
{
IView* pView = GetView( pActInfo );
if (!pView)
return;
int currentFrameId = gEnv->pRenderer->GetFrameID();
if (!bUpdateOnly && (m_lastShakeFrameID == currentFrameId))
return;
SInputParams inputParams;
ReadCurrentInputParams( pActInfo, inputParams );
IView::SShakeParams params;
params.bGroundOnly = inputParams.groundOnly;
params.isSmooth = inputParams.isSmooth;
params.shakeAngle = inputParams.angle;
params.shakeShift = inputParams.shift;
params.sustainDuration = inputParams.sustainDuration;
params.bPermanent = (params.sustainDuration == -1);
float freq = inputParams.frequency;
if (iszero(freq) == false)
freq = 1.0f / freq;
params.frequency = freq;
params.randomness = inputParams.randomness;
params.bFlipVec = true; // GetPortBool(pActInfo, EIP_Flip);
params.bUpdateOnly = bUpdateOnly; // it's an update if and only if Frequency has been changed
params.fadeInDuration = inputParams.fadeInDuration;
params.fadeOutDuration = inputParams.fadeOutDuration;
params.shakeID = FLOWGRAPH_SHAKE_ID;
float distance = inputParams.distance;
IEntity* pEntityNode = pActInfo->pEntity;
if (pEntityNode)
{
distance = pView->GetCurrentParams()->position.GetDistance( pEntityNode->GetWorldPos());
}
const float rangeMin = inputParams.rangeMin;
const float rangeMax = inputParams.rangeMax;
float amount = min(1.f, max(0.f, (rangeMax - distance) / (rangeMax - rangeMin)));
params.shakeAngle *= amount;
params.shakeShift *= amount;
pView->SetViewShakeEx( params );
m_lastShakeFrameID = currentFrameId;
}
示例2: Reset
void CCameraView::Reset()
{
//initialize the camera view
IViewSystem *pViewSystem = g_pGame->GetIGameFramework()->GetIViewSystem();
IView *pView = pViewSystem->GetActiveView();
CRY_ASSERT(pView);
m_lastViewParams = *(pView->GetCurrentParams());
//the player can still change camera angles etc.
CPlayer *pHero = CPlayer::GetHero();
CRY_ASSERT(pHero);
m_pCamHelper = pHero->GetCameraInputHelper();
CRY_ASSERT(m_pCamHelper);
m_bModeTransition = false;
m_fTransitionTimeout = 0.0f;
m_curPolar.SetPitch(1.f);
}