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

C++ GetOwnerActor函数代码示例

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

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



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

示例1: GetOwnerActor

//------------------------------------------------------------------------
void CVehicleMountedWeapon::StartUse(EntityId userId)
{
	IVehicle *pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(m_vehicleId);
	if (!IsRippingOff() && pVehicle)
	{ 
		m_pOwnerSeat = pVehicle->GetWeaponParentSeat(GetEntityId());
		m_pSeatUser = pVehicle->GetSeatForPassenger(userId);

		IActor* pOwner = GetOwnerActor();
		if (pOwner && !pOwner->IsPlayer())
		{
			SHUDEvent hudEvent(eHUDEvent_AddEntity);
			hudEvent.AddData((int)pVehicle->GetEntityId());
			CHUDEventDispatcher::CallEvent(hudEvent);
		}

		ClearItemFlags(eIF_InformClientsAboutUse);
 	}

	CHeavyMountedWeapon::StartUse(userId);

	CActor* pActor = GetOwnerActor();
	if (pActor && pActor->IsPlayer())
	{
		static_cast<CPlayer*>(pActor)->RefreshVisibilityState();
	}
}
开发者ID:amrhead,项目名称:eaascode,代码行数:28,代码来源:VehicleMountedWeapon.cpp


示例2: SetDualSlaveAccessory

//------------------------------------------------------------------------
void CItem::SetDualSlaveAccessory(bool noNetwork)
{
	if(!gEnv->bMultiplayer || (GetOwnerActor() && GetOwnerActor()->IsClient()))
	{
		CItem *pSlave = static_cast<CItem *>(GetDualWieldSlave());
		if (!pSlave)
			return;

		//Detach current accessories of the slave
		TAccessoryMap temp = pSlave->m_accessories;
		for (TAccessoryMap::const_iterator it=temp.begin(); it!=temp.end(); ++it)
		{
			if(m_accessories.find(it->first)==m_accessories.end())
				pSlave->SwitchAccessory(it->first.c_str()); //Only remove if not in the master
		}

		//Attach on the slave same accessories as "parent"
		for (TAccessoryMap::const_iterator it=m_accessories.begin(); it!=m_accessories.end(); ++it)
		{
			if(pSlave->m_accessories.find(it->first)==pSlave->m_accessories.end())
			{
				if(noNetwork)
					pSlave->AttachAccessory(it->first.c_str(), true, true, true);
				else
					pSlave->SwitchAccessory(it->first.c_str()); //Only add if not already attached
			}
		}
	}
}
开发者ID:Arnm7890,项目名称:CryGame,代码行数:30,代码来源:ItemDualWield.cpp


示例3: ResetState

void CBinocular::OnDropped(EntityId actorId)
{
	ResetState();

	if(GetOwnerActor() == NULL)
		return;

	GetOwnerActor()->SelectLastItem(true, true);
}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:9,代码来源:Binocular.cpp


示例4: CRY_ASSERT

