Thank you for your response.

I still have a problem. I get a DanglingReferenceException when I put
updateNodeReferences() in my behavior.

Would it be possible to refer me to an example of cloning a Behavior, or
show me what the cloneNode and updateNodeReferences functions should look
like for this simple example.

-----Original Message-----
From: Kelvin Chung [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 18, 2000 9:39 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Using CloneNode on Behavior


Hi Dave,

  You should use the following callback to retrieve the cloned copy of
TransformGroup which Behavior refer to:


 public void updateNodeReferences(NodeReferenceTable referenceTable) {
         super.updateNodeReferences(referenceTable);

         newTransformGroup = (TransformGroup)
                    referenceTable.getNewObjectReference(oldTransformGroup);
         ....

  }

- Kelvin

---------------
Java 3D Team
Sun Microsystems Inc.

>I have a Behavior similar to a RotationInterpolator which given a
>TransformGroup changes the transform. I want to clone a BranchGroup which
>contains the Behavior and the TransformGroup.
>
>        BranchGroup
>                |
>                /\
>             /  \
>    Behavior   TransformGroup
>
>The documentation says you must include in your class:
>
>     public Node cloneNode(boolean forceDuplicate) {
>         UserSubClass usc = new UserSubClass();
>         usc.duplicateNode(this, forceDuplicate);
>         return usc;
>     }
>
>
>If my initial constructor was :
>SimpleRotateBehavior b = new SimpleRotationBehavior(TransformGroup tg);
>
>I assume you replace UserSubClass with SimpleRotateBehavior but how do you
>get the cloned TransformGroup to give to the cloned Behavior.
>
>I think I might be missing something fundamental here, so any help or any
>starting point would be greatly appreciated.
>
>Thanks in advance,
>
>Dave.
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff JAVA3D-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".

SimpleRotate.java

Reply via email to