Constructor and Description |
---|
Force()
Create a zero force.
|
Force(double fh,
double fv)
Create a force with specified values.
|
Force(Force force)
Create a copy force.
|
Modifier and Type | Method and Description |
---|---|
void |
addDirection(Direction direction)
Increase direction with input value.
|
void |
addDirection(double fh,
double fv)
Increase forces with input value.
|
boolean |
equals(Object obj) |
static Force |
fromVector(double ox,
double oy,
double x,
double y)
Create a force from a vector movement.
|
double |
getDirectionHorizontal()
Get horizontal direction.
|
double |
getDirectionVertical()
Get vertical direction.
|
double |
getSensibility()
Get the current sensibility.
|
double |
getVelocity()
Get the current velocity.
|
int |
hashCode() |
boolean |
isDecreasingHorizontal()
Check if movement is horizontally decreasing.
|
boolean |
isIncreasingHorizontal()
Check if movement is horizontally decreasing.
|
void |
setDestination(double fh,
double fv)
Set force destination to reach.
|
void |
setDirection(Direction direction)
Set direction.
|
void |
setDirection(double fh,
double fv)
Set directions.
|
void |
setDirectionMaximum(Direction max)
Set the maximum reachable direction.
|
void |
setDirectionMinimum(Direction min)
Set the minimum reachable direction.
|
void |
setSensibility(double sensibility)
Set the sensibility value.
|
void |
setVelocity(double velocity)
Set the movement velocity.
|
void |
update(double extrp) |
public Force()
public Force(double fh, double fv)
fh
- The horizontal force.fv
- The vertical force.public Force(Force force)
force
- The force reference.public static Force fromVector(double ox, double oy, double x, double y)
The created force will describe the following values:
getDirectionHorizontal()
),getDirectionVertical()
),getVelocity()
).ox
- The old horizontal location.oy
- The old vertical location.x
- The current horizontal location.y
- The current vertical location.public void setVelocity(double velocity)
velocity
- The movement velocity.public void setSensibility(double sensibility)
sensibility
- The sensibility value (will round to destination between -sensibility and +sensibility).public void addDirection(Direction direction)
direction
- The direction to add.public void addDirection(double fh, double fv)
fh
- The added horizontal force.fv
- The added vertical force.public void setDirection(Direction direction)
direction
- The direction.public void setDirection(double fh, double fv)
fh
- The horizontal direction.fv
- The vertical direction.public void setDestination(double fh, double fv)
fh
- The horizontal destination.fv
- The vertical destination.public void setDirectionMaximum(Direction max)
max
- The direction max.public void setDirectionMinimum(Direction min)
min
- The direction min.public double getVelocity()
public double getSensibility()
public boolean isDecreasingHorizontal()
true
if horizontally decreasing, false
else.public boolean isIncreasingHorizontal()
true
if horizontally decreasing, false
else.public double getDirectionHorizontal()
Direction
getDirectionHorizontal
in interface Direction
public double getDirectionVertical()
Direction
getDirectionVertical
in interface Direction
Copyright © 2016 Byron 3D Games Studio. All rights reserved.