|
wiiuse
|
Classes | |
| struct | vec3i_t |
Functions | |
| struct vec3i_t | wiiuse_scale_calibration (const struct vec3b_t *cal, const struct vec3b_t *cal_lsb, int accel_xshift, int accel_yshift, int accel_zshift) |
| Scale an 8-bit calibration point up to the raw accel value's scale, per axis, filling in any real extra-precision bits decoded for it along the way. More... | |
| void | calculate_orientation (struct accel_t *ac, struct vec3w_t *accel, struct orient_t *orient, int smooth, int accel_xshift, int accel_yshift, int accel_zshift) |
| Calculate the roll, pitch, yaw. More... | |
| void | calculate_gforce (struct accel_t *ac, struct vec3w_t *accel, struct gforce_t *gforce, int accel_xshift, int accel_yshift, int accel_zshift) |
| Calculate the gravity forces on each axis. More... | |
| void | calc_joystick_state (struct joystick_t *js, float x, float y) |
| Calculate the angle and magnitude of a joystick. More... | |
| void | apply_smoothing (struct accel_t *ac, struct orient_t *orient, int type) |
| void calc_joystick_state | ( | struct joystick_t * | js, |
| float | x, | ||
| float | y | ||
| ) |
Calculate the angle and magnitude of a joystick.
| js | [out] Pointer to a joystick_t structure. |
| x | The raw x-axis value. |
| y | The raw y-axis value. |
| void calculate_gforce | ( | struct accel_t * | ac, |
| struct vec3w_t * | accel, | ||
| struct gforce_t * | gforce, | ||
| int | accel_xshift, | ||
| int | accel_yshift, | ||
| int | accel_zshift | ||
| ) |
Calculate the gravity forces on each axis.
| ac | An accelerometer (accel_t) structure. |
| accel | [in] Pointer to a vec3w_t structure that holds the raw acceleration data. |
| gforce | [out] Pointer to a gforce_t structure that will hold the gravity force data. |
| accel_xshift | [in] See calculate_orientation(). |
| accel_yshift | [in] See calculate_orientation(). |
| accel_zshift | [in] See calculate_orientation(). |
| void calculate_orientation | ( | struct accel_t * | ac, |
| struct vec3w_t * | accel, | ||
| struct orient_t * | orient, | ||
| int | smooth, | ||
| int | accel_xshift, | ||
| int | accel_yshift, | ||
| int | accel_zshift | ||
| ) |
Calculate the roll, pitch, yaw.
| ac | An accelerometer (accel_t) structure. |
| accel | [in] Pointer to a vec3w_t structure that holds the raw acceleration data. |
| orient | [out] Pointer to a orient_t structure that will hold the orientation data. |
| rorient | [out] Pointer to a orient_t structure that will hold the non-smoothed orientation data. |
| smooth | If smoothing should be performed on the angles calculated. 1 to enable, 0 to disable. |
| accel_xshift | [in] Per-axis WIIUSE_ACCEL_10BIT decode shift; see dynamics.h. |
| accel_yshift | [in] Per-axis WIIUSE_ACCEL_10BIT decode shift; see dynamics.h. |
| accel_zshift | [in] Per-axis WIIUSE_ACCEL_10BIT decode shift; see dynamics.h. |
Given the raw acceleration data from the accelerometer struct, calculate the orientation of the device and set it in the orient parameter.
| struct vec3i_t wiiuse_scale_calibration | ( | const struct vec3b_t * | cal, |
| const struct vec3b_t * | cal_lsb, | ||
| int | accel_xshift, | ||
| int | accel_yshift, | ||
| int | accel_zshift | ||
| ) |
Scale an 8-bit calibration point up to the raw accel value's scale, per axis, filling in any real extra-precision bits decoded for it along the way.
accel_xshift/yshift/zshift is 0 (a no-op) unless WIIUSE_ACCEL_10BIT is defined, so this always matches the scale handle_wm_accel()/ nunchuk_event() decoded the raw value at - see dynamics.h.
cal_lsb holds real extra-precision bits decoded from EEPROM (Wii Remote only); it is 0 elsewhere, so ORing it in is then a no-op.
1.8.13