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

Reply via email to