本文整理汇总了C++中IActor::IsThirdPerson方法的典型用法代码示例。如果您正苦于以下问题:C++ IActor::IsThirdPerson方法的具体用法?C++ IActor::IsThirdPerson怎么用?C++ IActor::IsThirdPerson使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IActor
的用法示例。
在下文中一共展示了IActor::IsThirdPerson方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnGameplayCommand
void CDevMode::OnGameplayCommand(const char* cmd)
{
SUIArguments args;
args.SetDelimiter(":");
args.SetArguments(cmd);
string action;
args.GetArg(0, action);
if (action == "GotoTagPoint")
{
int tagpoint;
args.GetArg(1, tagpoint);
if (tagpoint >= 0 && tagpoint <= 11)
GotoTagPoint(tagpoint);
}
else if (action == "SetViewMode" && gEnv->pGame && gEnv->pGame->GetIGameFramework())
{
int mode;
args.GetArg(1, mode);
IActor* pPlayer = gEnv->pGame->GetIGameFramework()->GetClientActor();
static ICVar* pCamVar = gEnv->pConsole->GetCVar("cl_cam_orbit");
if (pPlayer && pCamVar)
{
switch (mode)
{
case 0:
pCamVar->Set(0);
if (pPlayer->IsThirdPerson())
pPlayer->ToggleThirdPerson();
break;
case 1:
pCamVar->Set(0);
if (!pPlayer->IsThirdPerson())
pPlayer->ToggleThirdPerson();
break;
case 2:
pCamVar->Set(1);
break;
}
}
}
else if (action == "SetFlyMode" && gEnv->pGame && gEnv->pGame->GetIGameFramework())
{
int mode;
args.GetArg(1, mode);
IActor* pPlayer = gEnv->pGame->GetIGameFramework()->GetClientActor();
if (pPlayer && mode >= 0 && mode < 3)
pPlayer->SetFlyMode(mode);
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:50,代码来源:DevMode.cpp
示例2: ActivateLight
//-------------------------------------------------------------------------
void CLam::ActivateLight(bool activate, bool aiRequest /* = false */)
{
//GameWarning("CLam::ActivateLight(%i)", activate);
CItem *pParent = NULL;
EntityId ownerId = 0;
if (IItem *pOwnerItem = m_pItemSystem->GetItem(GetParentId()))
{
pParent = (CItem *)pOwnerItem;
IWeapon *pWeapon = pOwnerItem->GetIWeapon();
if(pWeapon)
ownerId = pOwnerItem->GetOwnerId();
}
else
{
pParent = this;
ownerId = GetOwnerId();
}
IActor *pOwnerActor = gEnv->pGame->GetIGameFramework()->GetIActorSystem()->GetActor(ownerId);
if (activate && !pOwnerActor)
return;
//Special FP stuff
if(pOwnerActor && pOwnerActor->IsPlayer() && !m_lamparams.isFlashLight)
return;
//For AI must be deactivated by default (if they don't request)
if(activate && !m_lightWasOn && !aiRequest && !pOwnerActor->IsPlayer())
return;
m_lightActivated = activate;
//Activate or deactivate effect
if (!m_lightActivated)
{
AttachLAMLight(false, pParent, eIGS_FirstPerson);
AttachLAMLight(false, pParent, eIGS_ThirdPerson);
//GameWarning("Global light count = %d", s_lightCount);
}
else
{
uint8 id = pOwnerActor->IsThirdPerson() ? 1 : 0;
if (m_lightID[id] == 0)
{
AttachLAMLight(true, pParent, id?eIGS_ThirdPerson:eIGS_FirstPerson);
}
}
if (m_laserActivated || m_lightActivated)
GetGameObject()->EnablePostUpdates(this);
if (!m_laserActivated && !m_lightActivated)
GetGameObject()->DisablePostUpdates(this);
}
示例3: CanDrawCrosshair
bool CBitmapUi::CanDrawCrosshair() const
{
assert( m_pGameFramework != NULL );
if ( ! g_pGameCVars->g_show_crosshair )
{
return false;
}
IActor* pPlayer = m_pGameFramework->GetClientActor();
if ( pPlayer == NULL )
{
return false;
}
bool isPlayerDead = pPlayer->IsDead();
if ( isPlayerDead )
{
return false;
}
bool thirdPersonMode = pPlayer->IsThirdPerson();
bool crosshairEnabledInThirdPerson = ( g_pGameCVars->g_show_crosshair_tp != 0 );
if ( thirdPersonMode && ! crosshairEnabledInThirdPerson )
{
return false;
}
IItem* pItem = pPlayer->GetCurrentItem();
if ( pItem == NULL )
{
return false;
}
IWeapon* pWeapon = pItem->GetIWeapon();
if ( pWeapon == NULL )
{
return false;
}
bool carryingMeleeWeapon = pWeapon->CanMeleeAttack();
if ( carryingMeleeWeapon )
{
return false;
}
bool isWeaponZoomed = pWeapon->IsZoomed();
bool usingWeaponSightForAiming = ( ! thirdPersonMode && isWeaponZoomed );
if ( usingWeaponSightForAiming )
{
return false;
}
return true;
}
示例4: CanZoom
//------------------------------------------------------------------------
bool CVehicleWeapon::CanZoom() const
{
if (!CWeapon::CanZoom())
return false;
if (m_pSeatUser != m_pOwnerSeat)
return false;
IActor* pActor = GetOwnerActor();
return pActor && pActor->IsThirdPerson();
}
示例5: OnEnterVehicleSeat
//------------------------------------------------------------------------
void CVehicleClient::OnEnterVehicleSeat(IVehicleSeat* pSeat)
{
m_bMovementFlagRight=m_bMovementFlagLeft=m_bMovementFlagForward=m_bMovementFlagBack=false;
m_fLeftRight = m_fForwardBackward = 0.f;
IVehicle* pVehicle = pSeat->GetVehicle();
assert(pVehicle);
IActorSystem* pActorSystem = gEnv->pGame->GetIGameFramework()->GetIActorSystem();
assert(pActorSystem);
IActor* pActor = pActorSystem->GetActor(pSeat->GetPassenger());
if (pActor)
{
bool isThirdPerson = pActor->IsThirdPerson() || m_tp;
TVehicleViewId viewId = InvalidVehicleViewId;
TVehicleViewId firstViewId = InvalidVehicleViewId;
while (viewId = pSeat->GetNextView(viewId))
{
if (viewId == firstViewId)
break;
if (firstViewId == InvalidVehicleViewId)
firstViewId = viewId;
if (IVehicleView* pView = pSeat->GetView(viewId))
{
if (pView->IsThirdPerson() == isThirdPerson)
break;
}
}
if (viewId != InvalidVehicleViewId)
pSeat->SetView(viewId);
if(IActor *pPassengerActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(pSeat->GetPassenger()))
{
if(pPassengerActor->IsPlayer())
{
EnableActionMaps(pSeat, true);
}
}
}
}
示例6: OnEnterVehicleSeat
//------------------------------------------------------------------------
void CVehicleClient::OnEnterVehicleSeat(IVehicleSeat* pSeat)
{
m_bMovementFlagRight=m_bMovementFlagLeft=m_bMovementFlagForward=m_bMovementFlagBack=false;
m_fLeftRight = m_fForwardBackward = 0.f;
IVehicle* pVehicle = pSeat->GetVehicle();
assert(pVehicle);
IActorSystem* pActorSystem = gEnv->pGame->GetIGameFramework()->GetIActorSystem();
assert(pActorSystem);
IActor* pActor = pActorSystem->GetActor(pSeat->GetPassenger());
bool isThirdPerson = pActor->IsThirdPerson() || m_tp;
TVehicleViewId viewId = InvalidVehicleViewId;
TVehicleViewId firstViewId = InvalidVehicleViewId;
while (viewId = pSeat->GetNextView(viewId))
{
if (viewId == firstViewId)
break;
if (firstViewId == InvalidVehicleViewId)
firstViewId = viewId;
if (IVehicleView* pView = pSeat->GetView(viewId))
{
if (pView->IsThirdPerson() == isThirdPerson)
break;
}
}
if (viewId != InvalidVehicleViewId)
pSeat->SetView(viewId);
IActionMapManager* pMapManager = gEnv->pGame->GetIGameFramework()->GetIActionMapManager();
assert(pMapManager);
pMapManager->EnableActionMap("landvehicle", false);
pMapManager->EnableActionMap("seavehicle", false);
pMapManager->EnableActionMap("helicopter", false);
pMapManager->EnableActionMap("vtol", false);
pMapManager->EnableFilter ( "vehicle_no_seat_change_and_exit", true );
}
示例7: ActivateLaser
//-------------------------------------------------------------------------
void CLam::ActivateLaser(bool activate, bool aiRequest /* = false */)
{
if (m_laserActivated == activate)
return;
CItem *pParent = NULL;
EntityId ownerId = 0;
bool ok = false;
if (IItem *pOwnerItem = m_pItemSystem->GetItem(GetParentId()))
{
pParent = (CItem *)pOwnerItem;
IWeapon *pWeapon = pOwnerItem->GetIWeapon();
if(pWeapon)
ownerId = pOwnerItem->GetOwnerId();
ok = true;
}
else
{
pParent = this;
ownerId = GetOwnerId();
}
IActor *pOwnerActor = gEnv->pGame->GetIGameFramework()->GetIActorSystem()->GetActor(ownerId);
if(!pOwnerActor)
return;
if(activate && !aiRequest && !pOwnerActor->IsPlayer())
return;
//Special FP stuff
if(pOwnerActor->IsPlayer() && !m_lamparams.isLaser)
return;
m_laserActivated = activate;
//Activate or deactivate effect??
if (!m_laserActivated)
{
AttachLAMLaser(false, eIGS_FirstPerson);
AttachLAMLaser(false, eIGS_ThirdPerson);
}
else
{
bool tp = pOwnerActor->IsThirdPerson();
if(!tp && ok)
{
SAccessoryParams *params = pParent->GetAccessoryParams(GetEntity()->GetClass()->GetName());
if (!params)
return;
m_laserHelperFP.clear();
m_laserHelperFP = params->attach_helper.c_str();
m_laserHelperFP.replace("_LAM","");
}
AttachLAMLaser(true, tp?eIGS_ThirdPerson:eIGS_FirstPerson);
}
if (m_laserActivated || m_lightActivated)
GetGameObject()->EnablePostUpdates(this);
if (!m_laserActivated && !m_lightActivated)
GetGameObject()->DisablePostUpdates(this);
}