Increased the deep sky object octree size (and thus the max draw distance) to 100 Gly.

ver1_5_1
Chris Laurel 2007-05-24 17:35:40 +00:00
parent 1ad7bcbcc9
commit 8efed8353d
3 changed files with 12 additions and 5 deletions

View File

@ -36,8 +36,10 @@
using namespace std;
static const float DSO_OCTREE_ROOT_SIZE = 1.8e9f;
static const float DSO_OCTREE_MAGNITUDE = 12.0f;
// 100 Gly - on the order of the current size of the universe
const float DSO_OCTREE_ROOT_SIZE = 1.0e11f;
static const float DSO_OCTREE_MAGNITUDE = 8.0f;
static const float DSO_EXTRA_ROOM = 0.01f; // Reserve 1% capacity for extra DSOs
// (useful as a complement of binary loaded DSOs)
@ -381,7 +383,11 @@ void DSODatabase::buildOctree()
{
DPRINTF(1, "Sorting DSOs into octree . . .\n");
float absMag = astro::appToAbsMag(DSO_OCTREE_MAGNITUDE, DSO_OCTREE_ROOT_SIZE * (float) sqrt(3.0));
DynamicDSOOctree* root = new DynamicDSOOctree(Point3d(1000, 1000, 1000), absMag); //TODO: center??
// TODO: investigate using a different center--it's possible that more
// objects end up straddling the base level nodes when the center of the
// octree is at the origin.
DynamicDSOOctree* root = new DynamicDSOOctree(Point3d(0, 0, 0), absMag);
for (int i = 0; i < nDSOs; ++i)
{
root->insertObject(DSOs[i], DSO_OCTREE_ROOT_SIZE);

View File

@ -23,6 +23,8 @@
static const unsigned int MAX_DSO_NAMES = 10;
extern const float DSO_OCTREE_ROOT_SIZE;
//NOTE: this one and starDatabase should be derived from a common base class since they share lots of code and functionality.
class DSODatabase
{

View File

@ -53,7 +53,6 @@ using namespace std;
#endif
static const float STAR_DISTANCE_LIMIT = 1.0e6f;
static const double DSO_DISTANCE_LIMIT = 1.8e9;
static const int REF_DISTANCE_TO_SCREEN = 400; //[mm]
// Distance from the Sun at which comet tails will start to fade out
@ -7103,7 +7102,7 @@ class DSORenderer : public ObjectRenderer<DeepSkyObject*, double>
DSORenderer::DSORenderer() :
ObjectRenderer<DeepSkyObject*, double>(DSO_DISTANCE_LIMIT),
ObjectRenderer<DeepSkyObject*, double>(DSO_OCTREE_ROOT_SIZE),
frustum(degToRad(45.0f), 1.0f, 1.0f)
{
}