wiiusej.wiiusejevents.physicalevents
Class IREvent

java.lang.Object
  extended by wiiusej.wiiusejevents.GenericEvent
      extended by wiiusej.wiiusejevents.physicalevents.IREvent

public class IREvent
extends GenericEvent

Class which represents an IR event.

Author:
guiguito

Field Summary
private  int ax
           
private  int ay
           
private  float distance
           
private  short indexPoints
           
private  IRSource[] IRPoints
           
private  short irSensitivity
           
private static short NB_POINTS
           
private  short screenAsPectRatio
           
private  short sensorBarPostion
           
private static short WIIUSE_IR_ABOVE
           
private static short WIIUSE_IR_BELOW
           
private static short WIIUSE_SCREEN_RATIO_16_9
           
private static short WIIUSE_SCREEN_RATIO_4_3
           
private  int x
           
private  int xOffset
           
private  int xVRes
           
private  int y
           
private  int yOffset
           
private  int yVRes
           
private  float z
           
 
Constructor Summary
IREvent(int id, int x, int y, float z, int ax, int ay, int xVRes, int yVRes, int xOffset, int yOffset, short sensorBarPostion, short screenAsPectRatio, short irSensitivity, float distance)
          Constructor of IREvent with full infos.
 
Method Summary
 void addIRpoint(int x, int y, short rx, short ry, short size)
          Add IR Point in the list (Max 4 points)
 int getAx()
          Return absolute X coordinate.
 int getAy()
          Return absolute Y coordinate.
 float getDistance()
          Pixel distance between first 2 dots.
 IRSource[] getIRPoints()
          Get list of IR points.
 short getIrSensitivity()
          The sensitivity of the IR camera can be turned up or down depending on your needs.
 short getScreenAsPectRatio()
          Return aspect ratio of the screen.
 int getX()
          Return calculated X coordinate.
 int getXOffset()
          Return IR X correction offset.
 int getXVRes()
          Return IR virtual screen x resolution.
 int getY()
          Return calculated Y coordinate.
 int getYOffset()
          Return IR Y correction offset.
 int getYVRes()
          Return IR virtual screen y resolution.
 float getZ()
          Return calculated distance.
 boolean isScreenAspectRatio169()
          Return true if screen aspect ratio set is 16/9.
 boolean isScreenAspectRatio43()
          Return true if screen aspect ratio set is 4/3.
 boolean isSensorBarAbove()
          Return true if the sensor bar is above.
 boolean isSensorBarBelow()
          Return true if the sensor bar is below.
 java.lang.String toString()
           
 
Methods inherited from class wiiusej.wiiusejevents.GenericEvent
getWiimoteId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IRPoints

private IRSource[] IRPoints

indexPoints

private short indexPoints

x

private int x

y

private int y

z

private float z

ax

private int ax

ay

private int ay

xVRes

private int xVRes

yVRes

private int yVRes

xOffset

private int xOffset

yOffset

private int yOffset

sensorBarPostion

private short sensorBarPostion

screenAsPectRatio

private short screenAsPectRatio

irSensitivity

private short irSensitivity

distance

private float distance

WIIUSE_IR_ABOVE

private static short WIIUSE_IR_ABOVE

WIIUSE_IR_BELOW

private static short WIIUSE_IR_BELOW

WIIUSE_SCREEN_RATIO_4_3

private static short WIIUSE_SCREEN_RATIO_4_3

WIIUSE_SCREEN_RATIO_16_9

private static short WIIUSE_SCREEN_RATIO_16_9

NB_POINTS

private static short NB_POINTS
Constructor Detail

IREvent

public IREvent(int id,
               int x,
               int y,
               float z,
               int ax,
               int ay,
               int xVRes,
               int yVRes,
               int xOffset,
               int yOffset,
               short sensorBarPostion,
               short screenAsPectRatio,
               short irSensitivity,
               float distance)
Constructor of IREvent with full infos.

Parameters:
id - d of the wiimote concerned.
x - calculated X coordinate.
y - calculated Y coordinate.
z - calculated distance.
ax - absolute X coordinate.
ay - absolute Y coordinate
xVRes - IR virtual screen x resolution.
yVRes - IR virtual screen y resolution.
xOffset - IR X correction offset.
yOffset - IR Y correction offset.
sensorBarPostion - aspect ratio of the screen.
screenAsPectRatio - IR sensor bar position.
irSensitivity - Sensitivity of the infrared camera.
distance - Pixel Distance between first two dots
Method Detail

getIRPoints

public IRSource[] getIRPoints()
Get list of IR points.

Returns:
the list of 2D points

addIRpoint

public void addIRpoint(int x,
                       int y,
                       short rx,
                       short ry,
                       short size)
Add IR Point in the list (Max 4 points)

Parameters:
x - x value
y - y value
rx - raw X coordinate (0-1023).
ry - raw Y coordinate (0-1023).
size - size of the IR dot (0-15).

getX

public int getX()
Return calculated X coordinate.

Returns:
the x

getY

public int getY()
Return calculated Y coordinate.

Returns:
the y

getZ

public float getZ()
Return calculated distance.

Returns:
the z

getAx

public int getAx()
Return absolute X coordinate.

Returns:
the ax

getAy

public int getAy()
Return absolute Y coordinate.

Returns:
the ay

getXVRes

public int getXVRes()
Return IR virtual screen x resolution.

Returns:
the xVRes

getYVRes

public int getYVRes()
Return IR virtual screen y resolution.

Returns:
the yVRes

getXOffset

public int getXOffset()
Return IR X correction offset.

Returns:
the xOffset

getYOffset

public int getYOffset()
Return IR Y correction offset.

Returns:
the yOffset

isSensorBarAbove

public boolean isSensorBarAbove()
Return true if the sensor bar is above.

Returns:
true if the sensor bar is above.

isSensorBarBelow

public boolean isSensorBarBelow()
Return true if the sensor bar is below.

Returns:
true if the sensor bar is below.

isScreenAspectRatio43

public boolean isScreenAspectRatio43()
Return true if screen aspect ratio set is 4/3.

Returns:
true if screen aspect ratio set is 4/3.

isScreenAspectRatio169

public boolean isScreenAspectRatio169()
Return true if screen aspect ratio set is 16/9.

Returns:
true if screen aspect ratio set is 16/9.

getScreenAsPectRatio

public short getScreenAsPectRatio()
Return aspect ratio of the screen.

Returns:
the screenAsPectRatio

getIrSensitivity

public short getIrSensitivity()
The sensitivity of the IR camera can be turned up or down depending on your needs. Like the Wii, wiiusej and wiiuse can set the camera sensitivity to a degree between 1 (lowest) and 5 (highest). The default is 3.

Returns:
the irSensitivity

getDistance

public float getDistance()
Pixel distance between first 2 dots.

Returns:
the distance between first 2 dots.

toString

public java.lang.String toString()
Specified by:
toString in class GenericEvent