本文整理汇总了C++中CStudioHdr::SequencesAvailable方法的典型用法代码示例。如果您正苦于以下问题:C++ CStudioHdr::SequencesAvailable方法的具体用法?C++ CStudioHdr::SequencesAvailable怎么用?C++ CStudioHdr::SequencesAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStudioHdr
的用法示例。
在下文中一共展示了CStudioHdr::SequencesAvailable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetRenderBounds
void C_BaseAnimatingOverlay::GetRenderBounds( Vector& theMins, Vector& theMaxs )
{
BaseClass::GetRenderBounds( theMins, theMaxs );
if ( !IsRagdoll() )
{
CStudioHdr *pStudioHdr = GetModelPtr();
if ( !pStudioHdr || !pStudioHdr->SequencesAvailable() )
return;
int nSequences = pStudioHdr->GetNumSeq();
int i;
for (i = 0; i < m_AnimOverlay.Count(); i++)
{
if (m_AnimOverlay[i].m_flWeight > 0.0)
{
if ( m_AnimOverlay[i].m_nSequence >= nSequences )
{
continue;
}
mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( m_AnimOverlay[i].m_nSequence );
VectorMin( seqdesc.bbmin, theMins, theMins );
VectorMax( seqdesc.bbmax, theMaxs, theMaxs );
}
}
}
}
示例2: HasPoseParameter
//=========================================================
//=========================================================
bool CAnimating::HasPoseParameter( int iSequence, int iParameter )
{
CStudioHdr *pstudiohdr = GetModelPtr( );
if ( !pstudiohdr )
{
return false;
}
if ( !pstudiohdr->SequencesAvailable() )
{
return false;
}
if (iSequence < 0 || iSequence >= pstudiohdr->GetNumSeq())
{
return false;
}
mstudioseqdesc_t &seqdesc = pstudiohdr->pSeqdesc( iSequence );
if (pstudiohdr->GetSharedPoseParameter( iSequence, seqdesc.paramindex[0] ) == iParameter ||
pstudiohdr->GetSharedPoseParameter( iSequence, seqdesc.paramindex[1] ) == iParameter)
{
return true;
}
return false;
}
示例3: GetIntervalMovement
bool C_CFPlayer::GetIntervalMovement( float flIntervalUsed, bool &bMoveSeqFinished, Vector &newPosition, QAngle &newAngles )
{
CStudioHdr *pstudiohdr = GetModelPtr( );
if (! pstudiohdr || !pstudiohdr->SequencesAvailable())
return false;
float flComputedCycleRate = GetSequenceCycleRate( pstudiohdr, GetSequence() );
float flNextCycle = GetCycle() + flIntervalUsed * flComputedCycleRate * m_flPlaybackRate;
if ((!SequenceLoops()) && flNextCycle > 1.0)
{
flIntervalUsed = GetCycle() / (flComputedCycleRate * m_flPlaybackRate);
flNextCycle = 1.0;
bMoveSeqFinished = true;
}
else
{
bMoveSeqFinished = false;
}
Vector deltaPos;
QAngle deltaAngles;
float poseParameters[MAXSTUDIOPOSEPARAM];
GetPoseParameters(pstudiohdr, poseParameters);
if (Studio_SeqMovement( pstudiohdr, GetSequence(), GetCycle(), flNextCycle, poseParameters, deltaPos, deltaAngles ))
{
VectorYawRotate( deltaPos, GetLocalAngles().y, deltaPos );
newPosition = GetLocalOrigin() + deltaPos;
newAngles.Init();
newAngles.y = GetLocalAngles().y + deltaAngles.y;
return true;
}
else
{
newPosition = GetLocalOrigin();
newAngles = GetLocalAngles();
return false;
}
}
示例4: GetPoseParameter
float CAnimating::GetPoseParameter( int iParameter )
{
CStudioHdr *pstudiohdr = GetModelPtr( );
if ( !pstudiohdr )
{
Assert(!"CBaseAnimating::GetPoseParameter: model missing");
return 0.0;
}
if ( !pstudiohdr->SequencesAvailable() )
{
return 0;
}
if (iParameter >= 0)
{
return Studio_GetPoseParameter( pstudiohdr, iParameter, GetPoseParameterArray()[iParameter]);
}
return 0.0;
}
示例5: DispatchAnimEvents
void CAnimationLayer::DispatchAnimEvents( CBaseAnimating *eventHandler, CBaseAnimating *pOwner )
{
animevent_t event;
CStudioHdr *pstudiohdr = pOwner->GetModelPtr( );
if ( !pstudiohdr )
{
Assert(!"CBaseAnimating::DispatchAnimEvents: model missing");
return;
}
if ( !pstudiohdr->SequencesAvailable() )
{
return;
}
if ( m_nSequence >= pstudiohdr->GetNumSeq() )
return;
// don't fire if here are no events
if ( pstudiohdr->pSeqdesc( m_nSequence ).numevents == 0 )
{
return;
}
// look from when it last checked to some short time in the future
float flCycleRate = pOwner->GetSequenceCycleRate( m_nSequence ) * m_flPlaybackRate;
float flStart = m_flLastEventCheck;
float flEnd = m_flCycle;
if (!m_bLooping)
{
// fire off events early
float flLastVisibleCycle = 1.0f - (pstudiohdr->pSeqdesc( m_nSequence ).fadeouttime) * flCycleRate;
if (flEnd >= flLastVisibleCycle || flEnd < 0.0)
{
m_bSequenceFinished = true;
flEnd = 1.01f;
}
}
m_flLastEventCheck = flEnd;
/*
if (pOwner->m_debugOverlays & OVERLAY_NPC_SELECTED_BIT)
{
Msg( "%s:%s : checking %.2f %.2f (%d)\n", STRING(pOwner->GetModelName()), pstudiohdr->pSeqdesc( m_nSequence ).pszLabel(), flStart, flEnd, m_bSequenceFinished );
}
*/
// FIXME: does not handle negative framerates!
int index = 0;
while ( (index = GetAnimationEvent( pstudiohdr, m_nSequence, &event, flStart, flEnd, index ) ) != 0 )
{
event.pSource = pOwner;
// calc when this event should happen
if (flCycleRate > 0.0)
{
float flCycle = event.cycle;
if (flCycle > m_flCycle)
{
flCycle = flCycle - 1.0;
}
event.eventtime = pOwner->m_flAnimTime + (flCycle - m_flCycle) / flCycleRate + pOwner->GetAnimTimeInterval();
}
// Msg( "dispatch %d (%d : %.2f)\n", index - 1, event.event, event.eventtime );
event.m_bHandledByScript = eventHandler->HandleScriptedAnimEvent( &event );
if ( eventHandler->HandleBehaviorAnimEvent( &event ) )
{
event.m_bHandledByScript = true;
}
eventHandler->HandleAnimEvent( &event );
}
}