本文整理汇总了C++中IEntityRenderProxy::SetMaterialLayersMask方法的典型用法代码示例。如果您正苦于以下问题:C++ IEntityRenderProxy::SetMaterialLayersMask方法的具体用法?C++ IEntityRenderProxy::SetMaterialLayersMask怎么用?C++ IEntityRenderProxy::SetMaterialLayersMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEntityRenderProxy
的用法示例。
在下文中一共展示了IEntityRenderProxy::SetMaterialLayersMask方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnGameTokenEvent
//--------------------------------------------------------------
void CWeaponSystem::OnGameTokenEvent( EGameTokenEvent event,IGameToken *pGameToken )
{
assert(pGameToken);
if(EGAMETOKEN_EVENT_CHANGE == event)
{
bool handled = false;
if(!strcmp("weapon.effects.ice",pGameToken->GetName()))
{
pGameToken->GetValueAs(m_frozenEnvironment);
handled = true;
}
else if(!strcmp("weapon.effects.wet",pGameToken->GetName()))
{
pGameToken->GetValueAs(m_wetEnvironment);
handled = true;
}
if (handled)
{
IGameFramework* pGF = gEnv->pGame->GetIGameFramework();
IActorSystem* pAS = pGF->GetIActorSystem();
int count = pAS->GetActorCount();
if (count)
{
IActorIteratorPtr it = pAS->CreateActorIterator();
while (CActor* pActor = (CActor*)it->Next())
{
CPlayer *pPlayer = (pActor->GetActorClass() == CPlayer::GetActorClassType()) ? static_cast<CPlayer*>(pActor) : 0;
if (pPlayer && pPlayer->GetNanoSuit())
{
// go through all players and turn their ice effects on/off
IEntityRenderProxy* pRenderProxy = (IEntityRenderProxy*)pPlayer->GetEntity()->GetProxy(ENTITY_PROXY_RENDER);
if (pRenderProxy)
{
uint8 mask = pRenderProxy->GetMaterialLayersMask();
uint32 blend = pRenderProxy->GetMaterialLayersBlend();
mask = IsFrozenEnvironment() ? mask|MTL_LAYER_DYNAMICFROZEN : mask&~MTL_LAYER_DYNAMICFROZEN;
mask = IsWetEnvironment() ? mask|MTL_LAYER_WET : mask&~MTL_LAYER_WET;
pRenderProxy->SetMaterialLayersMask(mask);
pRenderProxy->SetMaterialLayersBlend(blend);
if (CItem* pItem = static_cast<CItem*>(pPlayer->GetCurrentItem(true)))
{
pItem->FrostSync(true);
pItem->WetSync(true);
}
if (COffHand* pOffHand = static_cast<COffHand*>(pPlayer->GetItemByClass(CItem::sOffHandClass)))
{
pOffHand->FrostSync(pOffHand->GetOffHandState() != eOHS_INIT_STATE);
pOffHand->WetSync(pOffHand->GetOffHandState() != eOHS_INIT_STATE);
}
}
}
}
}
}
}
}