public class TuioPoint
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected TuioTime |
currentTime
The time stamp of the last update represented as TuioTime (time since session start)
|
protected TuioTime |
startTime
The creation time of this TuioPoint represented as TuioTime (time since session start)
|
protected float |
xpos
X coordinate, representated as a floating point value in a range of 0..1
|
protected float |
ypos
Y coordinate, representated as a floating point value in a range of 0..1
|
Constructor and Description |
---|
TuioPoint()
The default constructor takes no arguments and sets
its coordinate attributes to zero and its time stamp to the current session time.
|
TuioPoint(float xp,
float yp)
This constructor takes two floating point coordinate arguments and sets
its coordinate attributes to these values and its time stamp to the current session time.
|
TuioPoint(TuioPoint tpoint)
This constructor takes a TuioPoint argument and sets its coordinate attributes
to the coordinates of the provided TuioPoint and its time stamp to the current session time.
|
TuioPoint(TuioTime ttime,
float xp,
float yp)
This constructor takes a TuioTime object and two floating point coordinate arguments and sets
its coordinate attributes to these values and its time stamp to the provided TUIO time object.
|
Modifier and Type | Method and Description |
---|---|
float |
getAngle(float xp,
float yp)
Returns the angle to the provided coordinates
|
float |
getAngle(TuioPoint tpoint)
Returns the angle to the provided TuioPoint
|
float |
getAngleDegrees(float xp,
float yp)
Returns the angle in degrees to the provided coordinates
|
float |
getAngleDegrees(TuioPoint tpoint)
Returns the angle in degrees to the provided TuioPoint
|
float |
getDistance(float xp,
float yp)
Returns the distance to the provided coordinates
|
float |
getDistance(TuioPoint tpoint)
Returns the distance to the provided TuioPoint
|
int |
getScreenX(int width)
Returns the X coordinate in pixels relative to the provided screen width.
|
int |
getScreenY(int height)
Returns the Y coordinate in pixels relative to the provided screen height.
|
TuioTime |
getStartTime()
Returns the start time of this TuioPoint as TuioTime.
|
TuioTime |
getTuioTime()
Returns the time stamp of this TuioPoint as TuioTime.
|
float |
getX()
Returns the X coordinate of this TuioPoint.
|
float |
getY()
Returns the Y coordinate of this TuioPoint.
|
void |
update(float xp,
float yp)
Takes two floating point coordinate arguments and updates its coordinate attributes
to the coordinates of the provided TuioPoint and leaves its time stamp unchanged.
|
void |
update(TuioPoint tpoint)
Takes a TuioPoint argument and updates its coordinate attributes
to the coordinates of the provided TuioPoint and leaves its time stamp unchanged.
|
void |
update(TuioTime ttime,
float xp,
float yp)
Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes
to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object.
|
protected float xpos
protected float ypos
protected TuioTime currentTime
protected TuioTime startTime
public TuioPoint()
public TuioPoint(float xp, float yp)
xp
- the X coordinate to assignyp
- the Y coordinate to assignpublic TuioPoint(TuioPoint tpoint)
tpoint
- the TuioPoint to assignpublic TuioPoint(TuioTime ttime, float xp, float yp)
ttime
- the TuioTime to assignxp
- the X coordinate to assignyp
- the Y coordinate to assignpublic void update(TuioPoint tpoint)
tpoint
- the TuioPoint to assignpublic void update(float xp, float yp)
xp
- the X coordinate to assignyp
- the Y coordinate to assignpublic void update(TuioTime ttime, float xp, float yp)
ttime
- the TuioTime to assignxp
- the X coordinate to assignyp
- the Y coordinate to assignpublic float getX()
public float getY()
public float getDistance(float xp, float yp)
xp
- the X coordinate of the distant pointyp
- the Y coordinate of the distant pointpublic float getDistance(TuioPoint tpoint)
tpoint
- the distant TuioPointpublic float getAngle(float xp, float yp)
xp
- the X coordinate of the distant pointyp
- the Y coordinate of the distant pointpublic float getAngle(TuioPoint tpoint)
tpoint
- the distant TuioPointpublic float getAngleDegrees(float xp, float yp)
xp
- the X coordinate of the distant pointyp
- the Y coordinate of the distant pointpublic float getAngleDegrees(TuioPoint tpoint)
tpoint
- the distant TuioPointpublic int getScreenX(int width)
width
- the screen widthpublic int getScreenY(int height)
height
- the screen heightpublic TuioTime getTuioTime()
public TuioTime getStartTime()