Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008747opensim[REGION] Physics Enginespublic2020-08-16 14:422021-12-27 12:56
ReporterJeffKelley 
Assigned ToJeffKelley 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOperating SystemOperating System Version
Product Version 
Target VersionFixed in Version 
Summary0008747: [BulletSim] llApplyImpulse broken since 0.9.1.1
DescriptionI'm lagging behind my test duty and I just discovered that llApplyImpulse seems to do nothing under BulletSim since 0.9.1.1 and up to current master.
Steps To ReproduceTest scipt :


vector force = < 0, 500, 500 >;

default
{
    state_entry()
    {
        llSay(0, "Script reset");
        llSetStatus(STATUS_PHYSICS, FALSE);
        llSetColor (<0.5,0.5,1.0>, ALL_SIDES);
    }

    touch_start (integer n)
    {
        llSetStatus(STATUS_PHYSICS, TRUE);
        llSetColor (<1.0,0.0,0.0>, ALL_SIDES);
        llApplyImpulse(force, TRUE);
        llSetTimerEvent (3);
     }

    timer ()
    {
        llResetScript();
    }
    
}
Additional InformationMore elaborate script and visual result:
http://www.pescadoo.net/tmp/bullet.png [^]



vector HSV_TO_RGB (vector c1){
// vector c1; // HSVcolor (.x=H, .y=S, .z=V)
    vector c2; // RGBcolor (.x=R, .y=G, .z=B)
    integer i;
    float hue;
    float f;
    float p;
    float q;
    float t;

    hue = c1.x / 60.0;
    i = (integer)hue;
    f = hue - i;

    p = c1.z * (1.0 - c1.y);
    q = c1.z * (1.0 - c1.y * f);
    t = c1.z * (1.0 - c1.y + c1.y * f);

    if (i == 0) {
        c2.x = c1.z;
        c2.y = t;
        c2.z = p;
    }
    else if (i == 1) {
        c2.x = q;
        c2.y = c1.z;
        c2.z = p;
    }
    else if (i == 2) {
        c2.x = p;
        c2.y = c1.z;
        c2.z = t;
    }
    else if (i == 3) {
        c2.x = p;
        c2.y = q;
        c2.z = c1.z;
    }
    else if (i == 4) {
        c2.x = t;
        c2.y = p;
        c2.z = c1.z;
    }
    else if (i == 5) {
        c2.x = c1.z;
        c2.y = p;
        c2.z = q;
    }

    return c2;
}


list trail(vector color) {
    return [
        PSYS_PART_FLAGS, PSYS_PART_EMISSIVE_MASK,
        PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP,
        PSYS_PART_START_SCALE, <.3,.3, 0>,
        PSYS_PART_START_COLOR, color,
        PSYS_SRC_BURST_PART_COUNT, 1,
        PSYS_SRC_BURST_RATE, 0.02,
        PSYS_PART_MAX_AGE, 20.0
     ];
}

float alpha = 60; // Par rapport au plan horizontal
vector posit = < 100, 240, 24 >;
vector force = < 0, 0, 7 >;
string region;


Reset() {
    llOwnerSay ("Physics engine : "
        +osGetPhysicsEngineName());

    llSetStatus(STATUS_PHYSICS, FALSE);
    llSetColor (<0.5,0.5,1.0>, ALL_SIDES);
    vector rot = < 0, 90-alpha, 0 >;
    llSetRot (llEuler2Rot(rot*DEG_TO_RAD));
    llSetRegionPos (posit);
    llParticleSystem ([]);
}

Launch() {
    region = llGetRegionName();
    llSetStatus(STATUS_PHYSICS, TRUE);
    llSetColor (<1.0,0.0,0.0>, ALL_SIDES);
    llApplyImpulse(force, TRUE);
    float hue = llFrand (360.0);
    vector rgb = HSV_TO_RGB(<hue,1.0,1.0>);
    llParticleSystem (trail(rgb));
    llSleep (0.1); Sample();
}

Ground() {
    string landing_region = llGetRegionName();
    if (landing_region != region)
        llOwnerSay (landing_region);

    llResetScript();
}


Sample() {
    vector speed = llGetVel ();
    float mass = llGetMass ();
    float impu = llVecMag (force);
    float mvel = llVecMag (speed);
    float velo = impu/mass;

    float port = (velo * velo) * llSin (2 * alpha) / 9.81;

    llOwnerSay ((string) [" impu=",impu," mass=",mass," velo=",
                velo," (computed) ", mvel," (measured)"," port=", port]);
}




default {

    state_entry() {
        Reset();
    }

    touch_start(integer n) {
        Launch();
    }

    land_collision(vector pos) {
        Ground();
    }

}



Tested today on

Sanbox Plaza (ODE) : correct behaviour.
Sanbox Plaza II (BulletSim) : fails to move.
Sanbox Plaza III (ubODE) : correct behaviour.

You may have to adjust vector force to account for physics differences, and vector posit for home point.


Unfortunately, I am not set up for testing master right now (test grid under migration). Sorry for that.
TagsNo tags attached.
Git Revision or version number2476d711c4
Run Mode Grid (1 Region per Sim)
Physics EngineBulletSim
Script EngineXEngine
EnvironmentUnknown
Mono VersionNone
Viewer
Attached Files

- Relationships

-  Notes
(0036710)
JeffKelley (reporter)
2020-08-16 14:44

Note: what you see on the picture is 0.9.0.0 Bullet front, and Snail Dev ubODE back.
(0036711)
tampa (reporter)
2020-08-16 20:47

Pardon the question but what exactly seems broken to you? Expected vs. actual behavior

Outside of behavioral differences between the engines they seem to work fine, I been using that function to build a freefall tower, that still works as well.

There was a typo in Bullet that was fixed some two years ago or so I think, could be another small typo messing up some calculations, but pinpointing that may take time without more information.
(0036712)
JeffKelley (reporter)
2020-08-16 21:57

You are welcome to ask, I should have been more specific.
Broken means no effect. The prim won't move at all.
(0036713)
tampa (reporter)
2020-08-17 02:06

I tested the more elaborate version under YEngine in both ubODE and Bullet. In Bullet it indeed just falls to the ground. Script engine seems independent from it as XEngine and Bullet produce the same falling.

I am not sure if fixes the Bullet are likely to happen, have not seen misterblue around much, probably best to go over the mailing list. Setting to confirm for now.
(0036716)
JeffKelley (reporter)
2020-08-17 02:41
edited on: 2020-08-17 02:44

ubODE is a better choice for that kind of experiments. If you look at the example picture http://www.pescadoo.net/tmp/bullet.png [^] , you will see that Bullet has TWO solutions for the same initial impulse : red, yellow and green particle trails being the first one, blue the second one. Not very deterministic.

ubODE don't have this issue. Maybe it's time to push it as the default.

I report because it is a regression (and no one likes regressions).

(0038303)
JeffKelley (reporter)
2021-12-27 12:56

Tested again in 0.9.2.0 Yeti Dev 2021-11-30-249f0fc and working as expected. Closing

- Issue History
Date Modified Username Field Change
2020-08-16 14:42 JeffKelley New Issue
2020-08-16 14:44 JeffKelley Note Added: 0036710
2020-08-16 20:47 tampa Note Added: 0036711
2020-08-16 21:57 JeffKelley Note Added: 0036712
2020-08-17 02:06 tampa Note Added: 0036713
2020-08-17 02:06 tampa Status new => confirmed
2020-08-17 02:41 JeffKelley Note Added: 0036716
2020-08-17 02:44 JeffKelley Note Edited: 0036716 View Revisions
2020-08-17 02:44 JeffKelley Note Edited: 0036716 View Revisions
2021-12-27 12:56 JeffKelley Note Added: 0038303
2021-12-27 12:56 JeffKelley Status confirmed => resolved
2021-12-27 12:56 JeffKelley Resolution open => fixed
2021-12-27 12:56 JeffKelley Assigned To => JeffKelley


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker