I have included the code that I tried to compile, but apparently you can't inherit
from RotPosScalePathInterpolator, is that right? Anyway, I'm not sure the best way to
do this, but I'm going to try to inherit from the Alpha class. I appreciate any
suggestions.
Jason
class SequentialRPSI extends RotPosScalePathInterpolator
{
protected SequentialRPSI m_nextAnimation;
public void setNext(SequentialRPSI s)
{
m_nextAnimation = s;
}
public void initializeAnimation()
{
Transform3D t3d = new Transform3D();
super.getTarget().getTransform(t3d);
Vector3f v3f = new Vector3f();
t3d.get(v3f);
super.setPosition(0, new Point3f(v3f));
/* Rest of Initialization */
}
public void startAnimation()
{
m_nextAnimation.initializeAnimation();
m_nextAnimation.getAlpha().setStartTime(System.currentTimeMillis());
m_nextAnimation.setEnable(true);
}
public void processStimulus( Enumeration enum ) {
super.processStimulus( enum );
if(getAlpha().finished())
{
m_nextAnimation.startAnimation();
}
}
}
On Fri, 1 Sep 2000 08:07:09 -0700, Paul Byrne <[EMAIL PROTECTED]> wrote:
>Hi Joel,
>
>The other way to determine when an Alpha is finished is to write your
>own Subclass of Alpha and overide the method value() to check for
>completion and call your listener.
>
>Rgds
>
>Paul
>
>
>>MIME-Version: 1.0
>>Date: Fri, 1 Sep 2000 08:25:18 -0400
>>From: "J. Lee Dixon" <[EMAIL PROTECTED]>
>>Subject: [JAVA3D] Interpolator completion event
>>To: [EMAIL PROTECTED]
>>
>>Does anybody know an easy way to be notified when an interpolator has
>>completed? The way I figure it, I could watch the Alpha that I supply
>>to the interpolator to see when it has Alpha.finished(). But this would
>>mean making my own Behavior to be triggered every frame to watch it. It
>>would make much more sense to have an interface called an
>>InterpolatorListener. The interpolators should notice when their Alpha
>>has .finished(), and then tell any listeners about it...
>>
>>... or at the least, there is a WakeupOnBehaviorPost. The interpolator
>>could post a message saying that it's alpha has finished using the
>>Behavior.postID() function.
>>
>>After thinking this through, I think I could extend the interpolator
>>like below. Anybody at SUN interested in this?
>>
>>interface InterpolatorListener
>>{
>> abstract public void InterpolatorCompleted();
>>}
>>
>>class PositionInterpolatorWithEvent extends PositionInterpolator
>>{
>> // constructors...
>>
>> public void setListener(InterpolatorListener listener)
>> {
>> // do stuff
>> }
>>
>> // override the processStimulus function...
>> public void processStimulus(java.util.Enumeration criteria)
>> {
>> super.processStimulus(criteria);
>> if( (super.getAlpha()).finished() )
>> {
>> myListener.InterpolatorCompleted();
>> }
>> }
>>}
>>
>>J. Lee Dixon
>>Software Engineer
>>SAIC - Celebration, FL
>>[EMAIL PROTECTED]
>>
>>===========================================================================
>>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".
>
>----------------------------------------------------------
>Paul Byrne Email : [EMAIL PROTECTED]
>Sun Microsystems Phone : (650) 786 9926
>Visualization Software Group Fax : (650) 786 5852
>----------------------------------------------------------
>
> ==========================================================================
>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".