本文整理汇总了C++中GetSequence函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSequence函数的具体用法?C++ GetSequence怎么用?C++ GetSequence使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSequence函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetModelPtr
// asw - test always advancing the frames
void C_ASW_Alien::ASWUpdateClientSideAnimation()
{
if ( GetSequence() != -1 )
{
// latch old values
//OnLatchInterpolatedVariables( LATCH_ANIMATION_VAR );
// move frame forward
//FrameAdvance( 0.0f ); // 0 means to use the time we last advanced instead of a constant
CStudioHdr *hdr = GetModelPtr();
float cyclerate = hdr ? GetSequenceCycleRate( hdr, GetSequence() ) : 1.0f;
float addcycle = gpGlobals->frametime * cyclerate * m_flPlaybackRate;
float flNewCycle = GetCycle() + addcycle;
m_flAnimTime = gpGlobals->curtime;
if ( (flNewCycle < 0.0f) || (flNewCycle >= 1.0f) )
{
if (flNewCycle >= 1.0f) // asw
ReachedEndOfSequence(); // asw
if ( IsSequenceLooping( hdr, GetSequence() ) )
{
flNewCycle -= (int)(flNewCycle);
}
else
{
flNewCycle = (flNewCycle < 0.0f) ? 0.0f : 1.0f;
}
}
SetCycle( flNewCycle );
}
}
示例2: SetSequence
void CAnimating::ResetSequenceInfo()
{
if (GetSequence() == -1)
{
// This shouldn't happen. Setting m_nSequence blindly is a horrible coding practice.
SetSequence( 0 );
}
CStudioHdr *pStudioHdr = GetModelPtr();
m_flGroundSpeed = GetSequenceGroundSpeed( pStudioHdr, GetSequence() );
m_bSequenceLoops = ((GetSequenceFlags( pStudioHdr, GetSequence() ) & STUDIO_LOOPING) != 0);
// m_flAnimTime = gpGlobals->time;
m_flPlaybackRate = 1.0;
m_bSequenceFinished = false;
m_flLastEventCheck = 0;
m_nNewSequenceParity = ( *(m_nNewSequenceParity)+1 ) & EF_PARITY_MASK;
m_nResetEventsParity = ( *(m_nResetEventsParity)+1 ) & EF_PARITY_MASK;
// FIXME: why is this called here? Nothing should have changed to make this nessesary
if ( pStudioHdr )
{
SetEventIndexForSequence( pStudioHdr->pSeqdesc( GetSequence() ) );
}
}
示例3: GetSequence
void C_ASW_Simple_Drone::ClientThink()
{
BaseClass::ClientThink();
if (GetSequence() == LookupSequence("run_idle")
|| GetSequence() == LookupSequence("lunge_attack"))
UpdatePoseParams();
}
示例4: SetNextThink
//=========================================================
// Retire - stop being active
//=========================================================
void CNPC_BaseTurret::Retire(void)
{
// make the turret level
m_vecGoalAngles.x = 0;
m_vecGoalAngles.y = m_flStartYaw;
SetNextThink( gpGlobals->curtime + 0.1 );
StudioFrameAdvance( );
EyeOff( );
if (!MoveTurret())
{
if (m_iSpin)
{
SpinDownCall();
}
else if (GetSequence() != TURRET_ANIM_RETIRE)
{
SetTurretAnim(TURRET_ANIM_RETIRE);
CPASAttenuationFilter filter( this );
EmitSound( filter, entindex(), "Turret.Undeploy" );
m_OnDeactivate.FireOutput(this, this);
}
//else if (IsSequenceFinished())
else if( GetSequence() == TURRET_ANIM_RETIRE && GetCycle() <= 0.0 )
{
m_iOn = 0;
m_flLastSight = 0;
//SetTurretAnim(TURRET_ANIM_NONE);
Vector curmins, curmaxs;
curmins = WorldAlignMins();
curmaxs = WorldAlignMaxs();
curmaxs.z = m_iRetractHeight;
curmins.z = -m_iRetractHeight;
SetCollisionBounds( curmins, curmaxs );
if (m_iAutoStart)
{
SetThink(&CNPC_BaseTurret::AutoSearchThink);
SetNextThink( gpGlobals->curtime + 0.1 );
}
else
{
SetThink( &CBaseEntity::SUB_DoNothing );
}
}
}
else
{
SetTurretAnim(TURRET_ANIM_SPIN);
}
}
示例5: GetSequence
// process certificate header, set signature offset
void CertDecoder::ReadHeader()
{
if (source_.GetError().What()) return;
GetSequence(); // total
certBegin_ = source_.get_index();
sigIndex_ = GetSequence(); // this cert
sigIndex_ += source_.get_index();
GetExplicitVersion(); // version
GetInteger(Integer().Ref()); // serial number
}
示例6: GetModelPtr
unsigned int C_DynamicProp::ComputeClientSideAnimationFlags()
{
if ( GetSequence() != -1 )
{
CStudioHdr *pStudioHdr = GetModelPtr();
if ( GetSequenceCycleRate(pStudioHdr, GetSequence()) != 0.0f )
{
return BaseClass::ComputeClientSideAnimationFlags();
}
}
// no sequence or no cycle rate, don't do any per-frame calcs
return 0;
}
示例7: GetModelPtr
//-----------------------------------------------------------------------------
// Purpose:
// Output :
//-----------------------------------------------------------------------------
float CAnimating::GetInstantaneousVelocity( float flInterval )
{
CStudioHdr *pstudiohdr = GetModelPtr( );
if (! pstudiohdr)
return 0;
// FIXME: someone needs to check for last frame, etc.
float flNextCycle = GetCycle() + flInterval * GetSequenceCycleRate( GetSequence() ) * m_flPlaybackRate;
Vector vecVelocity;
Studio_SeqVelocity( pstudiohdr, GetSequence(), flNextCycle, GetPoseParameterArray(), vecVelocity );
vecVelocity *= m_flPlaybackRate;
return vecVelocity.Length();
}
示例8: ReadHeader
// Decode a BER encoded PKCS12 structure
void PKCS12_Decoder::Decode()
{
ReadHeader();
if (source_.GetError().What()) return;
// Get AuthSafe
GetSequence();
// get object id
byte obj_id = source_.next();
if (obj_id != OBJECT_IDENTIFIER) {
source_.SetError(OBJECT_ID_E);
return;
}
word32 length = GetLength(source_);
word32 algo_sum = 0;
while (length--)
algo_sum += source_.next();
// Get MacData optional
/*
mac digestInfo like certdecoder::getdigest?
macsalt octet string
iter integer
*/
}
示例9: GetSequence
void FMovieSceneSequenceInstance::OnSpawnedObjectDestroyed(const FGuid& ObjectId, IMovieScenePlayer& Player)
{
if(MovieSceneSequence.IsValid())
{
auto* BindingInstance = ObjectBindingInstances.Find(ObjectId);
if (!BindingInstance)
{
return;
}
SpawnedObjects.Remove(ObjectId);
// Destroy the object
BindingInstance->RuntimeObjects.Reset();
// Update any child possessable object bindings
UMovieSceneSequence* Sequence = GetSequence();
FMovieSceneSpawnable* Spawnable = Sequence ? Sequence->GetMovieScene()->FindSpawnable(ObjectId) : nullptr;
if (Spawnable)
{
for (const FGuid& Child : Spawnable->GetChildPossessables())
{
UpdateObjectBinding(Child, Player);
}
}
}
}
示例10: GetSequence
// process algo OID by summing, return it
word32 CertDecoder::GetAlgoId()
{
if (source_.GetError().What()) return 0;
word32 length = GetSequence();
if (source_.GetError().What()) return 0;
byte b = source_.next();
if (b != OBJECT_IDENTIFIER) {
source_.SetError(OBJECT_ID_E);
return 0;
}
length = GetLength(source_);
if (source_.IsLeft(length) == false) return 0;
word32 oid = 0;
while(length--)
oid += source_.next(); // just sum it up for now
// could have NULL tag and 0 terminator, but may not
b = source_.next();
if (b == TAG_NULL) {
b = source_.next();
if (b != 0) {
source_.SetError(EXPECT_0_E);
return 0;
}
}
else
// go back, didn't have it
b = source_.prev();
return oid;
}
示例11: switch
void CNPC_GMan::RunTask( const Task_t *pTask )
{
switch( pTask->iTask )
{
case TASK_WAIT:
// look at who I'm talking to
if (m_flTalkTime > gpGlobals->curtime && m_hTalkTarget != NULL)
{
AddLookTarget( m_hTalkTarget->GetAbsOrigin(), 1.0, 2.0 );
}
// look at player, but only if playing a "safe" idle animation
else if (m_hPlayer != NULL && (GetSequence() == 0 || IsInC5A1()) )
{
AddLookTarget( m_hPlayer->EyePosition(), 1.0, 3.0 );
}
else
{
// Just center the head forward.
Vector forward;
GetVectors( &forward, NULL, NULL );
AddLookTarget( GetAbsOrigin() + forward * 12.0f, 1.0, 1.0 );
SetBoneController( 0, 0 );
}
BaseClass::RunTask( pTask );
break;
}
SetBoneController( 0, 0 );
BaseClass::RunTask( pTask );
}
示例12: MDLCACHE_CRITICAL_SECTION
//-----------------------------------------------------------------------------
// Purpose: find the anim events that may have started sounds, and stop them.
//-----------------------------------------------------------------------------
void C_BaseObject::StopAnimGeneratedSounds( void )
{
MDLCACHE_CRITICAL_SECTION();
CStudioHdr *pStudioHdr = GetModelPtr();
if ( !pStudioHdr )
return;
mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( GetSequence() );
float flCurrentCycle = GetCycle();
mstudioevent_t *pevent = GetEventIndexForSequence( seqdesc );
for (int i = 0; i < (int)seqdesc.numevents; i++)
{
if ( pevent[i].cycle < flCurrentCycle )
{
if ( pevent[i].event == CL_EVENT_SOUND || pevent[i].event == AE_CL_PLAYSOUND )
{
StopSound( entindex(), pevent[i].options );
}
}
}
}
示例13: GetCycle
void CDAViewModel::PauseAnimation()
{
m_bPaused = true;
m_flPauseCycle = GetCycle();
m_nPauseSequence = GetSequence();
m_flPauseAnimTime = GetAnimTime();
}
示例14: GetModel
//-----------------------------------------------------------------------------
// implements these so ragdolls can handle frustum culling & leaf visibility
//-----------------------------------------------------------------------------
void C_DynamicProp::GetRenderBounds( Vector& theMins, Vector& theMaxs )
{
if ( m_bUseHitboxesForRenderBox )
{
if ( GetModel() )
{
studiohdr_t *pStudioHdr = modelinfo->GetStudiomodel( GetModel() );
if ( !pStudioHdr || GetSequence() == -1 )
{
theMins = vec3_origin;
theMaxs = vec3_origin;
return;
}
// Only recompute if it's a new frame
if ( gpGlobals->framecount != m_iCachedFrameCount )
{
ComputeEntitySpaceHitboxSurroundingBox( &m_vecCachedRenderMins, &m_vecCachedRenderMaxs );
m_iCachedFrameCount = gpGlobals->framecount;
}
theMins = m_vecCachedRenderMins;
theMaxs = m_vecCachedRenderMaxs;
return;
}
}
BaseClass::GetRenderBounds( theMins, theMaxs );
}
示例15: LookupSequence
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_NPC_Puppet::ClientThink( void )
{
if ( m_hAnimationTarget == NULL )
return;
C_BaseAnimating *pTarget = m_hAnimationTarget->GetBaseAnimating();
if ( pTarget == NULL )
return;
int nTargetSequence = pTarget->GetSequence();
const char *pSequenceName = pTarget->GetSequenceName( nTargetSequence );
int nSequence = LookupSequence( pSequenceName );
if ( nSequence >= 0 )
{
if ( nSequence != GetSequence() )
{
SetSequence( nSequence );
UpdateVisibility();
}
SetCycle( pTarget->GetCycle() );
SetPlaybackRate( pTarget->GetPlaybackRate() );
}
}