本文整理匯總了C++中AddSolidFlags函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddSolidFlags函數的具體用法?C++ AddSolidFlags怎麽用?C++ AddSolidFlags使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AddSolidFlags函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: SetModel
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFGrenadePipebombProjectile::Spawn()
{
if ( m_iType == TF_GL_MODE_REMOTE_DETONATE )
{
// Set this to max, so effectively they do not self-implode.
SetModel( TF_WEAPON_PIPEBOMB_MODEL );
SetDetonateTimerLength( FLT_MAX );
}
else
{
SetModel( TF_WEAPON_PIPEGRENADE_MODEL );
SetDetonateTimerLength( TF_WEAPON_GRENADE_DETONATE_TIME );
SetTouch( &CTFGrenadePipebombProjectile::PipebombTouch );
}
BaseClass::Spawn();
m_bTouched = false;
m_flCreationTime = gpGlobals->curtime;
// We want to get touch functions called so we can damage enemy players
AddSolidFlags( FSOLID_TRIGGER );
m_flMinSleepTime = 0;
}
示例2: GetModelName
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPointCommentaryNode::Spawn( void )
{
// No model specified?
char *szModel = (char *)STRING( GetModelName() );
if (!szModel || !*szModel)
{
szModel = "models/extras/info_speech.mdl";
SetModelName( AllocPooledString(szModel) );
}
Precache();
SetModel( szModel );
UTIL_SetSize( this, -Vector(16,16,16), Vector(16,16,16) );
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_CUSTOMRAYTEST | FSOLID_CUSTOMBOXTEST );
AddEffects( EF_NOSHADOW );
// Setup for animation
ResetSequence( LookupSequence("idle") );
SetThink( &CPointCommentaryNode::SpinThink );
SetNextThink( gpGlobals->curtime + 0.1f );
m_iNodeNumber = 0;
m_iNodeNumberMax = 0;
SetDisabled( m_bDisabled );
}
示例3: Precache
void CGrenadePathfollower::Spawn( void )
{
Precache( );
// -------------------------
// Inert when first spawned
// -------------------------
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_SOLID );
SetMoveType( MOVETYPE_NONE );
AddFlag( FL_OBJECT ); // So can be shot down
AddEffects( EF_NODRAW );
UTIL_SetSize(this, Vector(0, 0, 0), Vector(0, 0, 0));
m_flDamage = sk_dmg_pathfollower_grenade.GetFloat();
m_DmgRadius = sk_pathfollower_grenade_radius.GetFloat();
m_takedamage = DAMAGE_YES;
m_iHealth = 200;
SetGravity( 0.00001 );
SetFriction( 0.8 );
SetSequence( 1 );
}
示例4: SetMoveType
//
// Throw a chunk
//
void CGib::Spawn( const char *szGibModel )
{
SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE );
SetFriction(0.55); // deading the bounce a bit
// sometimes an entity inherits the edict from a former piece of glass,
// and will spawn using the same render FX or m_nRenderMode! bad!
SetRenderColorA( 255 );
m_nRenderMode = kRenderNormal;
m_nRenderFX = kRenderFxNone;
// hopefully this will fix the VELOCITY TOO LOW crap
m_takedamage = DAMAGE_EVENTS_ONLY;
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_STANDABLE );
SetCollisionGroup( COLLISION_GROUP_DEBRIS );
SetModel( szGibModel );
#ifdef HL1_DLL
SetElasticity( 1.0 );
UTIL_SetSize( this, vec3_origin, vec3_origin );
#endif//HL1_DLL
SetNextThink( gpGlobals->curtime + 4 );
m_lifeTime = 25;
SetTouch ( &CGib::BounceGibTouch );
m_bForceRemove = false;
m_material = matNone;
m_cBloodDecals = 5;// how many blood decals this gib can place (1 per bounce until none remain).
}
示例5: Spawn
//-----------------------------------------------------------------------------
// Spawn
//-----------------------------------------------------------------------------
void CNPC_Mossman :: Spawn()
{
Precache();
BaseClass::Spawn();
SetModel( "models/mossman.mdl" );
SetHullType(HULL_HUMAN);
SetHullSizeNormal();
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_STANDABLE );
SetMoveType( MOVETYPE_STEP );
SetBloodColor( BLOOD_COLOR_RED );
m_iHealth = 8;
m_flFieldOfView = 0.5;// indicates the width of this NPC's forward view cone ( as a dotproduct result )
m_NPCState = NPC_STATE_NONE;
CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_OPEN_DOORS | bits_CAP_ANIMATEDFACE | bits_CAP_TURN_HEAD );
NPCInit();
Relink();
}
示例6: Precache
//------------------------------------------------
// Spawn
//------------------------------------------------
void CPropCannon::Spawn( void )
{
Precache();
SetModel( STRING( GetModelName() ) );
SetCollisionGroup( COLLISION_GROUP_VEHICLE );
BaseClass::Spawn();
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_SOLID );
SetMoveType( MOVETYPE_NOCLIP );
m_takedamage = DAMAGE_EVENTS_ONLY;
m_takedamage = DAMAGE_EVENTS_ONLY;
m_flTurn = 0;
m_flExtension = 0;
m_flFlyTime = 0.0f;
m_flNextAttackTime = gpGlobals->curtime;
InitCannonSpeeds();
SetPoseParameter( "armextensionpose", m_flExtension );
CreateVPhysics();
SetNextThink( gpGlobals->curtime );
}
示例7: SetPredictionEligible
// ----------------------------------------------------------------------------- //
// CWeaponDODBase implementation.
// ----------------------------------------------------------------------------- //
CWeaponDODBase::CWeaponDODBase()
{
SetPredictionEligible( true );
m_bInAttack = false;
m_iAltFireHint = 0;
AddSolidFlags( FSOLID_TRIGGER ); // Nothing collides with these but it gets touches.
}
示例8: Precache
//------------------------------------------------
// Spawn
//------------------------------------------------
void CPropCrane::Spawn( void )
{
Precache();
SetModel( STRING( GetModelName() ) );
SetCollisionGroup( COLLISION_GROUP_VEHICLE );
BaseClass::Spawn();
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_SOLID );
SetMoveType( MOVETYPE_NOCLIP );
m_takedamage = DAMAGE_EVENTS_ONLY;
m_flTurn = 0;
m_flExtension = 0;
m_flNextDangerSoundTime = 0;
m_flNextCreakSound = 0;
m_flNextDropAllowedTime = 0;
m_flSlowRaiseTime = 0;
m_bDropping = false;
m_bMagnetOn = false;
InitCraneSpeeds();
SetPoseParameter( "armextensionpose", m_flExtension );
CreateVPhysics();
SetNextThink( gpGlobals->curtime );
}
示例9: Precache
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNPC_Bug_Warrior::Spawn( void )
{
Precache();
SetModel( BUG_WARRIOR_MODEL );
SetHullType(HULL_WIDE_HUMAN);//HULL_WIDE_SHORT;
SetHullSizeNormal();
SetDefaultEyeOffset();
SetViewOffset( (WorldAlignMins() + WorldAlignMaxs()) * 0.5 ); // See from my center
SetDistLook( 1024.0 );
SetNavType(NAV_GROUND);
m_NPCState = NPC_STATE_NONE;
SetBloodColor( BLOOD_COLOR_YELLOW );
m_iHealth = npc_bug_warrior_health.GetFloat();
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_STANDABLE );
SetMoveType( MOVETYPE_STEP );
m_iszPatrolPathName = NULL_STRING;
// Only do this if a squadname appears in the entity
if ( m_SquadName != NULL_STRING )
{
CapabilitiesAdd( bits_CAP_SQUAD );
}
CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_INNATE_MELEE_ATTACK1 );
NPCInit();
BaseClass::Spawn();
}
示例10: VPhysicsInitShadow
//-----------------------------------------------------------------------------
bool CBaseDoor::CreateVPhysics( )
{
if ( !FClassnameIs( this, "func_water" ) )
{
//normal door
// NOTE: Create this even when the door is not solid to support constraints.
VPhysicsInitShadow( false, false );
}
else
{
// special contents
AddSolidFlags( FSOLID_VOLUME_CONTENTS );
SETBITS( m_spawnflags, SF_DOOR_SILENT ); // water is silent for now
IPhysicsObject *pPhysics = VPhysicsInitShadow( false, false );
fluidparams_t fluid;
Assert( CollisionProp()->GetCollisionAngles() == vec3_angle );
fluid.damping = 0.01f;
fluid.surfacePlane[0] = 0;
fluid.surfacePlane[1] = 0;
fluid.surfacePlane[2] = 1;
fluid.surfacePlane[3] = CollisionProp()->GetCollisionOrigin().z + CollisionProp()->OBBMaxs().z - 1;
fluid.currentVelocity.Init(0,0,0);
fluid.torqueFactor = 0.1f;
fluid.viscosityFactor = 0.01f;
fluid.pGameData = static_cast<void *>(this);
//FIXME: Currently there's no way to specify that you want slime
fluid.contents = CONTENTS_WATER;
physenv->CreateFluidController( pPhysics, &fluid );
}
return true;
}
示例11: 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 );
}
示例12: Precache
//-----------------------------------------------------------------------------
// Spawn
//-----------------------------------------------------------------------------
void CNPC_GMan::Spawn()
{
Precache();
BaseClass::Spawn();
SetModel( "models/gman.mdl" );
SetHullType(HULL_HUMAN);
SetHullSizeNormal();
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_STANDABLE );
SetMoveType( MOVETYPE_STEP );
SetBloodColor( BLOOD_COLOR_RED );
m_iHealth = 8;
m_flFieldOfView = 0.5;// indicates the width of this NPC's forward view cone ( as a dotproduct result )
m_NPCState = NPC_STATE_NONE;
SetImpactEnergyScale( 0.0f ); // no physics damage on the gman
CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_OPEN_DOORS | bits_CAP_ANIMATEDFACE | bits_CAP_TURN_HEAD );
CapabilitiesAdd( bits_CAP_FRIENDLY_DMG_IMMUNE );
AddEFlags( EFL_NO_DISSOLVE | EFL_NO_MEGAPHYSCANNON_RAGDOLL );
NPCInit();
}
示例13: Precache
void CGEGrenade::Spawn( void )
{
Precache();
BaseClass::Spawn();
SetModel( "models/weapons/grenade/w_grenade.mdl" );
// So NPC's can "see" us
AddFlag( FL_OBJECT );
m_takedamage = DAMAGE_YES;
m_iHealth = 1;
m_bHitSomething = false;
m_bDroppedOnDeath = false;
// Default Damages they should be modified by the thrower
SetDamage( 320 );
SetDamageRadius( 260 );
SetSize( -Vector(4,4,4), Vector(4,4,4) );
SetCollisionGroup( COLLISION_GROUP_MINE );
// Init our physics definition
VPhysicsInitNormal( SOLID_VPHYSICS, GetSolidFlags() | FSOLID_TRIGGER, false );
SetMoveType( MOVETYPE_VPHYSICS );
// Don't think until we have a time to think about!
SetThink( NULL );
// Bounce if we hit something!
SetTouch( &BaseClass::BounceTouch );
AddSolidFlags( FSOLID_NOT_STANDABLE );
}
示例14: VPhysicsGetObject
void CStatueProp::Event_Killed( const CTakeDamageInfo &info )
{
IPhysicsObject *pPhysics = VPhysicsGetObject();
if ( pPhysics && !pPhysics->IsMoveable() )
{
pPhysics->EnableMotion( true );
VPhysicsTakeDamage( info );
}
m_nShatterFlags = 0; // If you have some flags to network for the shatter effect, put them here!
m_vShatterPosition = info.GetDamagePosition();
m_vShatterForce = info.GetDamageForce();
m_bShatter = true;
// Skip over breaking code!
//Break( info.GetInflictor(), info );
//BaseClass::Event_Killed( info );
// FIXME: Short delay before we actually remove so that the client statue gets a network update before we need it
// This isn't a reliable way to do this and needs to be rethought.
AddSolidFlags( FSOLID_NOT_SOLID );
SetNextThink( gpGlobals->curtime + 0.2f );
SetThink( &CBaseEntity::SUB_Remove );
}
示例15: Precache
//=========================================================
// Spawn
//=========================================================
void CNPC_HAssassin::Spawn()
{
Precache( );
SetModel( "models/hassassin.mdl");
SetHullType(HULL_HUMAN);
SetHullSizeNormal();
SetNavType ( NAV_GROUND );
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_STANDABLE );
SetMoveType( MOVETYPE_STEP );
m_bloodColor = BLOOD_COLOR_RED;
ClearEffects();
m_iHealth = sk_hassassin_health.GetFloat();
m_flFieldOfView = VIEW_FIELD_WIDE; // indicates the width of this monster's forward view cone ( as a dotproduct result )
m_NPCState = NPC_STATE_NONE;
m_HackedGunPos = Vector( 0, 24, 48 );
m_iTargetRanderamt = 20;
SetRenderColor( 255, 255, 255, 20 );
m_nRenderMode = kRenderTransTexture;
CapabilitiesClear();
CapabilitiesAdd( bits_CAP_MOVE_GROUND );
CapabilitiesAdd( bits_CAP_INNATE_RANGE_ATTACK1 | bits_CAP_INNATE_RANGE_ATTACK2 | bits_CAP_INNATE_MELEE_ATTACK1 );
NPCInit();
}