Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PrintBoundingBox() // Written by KyleFlynn.
- // The bounding box is a strange thing:
- // It is the negative (0) and positive (1) corners, measured relative to the root's center.
- // 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.
- // The center of the root is always the reference point (even if it's far from the centroid of the linkset).
- // If the root isn't in the center of the linkset, the magnitude of each of the two vectors will be different.
- // The rotation of the root (but not children) is removed.
- // 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.
- // Also, rotating the entire linkset of a linkset doesn't change the bounding box.
- // However, when only one child (non-root) is rotated, it is highly likely that this rotation will change the bounding box.
- {
- list lBoundingBoxVectors = llGetBoundingBox(llGetKey());
- vector vHi = llList2Vector(lBoundingBoxVectors, 1);
- vector vLo = llList2Vector(lBoundingBoxVectors, 0);
- llOwnerSay("\nHi: " + (string)vHi + "\nLo: " + (string)vLo);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement