Index: src/celengine/body.cpp =================================================================== --- src/celengine/body.cpp (revision 4069) +++ src/celengine/body.cpp (working copy) @@ -48,6 +48,8 @@ locations(NULL), locationsComputed(false), referenceMarks(0), + clickable(1), + visibleAsPoint(1), frameRefStar(NULL) { system = _system; @@ -827,7 +829,18 @@ } +void Body::setClickable(bool _clickable) +{ + clickable = _clickable ? 1 : 0; +} + +void Body::setVisibleAsPoint(bool _visibleAsPoint) +{ + visibleAsPoint = _visibleAsPoint ? 1 : 0; +} + + /**** Implementation of PlanetarySystem ****/ PlanetarySystem::PlanetarySystem(Body* _primary) : primary(_primary) @@ -997,3 +1010,4 @@ return completion; } + Index: src/celengine/solarsys.cpp =================================================================== --- src/celengine/solarsys.cpp (revision 4069) +++ src/celengine/solarsys.cpp (working copy) @@ -354,7 +354,7 @@ return NULL; } - double radius = (double)body->getRadius(); + double radius = (double) body->getRadius(); planetData->getNumber("Radius", radius); body->setRadius((float) radius); @@ -388,7 +388,7 @@ } else { - if(radius < 1000.0) + if (radius < 1000.0) classification = Body::Asteroid; else classification = Body::Planet; @@ -597,6 +597,12 @@ } } } + + bool clickable = true; + if (planetData->getBoolean("Clickable", clickable)) + { + body->setClickable(clickable); + } return body; } Index: src/celengine/body.h =================================================================== --- src/celengine/body.h (revision 4069) +++ src/celengine/body.h (working copy) @@ -215,6 +215,11 @@ void addLocation(Location*); Location* findLocation(const std::string&, bool i18n = false) const; void computeLocations(); + + bool isClickable() const { return clickable == 1; } + void setClickable(bool _clickable); + bool isVisibleAsPoint() const { return visibleAsPoint == 1; } + void setVisibleAsPoint(bool _visibleAsPoint); enum { @@ -273,6 +278,8 @@ mutable bool locationsComputed; uint32 referenceMarks; + unsigned int clickable : 1; + unsigned int visibleAsPoint : 1; // Only necessary until we switch to using frame hierarchy Star* frameRefStar; Index: src/celengine/universe.cpp =================================================================== --- src/celengine/universe.cpp (revision 4069) +++ src/celengine/universe.cpp (working copy) @@ -317,7 +317,7 @@ PlanetPickInfo* pickInfo = (PlanetPickInfo*) info; // Reject invisible bodies and bodies that don't exist at the current time - if (body->getClassification() == Body::Invisible || !body->extant(pickInfo->jd)) + if (body->getClassification() == Body::Invisible || !body->extant(pickInfo->jd) || !body->isClickable()) return true; Point3d bpos = body->getHeliocentricPosition(pickInfo->jd); @@ -363,6 +363,7 @@ // Test for intersection with the bounding sphere if (body->getClassification() != Body::Invisible && body->extant(pickInfo->jd) && + body->isClickable() && testIntersection(pickInfo->pickRay, Sphered(bpos, radius), distance)) { if (body->getModel() == InvalidResource)