当前位置: 首页>>代码示例>>C++>>正文


C++ GetAttachment函数代码示例

本文整理汇总了C++中GetAttachment函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAttachment函数的具体用法?C++ GetAttachment怎么用?C++ GetAttachment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetAttachment函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetAttachment

Vector	CBaseTurret::EyePosition( void )
{
	Vector vecOrigin;
	QAngle vecAngles;

	GetAttachment( "eyes", vecOrigin, vecAngles );
	return vecOrigin;
}
开发者ID:Filip98,项目名称:source-sdk-2013,代码行数:8,代码来源:npc_turret.cpp

示例2: GetAttachment

void CNPC_RocketTurret::UpdateMuzzleMatrix()
{
	if ( gpGlobals->tickcount != m_muzzleToWorldTick )
	{
		m_muzzleToWorldTick = gpGlobals->tickcount;
		GetAttachment( m_iMuzzleAttachment, m_muzzleToWorld );
	}
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:8,代码来源:npc_rocket_turret.cpp

示例3: GetAbsAngles

void CNPC_Gargantua::FlameUpdate( void )
{
	int				i;
	static float	offset[2] = { 60, -60 };
	trace_t			trace;
	Vector			vecStart;
	QAngle			angleGun;
	BOOL			streaks = FALSE;

	Vector			vForward;

	for ( i = 0; i < 2; i++ )
	{
		if ( m_pFlame[i] )
		{
			QAngle vecAim = GetAbsAngles();
			vecAim.x += -m_flameX;
			vecAim.y += m_flameY;

			AngleVectors( vecAim, &vForward );

			GetAttachment( i + 2, vecStart, angleGun );
			Vector vecEnd = vecStart + ( vForward * GARG_FLAME_LENGTH); //  - offset[i] * gpGlobals->v_right;
			
			UTIL_TraceLine ( vecStart, vecEnd, MASK_SOLID, this, COLLISION_GROUP_NONE, &trace);

			m_pFlame[i]->SetStartPos( trace.endpos );
			m_pFlame[i+2]->SetStartPos( (vecStart * 0.6) + (trace.endpos * 0.4) );

			if ( trace.fraction != 1.0 && gpGlobals->curtime > m_streakTime )
			{
				g_pEffects->Sparks( trace.endpos, 1, 1, &trace.plane.normal );
				streaks = TRUE;
				UTIL_DecalTrace( &trace, "SmallScorch" );
			}
			// RadiusDamage( trace.vecEndPos, pev, pev, gSkillData.gargantuaDmgFire, CLASS_ALIEN_MONSTER, DMG_BURN );
			FlameDamage( vecStart, trace.endpos, this, this, sk_gargantua_dmg_fire.GetFloat(), CLASS_ALIEN_MONSTER, DMG_BURN );

			CBroadcastRecipientFilter filter;
			GetAttachment(i + 2, vecStart, angleGun);
			te->DynamicLight( filter, 0.0, &vecStart, 255, 0, 0, 0, 48, 0.2, 150 );
		}
	}
	if ( streaks )
		m_streakTime = gpGlobals->curtime;
}
开发者ID:hitmen047,项目名称:TF2HLCoop,代码行数:46,代码来源:hl1_npc_gargantua.cpp

示例4: LookupAttachment

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPropAPC::Activate()
{
	BaseClass::Activate();

	m_nRocketAttachment = LookupAttachment( "cannon_muzzle" );
	m_nMachineGunMuzzleAttachment = LookupAttachment( "muzzle" );
	m_nMachineGunBaseAttachment = LookupAttachment( "gun_base" );

	// NOTE: gun_ref must have the same position as gun_base, but rotates with the gun
	int nMachineGunRefAttachment = LookupAttachment( "gun_def" );

	Vector vecWorldBarrelPos;
	matrix3x4_t matRefToWorld;
	GetAttachment( m_nMachineGunMuzzleAttachment, vecWorldBarrelPos );
	GetAttachment( nMachineGunRefAttachment, matRefToWorld );
	VectorITransform( vecWorldBarrelPos, matRefToWorld, m_vecBarrelPos );
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:20,代码来源:vehicle_apc.cpp

示例5: GetAttachment

//-----------------------------------------------------------------------------
// Purpose: Create danger sounds in front of the vehicle.
//-----------------------------------------------------------------------------
void CASW_PropJeep::CreateDangerSounds( void )
{
	QAngle dummy;
	GetAttachment( "Muzzle", m_vecGunOrigin, dummy );

	if ( m_flDangerSoundTime > gpGlobals->curtime )
		return;

	QAngle vehicleAngles = GetLocalAngles();
	Vector vecStart = GetAbsOrigin();
	Vector vecDir, vecRight;

	GetVectors( &vecDir, &vecRight, NULL );

	const float soundDuration = 0.25;
	float speed = m_VehiclePhysics.GetHLSpeed();
	// Make danger sounds ahead of the jeep
	if ( fabs(speed) > 120 )
	{
		Vector	vecSpot;

		float steering = m_VehiclePhysics.GetSteering();
		if ( steering != 0 )
		{
			if ( speed > 0 )
			{
				vecDir += vecRight * steering * 0.5;
			}
			else
			{
				vecDir -= vecRight * steering * 0.5;
			}
			VectorNormalize(vecDir);
		}
		const float radius = speed * 0.4;
		// 0.3 seconds ahead of the jeep
		vecSpot = vecStart + vecDir * (speed * 0.3f);
		CSoundEnt::InsertSound( SOUND_DANGER, vecSpot, radius, soundDuration, this, 0 );
		CSoundEnt::InsertSound( SOUND_PHYSICS_DANGER, vecSpot, radius, soundDuration, this, 1 );
		//NDebugOverlay::Box(vecSpot, Vector(-radius,-radius,-radius),Vector(radius,radius,radius), 255, 0, 255, 0, soundDuration);

#if 0
		trace_t	tr;
		// put sounds a bit to left and right but slightly closer to Jeep to make a "cone" of sound 
		// in front of it
		vecSpot = vecStart + vecDir * (speed * 0.5f) - vecRight * speed * 0.5;
		UTIL_TraceLine( vecStart, vecSpot, MASK_SHOT, this, COLLISION_GROUP_NONE, &tr );
		CSoundEnt::InsertSound( SOUND_DANGER, vecSpot, 400, soundDuration, this, 1 );

		vecSpot = vecStart + vecDir * (speed * 0.5f) + vecRight * speed * 0.5;
		UTIL_TraceLine( vecStart, vecSpot, MASK_SHOT, this, COLLISION_GROUP_NONE, &tr );
		CSoundEnt::InsertSound( SOUND_DANGER, vecSpot, 400, soundDuration, this, 2);
#endif
	}

	m_flDangerSoundTime = gpGlobals->curtime + 0.1;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:60,代码来源:asw_jeep.cpp

示例6: DetachObject

	void DetachObject(SActivationInfo *pActInfo)
	{
		IAttachment *pAttachment = GetAttachment(pActInfo);
		if (pAttachment)
		{
			pAttachment->ClearBinding();
			ActivateOutput(pActInfo, eOP_Detached, 0);
		}
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:9,代码来源:FlowAttachmentNodes.cpp

示例7: GetOwner

int CBaseTFVehicle::LocateEntryPoint( CBaseTFPlayer *pPlayer, float* fBest2dDistanceSqr )
{
	// Get the players origin and compare it to all the entry points on the
	// vehicle.
	Vector vecPlayerPos = pPlayer->GetAbsOrigin();
	Vector vecEntryPos;
	QAngle vecEntryAngle;

	int   iMinEntry = -1;
	float flMinDistance2 = INITIAL_MAX_DISTANCE;

	// Is the player the owner of the vehicle?
	bool bOwner = ( pPlayer == GetOwner() );

	char szPassengerEyes[32];
	for( int iEntryPoint = 0; iEntryPoint < m_nMaxPassengers; ++iEntryPoint )
	{
		// If not the owner, check to see if the entry point is available.  The
		// entry point is always available for the owner.
		bool bOccupied = ( GetPassenger( iEntryPoint ) != NULL );

		// Also check for child vehicles...

		if ( bOccupied && !bOwner )
			continue;
	
		// FIXME: Cache off the entry point
		Q_snprintf( szPassengerEyes, sizeof( szPassengerEyes ), "vehicle_feet_passenger%d", iEntryPoint );
		int nAttachmentIndex = LookupAttachment( szPassengerEyes );

		float flDistance2;
		if (nAttachmentIndex > 0)
		{
			GetAttachment( nAttachmentIndex, vecEntryPos, vecEntryAngle );
			Vector vecDelta = vecEntryPos - vecPlayerPos;
			flDistance2 = vecDelta.AsVector2D().LengthSqr();
		}
		else
		{
			// No attachment? Choose it if we must as a last resort
			flDistance2 = INITIAL_MAX_DISTANCE - 1;
		}

		if ( flDistance2 < flMinDistance2 )
		{
			flMinDistance2 = flDistance2;
			iMinEntry = iEntryPoint;
		}
	}

	if( fBest2dDistanceSqr )
	{
		*fBest2dDistanceSqr = flMinDistance2;
	}
	return iMinEntry;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:56,代码来源:basetfvehicle.cpp

示例8: GetAttachment

//------------------------------------------------------------------------------
// Purpose : Returns position of laser for any given position of the staler
// Input   :
// Output  :
//------------------------------------------------------------------------------
Vector CNPC_Stalker::LaserStartPosition(Vector vStalkerPos)
{
	// Get attachment position
	Vector vAttachPos;
	GetAttachment(STALKER_LASER_ATTACHMENT,vAttachPos);

	// Now convert to vStalkerPos
	vAttachPos = vAttachPos - GetAbsOrigin() + vStalkerPos;
	return vAttachPos;
}
开发者ID:Muini,项目名称:Nag-asw,代码行数:15,代码来源:npc_stalker.cpp

示例9: GetAttachment

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
Vector CNPC_CombineCamera::HeadDirection2D()
{
	Vector	vecMuzzle, vecMuzzleDir;

	GetAttachment("eyes", vecMuzzle, &vecMuzzleDir );
	vecMuzzleDir.z = 0;
	VectorNormalize(vecMuzzleDir);

	return vecMuzzleDir;
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:13,代码来源:npc_combinecamera.cpp

示例10: LookupAttachment

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
Vector CNPC_PoisonZombie::HeadTarget( const Vector &posSrc )
{
	int iCrabAttachment = LookupAttachment( "headcrab1" );
	Assert( iCrabAttachment > 0 );

	Vector vecPosition;

	GetAttachment( iCrabAttachment, vecPosition );

	return vecPosition;
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:13,代码来源:npc_poisonzombie.cpp

示例11: LookupAttachment

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void C_PropJeep::OnEnteredVehicle( C_BasePlayer *pPlayer )
{
	int eyeAttachmentIndex = LookupAttachment( "vehicle_driver_eyes" );
	Vector vehicleEyeOrigin;
	QAngle vehicleEyeAngles;
	GetAttachment( eyeAttachmentIndex, vehicleEyeOrigin, vehicleEyeAngles );

	m_vecLastEyeTarget = vehicleEyeOrigin;
	m_vecLastEyePos = vehicleEyeOrigin;
	m_vecEyeSpeed = vec3_origin;
}
开发者ID:BerntA,项目名称:tfo-code,代码行数:14,代码来源:c_vehicle_jeep.cpp

示例12: LookupAttachment

Vector CPropVehicleManhack::BodyTarget( const Vector &posSrc, bool bNoisy )
{
	Vector	shotPos;
	//matrix3x4_t	matrix;

	int eyeAttachmentIndex = LookupAttachment("vehicle_driver_eyes");
	GetAttachment( eyeAttachmentIndex, shotPos );
	//shotPos = WorldSpaceCenter();

	return shotPos;
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:11,代码来源:vehicle_manhack.cpp

示例13: GetAttachment

// Звук шага и пыль от поступи крематора, правый шаг.
Vector CNPC_Cremator::RightFootHit( float eventtime )
{	
	Vector footPosition;

	GetAttachment( "footright", footPosition );
	CPASAttenuationFilter filter( this );
	EmitSound( filter, entindex(), "NPC_Cremator.FootstepRight", &footPosition, eventtime );

	FootstepEffect( footPosition );
	return footPosition;
}
开发者ID:RaraFolf,项目名称:FIREFIGHT-RELOADED-src-sdk-2013,代码行数:12,代码来源:npc_cremator.cpp

示例14: ToBaseCombatCharacter

bool C_BaseCombatWeapon::GetShootPosition( Vector &vOrigin, QAngle &vAngles )
{
	// Get the entity because the weapon doesn't have the right angles.
	C_BaseCombatCharacter *pEnt = ToBaseCombatCharacter( GetOwner() );
	if ( pEnt )
	{
		if ( pEnt == C_BasePlayer::GetLocalPlayer() )
		{
			vAngles = pEnt->EyeAngles();
		}
		else
		{
			vAngles = pEnt->GetRenderAngles();	
		}
	}
	else
	{
		vAngles.Init();
	}

	C_BasePlayer *player = ToBasePlayer( pEnt );
	bool bUseViewModel = false;
	if ( C_BasePlayer::IsLocalPlayer( pEnt ) )
	{
		ACTIVE_SPLITSCREEN_PLAYER_GUARD_ENT( pEnt );
		bUseViewModel = !player->ShouldDrawLocalPlayer();
	}

	QAngle vDummy;
	if ( IsActiveByLocalPlayer() && bUseViewModel )
	{
		C_BaseViewModel *vm = player ? player->GetViewModel( 0 ) : NULL;
		if ( vm )
		{
			int iAttachment = vm->LookupAttachment( "muzzle" );
			if ( vm->GetAttachment( iAttachment, vOrigin, vDummy ) )
			{
				return true;
			}
		}
	}
	else
	{
		// Thirdperson
		int iAttachment = LookupAttachment( "muzzle" );
		if ( GetAttachment( iAttachment, vOrigin, vDummy ) )
		{
			return true;
		}
	}

	vOrigin = GetRenderOrigin();
	return false;
}
开发者ID:AniCator,项目名称:Project-Potato,代码行数:54,代码来源:c_basecombatweapon.cpp

示例15: UTIL_PointContents

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
bool CASW_PropJeep::CheckWater( void )
{
	bool bInWater = false;

	// Check all four wheels.
	for ( int iWheel = 0; iWheel < ASW_JEEP_WHEEL_COUNT; ++iWheel )
	{
		// Get the current wheel and get its contact point.
		IPhysicsObject *pWheel = m_VehiclePhysics.GetWheel( iWheel );
		if ( !pWheel )
			continue;

		// Check to see if we hit water.
		if ( pWheel->GetContactPoint( &m_WaterData.m_vecWheelContactPoints[iWheel], NULL ) )
		{
			m_WaterData.m_bWheelInWater[iWheel] = ( UTIL_PointContents( m_WaterData.m_vecWheelContactPoints[iWheel], MASK_WATER ) & MASK_WATER ) ? true : false;
			if ( m_WaterData.m_bWheelInWater[iWheel] )
			{
				bInWater = true;
			}
		}
	}

	// Check the body and the BONNET.
	int iEngine = LookupAttachment( "vehicle_engine" );
	Vector vecEnginePoint;
	QAngle vecEngineAngles;
	GetAttachment( iEngine, vecEnginePoint, vecEngineAngles );

	m_WaterData.m_bBodyInWater = ( UTIL_PointContents( vecEnginePoint, MASK_WATER ) & MASK_WATER ) ? true : false;

	if ( m_WaterData.m_bBodyInWater )
	{		
		if ( !m_VehiclePhysics.IsEngineDisabled() )
		{
			m_VehiclePhysics.SetDisableEngine( true );
		}
	}
	else
	{
		if ( m_VehiclePhysics.IsEngineDisabled() )
		{
			m_VehiclePhysics.SetDisableEngine( false );
		}
	}

	if ( bInWater )
	{
		// Check the player's water level.
		CheckWaterLevel();
	}

	return bInWater;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:57,代码来源:asw_jeep.cpp


注:本文中的GetAttachment函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。