MantisBT - opensim
View Issue Details
0008011opensim[REGION] Physics Enginespublic2016-08-26 17:592017-12-26 14:52
Kayaker Magic 
Robert Adams 
normalmajoralways
assignedfixed 
OSgridOpenSim 0.90.9 Dev OSgrid
 
0.9.0 
Grid (1 Region per Sim)
BulletSim
Mono / Linux64
3.0
FireStorm
0008011: BulletSim fails to send land_collision messages on some terrain
Sometimes a falling physical object lands on the ground, stops there but fails to send land_collision_start messages to the script. It apparently does detect the collision, because the object stops and does not fall through the ground. But it never sends any land collision events to the script. I've had cannonballs land on the ground, fail to explode then skitter around on the ground like a drop of water on a hot frying pan until finally getting a land_collision_start a minute later.

This is a rare event that I think only happens on ground with a particular slope. So to reproduce the problem, I wrote a script that rezzes bullets over a random area. Set this experiment up over rough terrain and eventually bullets will land in places where they get stuck. I also think I see bullets bouncing, as if they bounce off some spots in the land without sending land_collision_start messages.

To reproduce this problem: put the bullet script in a 0.1x0.1x0.1 sphere. Mark it PHYSICAL but not TEMPORARY this time, you want them to hang around once they get stuck. Take the bullet prim into inventory. Put it inside another prim along with the frying pan script below. Move the frying pan script above an area with rough slope. Try areas that drop off rapidly, they often get stuck as the slope increases.
//bullet script
//put this in a prim, mark the prim as PHYSICAL
//put the resulting prim in the inventory of a prim with the the frying pan script below
default
{
    collision_start(integer num)
    {
        llOwnerSay("start hit="+llDetectedName(0));
        llDie();
    }
    land_collision_start(vector pos)
    {
        llOwnerSay("land pos="+(string)pos);
        llDie();
    }


//frying pan
//rezzes objects over a random area to catch the ones that fail to detect land collisions
//put a bullet object in the prim with this script
//move it over an area that has rough terrain
default
{
    state_entry()
    {
        llSetTimerEvent(0.5);
    }
    timer()
    {
        vector del=<llFrand(1.0)+1.0,0,0>*llEuler2Rot(<0,0,llFrand(TWO_PI)>);
        llRezObject(llGetInventoryName(INVENTORY_OBJECT,0), //first object in inventory
                    llGetPos()+<0,0,-.19>+del, //randomly nearby
                    ZERO_VECTOR,ZERO_ROTATION,0); //standing still
    }
}
No tags attached.
Issue History
2016-08-26 17:59Kayaker MagicNew Issue
2016-09-27 11:40Robert AdamsAssigned To => Robert Adams
2016-09-27 11:40Robert AdamsStatusnew => assigned
2017-08-14 22:14Robert AdamsNote Added: 0032251
2017-12-26 11:44Kayaker MagicResolutionopen => fixed
2017-12-26 11:44Kayaker MagicFixed in Version => 0.9.0
2017-12-26 14:52Robert AdamsNote Added: 0032477

Notes
(0032251)
Robert Adams   
2017-08-14 22:14   
This problem seems to be caused by terrain height calculation being different for the simulator vs the physics engine. That is, the simulator thinks the object is below the terrain so it moves it up but the physics engine never sees the object hit the terrain so no collision.

This problem happens on steep/rough terrain and especially with small objects.

I've added code to the BulletSim2017 source branch which has made the problem much better but not completely fixed. This branch will probably be merged into master soon.
(0032477)
Robert Adams   
2017-12-26 14:52   
The BulletSim2017 branch has been merged into master and I believe this Mantis problem has been made a lot better. There will still be side cases on very rough terrain, but, for most uses, it seems to be working.