Changed idle simulate call to 16msecs (which will set avatar mixer rate at 60FPS), further small stats improvements

This commit is contained in:
Philip Rosedale 2013-05-01 22:40:38 -07:00
parent e2cc9d792c
commit 900caa6278

View file

@ -15,7 +15,7 @@
// Welcome Aboard! // Welcome Aboard!
// //
// //
// Keyboard Commands: // Keyboard Commands:
// //
// / = toggle stats display // / = toggle stats display
// spacebar = reset gyros/head position // spacebar = reset gyros/head position
@ -134,7 +134,7 @@ VoxelSystem voxels;
Audio audio(&audioScope, &myAvatar); Audio audio(&audioScope, &myAvatar);
#endif #endif
#define IDLE_SIMULATE_MSECS 8 // How often should call simulate and other stuff #define IDLE_SIMULATE_MSECS 16 // How often should call simulate and other stuff
// in the idle loop? // in the idle loop?
// Where one's own agent begins in the world (needs to become a dynamic thing passed to the program) // Where one's own agent begins in the world (needs to become a dynamic thing passed to the program)
@ -228,22 +228,23 @@ void displayStats(void)
drawtext(10, statsVerticalOffset + 15, 0.10f, 0, 1.0, 0, stats); drawtext(10, statsVerticalOffset + 15, 0.10f, 0, 1.0, 0, stats);
std::stringstream voxelStats; std::stringstream voxelStats;
voxelStats << "Voxels Rendered: " << voxels.getVoxelsRendered() << " Updated: " << voxels.getVoxelsUpdated(); voxelStats.precision(4);
voxelStats << "Voxels Rendered: " << voxels.getVoxelsRendered()/1000.f << "K Updated: " << voxels.getVoxelsUpdated()/1000.f << "K";
drawtext(10, statsVerticalOffset + 230, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); drawtext(10, statsVerticalOffset + 230, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str());
voxelStats.str(""); voxelStats.str("");
voxelStats << "Voxels Created: " << voxels.getVoxelsCreated() << " (" << voxels.getVoxelsCreatedPerSecondAverage() voxelStats << "Voxels Created: " << voxels.getVoxelsCreated()/1000.f << "K (" << voxels.getVoxelsCreatedPerSecondAverage()/1000.f
<< "/sec) "; << "Kps) ";
drawtext(10, statsVerticalOffset + 250, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); drawtext(10, statsVerticalOffset + 250, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str());
voxelStats.str(""); voxelStats.str("");
voxelStats << "Voxels Colored: " << voxels.getVoxelsColored() << " (" << voxels.getVoxelsColoredPerSecondAverage() voxelStats << "Voxels Colored: " << voxels.getVoxelsColored()/1000.f << "K (" << voxels.getVoxelsColoredPerSecondAverage()/1000.f
<< "/sec) "; << "Kps) ";
drawtext(10, statsVerticalOffset + 270, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); drawtext(10, statsVerticalOffset + 270, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str());
voxelStats.str(""); voxelStats.str("");
voxelStats << "Voxels Bytes Read: " << voxels.getVoxelsBytesRead() voxelStats << "Voxel Bits Read: " << voxels.getVoxelsBytesRead() * 8.f / 1000000.f
<< " (" << voxels.getVoxelsBytesReadPerSecondAverage() * 8.f / 1000000.f << " Mbps)"; << "M (" << voxels.getVoxelsBytesReadPerSecondAverage() * 8.f / 1000000.f << " Mbps)";
drawtext(10, statsVerticalOffset + 290,0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); drawtext(10, statsVerticalOffset + 290,0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str());
voxelStats.str(""); voxelStats.str("");
@ -251,13 +252,13 @@ void displayStats(void)
? ((float) voxels.getVoxelsBytesRead() / voxels.getVoxelsColored()) ? ((float) voxels.getVoxelsBytesRead() / voxels.getVoxelsColored())
: 0; : 0;
voxelStats << "Voxels Bytes per Colored: " << voxelsBytesPerColored; voxelStats << "Voxels Bits per Colored: " << voxelsBytesPerColored * 8;
drawtext(10, statsVerticalOffset + 310, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); drawtext(10, statsVerticalOffset + 310, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str());
Agent *avatarMixer = AgentList::getInstance()->soloAgentOfType(AGENT_TYPE_AVATAR_MIXER); Agent *avatarMixer = AgentList::getInstance()->soloAgentOfType(AGENT_TYPE_AVATAR_MIXER);
char avatarMixerStats[200]; char avatarMixerStats[200];
if (avatarMixer) { if (avatarMixer) {
sprintf(avatarMixerStats, "Avatar Mixer - %.f kbps, %.f pps", sprintf(avatarMixerStats, "Avatar Mixer: %.f kbps, %.f pps",
roundf(avatarMixer->getAverageKilobitsPerSecond()), roundf(avatarMixer->getAverageKilobitsPerSecond()),
roundf(avatarMixer->getAveragePacketsPerSecond())); roundf(avatarMixer->getAveragePacketsPerSecond()));
} else { } else {