Guest User

Untitled

a guest
May 2nd, 2016
106
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static Bounds findVesselBounds(Vessel ves)
  2.         {
  3.             Bounds retB = ves.parts[0].gameObject.GetRendererBounds();
  4.             Vector3 min, max;
  5.             min = retB.min;
  6.             max = retB.max;
  7.             foreach (Part p in ves.parts)
  8.             {
  9.                 Bounds b = p.gameObject.GetRendererBounds();
  10.                 if (b.min.x < retB.min.x) { min.x = b.min.x; }
  11.                 if (b.min.y < retB.min.y) { min.y = b.min.y; }
  12.                 if (b.min.z < retB.min.z) { min.z = b.min.z; }
  13.                 if (b.max.x > retB.max.x) { max.x = b.max.x; }
  14.                 if (b.max.y > retB.max.y) { max.y = b.max.y; }
  15.                 if (b.max.z > retB.max.z) { max.z = b.max.z; }
  16.             }
  17.             retB.SetMinMax(min, max);
  18.             log("VESSEL BOUNDS : " + retB.ToString());
  19.             return retB;
  20.         }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×