Constructor and Description |
---|
State(Point initialPosition,
Point initialVelocity)
Construct a new
Momentum.State . |
Modifier and Type | Method and Description |
---|---|
int |
getCumulativeElapsedMillis()
Get the cumulative elapsed time in milliseconds since momentum took over.
|
int |
getElapsedMillis()
Get the elapsed time in milliseconds since the last time the state was
updated.
|
Point |
getInitialPosition()
Get the initial position when the momentum took over.
|
Point |
getInitialVelocity()
Get the initial velocity in pixels per millisecond when the momentum took
over.
|
Point |
getPosition()
Get the current position.
|
Point |
getVelocity()
Get the current velocity in pixels per millisecond.
|
void |
setPosition(Point position)
Set the current position.
|
void |
setVelocity(Point velocity)
Get the current velocity in pixels per millisecond.
|
public State(Point initialPosition, Point initialVelocity)
Momentum.State
.initialPosition
- the initial position, which is also set to the
current positioninitialVelocity
- the initial velocity in pixels per millisecond,
which is also set to the current velocitypublic int getCumulativeElapsedMillis()
public int getElapsedMillis()
public Point getInitialPosition()
public Point getInitialVelocity()
public Point getPosition()
public Point getVelocity()
public void setPosition(Point position)
position
- set the current positionpublic void setVelocity(Point velocity)
velocity
- set the current velocityCopyright © 2018. All rights reserved.