|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgizmoball.board.Gizmo
gizmoball.board.RotatingGizmo
public class RotatingGizmo
This class represents a rotating gizmo, such as a flipper, that extends the abstract Gizmo class. A rotating gizmo has an angular velocity, a range of angles in which it can rotate, a center of rotation, and an enclosing polygon which represents the polygon that the flipper occupies at different times during its rotation.
| Field Summary |
|---|
| Fields inherited from class gizmoball.board.Gizmo |
|---|
color, connections, name, reverseConnections |
| Constructor Summary | |
|---|---|
RotatingGizmo(java.lang.String name,
java.awt.Color color,
Shape shape,
double rotatingVel,
double currentRotVel,
Polygon enclosingPoly,
Vect centerOfRotation,
Angle maxAngle,
Angle currentAngle)
Constructs a RotatingGizmo object |
|
| Method Summary | |
|---|---|
void |
action()
executes the action of the rotating gizmo which changes the mode of the flipper from stationary to rotating and vice versa. |
double |
getAngularVelocity()
returns the current angular velocity. |
Vect |
getCenterOfRotation()
returns the center of rotation of the gizmo. |
Angle |
getCurrentAngle()
returns the current angle that the rotating gizmo is at. |
Polygon |
getEnclosingPolygon()
returns the enclosing polygon of the gizmo |
Angle |
getMaxAngle()
returns the max angle that the gizmo can be rotated by. |
void |
rotateAroundCenter(double dt)
rotates the gizmo around its center of rotation. |
double |
timeToNextStop()
The expected time until the gizmo will stop again. |
| Methods inherited from class gizmoball.board.Gizmo |
|---|
getColor, getName, getShape, getTriggeredGizmos, getTriggeringGizmos, setColor, triggerConnections |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RotatingGizmo(java.lang.String name,
java.awt.Color color,
Shape shape,
double rotatingVel,
double currentRotVel,
Polygon enclosingPoly,
Vect centerOfRotation,
Angle maxAngle,
Angle currentAngle)
name - the name of the gizmocolor - the color of the gizmoshape - the shape of the gizmorotatingVel - the rotating velocityenclosingPoly - the enclosing shape of the gizmocenterOfRotation - the center of rotationmaxAngle - the maximus angle that the RotatingGizmo can rotate by| Method Detail |
|---|
public double timeToNextStop()
public Polygon getEnclosingPolygon()
public double getAngularVelocity()
public Angle getCurrentAngle()
public Angle getMaxAngle()
public Vect getCenterOfRotation()
public void rotateAroundCenter(double dt)
dt - how long the rotating gizmo is rotated forpublic void action()
action in class Gizmo
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||