本文整理汇总了C++中Atomic::getGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ Atomic::getGeometry方法的具体用法?C++ Atomic::getGeometry怎么用?C++ Atomic::getGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Atomic
的用法示例。
在下文中一共展示了Atomic::getGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderInstance
void ObjectRenderer::renderInstance(InstanceObject* instance,
RenderList& outList) {
const auto& atomic = instance->getAtomic();
if (!atomic) {
return;
}
// Only draw visible objects
if (!instance->getVisible()) {
return;
}
auto modelinfo = instance->getModelInfo<SimpleModelInfo>();
// Handles times provided by TOBJ data
const auto currentHour = m_world->getHour();
if (modelinfo->timeOff < modelinfo->timeOn) {
if (currentHour >= modelinfo->timeOff &&
currentHour < modelinfo->timeOn)
return;
} else {
if (currentHour >= modelinfo->timeOff ||
currentHour < modelinfo->timeOn)
return;
}
float mindist = glm::length(instance->getPosition() - m_camera.position) /
kDrawDistanceFactor;
if (mindist > modelinfo->getLargestLodDistance()) {
culled++;
return;
}
if (modelinfo->isBigBuilding() &&
mindist < modelinfo->getNearLodDistance() &&
mindist < kMagicLODDistance) {
auto related = modelinfo->related();
if (!related || related->isLoaded()) {
culled++;
return;
}
}
Atomic* distanceatomic =
modelinfo->getDistanceAtomic(mindist / kDrawDistanceFactor);
if (!distanceatomic) {
return;
}
if (atomic->getGeometry() != distanceatomic->getGeometry()) {
atomic->setGeometry(distanceatomic->getGeometry());
}
// Render the atomic the instance thinks it should be
renderAtomic(atomic.get(), glm::mat4(), instance, outList);
}