Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008503opensim[REGION] OpenSim Corepublic2019-03-21 14:502020-01-20 08:23
ReporterData Rossini 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformLinuxOSOS Version
Product Version0.9.0.1 
Target VersionFixed in Version 
Summary0008503: When Avi gets up after sitting he makes an unnatural air jump
DescriptionWhen the Avi stands up after sitting, he jumps in the air and eventually gets stuck in the room ceiling in a closed room. The air jump is done under BulletSim as well as under the ODE Physics Engine. At the BulletSim it is striking that the Avi gets stuck. The problem came with OpenSim version 0.9. In version 0.8, the movement was still natural when the Avis stand up.
I have changed the relevant line of the file ScenePresence.cs version 0.9, as it was realized in version 0.8 and recompiled and the problem was gone. I will leave it that way for me.
Steps To ReproduceHave testet with an old 0.8 version on my home grid and on Sandbox Plaza on OSGrid.
Additional InformationMono 4.6, BulletSim, OpenSim 0.9.0.1-1-g6b2da57 2018-06-29
Look at Gif movies/anims and the possible patch.

patch:

--- ScenePresence.cs.ori 2019-03-17 15:41:37.294160558 +0100
+++ ScenePresence.cs 2019-03-17 15:41:37.294160558 +0100
@@ -3211,7 +3211,8 @@ namespace OpenSim.Region.Framework.Scene
                     standRotationZ.Z = 0f;
                 }
 
- Vector3 adjustmentForSitPose = new Vector3(0.75f, 0, m_sitAvatarHeight + .3f) * standRotationZ;
+ //Vector3 adjustmentForSitPose = new Vector3(0.75f, 0, m_sitAvatarHeight + .3f) * standRotationZ;
+ Vector3 adjustmentForSitPose = new Vector3(0.74f, 0f, 0f) * standRotationZ;
 
                 Vector3 standPos = sitPartWorldPosition + adjustmentForSitPose;
                 m_pos = standPos;
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineBulletSim
Script Engine
EnvironmentUnknown
Mono VersionOther
ViewerFirestorm 6.0.2
Attached Fileszip file icon Gif_anims.zip [^] (2,803,104 bytes) 2019-03-21 14:50
patch file icon calmerstandup.patch [^] (1,119 bytes) 2019-03-21 21:51 [Show Content]

- Relationships
has duplicate 0008634new Request a method to set the position of an avatar when standing 

-  Notes
(0034949)
tampa (reporter)
2019-03-21 17:09

If you don't push the avatar up it has the potential to get stuck inside the thing it was sitting on, ideally we would place the avatar outside of the bounding box of a what it has sat on, but maybe not above it.

HOWEVER, adding detection for bounding boxes or potential other prims nearby to keep away from adds massive overhead to the system. I would honestly file this under "won't fix", because to me the current behavior seems the least problematic option.
(0034950)
mewtwo0641 (reporter)
2019-03-21 18:25
edited on: 2019-03-21 18:27

You could try making the object to be sat upon phantom; that way the avatar is more likely to fall through the object as they stand up rather than be ejected/pushed up by it. I've had to do this for a few objects on my grid but for the most part it's a non-issue aside from the oddness of seeing people blast off from their seats when they stand ;)

If you don't prefer the object to be phantom all the time you could have it go phantom via script upon sitting on the object and then after standing up have it go back to non-phantom (perhaps after a wait time of a second or two).

(0034951)
mewtwo0641 (reporter)
2019-03-21 19:03

I wrote a small poseball script to automate the set/unset phantom process. Try it and see if that helps work around the issue:

vector MyOffset = <0.0, 0.0, -0.2>;

string MyTitle = "Sit On Me"; //Set text for pose ball
integer ShowPoseballOnStand = TRUE;

float PhantomTimer = 1.0; //How long to wait until script unsets phantom

string MyAnimation = "";

key SitterKey = NULL_KEY;

//Keeps track of whether object was already phantom before sitting.
//If the object was already phantom then the script won't bother
//to set and unset phantom status since it is already set by default.
integer WasPhantom = FALSE;

Initialize()
{
    ToggleVisible(TRUE);
    
    if(MyAnimation == "" || llGetInventoryType(MyAnimation) == -1)
        MyAnimation = llGetInventoryName(INVENTORY_ANIMATION, 0);
    
    llSitTarget(MyOffset, ZERO_ROTATION);
}

DoAnimation(string anim, integer toggle)
{
    if(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)
    {
        if(toggle)
            llStartAnimation(anim);

        else if(!toggle)
            llStopAnimation(anim);
    }
}

StopAllAnimations()
{
    if(SitterKey != NULL_KEY)
    {
        list anims_playing = llGetAnimationList(SitterKey);
        
        integer i = 0;
        
        for(i; i < llGetListLength(anims_playing); i++)
        {
            DoAnimation(llList2String(anims_playing, i), FALSE);
        }
        
        DoAnimation("stand", TRUE);
        llSleep(0.05);
        DoAnimation("stand", FALSE);
    }
}

ToggleVisible(integer toggle)
{
    if(toggle)
    {
        if(ShowPoseballOnStand)
        {
            llSetText(MyTitle, <1,1,1>, 1.0);
            llSetAlpha(1.0, ALL_SIDES);
        }
        
        if(!ShowPoseballOnStand)
        {
            llSetText(" ", <1,1,1>, 1.0);
            llSetAlpha(0.0, ALL_SIDES);
        }
    }
    
    if(!toggle)
    {
        llSetText(" ", <1,1,1>, 1.0);
        llSetAlpha(0.0, ALL_SIDES);
    }
}

