|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectseltar.motion.Motion
| Field Summary | |
float |
Const
|
float |
Damp
|
Point |
pos
|
Point |
prevpos
|
float |
Spring
|
Vector |
v
|
| Constructor Summary | |
Motion(float X,
float Y)
Constructor #1 |
|
Motion(float X,
float Y,
float VX,
float VY)
Constructor #2 |
|
| Method Summary | |
float |
calcAngle()
Calculates angle from previous position to current position |
float |
calcAngle(float x1,
float y1,
float x2,
float y2)
Calculates the angle between two given points |
void |
constrain(float x1,
float y1,
float x2,
float y2)
Constrain Point pos and Point prevpos to given coordinates |
void |
followTo(float X,
float Y)
Sets Vector v Velocity & Direction Move point towards given point dividing by Const |
float |
getAngle()
Gets angle from Vector v |
float |
getConstant()
Gets Constant divider Used by followTo() & springTo() |
float |
getDamping()
Gets Damping Used by springTo() |
float |
getDistance()
Gets Distance from previous position to current position |
float |
getDistanceTo(float X,
float Y)
Gets Distance from current position to given position |
float |
getPX()
Gets Previous X-position |
float |
getPY()
Gets Previous Y-position |
float |
getSpring()
Gets Springiness Used by springTo() |
float |
getVX()
Gets current velocity-X |
float |
getVY()
Gets current velocity-Y |
float |
getX()
Gets current X-position |
float |
getY()
Gets current Y-position |
void |
move()
Sets prevpos to pos and Moves pos according to Vector v (Velocity & Direction) |
void |
moveDir(float Angle,
float Speed)
Sets Vector v Velocity & Direction Moves in a given Angle with a given Speed |
void |
setAngle(float A)
Set angle in Vector v |
void |
setConstant(float C)
Sets Constant divider Used by followTo() & springTo() |
void |
setDamping(float D)
Sets Damping Used by springTo() |
void |
setPos(float X,
float Y)
Set current position to given coordinate |
void |
setPos(Point p)
Set current position to given Point |
void |
setPrevPos(float X,
float Y)
Set previous position to given coordinate |
void |
setPrevPos(Point p)
Set previous position to given Point |
void |
setPX(float PX)
Set previous position to given float |
void |
setPY(float PY)
Set previous position to given float |
void |
setSpring(float S)
Sets Springiness Used by springTo() |
void |
setVelocity(float V)
Set velocity in Vector v |
void |
setVelocity(float VX,
float VY)
Set velocity-coordinates in Vector v |
void |
setVX(float VX)
Set X-velocity in Vector v |
void |
setVY(float VY)
Set Y-velocity in Vector v |
void |
setX(float X)
Set current X-position to given float |
void |
setY(float Y)
Set current Y-position to given float |
void |
springTo(float X,
float Y)
Sets Vector v Velocity & Direction Springs point towards given point dividing by Const, multiplied with Spring and Damp |
void |
wrap(float x1,
float y1,
float x2,
float y2)
Wraps Point pos and Point prevpos around given coordinates |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public float Damp
public float Const
public float Spring
public Point prevpos
public Point pos
public Vector v
| Constructor Detail |
public Motion(float X,
float Y)
X - float X-positionY - float Y-position
public Motion(float X,
float Y,
float VX,
float VY)
X - float X-positionY - float Y-positionVX - float X-VelocityVY - float Y-Velocity| Method Detail |
public float getPX()
public float getPY()
public float getX()
public float getY()
public float getVX()
public float getVY()
public float calcAngle()
public float getAngle()
public float getConstant()
public float getDamping()
public float getSpring()
public float getDistance()
public float getDistanceTo(float X,
float Y)
public void setPos(Point p)
p - Position
public void setPos(float X,
float Y)
X - X-positionY - Y-positionpublic void setX(float X)
X - X-positionpublic void setY(float Y)
Y - Y-positionpublic void setPrevPos(Point p)
p - Previous Position
public void setPrevPos(float X,
float Y)
X - Previous X-PositionY - Previous Y-Positionpublic void setPX(float PX)
PX - Previous X-Positionpublic void setPY(float PY)
PY - Previous Y-Positionpublic void setAngle(float A)
A - Anglepublic void setVelocity(float V)
V - Velocity
public void setVelocity(float VX,
float VY)
VX - X-VelocityVY - Y-Velocitypublic void setVX(float VX)
VX - X-Velocitypublic void setVY(float VY)
VY - Y-Velocitypublic void setConstant(float C)
C - Constantpublic void setDamping(float D)
D - Dampingpublic void setSpring(float S)
S - Springiness
public void wrap(float x1,
float y1,
float x2,
float y2)
public void constrain(float x1,
float y1,
float x2,
float y2)
public float calcAngle(float x1,
float y1,
float x2,
float y2)
public void move()
public void moveDir(float Angle,
float Speed)
public void followTo(float X,
float Y)
public void springTo(float X,
float Y)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||