本文整理汇总了C++中Navigator::get_JDay方法的典型用法代码示例。如果您正苦于以下问题:C++ Navigator::get_JDay方法的具体用法?C++ Navigator::get_JDay怎么用?C++ Navigator::get_JDay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigator
的用法示例。
在下文中一共展示了Navigator::get_JDay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
// Draw all the stars
double HipStarMgr::draw(Core* core, ToneReproductor* eye, Projector* prj)
{
Navigator* nav = core->getNavigation();
current_JDay = nav->get_JDay();
// If stars are turned off don't waste time below
// projecting all stars just to draw disembodied labels
if(!starsFader.getInterstate()) return 0.;
prj->set_orthographic_projection();
int max_search_level = getMaxSearchLevel(eye, prj);
const GeodesicSearchResult* geodesic_search_result = core->getGeodesicGrid()->search(prj->unprojectViewport(),max_search_level);
mag_converter->setFov(prj->get_fov());
mag_converter->setEye(eye);
// Set temporary static variable for optimization
if (flagStarTwinkle) twinkle_amount = twinkleAmount;
else twinkle_amount = 0;
const float names_brightness = names_fader.getInterstate()
* starsFader.getInterstate();
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
// Bind the star texture
starTexture->bind();
// Set the draw mode
glBlendFunc(GL_ONE, GL_ONE);
// draw all the stars of all the selected zones
float rcmag_table[2*256];
//static int count = 0;
//count++;
for (ZoneArrayMap::const_iterator it(zone_arrays.begin());
it!=zone_arrays.end();it++) {
const float mag_min = 0.001f*it->second->mag_min;
// if (maxMag < mag_min) break;
const float k = (0.001f*it->second->mag_range)/it->second->mag_steps;
for (int i=it->second->mag_steps-1;i>=0;i--) {
const float mag = mag_min+k*i;
// Compute the equivalent star luminance for a 5 arc min circle
// and convert it in function of the eye adaptation
// rmag_table[i] =
// eye->adaptLuminance(std::exp(-0.92103f*(mag + 12.12331f)) * 108064.73f)
// * std::pow(prj->getFov(),-0.85f) * 70.f;
if (mag_converter->computeRCMag(mag,getFlagPointStar(),eye,
rcmag_table + 2*i) < 0) {
if (i==0) goto exit_loop;
}
if (getFlagPointStar()) {
rcmag_table[2*i+1] *= starsFader.getInterstate();
} else {
rcmag_table[2*i] *= starsFader.getInterstate();
}
}
last_max_search_level = it->first;
unsigned int max_mag_star_name = 0;
if (names_fader.getInterstate()) {
int x = (int)((maxMagStarName-mag_min)/k);
if (x > 0) max_mag_star_name = x;
}
int zone;
for (GeodesicSearchInsideIterator it1(*geodesic_search_result,it->first);
(zone = it1.next()) >= 0;) {
it->second->draw(zone,true,rcmag_table,prj,
max_mag_star_name,names_brightness,
starFont,starTexture);
}
for (GeodesicSearchBorderIterator it1(*geodesic_search_result,it->first);
(zone = it1.next()) >= 0;) {
it->second->draw(zone,false,rcmag_table,prj,
max_mag_star_name,names_brightness,
starFont,starTexture);
}
}
exit_loop:
prj->reset_perspective_projection();
return 0.;
}