|
Firmware SDK
|
Helper library to determine dice (cube) face position from vectors. More...
Typedefs | |
| typedef struct twr_dice_t | twr_dice_t |
| Dice instance. | |
Enumerations | |
| enum | twr_dice_face_t { TWR_DICE_FACE_UNKNOWN = 0 , TWR_DICE_FACE_1 = 1 , TWR_DICE_FACE_2 = 2 , TWR_DICE_FACE_3 = 3 , TWR_DICE_FACE_4 = 4 , TWR_DICE_FACE_5 = 5 , TWR_DICE_FACE_6 = 6 } |
| Dice faces. More... | |
Functions | |
| void | twr_dice_init (twr_dice_t *self, twr_dice_face_t start) |
| Initialize dice. More... | |
| void | twr_dice_set_threshold (twr_dice_t *self, float threshold) |
| Set threshold. More... | |
| void | twr_dice_feed_vectors (twr_dice_t *self, float x_axis, float y_axis, float z_axis) |
| Feed dice with X/Y/Z axis vectors. More... | |
| twr_dice_face_t | twr_dice_get_face (twr_dice_t *self) |
| Get calculated dice face. More... | |
Helper library to determine dice (cube) face position from vectors.
| enum twr_dice_face_t |
Dice faces.
Definition at line 12 of file twr_dice.h.
| void twr_dice_feed_vectors | ( | twr_dice_t * | self, |
| float | x_axis, | ||
| float | y_axis, | ||
| float | z_axis | ||
| ) |
Feed dice with X/Y/Z axis vectors.
| [in] | self | Instance |
| [in] | x_axis | Vector of X axis |
| [in] | y_axis | Vector of Y axis |
| [in] | z_axis | Vector of Z axis |
Definition at line 31 of file twr_dice.c.
| twr_dice_face_t twr_dice_get_face | ( | twr_dice_t * | self | ) |
Get calculated dice face.
| [in] | self | Instance |
Definition at line 82 of file twr_dice.c.
| void twr_dice_init | ( | twr_dice_t * | self, |
| twr_dice_face_t | start | ||
| ) |
Initialize dice.
| [in] | self | Instance |
| [in] | start | Dice initial face |
Definition at line 17 of file twr_dice.c.
| void twr_dice_set_threshold | ( | twr_dice_t * | self, |
| float | threshold | ||
| ) |