38 #ifndef DYNAMICS_H_INCLUDED 39 #define DYNAMICS_H_INCLUDED 52 #define WIIMOTE_ACCEL_XBITS 2 53 #define WIIMOTE_ACCEL_YBITS 1 54 #define WIIMOTE_ACCEL_ZBITS 1 72 #ifdef WIIUSE_ACCEL_10BIT 73 #define WIIMOTE_ACCEL_XSHIFT WIIMOTE_ACCEL_XBITS 74 #define WIIMOTE_ACCEL_YSHIFT WIIMOTE_ACCEL_YBITS 75 #define WIIMOTE_ACCEL_ZSHIFT WIIMOTE_ACCEL_ZBITS 77 #define NUNCHUK_ACCEL_XSHIFT 2 78 #define NUNCHUK_ACCEL_YSHIFT 2 79 #define NUNCHUK_ACCEL_ZSHIFT 2 81 #define WIIMOTE_ACCEL_XSHIFT 0 82 #define WIIMOTE_ACCEL_YSHIFT 0 83 #define WIIMOTE_ACCEL_ZSHIFT 0 85 #define NUNCHUK_ACCEL_XSHIFT 0 86 #define NUNCHUK_ACCEL_YSHIFT 0 87 #define NUNCHUK_ACCEL_ZSHIFT 0 93 #define NUNCHUK_PASSTHROUGH_ACCEL_XSHIFT 0 94 #define NUNCHUK_PASSTHROUGH_ACCEL_YSHIFT 0 95 #define NUNCHUK_PASSTHROUGH_ACCEL_ZSHIFT 0 103 struct vec3i_t wiiuse_scale_calibration(const struct vec3b_t *cal,
const struct vec3b_t *cal_lsb,
int accel_xshift,
104 int accel_yshift,
int accel_zshift);
106 int accel_xshift,
int accel_yshift,
int accel_zshift);
108 int accel_yshift,
int accel_zshift);
110 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.
Definition: dynamics.c:219
Definition: dynamics.h:97
Accelerometer struct.
Definition: wiiuse.h:477
General internal wiiuse stuff.
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.
Definition: dynamics.c:187
Unsigned x,y,z 16-bit vector.
Definition: wiiuse.h:446
Gravity force struct.
Definition: wiiuse.h:469
Orientation struct.
Definition: wiiuse.h:456
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.
Definition: dynamics.c:102
Joystick calibration structure.
Definition: wiiuse.h:560