DI-Guy SDK Documentation  13.8
diguyMotionDirection.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2022 MAK Technologies, Inc.
4  ** All rights reserved.
5  *********************************************************************/
6 
7 
8 /*********************************************************************
9  **
10  *t diguyMotionDirection Type Declaration
11  **
12  */
13 
14 #ifndef __diguyMotionDirection_H
15 #define __diguyMotionDirection_H
16 
17 #ifdef SWIG
19 #else
20 #define CPLUSPLUS_ONLY
21 #endif
22 
23 extern "C" {
24 
25 #include <declspec_diguy.h>
26 
27 
28 /****************************************************************************/
29 typedef enum {
36 
47 
48 /*l
49  *b Description:
50  **
51  ** This function converts the passed direction enumeration into
52  ** a NULL-terminated C-style string.
53  **
54  *b Returns:
55  **
56  ** C-style string identifying direction
57  **
58  *b Callable From:
59  **
60  *- - C++
61  *- - Script
62  */
63 BDI_DECLSPEC_diguy
65 
66 /*l
67  *b Description:
68  **
69  ** This function converts the passed C-style string into an
70  ** enumerated value.
71  **
72  ** Directions are used in functions such as
73  ** diguyCharacter::get_action_from_description().
74  **
75  *b Returns:
76  **
77  ** enumeration value of direction
78  **
79  *b Callable From:
80  **
81  *- - C++
82  *- - Script
83  */
84 BDI_DECLSPEC_diguy
86 
87 /*l
88  *b Description:
89  **
90  ** This function converts the passed direction enumeration into
91  ** a floating point angle. The returned angle is in degrees.
92  **
93  ** Currently only the following directions return useful angles:
94  **
95  *- - DIGUY_MOTION_DIRECTION_FORWARD (angle = 0)
96  *- - DIGUY_MOTION_DIRECTION_BACKWARD (angle = 180)
97  *- - DIGUY_MOTION_DIRECTION_LEFT (angle = 90)
98  *- - DIGUY_MOTION_DIRECTION_RIGHT (angle = 270)
99  **
100  ** All other directions return an angle of 0.
101  **
102  *b Returns:
103  **
104  ** yaw angle of direction in degrees
105  **
106  *b Callable From:
107  **
108  *- - C++
109  *- - Script
110  */
111 BDI_DECLSPEC_diguy
113 
114 /*l
115  *b Description:
116  **
117  ** This function converts the passed angle into a
118  ** direction enumeration.
119  **
120  ** Currently only the following directions will be returned:
121  **
122  *- - DIGUY_MOTION_DIRECTION_FORWARD (angle approx. 0)
123  *- - DIGUY_MOTION_DIRECTION_BACKWARD (angle approx. 180)
124  *- - DIGUY_MOTION_DIRECTION_LEFT (angle approx. 90)
125  *- - DIGUY_MOTION_DIRECTION_RIGHT (angle approx. 270)
126  *- - DIGUY_MOTION_DIRECTION_UNKNOWN (everything else)
127  **
128  ** If the passed angle isn't within the specified error amount
129  ** of any direction's "exact" angle, the value
130  ** DIGUY_MOTION_DIRECTION_UNKNOWN will be returned.
131  **
132  *b Arguments:
133  **
134  *a angle - angle for which to retrieve direction, in degrees
135  *a allowed_error - how much error there can be from the
136  *a direction's "exact" angle
137  **
138  *b Returns:
139  **
140  ** enumeration value of direction
141  **
142  *b Callable From:
143  **
144  *- - C++
145  *- - Script
146  */
147 BDI_DECLSPEC_diguy
149  float allowed_error = 1.0f);
150 
151 
152 } /* end extern "C" */
153 
154 #endif /* __diguyMotionDirection_H */
155 
156 
157 /*********************************************************************
158  ** Copyright (c) 1992-2022 MAK Technologies, Inc.
159  ** All rights reserved.
160  *********************************************************************/
161 
Definition: diguyMotionDirection.h:40
float diguy_motion_direction_to_angle(diguyMotionDirection direction)
This function converts the passed direction enumeration into a floating point angle.
Definition: diguyMotionDirection.h:27
diguyMotionDirection
Definition: diguyMotionDirection.h:26
Definition: diguyMotionDirection.h:29
Definition: diguyMotionDirection.h:42
Definition: diguyMotionDirection.h:31
Definition: diguyMotionDirection.h:41
Definition: diguyMotionDirection.h:36
diguyMotionDirection diguy_motion_direction_from_string(const char *string)
This function converts the passed C-style string into an enumerated value.
diguyMotionDirection diguy_motion_direction_from_angle(float angle, float allowed_error=1.0f)
This function converts the passed angle into a direction enumeration.
Definition: diguyMotionDirection.h:32
Definition: diguyMotionDirection.h:37
Definition: diguyMotionDirection.h:30
Definition: diguyMotionDirection.h:28
Definition: diguyMotionDirection.h:35
Definition: diguyMotionDirection.h:39
const char * diguy_motion_direction_to_string(diguyMotionDirection direction)
This function converts the passed direction enumeration into a NULL-terminated C-style string...
Definition: diguyMotionDirection.h:34
Definition: diguyMotionDirection.h:38