|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.core.Rotation2D
public class Rotation2D
Class Rotation2D
represents the rotation of an object in space.
This class is used for controlling the rotation of GameItem
's
when they are rendered on screen.
Constructor Summary | |
---|---|
Rotation2D()
Default constructor; creates a Rotation2D object with a
angle of 0 and relative position of (0,0). |
|
Rotation2D(double theta,
Position p)
Constructor for creating a new Rotation2D object given an
angle of rotation and a relative position about which to rotate. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
Position |
getPosition()
Method for getting the position from which the rotation will occur. |
double |
getTheta()
Method for getting the angle of rotation. |
void |
rotate(double dtheta)
Changes the angle of rotation by dtheta. |
void |
setPosition(Position p)
Method for setting the position from which the rotation will occur. |
void |
setTheta(double theta)
Method for setting the angle of rotation. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Rotation2D()
Rotation2D
object with a
angle of 0 and relative position of (0,0).
public Rotation2D(double theta, Position p)
Rotation2D
object given an
angle of rotation and a relative position about which to rotate.
theta
- is the angle of rotation in degreesp
- is the relative Position
about which the rotation
will occurPosition
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public double getTheta()
public void setTheta(double theta)
theta
- is the angle of rotation in radianspublic final void rotate(double dtheta)
dtheta
- is the amount to rotate in radianspublic Position getPosition()
Position
about which the object will be
rotatedPosition
public void setPosition(Position p)
p
- is the relative Position
about which the rotation
will occurPosition
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |