Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007820opensim[REGION] OpenSim Corepublic2016-01-23 04:202016-06-27 02:22
Assigned ToDiva 
PlatformPCOperating SystemWindowsOperating System VersionSeven
Product Versionmaster (dev code) 
Target VersionFixed in Versionmaster (dev code) 
Summary0007820: osNpcSit does not work well in actual 0.9.x
DescriptionLook at the screenshot
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineBulletSim
Script Engine
Environment.NET / Windows32
Mono VersionNone
ViewerFirestorm, Singularity
Attached Filesjpg file icon osNpcSit.jpg [^] (155,536 bytes) 2016-01-23 04:20

jpg file icon MANTIS7820.jpg [^] (44,964 bytes) 2016-02-26 16:42

- Relationships
related to 0007903closedmelanie Avatars float over seats, LegacySitOffsets has no effect 

-  Notes
Mata Hari (reporter)
2016-01-23 08:11

It's not just osNpcSit()'s every single sit target of any type in any existing script or object. Opensim 0.9 has changed the calculation for seated position resulting in all of those to become broken. From what I can tell, it is simply reverting the 0.15m change that was made about 4 years ago when everything got broken the last time (when it was said the change was essential to have Opensim behave like SL...I don't know what the reason is behind it this time...probably to have it behave like Avination).
Bruce (reporter)
2016-01-24 08:29
edited on: 2016-01-24 08:37

It's no only that. All my scripts used to move the avatar away from the sit object on standing up, now with 0.9 the avatar stands on the object. This results in tall avatars (>1.90m) getting their upper body stuck in the ceiling of the buildings. The switch in the .ini file [1] that supposedly should disable the new settings is not doing anything.

[1] LegacySitOffsets = true/false

JeffKelley (reporter)
2016-02-26 16:42
edited on: 2016-02-26 16:43

The offset is exactly +10 cm as can be seen in the second picture. The blue prim is 0.1 height. Left region runs 367b7d7 (0.9). Right region runs bcb27d4 (a.k.a. Dev, pre-avination merge). And yes, this is for all avatars. Not NPC only.

Bruce (reporter)
2016-02-27 09:49

Thank you Jeff.

Questions for UbitUmarov:

Any chance of fixing the LegacySitOffsets switch that is in the OpenSimDefaults.ini file in the Regions section ?

What was changed that makes avatars and NPCs stand on a sit prim instead of next to it as worked prior to the Avination merge ?

Can sits no longer be set by scripts that were SL and OS compatible before that merge ?

I appreciate all the time you spent on the merger and I will greatly appreciate if you could answer my questions.
Mandarinka Tasty (reporter)
2016-05-08 14:46


I have compared last version: opensim-0.9.0-309-g1e44aba


Appropriate part of the code, that is responsible for SitTargetAvatar

we can find in ScenePresence.cs file.

I. Version 0.9.0-309-g1e44aba

Please notice, that LegacySitOffsets is defined as:

public bool LegacySitOffsets = true; in Scene.cs

Hence we realise what logical value of LegacySitOffsets , simulator sets as default

Next, we can notice:

LegacySitOffsets = startupConfig.GetBoolean("LegacyOpenSimSitOffsets", LegacySitOffsets);

That means, to make some changings, we must use variable:

LegacyOpenSimSitOffsets = true or false,depends on what we want.

If this variable is not set in OpenSim.ini ( OpenSimDefaults.ini ),

then simulator takes default:

public bool LegacySitOffsets = true

Next, the most important :

                        //Maths here

                        double offset = 0.05;

                        sitOffset = up * (float)offset;

                        //maths here
                        sitOffset = up * Appearance.AvatarHeight * 0.02638f;

So we can see, what is difference between LegacySitOffsets, enabled and disabled, that is seen in vector sitOffset,

and now, for both cases:

we have:

Vector3 newPos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT;


public static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.0f, 0.0f, 0.4f);

II version osgrid-opensim-10212015.v0.8.3.41b2855

I write only appropriate , important moments:

double offset = 0.05;

Vector3 sitOffset = up * (float)offset;

Vector3 newPos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset; !!!

Can you see here difference ?

That is not, in my opinion problem in LegacySitOffest wrongly defined in 0.9.0

but here:

Vector3 newPos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset; <- 0.8.3

Vector3 newPos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT; <-- 0.9.0

in old version there is subtraction, not addition.

I have only analysed this code.

Maybe someone could compile last 0.9.0 version with such new setting in


Vector3 newPos = sitTargetPos - sitOffset + SIT_TARGET_ADJUSTMENT;

and observe , if it helps or not.
Mandarinka Tasty (reporter)
2016-05-08 14:54
edited on: 2016-05-08 15:12

Since this difference: +0.1m = 10cm, you can see, because:

that is distance bettween x = -0.05 and x= +0.05, where 0.05 = offset.

For me that is pure algebra.

And that is why setting:

LegacyOpenSimSitOffsets = true or LegacyOpenSimSitOffsets = false

does not help in any case, because we have addition for both cases 0.9.0

and in 0.8.3, there is subtraction in this vector newPos

JeffKelley (reporter)
2016-05-08 17:04

I can confirm that flipping the sign restores the 0.8 behaviour.

ScenePresence.cs, line 3378:
  Vector3 newPos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT;
  Vector3 newPos = sitTargetPos - sitOffset + SIT_TARGET_ADJUSTMENT;

However, this is a quick tests with the default (Ruth) avatar and need to be more extensively tested. Also, we still have the LegacySitOffsets / LegacyOpensimSitOffsets mismatch.

Current master is 1e44aba.
djphil (reporter)
2016-05-25 02:28

I have also found, in addition to the already mentioned position shift above, I sit a npc with a script and it plays an animation npc sit or sit random animation in this case if i wait a little or if i change my position camera, then my npc really takes a strange position, completely shifted to the initial position of the animation played.
Mandarinka Tasty (reporter)
2016-05-25 05:08
edited on: 2016-05-25 05:09

Hello Dj !

All things related to SitOffsets have been normalised so far

and there has been offered certain solution of it for now.

And You can read everything about it here: [^]

This thing, you have noticed and reported concerning inappropriate seeing

of animations after changing position of the camera etc, refers

to other aspect.

i have been meeting such "problems" for many years in SL and other virtual worlds.

typical situation-scenario is:

a couple dance together, assume using the most popular Intan system in SL.

If one person will be using camera around and next , after pressing Esc button,

returns to initial position, all dance animations start to be seen

not synchronised. adn that thing is based on the way , how animations work.

Animations are loaded to the viewer's cache, that makes seeing them be individual process of the user =

Persons can see the same animation in different way, delays, lack of synchro,

And server of region, in our case, opensim server has not really influence

how fast the animation has been loaded to cache fo the viewer and can't cure

eventual lack of synchro later.

So in my modest opinion, there is no actually method to improve it.

I also notice such "problem" and i cure it in such way: i press ctrl+S in firestorm viewer, to synchronise seeing animations.

and because such trick has been offered by Friestorm team in sl, not just onyl for opensim,

that shows , problem is common.

djphil (reporter)
2016-05-28 04:18

It works again alot better now
It seems back to normal
Bruce (reporter)
2016-05-28 20:10

Thank you for everybody who contributed to make the LegacySitOffsets work.

However, my scripts used to move the avatar away from the sit object on standing up, now with 0.9 the avatar stands on the object. This results in tall avatars (>1.90m) getting their upper body stuck in the ceiling of the buildings.

Perhaps this should be reported in a separate mantis ?
Diva (administrator)
2016-06-21 09:50

Can we close this mantis?
JeffKelley (reporter)
2016-06-21 09:54

IMHO yes, since 0.8 legacy sit is now working.
Bruce (reporter)
2016-06-21 12:13
edited on: 2016-06-21 12:14

The legacy sit issue is fixed but, if a script that worked in 0.8 now generates different results under 0.9, would that not indicate that there is a regression somewhere in the code that affects that script ?

Mata Hari (reporter)
2016-06-21 13:14

Bruce, the decision appears to have been made that if you want to use the new method for calculating sit position you will need to completely redo all of your objects' sit targets or scripted sit positions to make them compliant with the new method. If you want to avoid having to do all of that work, you can disable it by using the Opensim.ini setting to use legacy sits. Compatibility between the result of the new and old methods has been deemed unimportant.

Personally, I still don't understand the reasoning behind breaking a vast amount of existing content in this way without there being a driving need to do so, and particularly where the new method also produces results that do not mirror those when used in SL.
Bruce (reporter)
2016-06-21 15:06

Mata, I had great hopes that the script would work again once legacy sits was fixed. I have LegacySitOffsets = true in the .ini file, but unfortunately that did not solve the problem. I think llGetCameraRot incorrectly positions the avatar on standing up. The culprit is somewhere in that portion of the script:

control( key id, integer L, integer E )
        vector dir;
        rotation rot=llGetCameraRot();
        if (L&CONTROL_FWD) dir+=llRot2Fwd(rot)*.01;
        if (L&CONTROL_BACK) dir-=llRot2Fwd(rot)*.01;
        if (L&CONTROL_ROT_LEFT) dir+=llRot2Left(rot)*.01;
        if (L&CONTROL_ROT_RIGHT) dir-=llRot2Left(rot)*.01;
        if (L&CONTROL_UP) dir+=llRot2Up(rot)*.01;
        if (L&CONTROL_DOWN) dir-=llRot2Up(rot)*.01;
        if (llVecDist(dir,home_pos)<2)

I agree with your comments and like you, I don't understand the reasoning that led to the breaking of so many existing content. It is really sad to see that the doctrine of items shared between Opensim and SL should behave the same on both platforms (something proclaimed in another mantis) is not being respected. So, if the result of redoing the scripts to accommodate the new method for calculating sit positions is not reflecting SL behaviour, then what is the point of this exercise.

But then one has to be realistic, what is the point of spending time in fixing this if only a few people are using a script that positions an avatar on standing up next to and not on top of the prim that contains the sit script.
Diva (administrator)
2016-06-21 20:46

djphil (reporter)
2016-06-27 02:22

It works well now, thank you

- Issue History
Date Modified Username Field Change
2016-01-23 04:20 djphil New Issue
2016-01-23 04:20 djphil File Added: osNpcSit.jpg
2016-01-23 08:11 Mata Hari Note Added: 0030016
2016-01-24 08:29 Bruce Note Added: 0030021
2016-01-24 08:37 Bruce Note Edited: 0030021 View Revisions
2016-02-26 16:42 JeffKelley File Added: MANTIS7820.jpg
2016-02-26 16:42 JeffKelley Note Added: 0030051
2016-02-26 16:43 JeffKelley Note Edited: 0030051 View Revisions
2016-02-27 09:49 Bruce Note Added: 0030052
2016-05-08 00:26 JeffKelley Relationship added related to 0007903
2016-05-08 14:46 Mandarinka Tasty Note Added: 0030285
2016-05-08 14:54 Mandarinka Tasty Note Added: 0030286
2016-05-08 15:12 Mandarinka Tasty Note Edited: 0030286 View Revisions
2016-05-08 17:04 JeffKelley Note Added: 0030287
2016-05-25 02:28 djphil Note Added: 0030380
2016-05-25 05:08 Mandarinka Tasty Note Added: 0030382
2016-05-25 05:09 Mandarinka Tasty Note Edited: 0030382 View Revisions
2016-05-28 04:18 djphil Note Added: 0030383
2016-05-28 20:10 Bruce Note Added: 0030384
2016-06-21 09:50 Diva Note Added: 0030621
2016-06-21 09:54 JeffKelley Note Added: 0030624
2016-06-21 12:13 Bruce Note Added: 0030632
2016-06-21 12:14 Bruce Note Edited: 0030632 View Revisions
2016-06-21 13:14 Mata Hari Note Added: 0030636
2016-06-21 15:06 Bruce Note Added: 0030641
2016-06-21 20:46 Diva Note Added: 0030649
2016-06-21 20:46 Diva Status new => resolved
2016-06-21 20:46 Diva Resolution open => fixed
2016-06-21 20:46 Diva Assigned To => Diva
2016-06-27 02:22 djphil Note Added: 0030795
2016-06-27 02:22 djphil Status resolved => closed
2016-06-27 02:22 djphil Fixed in Version => master (dev code)

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker