本文整理汇总了C++中IEntityRenderProxy::ClearSlots方法的典型用法代码示例。如果您正苦于以下问题:C++ IEntityRenderProxy::ClearSlots方法的具体用法?C++ IEntityRenderProxy::ClearSlots怎么用?C++ IEntityRenderProxy::ClearSlots使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEntityRenderProxy
的用法示例。
在下文中一共展示了IEntityRenderProxy::ClearSlots方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteEntities
void CFlock::DeleteEntities( bool bForceDeleteAll )
{
if (m_pEntity)
{
IEntityRenderProxy *pRenderProxy = (IEntityRenderProxy*)m_pEntity->GetProxy(ENTITY_PROXY_RENDER);
if (pRenderProxy)
pRenderProxy->ClearSlots();
}
I3DEngine *engine = gEnv->p3DEngine;
for (Boids::iterator it = m_boids.begin(); it != m_boids.end(); ++it)
{
CBoidObject* boid = *it;
if (boid->m_pickedUp && !bForceDeleteAll) // Do not delete picked up boids.
continue;
// SAFE_RELEASE(boid->m_object);
boid->m_object = 0;
boid->m_noentity = true;
if (boid->m_entity)
{
// Delete entity.
IEntity *pBoidEntity = gEnv->pEntitySystem->GetEntity(boid->m_entity);
if (pBoidEntity)
{
CBoidObjectProxy *pBoidObjectProxy = static_cast<CBoidObjectProxy *>(pBoidEntity->GetProxy(ENTITY_PROXY_BOID_OBJECT));
/* Luciano: old code did this (without getting the existing boid object proxy first), not sure why
if(!pBoidObjectProxy)
{
pBoidObjectProxy = new CBoidObjectProxy(pBoidEntity);
pBoidEntity->SetProxy(ENTITY_PROXY_BOID_OBJECT,pBoidObjectProxy);
}*/
if (pBoidObjectProxy)
pBoidObjectProxy->SetBoid(0);
}
gEnv->pEntitySystem->RemoveEntity(boid->m_entity);
boid->m_entity = 0;
boid->m_pPhysics = 0;
boid->m_physicsControlled = false;
}
}
m_bEntityCreated = false;
}
示例2: CreateBoids
void CBugsFlock::CreateBoids( SBoidsCreateContext &ctx )
{
CFlock::CreateBoids(ctx);
int i;
if (!m_e_flocks)
return;
if (m_pEntity)
{
IEntityRenderProxy *pRenderProxy = (IEntityRenderProxy*)m_pEntity->GetProxy(ENTITY_PROXY_RENDER);
if (pRenderProxy)
pRenderProxy->ClearSlots();
}
// Different boids.
for (i = 0; i < ctx.boidsCount; i++)
{
CBoidBug *boid = new CBoidBug( m_bc );
float radius = m_bc.fSpawnRadius;
boid->m_pos = m_origin + Vec3(radius*Boid::Frand(),radius*Boid::Frand(),
m_bc.MinHeight+(m_bc.MaxHeight-m_bc.MinHeight)*Boid::Frand() );
boid->m_heading = Vec3(Boid::Frand(),Boid::Frand(),0).GetNormalized();
boid->m_speed = m_bc.MinSpeed + (m_bc.MaxSpeed-m_bc.MinSpeed)*Boid::Frand();
boid->m_scale = m_bc.boidScale + Boid::Frand()*m_bc.boidRandomScale;
/*
//boid->CalcRandomTarget( GetPos(),m_bc );
if (!ctx.characterModel.empty())
{
if (numObj == 0 || (i % (numObj+1) == 0))
{
m_pEntity->LoadCharacter( i,ctx.characterModel );
boid->m_object = m_pEntity->GetCharacter(i);
if (boid->m_object)
{
AABB aabb=boid->m_object->GetAABB();
bbox.Add( aabb.min );
bbox.Add( aabb.max );
if (!ctx.animation.empty())
{
CryCharAnimationParams animParams;
animParams.m_nFlags |= CA_REMOVE_FROM_FIFO;
// Play animation in loop.
boid->m_object->GetISkeleton()->StartAnimation( ctx.animation.c_str(),0, 0,0, animParams );
IAnimationSet* animSet = boid->m_object->GetIAnimationSet();
if (animSet)
{
//Ivo: this is an animation flag in the new system
//boid->m_object->SetLoop( ctx.animation.c_str(), true, 0 );
}
}
}
}
}
if (numObj > 0)
boid->m_objectId = (i % numObj);
else
boid->m_objectId = 0;
if (!boid->m_object)
{
m_pEntity->LoadGeometry( i,ctx.models[boid->m_objectId] );
}
*/
//boid->m_p = gEnv->p3DEngine->MakeCharacter( model.c_str() );
/*
if (boid->m_object)
{
boid->Physicalize(m_bc);
}
*/
AddBoid(boid);
}
}