Nunchuk orientation June 21, 2009 08:46PM | Registered: 15 years ago Posts: 384 |
Re: Nunchuk orientation June 21, 2009 08:49PM | Admin Registered: 15 years ago Posts: 5,132 |
Re: Nunchuk orientation June 21, 2009 08:56PM | Registered: 15 years ago Posts: 384 |
Re: Nunchuk orientation June 22, 2009 02:11AM | Registered: 15 years ago Posts: 265 |
Re: Nunchuk orientation June 22, 2009 12:22PM | Registered: 15 years ago Posts: 384 |
Re: Nunchuk orientation June 22, 2009 12:41PM | Registered: 15 years ago Posts: 276 |
typedef struct nunchuk_t { struct accel_t accel_calib; /**< nunchuk accelerometer calibration */ struct joystick_t js; /**< joystick calibration */ int* flags; /**< options flag (points to wiimote_t.flags) */ ubyte btns; /**< what buttons have just been pressed */ ubyte btns_last; /**< what buttons have just been pressed */ ubyte btns_held; /**< what buttons are being held down */ ubyte btns_released; /**< what buttons were just released this */ struct vec3w_t accel; /**< current raw acceleration data */ struct orient_t orient; /**< current orientation on each axis */ struct gforce_t gforce; /**< current gravity forces on each axis */ } nunchuk_t;
typedef struct expansion_t { int type; /**< type of expansion attached */ union { struct nunchuk_t nunchuk; struct classic_ctrl_t classic; struct guitar_hero_3_t gh3; struct wii_board_t wb; }; } expansion_t;
struct expansion_t exp; WPAD_Expansion(0, &exp); /* first wiimote's expansion controller */
exp->nunchuk.orient.yaw exp->nunchuk.orient.roll exp->nunchuk.orient.pitch
Re: Nunchuk orientation June 22, 2009 01:08PM | Registered: 15 years ago Posts: 384 |
Re: Nunchuk orientation June 22, 2009 01:27PM | Registered: 15 years ago Posts: 384 |
Quote
ekeeke
then you get access to the nunchuk's "orient"structure as usual:exp->nunchuk.orient.yaw exp->nunchuk.orient.roll exp->nunchuk.orient.pitch
exp.nunchuk.orient.yaw exp.nunchuk.orient.roll exp.nunchuk.orient.pitch