Mike,
sorry I missed to add that in my
example code! Of course I've set the scheduling bounds to
"myBehaviour.setSchedulingBounds(new Point3d(0.0d,0.0d,0.0d), 3000.0d);" for
testing! When I choose "this.wakeupOn(new WakeupOnElapsedFrames(0));" then
processStimulus is started every frame! But wehen I choose wakeupOnAWTEvent
nothing happens!!!
Thank you for your interest! Every
answer is welcome ;)!
Sincerely,
Johannes
Neubauer
-----Ursprüngliche
Nachricht-----
Von: Discussion list for Java 3D
API [mailto:[EMAIL PROTECTED]]
Im Auftrag von Mike Pilone
Gesendet: Freitag, 15. August 2003
15:51
An:
[EMAIL PROTECTED]
Betreff: Re: [JAVA3D] Behaviour
processStimulus doesn't start
Johannes,
You need to set the scheduling
bounds of the behavior. Try something
like:
myBehavior.setSchedulingBounds(new
Point3d(), Double.MAX_VALUE);
-mike
On Fri, 2003-08-15 at 09:28,
Johannes
Neubauer wrote:
>Â Â Â Â Â Â Â Â
Hello again,
>
>
>
>Â Â Â Â Â Â Â Â
I’ve written my own Behaviour class which should wake up
on
>Â Â Â Â Â Â Â Â
“WakeupOnAWTEvent(KeyEvent.KEY_PRESSED)â€. The
“initialize();â€
>Â Â Â Â Â Â Â Â
method starts (I’ve checked with a print), but the
>Â Â Â Â Â Â Â Â
“processStimulus()†method never starts. I’ve checked
the
>Â Â Â Â Â Â Â Â
Tutorial but I’ve set a really big BoundingSphere as
>Â Â Â Â Â Â Â Â
schedulingBounds (for try) and I added it to the
>Â Â Â Â Â Â Â Â
TransformGroup it changes (not to the root), so that the
>Â Â Â Â Â Â Â Â
schedulingBounds isn’t needed, is it? I checked, if
he
>Â Â Â Â Â Â Â Â
Behaviour is live and yes it is. So what’s going
wrong?
>
>
>
>Â Â Â Â Â Â Â Â
The code looks like that (not exactly):
>
>
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
In the behavior class:
>
>
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
//BEGIN OF CODE
>
>
>
>Â
       private
targetTG;
>
>
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
public MyBehavior(TransformGroup targetTG)Â {
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
this.targetTG = targetTG;
>
>Â Â Â Â Â Â Â Â
}
>
>
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
public void initialize() {
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
System.out.println("initialize"); //is
>Â Â Â Â Â Â Â Â
printed
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
this.wakeupOn(new
>Â Â Â Â Â Â Â Â
WakeupOnAWTEvent(KeyEvent.KEY_PRESSED));
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
}
>
>Â Â Â Â Â Â Â Â
public void processStimulus() {
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
//make something
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
System.out.println(“processStimulusâ€);
//isn’t
>Â Â Â Â Â Â Â Â
printed!!!!
>
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
this.wakeupOn(new
>Â Â Â Â Â Â Â Â
WakeupOnAWTEvent(KeyEvent.KEY_PRESSED));
>
>Â Â Â Â Â Â Â Â
}
>
>Â Â Â Â Â Â Â Â
//END OF CODE
>
>
>
>Â Â Â Â Â Â Â Â
In the main class:
>
>
>
>Â Â Â Â Â Â Â Â
//BEGIN OIF CODE
>
>Â Â Â Â Â Â Â Â
BranchGroup bg = new BranchGroup();
>
>Â Â Â Â Â Â Â Â
TransformGroup targetTG = new TransformGroup();
>
>Â Â Â Â Â Â Â Â
targetTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
>
>
>
>Â Â Â Â Â Â Â Â
bg.addChild(targetTG);
>
>Â Â Â Â Â Â Â Â
MyBehavior myB = new MyBehavior(targetTG);
>
>
>
>Â Â Â Â Â Â Â Â
targetTG.addChild(myB);
>
>
>
>Â Â Â Â Â Â Â Â
bg.compile();
>
>
>
>Â Â Â Â Â Â Â Â
UniverseBuilder myUniverse = new UniverseBuilder(); //a
class
>Â Â Â Â Â Â Â Â
from me
>
>Â Â Â Â Â Â Â Â
myUniverse.addBranchGraph(bg);
>
>
>
>Â Â Â Â Â Â Â Â
System.out.println(myB.isLive()); //prints out true!!!
>
>Â Â Â Â Â Â Â Â
//END OF CODE
>
>
>
>Â Â Â Â Â Â Â Â
Every help is welcome ;)!
>
>Â Â Â Â Â Â Â Â
Thank you very much,
>
>Â Â Â Â Â Â Â Â
Sincerely,
>
>Â Â Â Â Â Â Â Â
Johannes
Neubauer
>
>
>
>Â Â Â Â Â Â Â Â
P.S.: According to my last mail: I don’t think Java is
slow.
>Â Â Â Â Â Â Â Â
But there ARE rumors AND Java is slower than C or C++. On
the
>Â Â Â Â Â Â Â Â
other hand, programming with Java is much more fun. I
didn’t
>Â Â Â Â Â Â Â Â
want to hurt anyone’s deep connection to this language I
love
>Â Â Â Â Â Â Â Â
it, too! ;)
>
>
>
>
>
======================================================================
> ===== 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".
--
Mike Pilone <mpilone at botch
dot 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".