//------------------------------------------------------
void CWeapon::SetInputFlag(uint8 actionFlag) 
{ 
	CRY_ASSERT(GetOwnerActor() && ( GetOwnerActor()->IsClient() || !GetOwnerActor()->IsPlayer() ) );

	if (!s_lockActionRequests) 
	{
		s_requestedActions |= actionFlag;
	} 
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:10,代码来源:WeaponInput.cpp


示例5: DrawSlot

//========================================
void CRocketLauncher::PickUp(EntityId pickerId, bool sound, bool select, bool keepHistory, const char *setup)
{

	CWeapon::PickUp(pickerId,sound,select,keepHistory, setup);

	if(m_auxSlotUsed)
	{
		DrawSlot(eIGS_ThirdPersonAux,false);
		m_auxSlotUsed = false;
	}

	if(GetOwnerActor() && !GetOwnerActor()->IsPlayer())
		m_stats.first_selection = false;
}
开发者ID:nhnam,项目名称:Seasons,代码行数:15,代码来源:RocketLauncher.cpp


示例6: IMPLEMENT_RMI

//------------------------------------------------------------------------
IMPLEMENT_RMI(CItem, SvRequestAttachAccessory)
{
	if (IInventory *pInventory=GetActorInventory(GetOwnerActor()))
	{
		char accessoryName[129] = {0};
		bool result = g_pGame->GetIGameFramework()->GetNetworkSafeClassName(accessoryName, 128, params.accessoryClassId);

#if !defined(_RELEASE)
	if(!result)
	{
		char errorMsg[256];
		sprintf(errorMsg, "CItem::SvRequestAttachAccessory failed to find network safe class name for id %d", params.accessoryClassId);
		CRY_ASSERT_MESSAGE(result, errorMsg);
	}
#endif

		if (accessoryName[0] != '\0' && pInventory->GetCountOfClass(accessoryName)>0)
		{
			DoSwitchAccessory(accessoryName);
			GetGameObject()->InvokeRMI(ClAttachAccessory(), params, eRMI_ToAllClients|eRMI_NoLocalCalls);

			return true;
		}
	}
	
	return true; // set this to false later
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:28,代码来源:ItemClientServer.cpp


示例7: GetOwnerActor

//---------------------------------------------------------------------------
void CVehicleWeapon::CheckForFriendlyPlayers(float frameTime)
{
	CActor *pOwner = GetOwnerActor();

	if(pOwner && pOwner->IsPlayer() && gEnv->bMultiplayer)
	{
		m_timeToUpdate-=frameTime;

		if(m_timeToUpdate>0.0f)
			return;

		m_timeToUpdate = 0.15f;

		if(IMovementController *pMC = pOwner->GetMovementController())
		{
			SMovementState info;
			pMC->GetMovementState(info);

			ray_hit rayhit;
			IPhysicalEntity *pSkipEnts[10];
			int nSkip = CSingle::GetSkipEntities(this, pSkipEnts, 10);

			int intersect = gEnv->pPhysicalWorld->RayWorldIntersection(info.weaponPosition, info.aimDirection * 150.0f, ent_all,
							rwi_stop_at_pierceable|rwi_colltype_any, &rayhit, 1, pSkipEnts, nSkip);

			IEntity *pLookAtEntity = NULL;

			if(intersect && rayhit.pCollider)
				pLookAtEntity = m_pEntitySystem->GetEntityFromPhysics(rayhit.pCollider);

			bool bFriendly = false;
		}
	}
}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:35,代码来源:VehicleWeapon.cpp


示例8: PerformRipOff

void CHeavyMountedWeapon::SetRippingOff(bool ripOff)
{
	if(ripOff && !m_rippingOff && !m_rippedOff)
	{
		PerformRipOff(GetOwnerActor());
	}
}
开发者ID:Xydrel,项目名称:Infected,代码行数:7,代码来源:HeavyMountedWeapon.cpp


示例9: GetEntity

void CHeavyMountedWeapon::ProcessEvent(SEntityEvent& event)
{
	if ((event.event == ENTITY_EVENT_XFORM) && IsMounted() && GetOwnerId())
	{
		const float Z_EPSILON = 0.01f;
		const Ang3& worldAngles = GetEntity()->GetWorldAngles();
		float xAngle = worldAngles.x;
		float zAngle = worldAngles.z;
		bool xAnglesAreEquivalent = (fabs(xAngle-m_lastXAngle)<Z_EPSILON);
		bool zAnglesAreEquivalent = (fabs(zAngle-m_lastZAngle)<Z_EPSILON);
		if (!xAnglesAreEquivalent || !zAnglesAreEquivalent)
		{
			if (m_rotatingSoundID==INVALID_SOUNDID)
				m_rotatingSoundID = PlayRotationSound();
			m_RotationSoundTimeOut = 0.15f;
			RequireUpdate( eIUS_General );
			m_lastXAngle = xAngle;
			m_lastZAngle = zAngle;
		}
			
		int flags = (int)event.nParam[0];
		if ((flags & ENTITY_XFORM_FROM_PARENT) && !(flags & ENTITY_XFORM_USER))
		{
			if (CActor* pOwnerActor = GetOwnerActor())
			{
				pOwnerActor->UpdateMountedGunController(true);
			}
		}
	}

	BaseClass::ProcessEvent(event);
}
开发者ID:Xydrel,项目名称:Infected,代码行数:32,代码来源:HeavyMountedWeapon.cpp


示例10: SwitchToRippedOffFireMode

void CHeavyMountedWeapon::SetUnMountedConfiguration()
{
	SwitchToRippedOffFireMode();

	IFireMode * pMountedFireMode = GetFireMode(0);
	assert(pMountedFireMode);
	
	pMountedFireMode->Enable(false);

	ExitZoom(true);

	//Second zoom mode is supposed to be unmounted
	if(GetZoomMode(1))
	{
		EnableZoomMode(1, true);
		SetCurrentZoomMode(1);
	}

	//Just in case, it was not clear properly
	CActor* pOwner = GetOwnerActor();
	if ((pOwner != NULL) && pOwner->IsClient())
	{
		float defaultFov = 55.0f;
		gEnv->pRenderer->EF_Query(EFQ_SetDrawNearFov,defaultFov);
	}
}
开发者ID:Xydrel,项目名称:Infected,代码行数:26,代码来源:HeavyMountedWeapon.cpp


示例11: GetOwnerActor

//---------------------------------------------------------------------------------
bool CWeapon::OnActionFiremode(EntityId actorId, const ActionId& actionId, int activationMode, float value)
{
	CActor* pOwner = GetOwnerActor();
	CPlayer* pPlayer = pOwner && pOwner->IsPlayer() ? static_cast<CPlayer*>(pOwner) : 0;
	if (pPlayer && (pPlayer->IsCinematicFlagActive(SPlayerStats::eCinematicFlag_LowerWeapon) || pPlayer->IsCinematicFlagActive(SPlayerStats::eCinematicFlag_LowerWeaponMP)) )
		return true;

	bool incompatibleZommMode = (m_secondaryZmId != 0 && (IsZoomed() || IsZoomingInOrOut()));

	if (AreAnyItemFlagsSet(eIF_BlockActions) || incompatibleZommMode)
	{
		return true;
	}

	if (activationMode == eAAM_OnPress)
	{
		IFireMode* pNewFiremode = GetFireMode(GetNextFireMode(GetCurrentFireMode()));
		if (pNewFiremode == m_fm)
		{
			if(pPlayer && pPlayer->CanSwitchItems())
			{
				pPlayer->SwitchToWeaponWithAccessoryFireMode();
			}
		}
		else if (!IsReloading())
		{
			StartChangeFireMode();
		}
	}

	return true;
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:33,代码来源:WeaponInput.cpp


示例12: CheckSprint

bool CWeapon::CheckSprint()
{
	CPlayer *pPlayer = static_cast<CPlayer*>(GetOwnerActor());
	if(!pPlayer || pPlayer->IsSliding())
		return false;

	SPlayerStats *pStats = static_cast<SPlayerStats*>(pPlayer->GetActorStats());
	assert(pStats);

	if(pPlayer->IsSprinting())
	{
		pStats->bIgnoreSprinting = true;

		float delayScale = pPlayer->GetModifiableValues().GetValue(kPMV_WeaponFireFromSprintTimeScale);
		m_delayedFireActionTimeOut = GetParams().sprintToFireDelay * delayScale;

		return true;
	}
	else if (m_delayedFireActionTimeOut > 0.f)
	{
		return true;
	}

	return false;
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:25,代码来源:WeaponInput.cpp


示例13: GetOwnerActor

//------------------------------------------------------------------------
void CItem::UpdateFPPosition(float frameTime)
{
	CActor* pActor = GetOwnerActor();
	if (!pActor)
		return;

	SPlayerStats *pStats = static_cast<SPlayerStats *>(pActor->GetActorStats());
	if (!pStats)
		return;

	Matrix34 tm = Matrix33::CreateRotationXYZ(pStats->FPWeaponAngles);

	Vec3 offset(0.0f,0.0f,0.0f);

	float right(g_pGameCVars->i_offset_right);
	float front(g_pGameCVars->i_offset_front);
	float up(g_pGameCVars->i_offset_up);

	if (front!=0.0f || up!=0.0f || right!=0.0f)
	{
		offset += tm.GetColumn(0).GetNormalized() * right;
		offset += tm.GetColumn(1).GetNormalized() * front;
		offset += tm.GetColumn(2).GetNormalized() * up;
	}

	tm.SetTranslation(pStats->FPWeaponPos + offset);
	GetEntity()->SetWorldTM(tm);

	//CryLogAlways("weaponpos: %.3f,%.3f,%.3f // weaponrot: %.3f,%.3f,%.3f", tm.GetTranslation().x,tm.GetTranslation().y,tm.GetTranslation().z, pStats->FPWeaponAngles.x, pStats->FPWeaponAngles.y, pStats->FPWeaponAngles.z);
}
开发者ID:AiYong,项目名称:CryGame,代码行数:31,代码来源:ItemView.cpp


示例14: PreActionAttack

//--------------------------------------------------------------------
bool CWeapon::PreActionAttack(bool startFire)
{
	// Melee while pressing SHIFT for SP
	CPlayer *pPlayer = static_cast<CPlayer*>(GetOwnerActor());
	if(!pPlayer)
		return false;
/*
	//if(gEnv->bMultiplayer)
	{
		if(startFire && pPlayer->IsSprinting())
		{
			//Stop sprinting, start firing
			SPlayerStats *pStats = static_cast<SPlayerStats*>(pPlayer->GetActorStats());
			if(pStats)
			{
				pStats->bSprinting = false;
				pStats->bIgnoreSprinting = true;
			}
		}
		else if(!startFire)
		{
			//Stop firing, continue sprinting
			SPlayerStats *pStats = static_cast<SPlayerStats*>(pPlayer->GetActorStats());
			if(pStats)
				pStats->bIgnoreSprinting = false;

		}
	}

	return false;
	*/

	if(startFire && pPlayer->IsSprinting()) return true;
	else return false;
}
开发者ID:wang1986one,项目名称:remod,代码行数:36,代码来源:WeaponInput.cpp


示例15: CollisionFeeback

//---------------------------------------------------------------
void CFists::CollisionFeeback(Vec3 &pos, int eFAS)
{

	CPlayer *pPlayer = static_cast<CPlayer*>(GetOwnerActor());
	if(pPlayer)
	{
		switch(eFAS)
		{
			case eFAS_RUNNING:
				pPlayer->PlaySound(CPlayer::ESound_Hit_Wall,true,true,"speed",0.4f);
				break;

			case eFAS_JUMPING:
				pPlayer->PlaySound(CPlayer::ESound_Hit_Wall,true,true,"speed",0.8f);
				break;

			default:
				break;
		}
	}

	//FX feedback
	IParticleEffect *pEffect = gEnv->pParticleManager->FindEffect("collisions.footsteps.dirt");
	if (pEffect)
	{
		Matrix34 tm = IParticleEffect::ParticleLoc(pos);
		pEffect->Spawn(true,tm);
	}	
}
开发者ID:AiYong,项目名称:CryGame,代码行数:30,代码来源:Fists.cpp


示例16: CryLog

//------------------------------------------------------------------------
void CParachute::Close(bool drop/*=false*/)
{
    // not used any more
    return;

    CryLog("Closing Parachute..");

    if (m_actorId)
    {
        IEntity* pEnt = m_pEntitySystem->GetEntity(m_actorId);
        if (pEnt && pEnt->GetParent()->GetId() == m_canvasId)
        {
            pEnt->DetachThis();
        }
        m_actorId = 0;
    }

    CActor* pActor = GetOwnerActor();
    if (pActor)
    {
        pActor->LinkToVehicle(0);
        if (IsOpened())
        {
            if (drop)
                pActor->DropItem(GetEntity()->GetId(), 1.0f, false);
        }
    }

    m_isOpened = false;
}
开发者ID:RenEvo,项目名称:dead6,代码行数:31,代码来源:Parachute.cpp


示例17: GetOwnerActor

//---------------------------------------------------------------
void CAmmoPickup::ShouldSwitchGrenade(IEntityClass* pClass)
{
	bool flashbang = (pClass==CItem::sFlashbangGrenade);
	bool smoke     = (pClass==CItem::sSmokeGrenade);
	bool emp       = (pClass==CItem::sEMPGrenade);
	bool explosive = (pClass==CItem::sExplosiveGrenade);

	if(!flashbang && !smoke && !emp && !explosive)
		return;

	CActor* pPlayer = GetOwnerActor();
	
	if(!pPlayer)
		return;

	COffHand* pOffHand = static_cast<COffHand*>(pPlayer->GetWeaponByClass(CItem::sOffHandClass));

	if(pOffHand)
	{
		if(IFireMode* fm = pOffHand->GetFireMode(pOffHand->GetCurrentFireMode()))
		{
			if(fm->OutOfAmmo())
			{
				if(explosive)
					pOffHand->RequestFireMode(EXPLOSIVE_GRENADE);
				else if(smoke)
					pOffHand->RequestFireMode(SMOKE_GRENADE);
				else if(flashbang)
					pOffHand->RequestFireMode(FLASHBANG_GRENADE);
				else if(emp)
					pOffHand->RequestFireMode(EMP_GRENADE);
			}
		}
	}
}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:36,代码来源:AmmoPickup.cpp


示例18: GetOwnerActor

//------------------------------------------------------------------------
bool CC4::CanSelect() const
{
	bool canSelect = (CWeapon::CanSelect() && !OutOfAmmo(false));

	//Check for remaining projectiles to detonate
	if(!canSelect)
	{
		CActor *pOwner = GetOwnerActor();

		if(!pOwner)
			return false;

		EntityId detonatorId = pOwner->GetInventory()?pOwner->GetInventory()->GetItemByClass(CItem::sDetonatorClass):0;

		//Do not re-select detonator again
		if(detonatorId && (detonatorId==pOwner->GetCurrentItemId()))
			return false;

		IFireMode *pFM = GetFireMode(GetCurrentFireMode());

		if(pFM)
		{
			//CC4::Select will select the detonator in this case
			EntityId projectileId = pFM->GetProjectileId();

			if(projectileId && g_pGame->GetWeaponSystem()->GetProjectile(projectileId))
				return true;

		}
	}

	return canSelect;
};
开发者ID:super-nova,项目名称:NovaRepo,代码行数:34,代码来源:C4.cpp


示例19: GetGameObject

//------------------------------------------------------------------------
void CItem::InitClient(int channelId)
{
	// send the differences between the current, and the initial setup
	for(TAccessoryMap::iterator it=m_accessories.begin(); it != m_accessories.end(); ++it)
		GetGameObject()->InvokeRMI(ClAttachAccessory(), RequestAttachAccessoryParams(it->first.c_str()), eRMI_ToClientChannel, channelId);

	IActor *pOwner=GetOwnerActor();

	if(!pOwner)
		return;

	// only send the pickup message if the player is connecting
	// for items spawned during gameplay, CItem::PickUp is already sending the pickup message
	INetChannel *pNetChannel=m_pGameFramework->GetNetChannel(channelId);

	if(pNetChannel && pNetChannel->GetContextViewState()<eCVS_InGame)
	{
		if(!m_stats.mounted && !m_stats.used)
		{
			pOwner->GetGameObject()->InvokeRMIWithDependentObject(CActor::ClPickUp(),
					CActor::PickItemParams(GetEntityId(), m_stats.selected, false), eRMI_ToClientChannel, GetEntityId(), channelId);
			//GetOwnerActor()->GetGameObject()->InvokeRMI(CActor::ClPickUp(),
			//	CActor::PickItemParams(GetEntityId(), m_stats.selected, false), eRMI_ToClientChannel, channelId);
		}
	}

	if(m_stats.mounted && m_stats.used)
	{
		pOwner->GetGameObject()->InvokeRMIWithDependentObject(CActor::ClStartUse(),
				CActor::ItemIdParam(GetEntityId()), eRMI_ToClientChannel, GetEntityId(), channelId);
	}
}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:33,代码来源:ItemClientServer.cpp


示例20: SetViewMode

void CJaw::PostSerialize()
{
	BaseClass::PostSerialize();

	if(m_auxSlotUsed)
	{
		SetViewMode(0);
		DrawSlot(eIGS_ThirdPersonAux,true);
	}
	else if (GetOwner() != 0 && !IsAttachedToBack() && !IsAttachedToHand())
	{
		Hide(true);
	}
	else if (!IsOwnerFP())
	{
		SetViewMode(eIVM_ThirdPerson);
		DrawSlot(eIGS_ThirdPerson, true);
		DrawSlot(eIGS_ThirdPersonAux,false);
	}

	if (m_smokeActive)
	{
		Pickalize(false, true);
	}

	if (GetOwner() != 0)
	{
		CActor* pOwner = GetOwnerActor();
		IInventory* pInventory = pOwner ? pOwner->GetInventory() : 0;
		UnregisterUsedAmmoWithInventory(pInventory);
		RegisterUsedAmmoWithInventory(pInventory);
	}
}
开发者ID:amrhead,项目名称:eaascode,代码行数:33,代码来源:JAW.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetOwnerGUID函数代码示例发布时间:2022-05-30
下一篇:
C++ GetOwner函数代码示例发布时间: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