Added the Clickable property for deep sky objects.

ver1_6_1
Chris Laurel 2008-09-09 20:48:28 +00:00
parent c5a6543a49
commit 8dac3c6931
3 changed files with 13 additions and 3 deletions

View File

@ -33,7 +33,8 @@ DeepSkyObject::DeepSkyObject() :
radius(1),
absMag(DSO_DEFAULT_ABS_MAGNITUDE),
infoURL(NULL),
visible(true)
visible(true),
clickable(true)
{
}
@ -181,5 +182,11 @@ bool DeepSkyObject::load(AssociativeArray* params, const string& resPath)
setVisible(visible);
}
bool clickable = true;
if (params->getBoolean("Clickable", clickable))
{
setClickable(clickable);
}
return true;
}

View File

@ -58,6 +58,8 @@ class DeepSkyObject
bool isVisible() const { return visible; }
void setVisible(bool _visible) { visible = _visible; }
bool isClickable() const { return clickable; }
void setClickable(bool _clickable) { clickable = _clickable; }
virtual const char* getObjTypeName() const = 0;
@ -88,6 +90,7 @@ class DeepSkyObject
std::string* infoURL;
bool visible : 1;
bool clickable : 1;
};
typedef std::vector<DeepSkyObject*> DeepSkyCatalog;

View File

@ -787,7 +787,7 @@ DSOPicker::DSOPicker(const Point3d& pickOrigin,
void DSOPicker::process(DeepSkyObject* const & dso, double, float)
{
if (!(dso->getRenderMask() & renderFlags))
if (!(dso->getRenderMask() & renderFlags) || !dso->isVisible() || !dso->isClickable())
return;
Vec3d relativeDSOPos = dso->getPosition() - pickOrigin;
@ -857,7 +857,7 @@ void CloseDSOPicker::process(DeepSkyObject* const & dso,
double distance,
float)
{
if (distance > maxDistance || !(dso->getRenderMask() & renderFlags))
if (distance > maxDistance || !(dso->getRenderMask() & renderFlags) || !dso->isVisible() || !dso->isClickable())
return;
double distanceToPicker = 0.0;