MantisBT - opensim
View Issue Details
0007353opensim[REGION] Script Functionspublic2014-10-20 11:522015-06-04 17:09
kcozens 
nebadon 
normalminoralways
closedfixed 
 
 
0.8-post-fixes branch
Grid (1 Region per Sim)
BulletSim
Mono / Windows
None
0007353: llGetGeometricCenter() returns the wrong vector.
The LSL function llGetGeometricCenter() is returning the wrong vector. The attached sample script show the problem and what the expected value is for a given linkset.
Rez a few standard shapes (say 3) with different sizes and arrange them so they aren't all in a straight line. Link the objects together. Put the attached script (Test script - llGetGeometricCenter.txt) in the root prim. Touch the root prim to see the geometric center. The two lines should show the same vector if the LSL function is working correctly.
I have only tested this in the 0.8-post-fixes branch of Open Simulator.
No tags attached.
txt Test script - llGetGeometricCenter.txt (737) 2014-10-20 11:52
http://opensimulator.org/mantis/file_download.php?file_id=4008&type=bug
xml llGetGeometricCenter.xml (39,868) 2014-10-20 11:57
http://opensimulator.org/mantis/file_download.php?file_id=4009&type=bug
patch 0001-Implement-llGetGeometricCenter-correctly.patch (2,141) 2015-04-30 22:05
http://opensimulator.org/mantis/file_download.php?file_id=4175&type=bug
Issue History
2014-10-20 11:52kcozensNew Issue
2014-10-20 11:52kcozensFile Added: Test script - llGetGeometricCenter.txt
2014-10-20 11:57kcozensNote Added: 0026956
2014-10-20 11:57kcozensFile Added: llGetGeometricCenter.xml
2014-10-20 12:07kcozensNote Added: 0026957
2015-04-30 15:47MagnuzNote Added: 0028149
2015-04-30 15:47MagnuzStatusnew => patch included
2015-04-30 15:48MagnuzFile Added: 0001-Implement-llGetGeometricCenter-correctly.patch
2015-04-30 22:05MagnuzFile Deleted: 0001-Implement-llGetGeometricCenter-correctly.patch
2015-04-30 22:05MagnuzFile Added: 0001-Implement-llGetGeometricCenter-correctly.patch
2015-04-30 22:08MagnuzNote Edited: 0028149bug_revision_view_page.php?bugnote_id=28149#r4052
2015-05-04 10:36nebadonNote Added: 0028181
2015-05-04 10:36nebadonStatuspatch included => resolved
2015-05-04 10:36nebadonResolutionopen => fixed
2015-05-04 10:36nebadonAssigned To => nebadon
2015-06-04 17:09Robert AdamsStatusresolved => closed

Notes
(0026956)
kcozens   
2014-10-20 11:57   
I have attached an XML file for use with the Singularity viewer to set up the test case I was using. The expected vector is given in the previously attached script.
(0026957)
kcozens   
2014-10-20 12:07   
Looking at LSL_Api.cs the geometric center appears to be a SOP property. I think it would make more sense if it was a SOG property, or just computed when this function is called.
(0028149)
Magnuz   
2015-04-30 15:47   
(edited on: 2015-04-30 22:08)
In Second Life, llGetGeometricCenter returns the average position offset of all linked parts, including the root prim and seated avatars, relative to the root prim in local coordinates.

In OpenSimulator, llGetGeometricCenter returns the root prim region position.

The attached patch changes the OpenSimulator behavior to be the same as in Second Life.

(edited: changed ambiguous wording in description and updated the patch accordingly)

(0028181)
nebadon   
2015-05-04 10:36   
patch applied to master git > http://opensimulator.org/viewgit/?a=commit&p=opensim&h=5a2440dfdf4a4ab769692330f6d4f98521e271ce [^]