*/
public synchronized void setVisible(boolean visible) {
// If we want to make the affordance visible and it already is not
// visible, then make it visible.
if (visible == true && isVisible == false) {
RenderUpdater updater = new RenderUpdater() {
public void update(Object arg0) {
Affordance affordance = (Affordance)arg0;
Node rootNode = affordance.getRootNode();
ClientContextJME.getWorldManager().addEntity(affordance);
ClientContextJME.getWorldManager().addToUpdateList(rootNode);
}
};
WorldManager wm = ClientContextJME.getWorldManager();
wm.addRenderUpdater(updater, this);
isVisible = true;
return;
}
// If we want to make the affordance invisible and it already is
// visible, then make it invisible
if (visible == false && isVisible == true) {
RenderUpdater updater = new RenderUpdater() {
public void update(Object arg0) {
Affordance affordance = (Affordance)arg0;
ClientContextJME.getWorldManager().removeEntity(affordance);
}
};