When I created my own camera-based view behavior, I found that
setEnable() didn't work as I expected. Apparently, all of the events
that occur when a Behavior is disabled are queued. When it is
re-enabled, it processes those events and acts on them. Thus, setEnable
is more like a pause or suspend.
To get around this, I overrode the setEnable() method to set a flag on my
view behavior class. Then, inside processStimulus(...), if the flag is
set the method simply returns (effectively consuming the WakeUpCriterion
event). I suppose another way would be to clear out the wakeupOn()
criteria to disable and then reset it to re-enable.
Brad
BENOIT VIGIER wrote:
> Hi everybody,
>
> I have created a simple modeller using Java3D. I use the
> MouseBehavior to translate, rotate my objects on 4 canvases.
> The problem is that I can't disable them so that I have only one
> active behavior at a time... Therefore my objects move altogether,
> instead of the current one.
>
> I use the command setEnable to activate/deactivate their behavior,
> but the fact is that they always act as if they were "enabled".
>
> setEnable(true) = setEnable(false)
>
> Does anybody have the same problem ? Is it a bug ?
>
> Any comments or suggestions would be greatly appreciated.
>
> Thanks
>
> Ben
> -------------------------------------------------
> Benoit VIGIER
> BSc (Hons) Computer Studies Year 3
> North East Wales Institute of Higher Education
> University of Wales Associate College
> E-Mail : [EMAIL PROTECTED]
> -------------------------------------------------
> =====================================================================
> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> Java 3D Home Page: http://java.sun.com/products/java-media/3D/
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/