Motion sensors, joysticks and analog buttons should have their data coverted to normalised float values before handing it off to the caller.
The calibration data would be used to convert the raw data, such that zero acceleration registers as 0.0, 1g is 1.0, -1g is -1.0, et cetera.
Joysticks would be treated similarly. The minimum limits are normalised to -1.0, maximum to 1.0, and zero to 0.0.
Analog buttons would be normalised to 0.0 for not pressed and 1.0 for pressed.
This way, the caller need not worry about converting these values to something useful because the WiiRemote framework is in a perfect position to do this itself. Gory implementation details like calibration data and raw instrument readings can be hidden from the user under normal circumstances. ;)
Send any questions or suggestions or whatever to <email@example.com>. Thanks!
Log in to post a comment.