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


C++ IActor::SetViewInVehicle方法代码示例

本文整理汇总了C++中IActor::SetViewInVehicle方法的典型用法代码示例。如果您正苦于以下问题:C++ IActor::SetViewInVehicle方法的具体用法?C++ IActor::SetViewInVehicle怎么用?C++ IActor::SetViewInVehicle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IActor的用法示例。


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

示例1: UpdateView

//------------------------------------------------------------------------
void CVehicleViewFirstPerson::UpdateView(SViewParams &viewParams, EntityId playerId)
{
	// JB: Attaching vehicles to trackview causes the view position to be out of date
	// by the time we reach Update view, introducing view lag. Need to re-update
	m_viewPosition = GetWorldPosGoal();

  if (!m_passengerId)
    return;

  	viewParams.nearplane = 0.02f;
	viewParams.fov = m_fov;

	if (EntityId weaponId = m_pVehicle->GetCurrentWeaponId(m_passengerId))  
	{
		if (IItem* pItem = CCryAction::GetCryAction()->GetIItemSystem()->GetItem(weaponId))    
		{
			if (pItem->FilterView(viewParams))
				return;
		}
	}

	viewParams.position = m_viewPosition;
	viewParams.rotation = GetVehicleRotGoal() * Quat::CreateRotationXYZ(m_rotation);
	
	// set view direction on actor
	IActor* pActor = CCryAction::GetCryAction()->GetIActorSystem()->GetActor(playerId);
	if(pActor && pActor->IsClient())
	{
		pActor->SetViewInVehicle(viewParams.rotation);
	}
	
  // recoil
  viewParams.rotation *= Quat::CreateRotationXYZ(m_viewAngleOffset);   
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:35,代码来源:VehicleViewFirstPerson.cpp

示例2: UpdateView

//------------------------------------------------------------------------
void CVehicleViewSteer::UpdateView(SViewParams &viewParams, EntityId playerId)
{
	static bool doUpdate = true;

	if (!doUpdate) return;

	if (m_position.IsValid())
	{
		viewParams.position = m_position;
	}
	else
	{
		CRY_ASSERT_MESSAGE(0, "camera position invalid");
	}

	Vec3 dir = (m_lookAt - m_position).GetNormalizedSafe();
	if (dir.IsValid() && dir.GetLengthSquared() > 0.01f)
	{
		viewParams.rotation = Quat::CreateRotationVDir(dir);
	}
	else
	{
		CRY_ASSERT_MESSAGE(0, "camera rotation invalid");
	}

	// set view direction on actor
	IActor* pActor = m_pSeat->GetPassengerActor(true);
	if (pActor && pActor->IsClient())
	{
		pActor->SetViewInVehicle(viewParams.rotation);
	}
}
开发者ID:joewan,项目名称:pycmake,代码行数:33,代码来源:VehicleViewSteer.cpp


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