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


C++ GetDriver函数代码示例

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


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

示例1: CanEnterVehicle

bool CPropVehicleManhack::CanEnterVehicle( CBaseEntity *pEntity )
{
	// Prevent entering if the vehicle's being driven by an NPC
	if ( GetDriver() && GetDriver() != pEntity )
		return false;

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

示例2: CanEnterVehicle

//-----------------------------------------------------------------------------
// Purpose: Return true of the player's allowed to enter / exit the vehicle
//-----------------------------------------------------------------------------
bool CPropCrane::CanEnterVehicle( CBaseEntity *pEntity )
{
	// Prevent entering if the vehicle's being driven by an NPC
	if ( GetDriver() && GetDriver() != pEntity )
		return false;
	
	// Prevent entering if the vehicle's locked
	return ( !m_bLocked );
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:12,代码来源:vehicle_crane.cpp

示例3: CanEnterVehicle

//-----------------------------------------------------------------------------
// Purpose: Return true of the player's allowed to enter / exit the vehicle
//-----------------------------------------------------------------------------
bool CPropVehicleChoreoGeneric::CanEnterVehicle( CBaseEntity *pEntity )
{
	// Prevent entering if the vehicle's being driven by an NPC
	if ( GetDriver() && GetDriver() != pEntity )
		return false;

	// Prevent entering if the vehicle's locked
	return !m_bLocked;
}
开发者ID:P1x3lF3v3r,项目名称:Estranged-Act-1,代码行数:12,代码来源:vehicle_choreo_generic.cpp

示例4: ForcePlayerOut

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPropVehicleManhack::Think(void)
{
	if ( GetDriver() )
	{
		if (GlobalEntity_GetState("manhacks_not_controllable") == GLOBAL_ON)
			ForcePlayerOut();

		BaseClass::Think();

		SetNextThink( gpGlobals->curtime );

		StudioFrameAdvance();

		if (m_hManhack == NULL || m_iManhackHealth <= 0 || m_iManhackDistance >= 100)
		{
			if (m_iManhackDistance >= 100)
			{
				CNPC_Manhack *pManhack = m_hManhack;

				if (pManhack)
				{
					pManhack->ComeBackToPlayer(m_hPlayer, 8.0f);
				}
			}

			/*if (!FindNextManhack())
			{
				SetLocator( NULL );
				ForcePlayerOut();
				DestroyAllManhacks();
				UTIL_Remove(this);
			}*/

			if (!FindNextManhack(true))
			{
				ForcePlayerOut();
			}
		} 
		else if ( m_hPlayer.Get() != NULL )
		{
			UpdateManhackView( m_hPlayer.Get() );	
			UpdateManhackDistance(this);
		}

		if (!GetDriver() && m_bHadDriver)
		{
			DevMsg("We have no driver, lets disappear");
			m_bHadDriver = false;
			//SetRenderMode(kRenderTransColor );
			//SetRenderColorA(0);
			AddEffects( EF_NODRAW );
			SetSolid(SOLID_NONE);
			AddSolidFlags( FSOLID_NOT_SOLID );
		}
	}
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:59,代码来源:vehicle_manhack.cpp

示例5: GetDriver

//TERO: We want to take damage normally since this is not really a vehicle but a fake body
//		We exit the vehicle so that it wouldn't look silly stiff man from the manhack point of view
int CPropVehicleManhack::OnTakeDamage( const CTakeDamageInfo &inputInfo )
{
	//Check to do damage to driver
	if ( GetDriver() )
	{
		GetDriver()->TakeDamage( inputInfo );
		ForcePlayerOut();
	}

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

示例6: CanEnterVehicle

//-----------------------------------------------------------------------------
// Purpose: Return true of the player's allowed to enter the vehicle
//-----------------------------------------------------------------------------
bool CPropVehicleDriveable::CanEnterVehicle( CBaseEntity *pEntity )
{
	// Prevent entering if the vehicle's being driven by an NPC
	if ( GetDriver() && GetDriver() != pEntity )
		return false;

	if ( IsOverturned() )
		return false;

	// Prevent entering if the vehicle's locked, or if it's moving too fast.
	return ( !m_bLocked && (m_nSpeed <= m_flMinimumSpeedToEnterExit) );
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:15,代码来源:vehicle_base.cpp

示例7: GetDriver

CClientPlayer * CClientVehicle::GetOccupant(BYTE byteSeatId)
{
	if(byteSeatId == 0)
		return GetDriver();

	return GetPassenger(byteSeatId - 1);
}
开发者ID:Azon099,项目名称:networked-iv,代码行数:7,代码来源:CClientVehicle.cpp

示例8: int

void GaussianBlurRender::Render(Engine& engine, IDirect3DSurface9* backBuffer, IDirect3DSurface9* dsSurface)
{
	if (!_shader || !GetRT() || !GetRT()->IsInit() || !_colorTex)
		throw int();

	_shader->Apply(engine);
	IDirect3DSurface9* targetSurf;
	GetRT()->GetTex()->GetSurfaceLevel(0, &targetSurf);
	GetDriver().GetDevice()->SetRenderTarget(0, targetSurf);
	engine.SetTexture(0, _colorTex->GetTex());

	//Horizontal
	_shader->curTechnique = GaussianBlurShader::ttHorizontal;
	engine.BeginDraw();
	DrawScreenQuad(engine);
	engine.EndDraw();

	//Vertical
	_shader->curTechnique = GaussianBlurShader::ttVertical;
	engine.BeginDraw();
	DrawScreenQuad(engine);
	engine.EndDraw();

	_shader->UnApply(engine);
	engine.SetTexture(0, 0);	
}
开发者ID:DimaKirk,项目名称:rrr3d,代码行数:26,代码来源:GaussianBlur.cpp

示例9: GetDriver

CPlayerEntity * CVehicleEntity::GetOccupant(BYTE byteSeatId)
{
	if(byteSeatId == 0)
		return GetDriver();

	return new CPlayerEntity(); //GetPassenger(byteSeatId - 1);
}
开发者ID:KomiHe,项目名称:IVMultiplayer,代码行数:7,代码来源:CVehicleEntity.cpp

示例10: Think

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPropVehicleDriveable::Think()
{
	BaseClass::Think();

	// Always think if we have any driver in us
	if ( GetDriver() )
	{
		SetNextThink( gpGlobals->curtime );
	}

	// If we have an NPC Driver, tell him to drive
	if ( m_hNPCDriver )
	{
		GetServerVehicle()->NPC_DriveVehicle();
	}

	// Keep thinking while we're waiting to turn off the keep upright
	if ( m_flTurnOffKeepUpright )
	{
		SetNextThink( gpGlobals->curtime );

		// Time up?
		if ( m_hKeepUpright && m_flTurnOffKeepUpright < gpGlobals->curtime && m_hKeepUpright )
		{
			variant_t emptyVariant;
			m_hKeepUpright->AcceptInput( "TurnOff", this, this, emptyVariant, USE_TOGGLE );
			m_flTurnOffKeepUpright = 0;

			UTIL_Remove( m_hKeepUpright );
		}
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:35,代码来源:vehicle_base.cpp

示例11: InputForcePlayerOut

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPropVehicleViewController::InputForcePlayerOut( inputdata_t &inputdata )
{
	if ( !GetDriver() )
		return;

	GetServerVehicle()->HandlePassengerExit( m_hPlayer );
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:10,代码来源:vehicle_viewcontroller.cpp

示例12: Interpolate

void CVehicleEntity::Interpolate()
{
	// Do we have a driver?
	if(GetDriver())
	{
		// Update our target position
		UpdateTargetPosition();

		// Update our target rotation
		UpdateTargetRotation();

		// Update our interior
		UpdateInterior(true);
	}
	else
	{
		// Update our interior
		UpdateInterior(false);

		// Remove our target position
		RemoveTargetPosition();

		// Remove our target rotation
		RemoveTargetRotation();
	}
}
开发者ID:KomiHe,项目名称:IVMultiplayer,代码行数:26,代码来源:CVehicleEntity.cpp

示例13: GetDriver

void UUnitTestNetConnection::HandleClientPlayer(class APlayerController* PC, class UNetConnection* NetConnection)
{
	// Implement only essential parts of the original function, as we want to block most of it (triggers level change code)
	PC->Role = ROLE_AutonomousProxy;
	PC->NetConnection = NetConnection;

	PlayerController = PC;
	OwningActor = PC;

	// @todo #JohnBReview: This might cause undesirable behaviour, if - for example - HandleDisconnect gets called by
	//				RPC's, so may want to create a fake localplayer instead
	PC->Player = GEngine->GetFirstGamePlayer(NUTUtil::GetPrimaryWorld());

	// Sometimes, e.g. when executing in a commandlet, there is no available player, and one has to be created
	if (PC->Player == NULL)
	{
		// Do nothing, other than just create the raw object
		PC->Player = NewObject<ULocalPlayer>(GEngine, GEngine->LocalPlayerClass);
	}


	// Pass on notification
	UNetDriver* CurDriver = GetDriver();
	FNetworkNotifyHook* NotifyHook = (Driver != NULL ? (FNetworkNotifyHook*)CurDriver->Notify : NULL);

	if (NotifyHook != NULL)
	{
		NotifyHook->NotifyHandleClientPlayer(PC, NetConnection);
	}
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:30,代码来源:UnitTestNetConnection.cpp

示例14: return

bool UDemoNetConnection::ClientHasInitializedLevelFor(const UObject* TestObject) const
{
	// We save all currently streamed levels into the demo stream so we can force the demo playback client
	// to stay in sync with the recording server
	// This may need to be tweaked or re-evaluated when we start recording demos on the client
	return ( GetDriver()->DemoFrameNum > 2 || Super::ClientHasInitializedLevelFor( TestObject ) );
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:7,代码来源:DemoNetDriver.cpp

示例15: unregister_cdrom

void unregister_cdrom(int drive)
{
	int device = GetDriver(drive);
	if (device >= 4)
		return;
	cd_drives[drive] = -1;
	numDrives--;
}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:8,代码来源:mscdex.c


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