Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007353opensim[REGION] Script Functionspublic2014-10-20 11:522015-06-04 17:09
Reporterkcozens 
Assigned Tonebadon 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0007353: llGetGeometricCenter() returns the wrong vector.
DescriptionThe 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.
Steps To ReproduceRez 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.
Additional InformationI have only tested this in the 0.8-post-fixes branch of Open Simulator.
TagsNo tags attached.
Git Revision or version number0.8-post-fixes branch
Run Mode Grid (1 Region per Sim)
Physics EngineBulletSim
EnvironmentMono / Windows
Mono VersionNone
Viewer
Attached Filestxt file icon Test script - llGetGeometricCenter.txt [^] (737 bytes) 2014-10-20 11:52 [Show Content]
xml file icon llGetGeometricCenter.xml [^] (39,868 bytes) 2014-10-20 11:57
patch file icon 0001-Implement-llGetGeometricCenter-correctly.patch [^] (2,141 bytes) 2015-04-30 22:05 [Show Content]

- Relationships

-  Notes
(0026956)
kcozens (administrator)
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 (administrator)
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 (reporter)
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 (administrator)
2015-05-04 10:36

patch applied to master git > http://opensimulator.org/viewgit/?a=commit&p=opensim&h=5a2440dfdf4a4ab769692330f6d4f98521e271ce [^]

- Issue History
Date Modified Username Field Change
2014-10-20 11:52 kcozens New Issue
2014-10-20 11:52 kcozens File Added: Test script - llGetGeometricCenter.txt
2014-10-20 11:57 kcozens Note Added: 0026956
2014-10-20 11:57 kcozens File Added: llGetGeometricCenter.xml
2014-10-20 12:07 kcozens Note Added: 0026957
2015-04-30 15:47 Magnuz Note Added: 0028149
2015-04-30 15:47 Magnuz Status new => patch included
2015-04-30 15:48 Magnuz File Added: 0001-Implement-llGetGeometricCenter-correctly.patch
2015-04-30 22:05 Magnuz File Deleted: 0001-Implement-llGetGeometricCenter-correctly.patch
2015-04-30 22:05 Magnuz File Added: 0001-Implement-llGetGeometricCenter-correctly.patch
2015-04-30 22:08 Magnuz Note Edited: 0028149 View Revisions
2015-05-04 10:36 nebadon Note Added: 0028181
2015-05-04 10:36 nebadon Status patch included => resolved
2015-05-04 10:36 nebadon Resolution open => fixed
2015-05-04 10:36 nebadon Assigned To => nebadon
2015-06-04 17:09 Robert Adams Status resolved => closed


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker