本文整理汇总了C++中CFeature::IsInVoid方法的典型用法代码示例。如果您正苦于以下问题:C++ CFeature::IsInVoid方法的具体用法?C++ CFeature::IsInVoid怎么用?C++ CFeature::IsInVoid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFeature
的用法示例。
在下文中一共展示了CFeature::IsInVoid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawQuad
void DrawQuad(int x, int y)
{
std::vector<IWorldObjectModelRenderer*>& opaqueModelRenderers = featureDrawer->opaqueModelRenderers;
std::vector<IWorldObjectModelRenderer*>& cloakedModelRenderers = featureDrawer->cloakedModelRenderers;
const CFeatureDrawer::DrawQuad* dq = &(*drawQuads)[y * drawQuadsX + x];
for (std::set<CFeature*>::const_iterator fi = dq->features.begin(); fi != dq->features.end(); ++fi) {
CFeature* f = (*fi);
if (f->IsInVoid())
continue;
assert(f->def->drawType == DRAWTYPE_MODEL);
if (gu->spectatingFullView || f->IsInLosForAllyTeam(gu->myAllyTeam)) {
if (drawReflection) {
float3 zeroPos;
if (f->midPos.y < 0.0f) {
zeroPos = f->midPos;
} else {
const float dif = f->midPos.y - camera->GetPos().y;
zeroPos =
camera->GetPos() * (f->midPos.y / dif) +
f->midPos * (-camera->GetPos().y / dif);
}
if (ground->GetApproximateHeight(zeroPos.x, zeroPos.z, false) > f->drawRadius) {
continue;
}
}
if (drawRefraction) {
if (f->pos.y > 0.0f)
continue;
}
const float sqDist = (f->pos - camera->GetPos()).SqLength();
const float farLength = f->sqRadius * unitDrawer->unitDrawDistSqr;
#ifdef USE_GML
if (statFeatures && (f->reclaimLeft < 1.0f || f->resurrectProgress > 0.0f))
statFeatures->push_back(f);
#endif
if (sqDist < farLength) {
float sqFadeDistE;
float sqFadeDistB;
if (farLength < sqFadeDistEnd) {
sqFadeDistE = farLength;
sqFadeDistB = farLength * sqFadeDistBegin / sqFadeDistEnd;
} else {
sqFadeDistE = sqFadeDistEnd;
sqFadeDistB = sqFadeDistBegin;
}
if (sqDist < sqFadeDistB) {
cloakedModelRenderers[MDL_TYPE(f)]->DelFeature(f);
if (camera->InView(f->drawMidPos, f->drawRadius))
opaqueModelRenderers[MDL_TYPE(f)]->AddFeature(f);
} else if (sqDist < sqFadeDistE) {
const float falpha = 1.0f - (sqDist - sqFadeDistB) / (sqFadeDistE - sqFadeDistB);
opaqueModelRenderers[MDL_TYPE(f)]->DelFeature(f);
if (camera->InView(f->drawMidPos, f->drawRadius))
cloakedModelRenderers[MDL_TYPE(f)]->AddFeature(f, falpha);
}
} else {
if (farFeatures) {
farTextureHandler->Queue(f);
}
}
}
}
}