#include
#include
#include
#include "definitions.h"
#include "wiiuse_internal.h"
#include "ir.h"
Functions |
|
| static int | get_ir_sens (struct wiimote_t *wm, char **block1, char **block2) |
| Get the IR sensitivity settings. |
|
| static void | interpret_ir_data (struct wiimote_t *wm) |
| Interpret IR data into more user friendly variables. |
|
| static void | fix_rotated_ir_dots (struct ir_dot_t *dot, float ang) |
| Fix the rotation of the IR dots. |
|
| static void | get_ir_dot_avg (struct ir_dot_t *dot, int *x, int *y) |
| Average IR dots. |
|
| static void | reorder_ir_dots (struct ir_dot_t *dot) |
| Reorder the IR dots. |
|
| static float | ir_distance (struct ir_dot_t *dot) |
| Calculate the distance between the first 2 visible IR dots. |
|
| static int | ir_correct_for_bounds (int *x, int *y, enum aspect_t aspect, int offset_x, int offset_y) |
| Correct for the IR bounding box. |
|
| static void | ir_convert_to_vres (int *x, int *y, enum aspect_t aspect, int vx, int vy) |
| Interpolate the point to the user defined virtual screen resolution. |
|
| void | wiiuse_set_ir (struct wiimote_t *wm, int status) |
| Set if the wiimote should track IR targets. |
|
| void | wiiuse_set_ir_vres (struct wiimote_t *wm, unsigned int x, unsigned int y) |
| Set the virtual screen resolution for IR tracking. |
|
| void | wiiuse_set_ir_position (struct wiimote_t *wm, enum ir_position_t pos) |
| Set the XY position for the IR cursor. |
|
| void | wiiuse_set_aspect_ratio (struct wiimote_t *wm, enum aspect_t aspect) |
| Set the aspect ratio of the TV/monitor. |
|
| void | wiiuse_set_ir_sensitivity (struct wiimote_t *wm, int level) |
| Set the IR sensitivity. |
|
| void | calculate_basic_ir (struct wiimote_t *wm, byte *data) |
| Calculate the data from the IR spots. Basic IR mode. |
|
| void | calculate_extended_ir (struct wiimote_t *wm, byte *data) |
| Calculate the data from the IR spots. Extended IR mode. |
|
| float | calc_yaw (struct ir_t *ir) |
| Calculate yaw given the IR data. |
|
| float calc_yaw | ( | struct ir_t * | ir | ) |
Calculate yaw given the IR data.
| ir | IR data structure. |
| void calculate_basic_ir | ( | struct wiimote_t * | wm, | |
| byte * | data | |||
| ) |
Calculate the data from the IR spots. Basic IR mode.
| wm | Pointer to a wiimote_t structure. | |
| data | Data returned by the wiimote for the IR spots. |
| void calculate_extended_ir | ( | struct wiimote_t * | wm, | |
| byte * | data | |||
| ) |
Calculate the data from the IR spots. Extended IR mode.
| wm | Pointer to a wiimote_t structure. | |
| data | Data returned by the wiimote for the IR spots. |
| static void fix_rotated_ir_dots | ( | struct ir_dot_t * | dot, | |
| float | ang | |||
| ) | [static] |
Fix the rotation of the IR dots.
| dot | An array of 4 ir_dot_t objects. | |
| ang | The roll angle to correct by (-180, 180) |
If the accelerometer is off then obviously this will not do anything and the cursor position may be inaccurate.
| static void get_ir_dot_avg | ( | struct ir_dot_t * | dot, | |
| int * | x, | |||
| int * | y | |||
| ) | [static] |
Average IR dots.
| dot | An array of 4 ir_dot_t objects. | |
| x | [out] Average X | |
| y | [out] Average Y |
| static int get_ir_sens | ( | struct wiimote_t * | wm, | |
| char ** | block1, | |||
| char ** | block2 | |||
| ) | [static] |
Get the IR sensitivity settings.
| wm | Pointer to a wiimote_t structure. | |
| block1 | [out] Pointer to where block1 will be set. | |
| block2 | [out] Pointer to where block2 will be set. |
| static void interpret_ir_data | ( | struct wiimote_t * | wm | ) | [static] |
Interpret IR data into more user friendly variables.
| wm | Pointer to a wiimote_t structure. |
| static int ir_correct_for_bounds | ( | int * | x, | |
| int * | y, | |||
| enum aspect_t | aspect, | |||
| int | offset_x, | |||
| int | offset_y | |||
| ) | [static] |
Correct for the IR bounding box.
| x | [out] The current X, it will be updated if valid. | |
| y | [out] The current Y, it will be updated if valid. | |
| aspect | Aspect ratio of the screen. | |
| offset_x | The X offset of the bounding box. | |
| offset_y | The Y offset of the bounding box. |
| static float ir_distance | ( | struct ir_dot_t * | dot | ) | [static] |
Calculate the distance between the first 2 visible IR dots.
| dot | An array of 4 ir_dot_t objects. |
| static void reorder_ir_dots | ( | struct ir_dot_t * | dot | ) | [static] |
Reorder the IR dots.
| dot | An array of 4 ir_dot_t objects. |
Set the aspect ratio of the TV/monitor.
| wm | Pointer to a wiimote_t structure. | |
| aspect | Either WIIUSE_ASPECT_16_9 or WIIUSE_ASPECT_4_3 |
| void wiiuse_set_ir | ( | struct wiimote_t * | wm, | |
| int | status | |||
| ) |
Set if the wiimote should track IR targets.
| wm | Pointer to a wiimote_t structure. | |
| status | 1 to enable, 0 to disable. |
| void wiiuse_set_ir_position | ( | struct wiimote_t * | wm, | |
| enum ir_position_t | pos | |||
| ) |
Set the XY position for the IR cursor.
| wm | Pointer to a wiimote_t structure. |
| void wiiuse_set_ir_sensitivity | ( | struct wiimote_t * | wm, | |
| int | level | |||
| ) |
Set the IR sensitivity.
| wm | Pointer to a wiimote_t structure. | |
| level | 1-5, same as Wii system sensitivity setting. |
| void wiiuse_set_ir_vres | ( | struct wiimote_t * | wm, | |
| unsigned int | x, | |||
| unsigned int | y | |||
| ) |
Set the virtual screen resolution for IR tracking.
| wm | Pointer to a wiimote_t structure. | |
| status | 1 to enable, 0 to disable. |
1.5.4