本文整理汇总了C++中SetSequence函数的典型用法代码示例。如果您正苦于以下问题:C++ SetSequence函数的具体用法?C++ SetSequence怎么用?C++ SetSequence使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetSequence函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetSequence
void StartSequenceDesigGridCell::SetStartSequence(int nValue)
{
TestZoneCurve& currTZC = testZoneCurves.GetRef(tzcIndex);
SetSequence(currTZC.startSeqID, nValue);
if (StringLength(currTZC.endSeqID) == 0)
SetSequence(currTZC.endSeqID, nValue);
}
示例2: Precache
//-----------------------------------------------------------------------------
// Purpose: the entity
//-----------------------------------------------------------------------------
void CNPC_RocketTurret::Spawn( void )
{
Precache();
BaseClass::Spawn();
SetViewOffset( vec3_origin );
AddEFlags( EFL_NO_DISSOLVE );
SetModel( ROCKET_TURRET_MODEL_NAME );
SetSolid( SOLID_VPHYSICS );
m_iMuzzleAttachment = LookupAttachment ( "barrel" );
m_iLightAttachment = LookupAttachment ( "eye" );
m_iPosePitch = LookupPoseParameter( "aim_pitch" );
m_iPoseYaw = LookupPoseParameter( "aim_yaw" );
m_vecCurrentAngles = m_vecGoalAngles = GetAbsAngles();
CreateVPhysics();
//Set our autostart state
m_bEnabled = ( ( m_spawnflags & SF_ROCKET_TURRET_START_INACTIVE ) == false );
// Set Locked sprite
if ( m_bEnabled )
{
m_iLaserState = 1;
SetSequence(LookupSequence("idle"));
}
else
{
m_iLaserState = 0;
SetSequence(LookupSequence("inactive"));
}
SetCycle(1.0f);
UpdateSkin( ROCKET_SKIN_IDLE );
SetPoseParameter( "aim_pitch", 0 );
SetPoseParameter( "aim_yaw", -180 );
if ( m_bEnabled )
{
SetThink( &CNPC_RocketTurret::FollowThink );
}
SetNextThink( gpGlobals->curtime + ROCKET_TURRET_THINK_RATE );
}
示例3: SetSequence
void KeyframeMeshInstance::RecoverFromTempSequence()
{
m_isRunningTempSequence = false;
SetSequence(m_oldSequenceName, m_oldSequenceLoop);
m_oldSequenceName.clear();
m_oldSequenceLoop = false;
}
示例4: SelectHeaviestSequence
void QUA_helicopter::SetActivity(Activity NewActivity) {
int sequence;
if (m_Activity == NewActivity)
{
return;
} else {
sequence = SelectHeaviestSequence( NewActivity );
//int sequence = this->LookupSequence("Idle01");
if ( sequence != ACTIVITY_NOT_AVAILABLE )
{
m_Activity=NewActivity;
SetSequence( sequence );
SetActivity(NewActivity);
SetCycle( 0 );
ResetSequenceInfo( );
if(NewActivity==ACT_MELEE_ATTACK1) {
SetPlaybackRate(2.0f);
} else {
SetPlaybackRate(1.0f);
}
//m_Activity=NewActivity;
} else {
return;
}
}
}
示例5: 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() ) );
}
}
示例6: Precache
void CBaseTurret::Spawn()
{
Precache( );
SetNextThink( gpGlobals->curtime + 1 );
SetMoveType( MOVETYPE_FLY );
SetSequence(0);
SetCycle(0);
SetSolid( SOLID_SLIDEBOX );
m_takedamage = DAMAGE_YES;
AddFlag( FL_AIMTARGET );
m_iAmmoType = g_pGameRules->GetAmmoDef()->Index("SMG1");
AddFlag( FL_NPC );
if (( m_spawnflags & SF_NPC_TURRET_AUTOACTIVATE ) && !( m_spawnflags & SF_NPC_TURRET_STARTINACTIVE ))
{
m_iAutoStart = true;
}
ResetSequenceInfo( );
SetPoseParameter( TURRET_BC_YAW, 0 );
SetPoseParameter( TURRET_BC_PITCH, 0 );
// Activities
ADD_CUSTOM_ACTIVITY( CBaseTurret, ACT_TURRET_OPEN );
ADD_CUSTOM_ACTIVITY( CBaseTurret, ACT_TURRET_CLOSE );
ADD_CUSTOM_ACTIVITY( CBaseTurret, ACT_TURRET_CLOSED_IDLE );
ADD_CUSTOM_ACTIVITY( CBase`matTurret, ACT_TURRET_OPEN_IDLE );
ADD_CUSTOM_ACTIVITY( CBaseTurret, ACT_TURRET_FIRE );
ADD_CUSTOM_ACTIVITY( CBaseTurret, ACT_TURRET_RELOAD );
}
示例7: Precache
//-----------------------------------------------------------------------------
// Purpose: This used to have something to do with bees flying, but
// now it only initializes moving furniture in scripted sequences
//-----------------------------------------------------------------------------
void CNPC_Furniture::Spawn( )
{
Precache();
SetModel( STRING(GetModelName()) );
SetMoveType( MOVETYPE_STEP );
SetSolid( SOLID_BBOX );
// Our collision, if needed, will be done through bone followers
AddSolidFlags( FSOLID_NOT_SOLID );
SetBloodColor( DONT_BLEED );
m_iHealth = TOO_MUCH_HEALTH_TO_DIE; //wow
m_takedamage = DAMAGE_AIM;
SetSequence( 0 );
SetCycle( 0 );
SetNavType( NAV_FLY );
AddFlag( FL_FLY );
CapabilitiesAdd( bits_CAP_MOVE_FLY | bits_CAP_TURN_HEAD | bits_CAP_ANIMATEDFACE );
AddEFlags( EFL_NO_MEGAPHYSCANNON_RAGDOLL );
// pev->nextthink += 1.0;
// SetThink (WalkMonsterDelay);
ResetSequenceInfo( );
SetCycle( 0 );
NPCInit();
// Furniture needs to block LOS
SetBlocksLOS( true );
}
示例8: SetModelName
void C_PortalGhostRenderable::PerFrameUpdate( void )
{
if( m_pGhostedRenderable )
{
SetModelName( m_pGhostedRenderable->GetModelName() );
SetModelIndex( m_pGhostedRenderable->GetModelIndex() );
SetEffects( m_pGhostedRenderable->GetEffects() | EF_NOINTERP );
m_flAnimTime = m_pGhostedRenderable->m_flAnimTime;
if( m_bSourceIsBaseAnimating )
{
C_BaseAnimating *pSource = (C_BaseAnimating *)m_pGhostedRenderable;
SetCycle( pSource->GetCycle() );
SetSequence( pSource->GetSequence() );
m_nBody = pSource->m_nBody;
m_nSkin = pSource->m_nSkin;
}
}
// Set position and angles relative to the object it's ghosting
Vector ptNewOrigin = m_matGhostTransform * m_pGhostedRenderable->GetAbsOrigin();
QAngle qNewAngles = TransformAnglesToWorldSpace( m_pGhostedRenderable->GetAbsAngles(), m_matGhostTransform.As3x4() );
SetAbsOrigin( ptNewOrigin );
SetAbsAngles( qNewAngles );
AddEffects( EF_NOINTERP );
RemoveFromInterpolationList();
g_pClientLeafSystem->RenderableChanged( RenderHandle() );
}
示例9: Precache
void CGrenadeSpit::Spawn( void )
{
Precache( );
SetSolid( SOLID_BBOX );
SetMoveType( MOVETYPE_FLYGRAVITY );
// FIXME, if these is a sprite, then we need a base class derived from CSprite rather than
// CBaseAnimating. pev->scale becomes m_flSpriteScale in that case.
SetModel( "models/spitball_large.mdl" );
UTIL_SetSize(this, Vector(0, 0, 0), Vector(0, 0, 0));
m_nRenderMode = kRenderTransAdd;
SetRenderColor( 255, 255, 255, 255 );
m_nRenderFX = kRenderFxNone;
SetThink( SpitThink );
SetUse( DetonateUse );
SetTouch( GrenadeSpitTouch );
SetNextThink( gpGlobals->curtime + 0.1f );
m_flDamage = sk_dmg_spit_grenade.GetFloat();
m_DmgRadius = sk_spit_grenade_radius.GetFloat();
m_takedamage = DAMAGE_YES;
m_iHealth = 1;
SetGravity( UTIL_ScaleForGravity( SPIT_GRAVITY ) );
SetFriction( 0.8 );
SetSequence( 1 );
SetCollisionGroup( HL2COLLISION_GROUP_SPIT );
}
示例10: EncodeAttributes
static int EncodeAttributes(EncodedAttrib* ea, int eaSz,
PKCS7Attrib* attribs, int attribsSz)
{
int i;
int maxSz = min(eaSz, attribsSz);
int allAttribsSz = 0;
for (i = 0; i < maxSz; i++)
{
int attribSz = 0;
ea[i].value = attribs[i].value;
ea[i].valueSz = attribs[i].valueSz;
attribSz += ea[i].valueSz;
ea[i].valueSetSz = SetSet(attribSz, ea[i].valueSet);
attribSz += ea[i].valueSetSz;
ea[i].oid = attribs[i].oid;
ea[i].oidSz = attribs[i].oidSz;
attribSz += ea[i].oidSz;
ea[i].valueSeqSz = SetSequence(attribSz, ea[i].valueSeq);
attribSz += ea[i].valueSeqSz;
ea[i].totalSz = attribSz;
allAttribsSz += attribSz;
}
return allAttribsSz;
}
示例11: SetOrigin
Npc::Npc(sf::Texture* tex):Image(tex) {
locked=true;
direction=0;
objectIndex=6;
index=0;
SetOrigin(imageWidth/2,imageHeight-11);
SetBBox(-engine->gridSize/2+engine->gridSize/32*4,-engine->gridSize/2+engine->gridSize/32*8,
engine->gridSize-engine->gridSize/32*8,engine->gridSize-engine->gridSize/32*15);
AddSequence(0,0,0.25);
AddSequence(5,5,0.25);
AddSequence(10,10,0.25);
AddSequence(15,15,0.25);
AddSequence(1,4,0.2);
AddSequence(6,9,0.2);
AddSequence(11,14,0.2);
AddSequence(16,19,0.2);
SetSequence(0,1);
sprShadow.setTexture(*engine->resourcesManager->GetTexture("sprShadow"),true);
sprShadow.setOrigin(engine->resourcesManager->GetTexture("sprShadow")->getSize().x/2,
engine->resourcesManager->GetTexture("sprShadow")->getSize().y/2-1*2);
};
示例12: 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() );
}
}
示例13: Precache
void CNPC_Sentry::Spawn()
{
Precache( );
SetModel( "models/sentry.mdl" );
m_iHealth = sk_sentry_health.GetFloat();
m_HackedGunPos = Vector( 0, 0, 48 );
SetViewOffset( Vector(0,0,48) );
m_flMaxWait = 1E6;
m_flMaxSpin = 1E6;
BaseClass::Spawn();
SetSequence( TURRET_ANIM_RETIRE );
SetCycle( 0.0 );
m_flPlaybackRate = 0.0;
m_iRetractHeight = 64;
m_iDeployHeight = 64;
m_iMinPitch = -60;
UTIL_SetSize(this, Vector(-16, -16, -m_iRetractHeight), Vector(16, 16, m_iRetractHeight));
SetTouch(&CNPC_Sentry::SentryTouch);
SetThink(&CNPC_Sentry::Initialize);
SetNextThink(gpGlobals->curtime + 0.3);
m_bStartedDeploy = false;
}
示例14: GetOwner
// If the local player is visible (thirdperson mode, tf2 taunts, etc., then make sure that we are using the
// w_ (world) model not the v_ (view) model or else the model can flicker, etc.
// Otherwise, if we're not the local player, always use the world model
void C_BaseCombatWeapon::EnsureCorrectRenderingModel()
{
C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer();
if ( localplayer &&
localplayer == GetOwner() &&
!localplayer->ShouldDrawLocalPlayer() )
{
return;
}
MDLCACHE_CRITICAL_SECTION();
// BRJ 10/14/02
// FIXME: Remove when Yahn's client-side prediction is done
// It's a hacky workaround for the model indices fighting
// (GetRenderBounds uses the model index, which is for the view model)
SetModelIndex( GetWorldModelIndex() );
// Validate our current sequence just in case ( in theory the view and weapon models should have the same sequences for sequences that overlap at least )
CStudioHdr *pStudioHdr = GetModelPtr();
if ( pStudioHdr &&
GetSequence() >= pStudioHdr->GetNumSeq() )
{
SetSequence( 0 );
}
}
示例15: EncodeDSA_Signature
word32 EncodeDSA_Signature(const Integer& r, const Integer& s, byte* output)
{
word32 rSz = r.ByteCount();
word32 sSz = s.ByteCount();
byte rLen[MAX_LENGTH_SZ + 1];
byte sLen[MAX_LENGTH_SZ + 1];
rLen[0] = INTEGER;
sLen[0] = INTEGER;
word32 rLenSz = SetLength(rSz, &rLen[1]) + 1;
word32 sLenSz = SetLength(sSz, &sLen[1]) + 1;
byte seqArray[MAX_SEQ_SZ];
word32 seqSz = SetSequence(rLenSz + rSz + sLenSz + sSz, seqArray);
// seq
memcpy(output, seqArray, seqSz);
// r
memcpy(output + seqSz, rLen, rLenSz);
r.Encode(output + seqSz + rLenSz, rSz);
// s
memcpy(output + seqSz + rLenSz + rSz, sLen, sLenSz);
s.Encode(output + seqSz + rLenSz + rSz + sLenSz, sSz);
return seqSz + rLenSz + rSz + sLenSz + sSz;
}