本文整理汇总了C++中IVehicleSeat::GetCurrentView方法的典型用法代码示例。如果您正苦于以下问题:C++ IVehicleSeat::GetCurrentView方法的具体用法?C++ IVehicleSeat::GetCurrentView怎么用?C++ IVehicleSeat::GetCurrentView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVehicleSeat
的用法示例。
在下文中一共展示了IVehicleSeat::GetCurrentView方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CanZoom
//------------------------------------------------------------------------
bool CVehicleWeapon::CanZoom() const
{
if (!CWeapon::CanZoom())
return false;
if (!m_bOwnerInSeat)
return false;
IVehicle *pVehicle = GetVehicle();
if(!pVehicle)
return false;
IActor* pActor = GetOwnerActor();
IVehicleSeat* pSeat = pActor ? pVehicle->GetSeatForPassenger(pActor->GetEntityId()) : NULL;
IVehicleView* pView = pSeat ? pSeat->GetCurrentView() : NULL;
if (pView && pView->IsThirdPerson())
return false;
return true;
}
示例2: CanZoom
//------------------------------------------------------------------------
bool CVehicleMountedWeapon::CanZoom() const
{
if (!CHeavyMountedWeapon::CanZoom())
return false;
IVehicle *pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(m_vehicleId);
if(pVehicle && !IsRippedOff())
{
if (m_pSeatUser != m_pOwnerSeat)
return false;
IActor* pActor = GetOwnerActor();
IVehicleSeat* pSeat = pActor ? pVehicle->GetSeatForPassenger(pActor->GetEntityId()) : NULL;
IVehicleView* pView = pSeat ? pSeat->GetCurrentView() : NULL;
if (pView && pView->IsThirdPerson())
return false;
}
return true;
}
示例3: IsGhostPit
//------------------------------------------------------------------------
int CScriptBind_Actor::IsGhostPit(IFunctionHandler *pH)
{
CActor *pActor = GetActor(pH);
if (!pActor)
return pH->EndFunction();
bool hidden = false;
if (IVehicle* pVehicle = pActor->GetLinkedVehicle())
{
IVehicleSeat* pSeat = pVehicle->GetSeatForPassenger(pActor->GetEntityId());
if (pSeat)
{
if (IVehicleView* pView = pSeat->GetView(pSeat->GetCurrentView()))
hidden = pView->IsPassengerHidden();
}
}
return pH->EndFunction(hidden);
}
示例4: UpdateLight
//-----------------------------------------------------------------------
void CVehiclePartLight::UpdateLight(const float frameTime)
{
if (m_slot == -1)
return;
// move to vehicle event change view?
if (m_diffuseMult[0] != m_diffuseMult[1])
{
SEntitySlotInfo info;
if (m_pVehicle->GetEntity()->GetSlotInfo(m_slot, info) && info.pLight)
{
CDLight& light = info.pLight->GetLightProperties();
IActor* pActor = CCryAction::GetCryAction()->GetClientActor();
bool localPlayer = (pActor != NULL) && (pActor->GetLinkedVehicle() == m_pVehicle);
IVehicleSeat* pSeat = pActor ? m_pVehicle->GetSeatForPassenger(pActor->GetEntityId()) : NULL;
IVehicleView* pView = pSeat? pSeat->GetView(pSeat->GetCurrentView()) : NULL;
bool isThirdPersonView = pView? pView->IsThirdPerson() : true;
if (localPlayer && !isThirdPersonView)
light.SetLightColor(ColorF(m_diffuseCol * m_diffuseMult[0], 1.f));
else
light.SetLightColor(ColorF(m_diffuseCol * m_diffuseMult[1], 1.f));
}
}
if (m_pHelper)
{
const static Matrix33 rot(Matrix33::CreateRotationXYZ(Ang3(0.f, 0.f, DEG2RAD(90.f))));
Matrix34 helperTM;
m_pHelper->GetVehicleTM(helperTM);
Matrix34 localTM = Matrix33(helperTM) * rot;
localTM.SetTranslation(helperTM.GetTranslation());
GetEntity()->SetSlotLocalTM(m_slot, localTM);
}
}
示例5: OnAction
//------------------------------------------------------------------------
void CVehicleClient::OnAction(IVehicle* pVehicle, EntityId actorId, const ActionId& actionId, int activationMode, float value)
{
assert(pVehicle);
if (!pVehicle)
return;
TActionNameIdMap::const_iterator ite = m_actionNameIds.find(actionId);
if (ite == m_actionNameIds.end())
return;
IVehicleMovement *pMovement = pVehicle->GetMovement();
const bool isAir = pMovement && pMovement->GetMovementType()==IVehicleMovement::eVMT_Air;
IVehicleSeat* pCurrentSeat = pVehicle->GetSeatForPassenger(actorId);
const bool isThirdPerson = pCurrentSeat && pCurrentSeat->GetView(pCurrentSeat->GetCurrentView())->IsThirdPerson();
const bool isDriver = pCurrentSeat && pCurrentSeat->IsDriver();
switch (ite->second)
{
case (eVAI_XIMoveX):
{
if(pMovement && pMovement->GetMovementType() == IVehicleMovement::eVMT_Air)
{
//strafe instead of turning for air vehicles
if(value>0.f)
{
pVehicle->OnAction(eVAI_StrafeRight, eAAM_OnPress, value, actorId);
m_bMovementFlagRight = true;
}
else if(value==0.f)
{
if(m_bMovementFlagRight)
{
pVehicle->OnAction(eVAI_StrafeRight, eAAM_OnRelease, 0.f, actorId);
m_bMovementFlagRight = false;
}
else if(m_bMovementFlagLeft)
{
pVehicle->OnAction(eVAI_StrafeLeft, eAAM_OnRelease, 0.f, actorId);
m_bMovementFlagLeft = false;
}
}
else//value<0
{
pVehicle->OnAction(eVAI_StrafeLeft, eAAM_OnPress, -value, actorId);
m_bMovementFlagLeft = true;
}
}
else
{
if(value>0.f)
{
pVehicle->OnAction(eVAI_TurnRight, eAAM_OnPress, value, actorId);
m_bMovementFlagRight = true;
}
else if(value==0.f)
{
if(m_bMovementFlagRight)
{
pVehicle->OnAction(eVAI_TurnRight, eAAM_OnRelease, 0.f, actorId);
m_bMovementFlagRight = false;
}
else if(m_bMovementFlagLeft)
{
pVehicle->OnAction(eVAI_TurnLeft, eAAM_OnRelease, 0.f, actorId);
m_bMovementFlagLeft = false;
}
}
else//value<0
{
pVehicle->OnAction(eVAI_TurnLeft, eAAM_OnPress, -value, actorId);
m_bMovementFlagLeft = true;
}
}
break;
}
case (eVAI_XIMoveY):
{
EVehicleActionIds eForward = eVAI_MoveForward;
EVehicleActionIds eBack = eVAI_MoveBack;
if(!strcmp("Asian_helicopter",pVehicle->GetEntity()->GetClass()->GetName()))
{
eForward = eVAI_MoveUp;
eBack = eVAI_MoveDown;
}
if(value>0.f)
{
pVehicle->OnAction(eForward, eAAM_OnPress, value, actorId);
m_bMovementFlagForward = true;
}
else if(value==0.f)
{
if(m_bMovementFlagForward)
{
pVehicle->OnAction(eForward, eAAM_OnRelease, 0.f, actorId);
m_bMovementFlagForward = false;
}
else if(m_bMovementFlagBack)
//.........这里部分代码省略.........