gizmoball.gameworld.gameobjects
Class DetectorPlane

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

public class DetectorPlane
extends Gizmo

A DetectorPlane detects when a ball passes through a plane. A DetectorPlane should always be used with a NoCollideTrigger and an ActivateGizmoTrigger. It works by becoming two planes surrounding the original location when hit.

Specification Fields

Field Summary
 
Fields inherited from class gizmoball.gameworld.Gizmo
orientation, totalTranslation
 
Constructor Summary
DetectorPlane(java.util.List<Vect3> vertices, Vect3 dir)
           
 
Method Summary
 void doActivate()
          Immediately "activates" this gizmo.
protected  void doUpdate(double dt)
          A DetectorPlane does nothing when updated.
 java.util.List<Trigger> getDefaultTriggers()
          Default gizmos have no triggers
 GraphicsProperties getGraphicsProperties()
          Returns an object that holds the information necessary for drawing this object.
 PhysicsModel getPhysicsModel()
          Returns the physical model of this gizmo.
 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, 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

DetectorPlane

public DetectorPlane(java.util.List<Vect3> vertices,
                     Vect3 dir)
Parameters:
vertices - the vertices of this.polygon
dir - the direction the ball is expected to move
Effects:
creates a new DetectorPlane
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:
toggles the value of used if used = true, sets this.physicsModel = polygon if used = false, sets this.physicsModel = polygon shifted up and down in direction dir by .6 (bigger than the diameter of a ball)

doUpdate

protected void doUpdate(double dt)
A DetectorPlane does nothing when updated.

Specified by:
doUpdate in class Gizmo

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:
all the information needed to draw this object.

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

getDefaultTriggers

public java.util.List<Trigger> getDefaultTriggers()
Description copied from class: Gizmo
Default gizmos have no triggers

Overrides:
getDefaultTriggers in class Gizmo
Returns:
a list with a NoCollisionTrigger and a ActivateGizmoTrigger