wiiusej.wiiuseapievents
Class IREvent

java.lang.Object
  extended by wiiusej.wiiuseapievents.WiimoteEvent
      extended by wiiusej.wiiuseapievents.IREvent

public class IREvent
extends WiimoteEvent

Class which represents an IR event.

Author:
guiguito

Field Summary
private  int ax
           
private  int ay
           
private  short indexPoints
           
private  IRSource[] IRPoints
           
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  int z
           
 
Constructor Summary
IREvent(int id, int x, int y, int z, int ax, int ay, int xVRes, int yVRes, int xOffset, int yOffset, short sensorBarPostion, short screenAsPectRatio)
          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.
 IRSource[] getIRPoints()
          Get list of IR points.
 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.
 int 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.wiiuseapievents.WiimoteEvent
getWiimoteId, setWiimoteId
 
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 int 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

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,
               int z,
               int ax,
               int ay,
               int xVRes,
               int yVRes,
               int xOffset,
               int yOffset,
               short sensorBarPostion,
               short screenAsPectRatio)
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.
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 int 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

toString

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