From Second Life Wiki
Revision as of 23:01, 28 February 2012 by Strife Onizuka
|LSL Portal||Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials|
- The "geometric center" is the average of all linked prim centers. Mathematically, it's the root-relative positions of all linked prims in the linkset added together and divided by the number of prims in the linkset.
vector center = ZERO_VECTOR; integer p = llGetNumberOfPrims(); //since we skip the root prim, we can ignore the single prim case. //If we weren't skipping the root, this would be more complicated. integer i = 1; while(i < p) center += llList2Vector(llGetLinkPrimitiveParams(++i, [PRIM_POS_LOCAL]), 0); return center / p;
All Issues~ Search JIRA for related Issues
|SVC-6579||A||Provide better llGetGeometricCenter function.|
function vector llGetGeometricCenter();