gizmoball.gameworld.gameobjects
Class MonkeyBallGizmo

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

public class MonkeyBallGizmo
extends Gizmo

A MonkeyBallGizmo applies camera and gravitational effects to simulate rotation of the board in Monkey Ball. A MonkeyBallGizmo has no internal state.


Field Summary
 
Fields inherited from class gizmoball.gameworld.Gizmo
orientation, totalTranslation
 
Constructor Summary
MonkeyBallGizmo(WorldState ws, Vect3 initialGravity, CameraChanger c, Vect3 cameraDiff)
          Creates a new MonkeyBallGizmo
 
Method Summary
 Trigger changeGravityTrigger(Vect3 amount)
          Makes a note in list of gravities that the gravitational effect should be changed
 void doActivate()
          A MonkeyBallGizmo does nothing upon activation.
protected  void doUpdate(double dt)
          The same as GameObject.update().
 GraphicsProperties getGraphicsProperties()
          Returns an object that holds the information necessary for drawing this object.
 Trigger getJumpTrigger()
           
 PhysicsModel getPhysicsModel()
          A MonkeyBallGizmo has no PhysicsModel
 java.lang.String getXMLString(java.lang.String name)
          returns the XML string that would be used to save this game object
 
Methods inherited from class gizmoball.gameworld.Gizmo
activate, copy, getBoundingBox, 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

MonkeyBallGizmo

public MonkeyBallGizmo(WorldState ws,
                       Vect3 initialGravity,
                       CameraChanger c,
                       Vect3 cameraDiff)
Creates a new MonkeyBallGizmo

Parameters:
ws - the world state this is acting on
initialGravity - the initial gravity in the world state
c - changes the camera view
cameraDiff - the vector between the camera target and the camera position
Method Detail

doActivate

public void doActivate()
A MonkeyBallGizmo does nothing upon activation.

Specified by:
doActivate in class Gizmo

doUpdate

protected void doUpdate(double dt)
Description copied from class: Gizmo
The same as GameObject.update().

Specified by:
doUpdate in class Gizmo
Effects:
calculates the desired gravitational effect and applies it; sets the correct camera position and angle to simulate rotation

getPhysicsModel

public PhysicsModel getPhysicsModel()
A MonkeyBallGizmo has no PhysicsModel

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:
an invisible empty GraphicsProperties

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

changeGravityTrigger

public Trigger changeGravityTrigger(Vect3 amount)
Makes a note in list of gravities that the gravitational effect should be changed

Parameters:
amount - the amount of the change
Returns:
a Trigger that changes the gravity by amount

getJumpTrigger

public Trigger getJumpTrigger()
Returns:
a Trigger that makes the ball jump