java3d
  1. java3d
  2. JAVA3D-555

Muting a PointSound causes a ClassCastException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: 1.5.2
    • Component/s: j3d-core
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      555

      Description

      Calling setMute(...) on a PointSound or ConeSound results in:

      Exception in thread "J3D-SoundStructureUpdateThread-1"
      java.lang.ClassCastException: java.lang.Boolean cannot be cast to
      javax.vecmath.Point3f
      at javax.media.j3d.PointSoundRetained.updateMirrorObject
      (PointSoundRetained.java:258)
      at javax.media.j3d.SoundStructure.changeNodeAttrib
      (SoundStructure.java:338)
      at javax.media.j3d.SoundStructure.processMessages
      (SoundStructure.java:95)
      at javax.media.j3d.StructureUpdateThread.doWork
      (StructureUpdateThread.java:83)
      at javax.media.j3d.J3dThread.run(J3dThread.java:256)

      This is a result of SoundRetained.MUTE_DIRTY_BIT and
      SoundRetained.POSITION_DIRTY_BIT having the same value, resulting in lines 256
      to 262 of PointSoundRetained being executed when they should not when muting a
      sound.

      I have a simple test case to attach.

      A simple fix/workaround would be to change lines 258 to 259 to:

      if (o instanceof Point3f){
      point.position = (Point3f)objs[4];
      point.getLastLocalToVworld().transform(point.position,
      point.xformPosition);
      }

        Activity

        Hide
        dutchiedave added a comment -

        Created an attachment (id=336)
        A Zip file containing a netbeans 5.5.1 project which displays the issue

        Show
        dutchiedave added a comment - Created an attachment (id=336) A Zip file containing a netbeans 5.5.1 project which displays the issue
        Hide
        dutchiedave added a comment -

        Sorry, that should read:

        A simple fix/workaround would be to change lines 258 to 259 to:

        Object o = objs[4];
        if (o instanceof Point3f)

        { point.position = (Point3f)objs[4]; point.getLastLocalToVworld().transform(point.position, point.xformPosition); }
        Show
        dutchiedave added a comment - Sorry, that should read: A simple fix/workaround would be to change lines 258 to 259 to: Object o = objs [4] ; if (o instanceof Point3f) { point.position = (Point3f)objs[4]; point.getLastLocalToVworld().transform(point.position, point.xformPosition); }
        Hide
        kcr added a comment -

        Set target milestone to 1.5.2 and assign to jada

        Show
        kcr added a comment - Set target milestone to 1.5.2 and assign to jada
        Hide
        jada added a comment -

        Fixed! Thanks to dutchiedave.

        Show
        jada added a comment - Fixed! Thanks to dutchiedave.

          People

          • Assignee:
            jada
            Reporter:
            dutchiedave
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: