secondlife / secondlife/viewer

Particles on child prims are not interpolated properly

Open
#959 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug stale team:viewer
Dominant language
C++
Stars
299
Forks
146
Avg merge
1d 9h
Merged PRs (30d)
88

Description

If a child prim in a linkset has a particle effect and the child prim moves individually, i.e. not via motion or TargetOmega of the root prim, the particles are not interpolated unlike the child prim's own motion.

Steps to reproduce: make a linkset with 2 cubes, make prim 2 50% transparent so you can see the particles inside it.

Insert the following script in the root:


default

{

    state_entry()

    {

        integer MOVE_ROOT = FALSE; // set to TRUE to move the root, which has no interpolation issues

        llLinkParticleSystem(2, [ // set up child prim particle system

            PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP,

            PSYS_SRC_TEXTURE, "82e7dccf-5717-2601-05a2-0c6b86182b8e",

            PSYS_PART_MAX_AGE, 3/30.0,

            PSYS_SRC_BURST_RATE, 1/30.0,

            PSYS_SRC_BURST_PART_COUNT, 1,

            PSYS_PART_FLAGS,

                PSYS_PART_FOLLOW_SRC_MASK | // can comment out the follow_src, the issue persists

                PSYS_PART_EMISSIVE_MASK

        ]);

        float t;

        integer target = 2; // set up movement params

        vector base = ZERO_VECTOR;

        if(MOVE_ROOT) {

            base = llGetPos();

            target = LINK_ROOT;

            llSetLinkPrimitiveParamsFast(2, [PRIM_POS_LOCAL, <0, 1, 0>]);

        }

        while(TRUE) {

            llSetLinkPrimitiveParamsFast(target, [PRIM_POS_LOCAL, base+<0, llCos(t), llSin(t)>]);

            t += 0.07;

            if(t >= TWO_PI)

                t -= TWO_PI;

            llSleep(0.1);

        }

    }

}

You can see the particle blob will jitter and be ahead of the child prim's motion, not interpolated: it immediately snaps to the prim's true position instead of moving smoothly.

By setting the MOVE_ROOT to TRUE at the start of the script, it will move the root prim instead. The child prim particles are now interpolated correctly and follow the child prim's motion smoothly.

https://secondlife.canny.io/admin/board/bug-reports/p/particles-on-child-prims-are-not-interpolated-properly

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified in the issue. Start by running the supplied LSL reproduction using llLinkParticleSystem and llSetLinkPrimitiveParamsFast, comparing child-prim movement with root movement. Done means particles attached to a moving child prim are interpolated smoothly rather than snapping ahead to its true position.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.