本文整理汇总了C++中ActorSet::get方法的典型用法代码示例。如果您正苦于以下问题:C++ ActorSet::get方法的具体用法?C++ ActorSet::get怎么用?C++ ActorSet::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorSet
的用法示例。
在下文中一共展示了ActorSet::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onTrigger
void Bullet::onTrigger(void)
{
OBJECT_ID id = INVALID_ID;
// Only consider Creature from our World that are not the Bullet owner
ActorSet s = getZone().getObjects().typeFilter<Creature>().exclude(owner);
if(isAnythingInProximity(s, id))
{
Creature& creature = dynamic_cast<Creature&>(s.get(id));
creature.damage(damageValue, owner);
creature.applyKnockBack(creature.getPos()-getPos());
if(causesFreeze)
creature.freeze();
kill();
}
}
示例2: update
void Shadow::update(const ActorSet &zoneActors, float deltaTime)
{
if(light!=0 && zoneActors.isMember(actorID))
{
const Actor &actor = zoneActors.get(actorID);
// Update the shadow when something has changed
needsUpdate |= (actor.hasAnimated || actor.hasMoved);
// Update when necessary or requested
if(needsUpdate)
{
float lx=0, ly=0;
calculateAngularSpread(actor, lightViewMatrix, lx, ly);
calculateMatrices(*light, actor, shadowMapSize, lightProjectionMatrix, lightViewMatrix, textureMatrix, lx, ly);
frustum = calculateFrustum(lightProjectionMatrix, lightViewMatrix);
if(g_Application.displayDebugData)
{
calculateFrustumVertices(*light, actor, lx, ly, ntl, ntr, nbl, nbr, ftl, ftr, fbl, fbr);
}
renderToShadow(shadowMapTexture, shadowMapSize, actor, lightProjectionMatrix, lightViewMatrix);
needsUpdate=false;
}
// Periodically take some time to determine the actors that be receiving this shadow
periodicTimer-=deltaTime;
if(periodicTimer<0)
{
periodicTimer = 250.0f + FRAND_RANGE(100.0f, 250.0f); // stagger
receivers = calculateReceivers(zoneActors, lightProjectionMatrix, lightViewMatrix);
}
}
}