• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetDriver函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ShouldAttractAutoAim

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool CPropAPC::ShouldAttractAutoAim( CBaseEntity *pAimingEnt )
{
	if( IsXbox() && pAimingEnt->IsPlayer() && GetDriver() )
	{
		return true;
	}

	return BaseClass::ShouldAttractAutoAim( pAimingEnt );
}
开发者ID:paralin,项目名称:hl2sdk,代码行数:11,代码来源:vehicle_apc.cpp


示例17: CalculatePhysicsImpactDamage

//-----------------------------------------------------------------------------
// Purpose: // The player takes damage if he hits something going fast enough
//-----------------------------------------------------------------------------
void CPropVehicleDriveable::VPhysicsCollision( int index, gamevcollisionevent_t *pEvent )
{
	// Don't care if we don't have a driver
	if ( !GetDriver() )
		return;

	// Make sure we don't keep hitting the same entity
	int otherIndex = !index;
	CBaseEntity *pHitEntity = pEvent->pEntities[otherIndex];
	if ( pEvent->deltaCollisionTime < 0.5 && (pHitEntity == this) )
		return;

	BaseClass::VPhysicsCollision( index, pEvent );

	// If we hit hard enough, damage the player
	// Don't take damage from ramming bad guys
	if ( pHitEntity->MyNPCPointer() )
		return;

	// Don't take damage from ramming ragdolls
	if ( pEvent->pObjects[otherIndex]->GetGameFlags() & FVPHYSICS_PART_OF_RAGDOLL )
		return;

	// Ignore func_breakables
	CBreakable *pBreakable = dynamic_cast<CBreakable *>(pHitEntity);
	if ( pBreakable )
	{
		// ROBIN: Do we want to only do this on func_breakables that are about to die?
		//if ( pBreakable->HasSpawnFlags( SF_PHYSICS_BREAK_IMMEDIATELY ) )
		return;
	}

	// Over our skill's minimum crash level?
	int damageType = 0;
	float flDamage = CalculatePhysicsImpactDamage( index, pEvent, gDefaultPlayerVehicleImpactDamageTable, 1.0, true, damageType );
	if ( flDamage > 0 )
	{
		Vector damagePos;
		pEvent->pInternalData->GetContactPoint( damagePos );
		Vector damageForce = pEvent->postVelocity[index] * pEvent->pObjects[index]->GetMass();
		CTakeDamageInfo info( this, GetDriver(), damageForce, damagePos, flDamage, damageType );
		GetDriver()->TakeDamage( info );
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:47,代码来源:vehicle_base.cpp


示例18: VPhysicsTakeDamage

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
int CASW_PropJeep::OnTakeDamage( const CTakeDamageInfo &inputInfo )
{
	//Do scaled up physics damage to the car
	CTakeDamageInfo info = inputInfo;
	info.ScaleDamage( 25 );
	
	// HACKHACK: Scale up grenades until we get a better explosion/pressure damage system
	if ( inputInfo.GetDamageType() & DMG_BLAST )
	{
		info.SetDamageForce( inputInfo.GetDamageForce() * 10 );
	}
	VPhysicsTakeDamage( info );

	// reset the damage
	info.SetDamage( inputInfo.GetDamage() );

	// small amounts of shock damage disrupt the car, but aren't transferred to the player
	if ( info.GetDamageType() == DMG_SHOCK )
	{
		if ( info.GetDamage() <= 10 )
		{
			// take 10% damage and make the engine stall
			info.ScaleDamage( 0.1 );
			m_throttleDisableTime = gpGlobals->curtime + 2;
		}
	}

	//Check to do damage to driver
	if ( GetDriver() )
	{
		//Take no damage from physics damages
		if ( info.GetDamageType() & DMG_CRUSH )
			return 0;

		// Take the damage (strip out the DMG_BLAST)
		info.SetDamageType( info.GetDamageType() & (~DMG_BLAST) );
		GetDriver()->TakeDamage( info );
	}

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


示例19: UE_LOG

void UDemoNetConnection::LowLevelSend( void* Data, int32 Count )
{
	if ( Count == 0 )
	{
		UE_LOG( LogDemo, Warning, TEXT( "UDemoNetConnection::LowLevelSend: Ignoring empty packet." ) );
		return;
	}

	if ( Count > MAX_DEMO_READ_WRITE_BUFFER )
	{
		UE_LOG( LogDemo, Fatal, TEXT( "UDemoNetConnection::LowLevelSend: Count > MAX_DEMO_READ_WRITE_BUFFER." ) );
	}

	if ( !GetDriver()->ServerConnection && GetDriver()->FileAr )
	{
		// If we're outside of an official demo frame, we need to queue this up or it will throw off the stream
		if ( !GetDriver()->bIsRecordingDemoFrame )
		{
			FQueuedDemoPacket & B = *( new( QueuedDemoPackets )FQueuedDemoPacket );
			B.Data.AddUninitialized( Count );
			FMemory::Memcpy( B.Data.GetData(), Data, Count );
			return;
		}

		*GetDriver()->FileAr << Count;
		GetDriver()->FileAr->Serialize( Data, Count );
		
#if DEMO_CHECKSUMS == 1
		uint32 Checksum = FCrc::MemCrc32( Data, Count, 0 );
		*GetDriver()->FileAr << Checksum;
#endif
	}
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:33,代码来源:DemoNetDriver.cpp


示例20: FlushNet

void UDemoNetConnection::FlushNet( bool bIgnoreSimulation )
{
	// in playback, there is no data to send except
	// channel closing if an error occurs.
	if ( GetDriver()->ServerConnection != NULL )
	{
		InitSendBuffer();
	}
	else
	{
		Super::FlushNet( bIgnoreSimulation );
	}
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:13,代码来源:DemoNetDriver.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetDroppedFlagGUID函数代码示例发布时间:2022-05-30
下一篇:
C++ GetDriveTypeA函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap