java3d
  1. java3d
  2. JAVA3D-638

ObjectFile should allow to build geometry that is NOT 'BY_REFERENCE'

    Details

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

      Operating System: All
      Platform: All

    • Issuezilla Id:
      638

      Description

      For consistency, ObjectFile.java should default to BY_COPY geometry, or at least
      allow this to be specified in the constructor, as with other properties, like
      TRIANGULATE.

      This can be accomplished by changing line 1195:

      shape.setGeometry(gi.getGeometryArray(true, true, false));
      to
      shape.setGeometry(gi.getGeometryArray(false, false, false));

      Trivial fix is ready.

        Activity

        Hide
        mcneillk added a comment -

        Fix ready.

        Show
        mcneillk added a comment - Fix ready.
        Hide
        aces added a comment -

        Hi

        Would be interesting to check if it reduces memory usage on very large models.

        There is a possibility it breaks some applications with access Object's
        geometries and try to read/change it as BY_Reference. A counter argument is
        that ObjectFile doesn't specify the Geometry vertex format and programmer should
        check it at runtime.

        Show
        aces added a comment - Hi Would be interesting to check if it reduces memory usage on very large models. There is a possibility it breaks some applications with access Object's geometries and try to read/change it as BY_Reference. A counter argument is that ObjectFile doesn't specify the Geometry vertex format and programmer should check it at runtime.
        Hide
        mcneillk added a comment -

        I understand your feedback.

        For me, it is really a question of consistency; that is that all other loaders
        use the 'default' behavior of Java 3D, which is BY_COPY. Wanting to change the
        geometry at runtime BY_REFERENCE is an explicit declaration that requires an
        GeometryUpdater, etc.

        In addition however, there is the potential for memory problems with
        BY_REFERENCE, chiefly Java 3D is known to keep references to the reference
        array, requiring calls like 'setCoordRefFloat(null);' to clean-up.

        I would like us to consider these issues.

        Show
        mcneillk added a comment - I understand your feedback. For me, it is really a question of consistency; that is that all other loaders use the 'default' behavior of Java 3D, which is BY_COPY. Wanting to change the geometry at runtime BY_REFERENCE is an explicit declaration that requires an GeometryUpdater, etc. In addition however, there is the potential for memory problems with BY_REFERENCE, chiefly Java 3D is known to keep references to the reference array, requiring calls like 'setCoordRefFloat(null);' to clean-up. I would like us to consider these issues.
        Hide
        mcneillk added a comment -

        Integrated.

        Show
        mcneillk added a comment - Integrated.
        Hide
        mcneillk added a comment -

        Will close soon.

        Show
        mcneillk added a comment - Will close soon.
        Hide
        mcneillk added a comment -

        Checked-in

        Show
        mcneillk added a comment - Checked-in

          People

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

            Dates

            • Created:
              Updated:
              Resolved: