Hi Anders:

   The class RotPosScaleTCBSplinePathInterpolator

fail to duplicate the two attributes

Alpha alpha, TCBKeyFrame keys[] of its parent class

 TCBSplinePathInterpolator

since the parent class did not implement

 public void duplicateNode(Node originalNode, boolean forceDuplicate)


To fix the problem,


Please add the following function in TCBSplinePathInterpolator.java


    public void duplicateNode(Node originalNode, boolean forceDuplicate) {
        super.duplicateNode(originalNode, forceDuplicate);
        TCBSplinePathInterpolator originalSpline = (TCBSplinePathInterpolator)
originalNode;
        setAlpha(originalSpline.getAlpha());
        keysLength = originalSpline.keysLength;
        keyFrames = new TCBKeyFrame[keysLength];
        System.arraycopy(originalSpline.keyFrames, 0,
                         keyFrames, 0, keysLength);
    }


(You can find the source code of j3d utility in the distribution)


This bug will be fix in FCS version (but not in the upcoming v1.2 beta2).

Thanks for your bug report.

- Kelvin

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


>X-Originating-IP: [137.222.217.98]
>Mime-Version: 1.0
>Date: Sat, 18 Mar 2000 18:32:39 CET
>From: Anders Breivik <[EMAIL PROTECTED]>
>Subject: [JAVA3D] cloneTree and TCBSplinePathInterpolator  !!!!
>To: [EMAIL PROTECTED]
>
>Hello everyone!
>
>I've got a java3d problem which really starts to annoy me, can anyone please
>help me with the following:
>
>I've got a scene with a number of objects. Some of these objects have
>assosiated interpolators (RotPosScaleTCBSplinePathInterpolator)
>which create animations. The scene is loaded from lightwave (using
>lw3dLoader) which creates a BranchGroup representing the entire scene.
>I've used cloneTree to make a copy of this BranchGroup. (I whish to do this
>because I do not want to reload the entire scene each time my game is
>restarted.) The problem is that the cloned branchgroup does NOT contain the
>TCBKeyFrame data which makes TCBSplinePathInterpolator and
>RotPosScaleTCBSplinePathInterpolator work! The game starts up, but no
>objects in the scene are moving. It then gives a NullPointerException
>because the TBCKeyFrame array kontaines no data - no frames! Whats going
>on????? Am I missing something important or is  this a BUG?
>
>I tried to work around this by accessing the TCBKeyFrame field 'keyFrames'
>but it is protected wihtin the class TCBSplinePathInterpolator
>
>Help, Help... What should I do?
>
>
>Regards
>Anders
>
>
>
>
>
>
>
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>
>===========================================================================
>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".

===========================================================================
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".

Reply via email to