|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.lancs.relate.trigger.Trackable
public class Trackable
This class represents a trackable user, device or physical object.
| Constructor Summary | |
|---|---|
Trackable(java.lang.String id,
Location p,
Orientation o,
Motion m)
Creates a new Trackable with a unique id, location, orientation and motion |
|
| Method Summary | |
|---|---|
double |
getDirectionTo(Location p)
Returns the direction in which a second location is from this point of view (in degrees 0 - 360). |
double |
getDistanceTo(Location p)
Returns the distance from this location to a given second location. |
java.lang.String |
getId()
Returns the unique id. |
Location |
getLocation()
Returns the current location. |
Motion |
getMotion()
Returns the current motion. |
Orientation |
getOrientation()
Returns the current orientation. |
boolean |
hasBackTo(Location p)
Returns true if the Trackable is oriented towards a given location, meaning the angle between the orientation and the direction in which the target is located is less than 20 degrees. |
boolean |
isCloserThan(double limit,
Location p)
Returns true if the distance to a given second location is closer than a given limit. |
boolean |
isFacing(Location p)
Returns true if the Trackable is oriented towards a given location, meaning the angle between the orientation and the direction in which the target is located is less than 20 degrees. |
boolean |
isLeftOf(Location p)
Returns true if the angle between the Trackable's orientation and the direction in which the target is located is between 45 and 135 degrees and the target is to the left from the Trackable's point of view. |
boolean |
isMoving()
Returns true if the velocity is not null. |
boolean |
isMovingAway(Location p)
Returns true if the Trackable is moving towards a given location, meaning the angle between the direction in which the Trackable is moving and the direction in which the target is located is higher than 90 degrees. |
boolean |
isMovingTowards(Location p)
Returns true if the Trackable is moving towards a given location, meaning the angle between the direction in which the Trackable is moving and the direction in which the target is located is less than 20 degrees. |
boolean |
isRightOf(Location p)
Returns true if the angle between the Trackable's orientation and the direction in which the target is located is between 45 and 135 degrees and the target is to the right from the Trackable's point of view. |
void |
setLocation(Location location)
Sets the current location. |
void |
setMotion(Motion motion)
Sets the current motion. |
void |
setOrientation(Orientation orientation)
Sets the current orientation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Trackable(java.lang.String id,
Location p,
Orientation o,
Motion m)
id - unique idp - locationo - orientationm - motion| Method Detail |
|---|
public java.lang.String getId()
public Motion getMotion()
public void setMotion(Motion motion)
motion - motionpublic Orientation getOrientation()
public void setOrientation(Orientation orientation)
orientation - orientationpublic Location getLocation()
public void setLocation(Location location)
location - locationpublic double getDistanceTo(Location p)
p - second location
public double getDirectionTo(Location p)
p - second location
public boolean isCloserThan(double limit,
Location p)
limit - limitp - second location
public boolean isFacing(Location p)
p - target location
public boolean hasBackTo(Location p)
p - target location
public boolean isRightOf(Location p)
p - target location
public boolean isLeftOf(Location p)
p - target location
public boolean isMoving()
public boolean isMovingTowards(Location p)
p - target location
public boolean isMovingAway(Location p)
p - target location
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||