Uploaded image for project: 'Snowstorm'
  1. Snowstorm
  2. STORM-1915

Vector math updates

    XMLWordPrintableJSON

    Details

    • Type: Defect
    • Status: Closed
    • Priority: Minor
    • Resolution: Released
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      SL Release 3.4.0
      (link to test viewer later)
    • Test Plan:
      Hide

      Moon Metty added a comment - 15/Oct/12 2:33 AM

      Test: Edit linked prims numerically.

      The following test has a very different outcome in the viewer with the normalized PackToVector3.

      Create two prims.
      Link the two prims.
      Check "Edit linked".
      Select the root, and set rotation to <180, 0, 271>.
      Select the child, and set Z-rotation to 1.00

      Observe: In the original viewer, the X- and Y-rotation fall over to 359.95 The error is large enough to overcome the rounding in two fields at once. Again, this is caused by passing a badly normalized quaternion to PackToVector3, it doesn't happen in the patched viewer.

      =======

      Other parts of the viewer code are vulnerable to bad normalization too. For example the quaternion to matrix conversion, and getAngleAxis.
      A simple way to test the linkset errors is to add the straight-angles-script to the childprim.
      Set the root to any angle, then set the child to a straight angle.

      Root <1, 0, 0> Child <0, 0, 0> ---> 0.001541 degrees
      Root <1, 0, 1> Child <0, 0, 0> ---> 0.002136 degrees
      Root <1, 0, 1> Child <90, 0, 90> ---> 0.002136 degrees
      Root <45, 0, 120> Child <180, 0, 0> ---> 0.004181 degrees

      The fix in PackToVector3 solves the largest problems, but there's another source of noise (at a lower level, but more common).

      Show
      Moon Metty added a comment - 15/Oct/12 2:33 AM Test: Edit linked prims numerically. The following test has a very different outcome in the viewer with the normalized PackToVector3. Create two prims. Link the two prims. Check "Edit linked". Select the root, and set rotation to <180, 0, 271>. Select the child, and set Z-rotation to 1.00 Observe: In the original viewer, the X- and Y-rotation fall over to 359.95 The error is large enough to overcome the rounding in two fields at once. Again, this is caused by passing a badly normalized quaternion to PackToVector3, it doesn't happen in the patched viewer. ======= Other parts of the viewer code are vulnerable to bad normalization too. For example the quaternion to matrix conversion, and getAngleAxis. A simple way to test the linkset errors is to add the straight-angles-script to the childprim. Set the root to any angle, then set the child to a straight angle. Root <1, 0, 0> Child <0, 0, 0> ---> 0.001541 degrees Root <1, 0, 1> Child <0, 0, 0> ---> 0.002136 degrees Root <1, 0, 1> Child <90, 0, 90> ---> 0.002136 degrees Root <45, 0, 120> Child <180, 0, 0> ---> 0.004181 degrees The fix in PackToVector3 solves the largest problems, but there's another source of noise (at a lower level, but more common).

      Description

      Steps to Reproduce

      Repository: https://bitbucket.org/MartinRJ/bug-540

      Actual Behavior

      This is a Jira for Math Updates from Moon Metty.
      Reviewed by Chieron Tenk.

      Expected Behavior

      Codereview link: https://codereview.secondlife.com/r/606/

      Other information

      Improved functions:
      getEulerAngles ( now: setQuat(F32 roll, F32 pitch, F32 yaw) )
      packToVector3
      getAngleAxis
      setAngleAxis
      shortestArc
      projected_vec
      angle_between

      see http://jira.phoenixviewer.com/browse/FIRE-7989
      and http://jira.phoenixviewer.com/browse/FIRE-7997

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              martinrj.fayray MartinRJ Fayray
              Contributor:
              Moon Metty
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: