本文整理汇总了C++中ActorSet::isMember方法的典型用法代码示例。如果您正苦于以下问题:C++ ActorSet::isMember方法的具体用法?C++ ActorSet::isMember怎么用?C++ ActorSet::isMember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorSet
的用法示例。
在下文中一共展示了ActorSet::isMember方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: moveObject
void ActorSet::moveObject(ActorSet &dest, OBJECT_ID id)
{
ASSERT(isMember(id), "The object is not a member of this set");
ASSERT(!dest.isMember(id), "The object is already a member of the other set");
// Add it to the other set
dest.insert( make_pair(id, toActor(*find(id))) );
// Remove it from this set
erase(find(id));
}
示例2: bind
void Shadow::bind(const ActorSet &zoneActors, unsigned int textureUnit) const
{
if(light!=0 && zoneActors.isMember(actorID))
{
CHECK_GL_ERROR();
// Bind shadow texture
glActiveTextureARB(textureStages[textureUnit]);
glClientActiveTextureARB(textureStages[textureUnit]);
glBindTexture(GL_TEXTURE_2D, shadowMapTexture);
glEnable(GL_TEXTURE_2D);
// Define the matrix
const float row1[4] = {textureMatrix.m[0], textureMatrix.m[4], textureMatrix.m[8], textureMatrix.m[12]};
const float row2[4] = {textureMatrix.m[1], textureMatrix.m[5], textureMatrix.m[9], textureMatrix.m[13]};
const float row3[4] = {textureMatrix.m[2], textureMatrix.m[6], textureMatrix.m[10], textureMatrix.m[14]};
const float row4[4] = {textureMatrix.m[3], textureMatrix.m[7], textureMatrix.m[11], textureMatrix.m[15]};
// Enable tex coord generation
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);
glEnable(GL_TEXTURE_GEN_Q);
// Define the parameters of the generation
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
// Pass the texture matrix we defined above
glTexGenfv(GL_S, GL_EYE_PLANE, row1);
glTexGenfv(GL_T, GL_EYE_PLANE, row2);
glTexGenfv(GL_R, GL_EYE_PLANE, row3);
glTexGenfv(GL_Q, GL_EYE_PLANE, row4);
// Enable shadow comparison
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL);
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY);
CHECK_GL_ERROR();
}
}
示例3: 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);
}
}
}