Bitmap Camera Example Scene

Class CrystalBall

java.lang.Object
  |
  +--CrystalBall

public class CrystalBall
extends java.lang.Object

This class implements the crystal ball actor, the floating eye (aka Wizard Eye), the refraction texture on the crystal ball, the image-based lighting on the eye, and the crystal ball lens (the plane object inside the crystal ball showing what the eye sees).


Constructor Summary
CrystalBall(WTStage s, WTCamera c, WTGroup t)
          Constructor
 
Method Summary
 void destroy()
          Class destructor
 void onLoadComplete(WTObject o)
          Fired after the wizardeye object loads, so that its bone can be obtained
 void setBallOpacity()
          Sets ball opacity based on current setting of ballOpacity.
 void toggleCrystalBall()
          Called from the Main keyboard loop.
 void update(float dt)
          Called in the Main render loop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrystalBall

public CrystalBall(WTStage s,
                   WTCamera c,
                   WTGroup t)
Constructor

Parameters:
s - The main stage
c - The main rendering camera
t - The level object, which can be a WTStudio level, or an actor cast to a group. This object must be fully loaded before the constructor is called.
Method Detail

destroy

public void destroy()
Class destructor


onLoadComplete

public void onLoadComplete(WTObject o)
Fired after the wizardeye object loads, so that its bone can be obtained


setBallOpacity

public void setBallOpacity()
Sets ball opacity based on current setting of ballOpacity. Note that the texture opacity mask needs to be reapplied whenever it is changed, so this method is only called when ball is fading in or out.


toggleCrystalBall

public void toggleCrystalBall()
Called from the Main keyboard loop. If ball is turned on, this method causes it to start fading out, and vice versa. If the ball is already fading, it reverses fade direction.


update

public void update(float dt)
Called in the Main render loop. Updates the reflection cam position and crystal ball opacity as needed

Parameters:
dt - The time in seconds since the last render

Bitmap Camera Example Scene