public boolean isPlaceEmpty(Vector2 pos, boolean considerPlanets) { Planet np = myPlanetManager.getNearestPlanet(pos); if (considerPlanets) { boolean inPlanet = np.getPos().dst(pos) < np.getFullHeight(); if (inPlanet) return false; } SolSystem ns = myPlanetManager.getNearestSystem(pos); if (ns.getPos().dst(pos) < SunSingleton.SUN_HOT_RAD) return false; List<SolObject> objs = myObjectManager.getObjs(); for (int i = 0, objsSize = objs.size(); i < objsSize; i++) { SolObject o = objs.get(i); if (!o.hasBody()) continue; if (pos.dst(o.getPos()) < myObjectManager.getRadius(o)) { return false; } } List<FarObjData> farObjs = myObjectManager.getFarObjs(); for (int i = 0, farObjsSize = farObjs.size(); i < farObjsSize; i++) { FarObjData fod = farObjs.get(i); FarObj o = fod.fo; if (!o.hasBody()) continue; if (pos.dst(o.getPos()) < o.getRadius()) { return false; } } return true; }
public void draw(SolGame game, GameDrawer drawer) { SolCam cam = game.getCam(); Vector2 camPos = cam.getPos(); Planet p = game.getPlanetMan().getNearestPlanet(); Vector2 pPos = p.getPos(); float toCamLen = camPos.dst(pPos); float vd = cam.getViewDist(); float gh = p.getMinGroundHeight(); if (toCamLen < gh + vd) { float sz = gh; drawer.draw(myTex, sz * 2, sz * 2, sz, sz, pPos.x, pPos.y, p.getAngle(), SolColor.W); } }