本文整理汇总了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;
}
示例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 );
}
示例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;
}
示例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 );
}
}
}
示例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;
}
示例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) );
}
示例7: GetDriver
CClientPlayer * CClientVehicle::GetOccupant(BYTE byteSeatId)
{
if(byteSeatId == 0)
return GetDriver();
return GetPassenger(byteSeatId - 1);
}
示例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);
}
示例9: GetDriver
CPlayerEntity * CVehicleEntity::GetOccupant(BYTE byteSeatId)
{
if(byteSeatId == 0)
return GetDriver();
return new CPlayerEntity(); //GetPassenger(byteSeatId - 1);
}
示例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 );
}
}
}
示例11: InputForcePlayerOut
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPropVehicleViewController::InputForcePlayerOut( inputdata_t &inputdata )
{
if ( !GetDriver() )
return;
GetServerVehicle()->HandlePassengerExit( m_hPlayer );
}
示例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();
}
}
示例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);
}
}
示例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 ) );
}
示例15: unregister_cdrom
void unregister_cdrom(int drive)
{
int device = GetDriver(drive);
if (device >= 4)
return;
cd_drives[drive] = -1;
numDrives--;
}