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


C++ ActorSet::get方法代码示例

本文整理汇总了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();
	}
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:20,代码来源:Bullet.cpp

示例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);
		}
	}
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:39,代码来源:Shadow.cpp


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