TogglePhantom(integer toggle)
{
    llSetStatus(STATUS_PHANTOM, toggle);
    //llSay(0, "Phantom = " + (string)toggle);
}

default
{
    state_entry()
    {
        Initialize();
    }
    
    on_rez(integer params)
    {
        llResetScript();
    }

    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            if(llAvatarOnSitTarget() != NULL_KEY)
            {
                SitterKey = llAvatarOnSitTarget();
                WasPhantom = llGetStatus(STATUS_PHANTOM);
                ToggleVisible(FALSE);
                llRequestPermissions(SitterKey, PERMISSION_TRIGGER_ANIMATION);
                StopAllAnimations();
            }
            
            else if(llAvatarOnSitTarget() == NULL_KEY)
            {
                ToggleVisible(TRUE);
                SitterKey = NULL_KEY;
                
                if(!WasPhantom)
                {
                    if(PhantomTimer > 0.0)
                        llSetTimerEvent(PhantomTimer);
                        
                    else
                        TogglePhantom(FALSE);
                }
            }
        }
    }
    
    timer()
    {
        llSetTimerEvent(0.0);
        TogglePhantom(FALSE);
    }
    
    run_time_permissions(integer permissions)
    {
        if (permissions & PERMISSION_TRIGGER_ANIMATION)
        {
            if(SitterKey != NULL_KEY)
            {
                StopAllAnimations();
                DoAnimation(MyAnimation, TRUE);
                
                if(!WasPhantom)
                    TogglePhantom(TRUE);
            }
        }
    }
}
(0034952)
BillBlight (developer)
2019-03-21 21:49
edited on: 2019-03-21 21:50

The reason this was done, because in many case when the avatar stands up they could end up half in the ground, and end up being launched due to the physics overlap.

If you want to try it I made a much calmer version that still accomplishes the same thing ..

- Vector3 adjustmentForSitPose = new Vector3(0.75f, 0, m_sitAvatarHeight + .3f) * standRotationZ;
+ Vector3 adjustmentForSitPose = new Vector3(0.74f, 0, m_sitAvatarHeight /2 + .1f) * standRotationZ;

(0034992)
UbitUmarov (administrator)
2019-03-26 10:00

yes there is a little jump by default.
reason it that we do not probe the potential stand position to check if the avatar will fit there, because that is a expensive operation.
physics engines react very badly if we tell them to rez a avatar overlapping another object. Most times you are sling shot to the moon, on the best cases you get stuck.
that little jump reduces the chances of that happening on normal situations.

ubOde is now more gentle on those overlap cases, but still has is moods.
old ode and bullet aren't.
(0035982)
Data Rossini (reporter)
2019-12-12 12:29
edited on: 2019-12-12 13:38

I have it configurable for me in OpenSim.ini with the following few lines in ScenePresence.cs (OpenSim OpenSim 0.9.1.1 Snail Dev from 20191028):

From line 3280:
==================================================
                Vector3 adjustmentForSitPose = new Vector3(0.75f, 0, m_sitAvatarHeight + .3f) * standRotationZ;

                IConfig sconfig = m_scene.Config.Configs["AviStandUp"];
                if (sconfig != null)
                {
                        string mtd = sconfig.GetString("Method", "new");
                        if (mtd == "old")
                                adjustmentForSitPose = new Vector3(0.74f, 0f, 0f) * standRotationZ;
                }

                Vector3 standPos = sitPartWorldPosition + adjustmentForSitPose;
                m_pos = standPos;



====================================
PS: Otherwise the OpenSim 0.9.1.1 runs great.
My respect for the developers and thanks to all contributors.
Time for version 1.0.
Regards Data

(0036129)
UbitUmarov (administrator)
2020-01-20 08:23

did reduce the jump a bit. Let us know if avatar gets stuck or sent to moon using bullet

- Issue History
Date Modified Username Field Change
2019-03-21 14:50 Data Rossini New Issue
2019-03-21 14:50 Data Rossini File Added: Gif_anims.zip
2019-03-21 17:09 tampa Note Added: 0034949
2019-03-21 18:25 mewtwo0641 Note Added: 0034950
2019-03-21 18:27 mewtwo0641 Note Edited: 0034950 View Revisions
2019-03-21 19:03 mewtwo0641 Note Added: 0034951
2019-03-21 21:49 BillBlight Note Added: 0034952
2019-03-21 21:50 BillBlight Note Edited: 0034952 View Revisions
2019-03-21 21:51 BillBlight File Added: calmerstandup.patch
2019-03-26 10:00 UbitUmarov Note Added: 0034992
2019-12-12 02:59 Kayaker Magic Relationship added has duplicate 0008634
2019-12-12 12:29 Data Rossini Note Added: 0035982
2019-12-12 12:45 Data Rossini Note Edited: 0035982 View Revisions
2019-12-12 12:52 Data Rossini Note Edited: 0035982 View Revisions
2019-12-12 13:26 Data Rossini Note Edited: 0035982 View Revisions
2019-12-12 13:32 Data Rossini Note Edited: 0035982 View Revisions
2019-12-12 13:37 Data Rossini Note Edited: 0035982 View Revisions
2019-12-12 13:38 Data Rossini Note Edited: 0035982 View Revisions
2020-01-20 08:23 UbitUmarov Note Added: 0036129


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker