Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. PrintBoundingBox() // Written by KyleFlynn.
  2. // The bounding box is a strange thing:
  3. // It is the negative (0) and positive (1) corners, measured relative to the root's center.
  4. // For a linkset, regardless of which key is used, it's always the bounding box for the entire linkset, and always relative to the root.
  5. // The center of the root is always the reference point (even if it's far from the centroid of the linkset).
  6. // If the root isn't in the center of the linkset, the magnitude of each of the two vectors will be different.
  7. // The rotation of the root (but not children) is removed.
  8. // In other words, a single 0.5^3 cube will always have bounds of <-0.25,-0.25,-0.25> & <0.25,0.25,0.25> regardless of rotation.
  9. // Also, rotating the entire linkset of a linkset doesn't change the bounding box.
  10. // However, when only one child (non-root) is rotated, it is highly likely that this rotation will change the bounding box.
  11. {
  12. list lBoundingBoxVectors = llGetBoundingBox(llGetKey());
  13. vector vHi = llList2Vector(lBoundingBoxVectors, 1);
  14. vector vLo = llList2Vector(lBoundingBoxVectors, 0);
  15. llOwnerSay("\nHi: " + (string)vHi + "\nLo: " + (string)vLo);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement