Skip to content
lsl.devlsl.devLSL Dev

llGetGeometricCenter

function
Function syntax
vector llGetGeometricCenter();
Returns
vector
Energy
10

Returns a vector representing the geometric center of the object relative to its root prim.

How to use
vector result = llGetGeometricCenter();

The “geometric center” is different from the “center” in viewer’s build tools and also different from what llRezObject considers to be the “center” of a linkset.

Example 1
default
{
touch_start(integer total_number)
{
llOwnerSay("Geometric center of the object relative to the root prim: " + (string)llGetGeometricCenter());
}
}
  • 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.
  • SVC-6579: Provide better llGetGeometricCenter function.
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.