gizmoball.gameworld.gameobjects
Class ToggleGizmo

java.lang.Object
  extended by gizmoball.gameworld.GameObject
      extended by gizmoball.gameworld.Gizmo
          extended by gizmoball.gameworld.gameobjects.ToggleGizmo

public class ToggleGizmo
extends Gizmo

A ToggleGizmo adds two internal states to an underlying Gizmo.

Specification Fields

Field Summary
 
Fields inherited from class gizmoball.gameworld.Gizmo
orientation, totalTranslation
 
Constructor Summary
ToggleGizmo(Gizmo gizmo)
           
 
Method Summary
 void doActivate()
          Immediately "activates" this gizmo.
 void doUpdate(double dt)
          The effect of update is the same as that of the underlying Gizmo
 Vect3Pair getBoundingBox()
          A ToggleGizmo has the same bounding box as its underlying gizmo
 GraphicsProperties getGraphicsProperties()
          Returns an object that holds the information necessary for drawing this object.
 PhysicsModel getPhysicsModel()
          Returns the physical model of this gizmo.
 boolean getState()
           
 java.lang.String getXMLString(java.lang.String name)
          returns the XML string that would be used to save this game object
 void setState(boolean state)
           
 void toggle()
           
 
Methods inherited from class gizmoball.gameworld.Gizmo
activate, copy, getCoeffReflectionString, getColorString, getCommonAttributesString, getDefaultTriggers, getOrientationDoubleString, getOrientationString, getReflectionCoeff, getTextureString, getTranslationString, getXMLDelay, getXMLDelayString, rotateAboutAxis, setCoefficientOfReflection, setCommonAttributes, setDelay, translateBy, update
 
Methods inherited from class gizmoball.gameworld.GameObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ToggleGizmo

public ToggleGizmo(Gizmo gizmo)
Effects:
Creates a new ToggleGizmo
Method Detail

doActivate

public void doActivate()
Description copied from class: Gizmo
Immediately "activates" this gizmo. The definition of "activate" varies from gizmo to gizmo.

Specified by:
doActivate in class Gizmo
Effects:
this.state = !state

toggle

public void toggle()
Effects:
this.state = !this.state;

getState

public boolean getState()
Returns:
this.state

setState

public void setState(boolean state)
Effects:
this.state = state

getPhysicsModel

public PhysicsModel getPhysicsModel()
Description copied from class: Gizmo
Returns the physical model of this gizmo. The model stores the structure, as well as velocity, rotation, and rotation of this gizmo.

Specified by:
getPhysicsModel in class Gizmo
Returns:
this.physicsModel

getGraphicsProperties

public GraphicsProperties getGraphicsProperties()
Description copied from class: GameObject
Returns an object that holds the information necessary for drawing this object. Making changes to this object changes the underlying object, so those changes will be reflected in the drawer.

Specified by:
getGraphicsProperties in class GameObject
Returns:
this.graphicsProperties

doUpdate

public void doUpdate(double dt)
The effect of update is the same as that of the underlying Gizmo

Specified by:
doUpdate in class Gizmo

getXMLString

public java.lang.String getXMLString(java.lang.String name)
Description copied from class: GameObject
returns the XML string that would be used to save this game object

Specified by:
getXMLString in class GameObject
Returns:
String s where s is sufficient to be directly inserted into an XML file where game world information is being saved

getBoundingBox

public Vect3Pair getBoundingBox()
A ToggleGizmo has the same bounding box as its underlying gizmo

Overrides:
getBoundingBox in class Gizmo
Returns:
a bounding box for this