DI-Guy SDK Documentation  13.2
diguy_api.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2016 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 /*********************************************************************
8  **
9  *t DI-Guy API, Main Header File
10  **
11  ** The API is subject to change in future releases.
12  **
13  *b Link against: libdiguy
14  */
15 
16 #ifndef __diguy_api_H
17 #define __diguy_api_H
18 
19 #ifdef SWIG
20 %module diguy_api
21 #else
22 #define CPLUSPLUS_ONLY
23 #endif
24 
25 #ifdef CPLUSPLUS_ONLY
26 
27 #include <diguy_constants.h>
28 
29 class diguyApp;
30 #include "diguy_typedefs.h" // needed for diguyScenarioCallback
31 
32 #include <declspec_diguy.h>
33 
34 #endif
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 /*****************************************************************************/
47 #ifdef CPLUSPLUS_ONLY
48 
49 /*l
50  *b Description:
51  **
52  ** This function sets the filename of the top-level configuration file
53  ** that will be read by the DI-Guy software. The default is "diguy.cfg".
54  **
55  ** This function must be called before diguy_initialize_[platform]().
56  **
57  ** It should rarely be necessary to use this function.
58  **
59  *b Callable From:
60  **
61  *- - C++
62  **
63  *b Arguments:
64  **
65  *a cfg_file - filename of desired configuration file
66  **
67  *b Returns:
68  **
69  ** 0 on success, -1 on failure
70  **
71  *b C++ Example:
72  **
73  *e #include <diguy_graphics_ogl.h>
74  *e
75  *e diguy_set_cfg_file("custom.cfg");
76  *e diguy_ogl_initialize(NULL);
77  */
78 BDI_DECLSPEC_diguy
79 int diguy_set_cfg_file(const char* cfg_file);
80 
81 /*l
82  *b Description:
83  **
84  ** This function sets the base directory in which to search for DI-Guy
85  ** files.
86  **
87  ** This function must be called before diguy_initialize_[platform]().
88  **
89  ** It should rarely be necessary to use this function. In typical use,
90  ** this directory will be read from the DIGUY environment variable.
91  **
92  ** Calling this function will override the directory specified in the
93  ** DIGUY environment variable.
94  **
95  ** The base directory can be retrieved by using the function
96  ** diguyApp::get_diguy_base_dir_path().
97  **
98  *b Callable From:
99  **
100  *- - C++
101  **
102  *b Arguments:
103  **
104  *a directory_name - override directory in which to search for DI-Guy files
105  **
106  *b Returns:
107  **
108  ** 0 on success, -1 on failure
109  **
110  *b C++ Example:
111  **
112  *e #include <diguy_graphics_ogl.h>
113  *e
114  *e diguy_set_diguy_base_dir_path("c:/DI-Guy_alternate_directory");
115  *e diguy_ogl_initialize(NULL);
116  */
117 BDI_DECLSPEC_diguy
118 int diguy_set_diguy_base_dir_path(const char* directory_name);
119 
120 /*l
121  *b Description:
122  **
123  ** This function shuts down the DI-Guy software, removing all characters
124  ** and cleaning up memory allocated by the library. No objects created
125  ** by the DI-Guy software should be referenced after this call is made.
126  **
127  *i This function should only be called once per program execution.
128  *i Do not try to re-initialize the DI-Guy software after calling
129  *i this function.
130  **
131  **
132  *b Callable From:
133  **
134  *- - C++
135  **
136  *b Returns:
137  **
138  ** 0 on success, -1 on failure
139  **
140  *b C++ Example:
141  **
142  *e diguy_deinitialize();
143  */
144 BDI_DECLSPEC_diguy
145 int diguy_deinitialize();
146 
147 #endif
148 
149 
150 /*****************************************************************************/
156 /*l
157  *b Description:
158  **
159  ** This function returns a pointer to the DI-Guy application object.
160  ** Only one application object exists per DI-Guy run. The application
161  ** object is created during DI-Guy initialize calls; e.g.
162  ** diguy_ogl_initialize().
163  **
164  *b Returns:
165  **
166  ** a pointer of type diguyApp
167  **
168  *b Callable From:
169  **
170  *- - C++
171  **
172  *b C++ Example:
173  **
174  *e diguyApp* app = diguy_get_app();
175  **
176  */
177 BDI_DECLSPEC_diguy
179 
180 /*l
181  ** Description:
182  **
183  ** This function allocates and returns an empty object of type
184  ** diguyScenario. This is the top-level "container" of most
185  ** DI-Guy types, and includes objects of type diguyCharacter,
186  ** diguyViewCamera, diguySceneObject, and diguySignal.
187  **
188  *b Callable From:
189  **
190  *- - C++
191  **
192  *b Returns:
193  **
194  ** Pointer to object of type diguyScenario if successful;
195  ** NULL if not.
196  **
197  *b C++ Example:
198  **
199  *e diguyScenario* sc = diguy_create_scenario();
200  *e if (sc)
201  *e {
202  *e sc->load("my_scenario.dss");
203  *e }
204  **
205  */
206 BDI_DECLSPEC_diguy
208 
209 /*l
210  ** Description:
211  **
212  ** This function destroys an object of type diguyScenario allocated
213  ** by diguy_create_scenario().
214  **
215  *b Callable From:
216  **
217  *- - C++
218  **
219  *b Returns:
220  **
221  ** 0 on success, -1 on failure
222  **
223  *b C++ Example:
224  **
225  *e diguyScenario* sc = diguy_create_scenario();
226  *e // ...
227  *e diguy_destroy_scenario(sc);
228  **
229  */
230 BDI_DECLSPEC_diguy
232 
233 
234 
235 /*****************************************************************************/
241 #ifdef CPLUSPLUS_ONLY
242 
243 /*l
244  *b Description:
245  **
246  ** This utility function changes the order of Euler angle triples.
247  ** DI-Guy uses the order ZXY for all 3D rotations.
248  **
249  *b Callable From:
250  **
251  *- - C++
252  **
253  *b Returns:
254  **
255  ** 0 on success, -1 on failure
256  */
257 BDI_DECLSPEC_diguy
258 int diguy_convert_euler_angle_order(float src_rx,
259  float src_ry,
260  float src_rz,
261  diguyEulerAngleOrder src_order,
262  float* dest_rx,
263  float* dest_ry,
264  float* dest_rz,
265  diguyEulerAngleOrder dest_order);
266 
267 /*l
268  *b Description:
269  **
270  ** This utility function converts a DI-Guy ZXY Euler angle triple
271  ** into a quaternion.
272  **
273  *b Callable From:
274  **
275  *- - C++
276  **
277  *b Returns:
278  **
279  ** 0 on success, -1 on failure
280  */
281 BDI_DECLSPEC_diguy
282 int diguy_convert_euler_angles_to_quaternion(const float* euler_angle_ptr,
283  float* quat_ptr);
284 
285 /*l
286  *b Description:
287  **
288  ** To be written.
289  **
290  *b Callable From:
291  **
292  *- - C++
293  **
294  *b Returns:
295  **
296  ** 0 on success, -1 on failure
297  */
298 BDI_DECLSPEC_diguy
300  float* translation,
301  float* euler_angles,
302  diguyEulerAngleOrder euler_angle_order);
303 
304 /*l
305  *b Description:
306  **
307  ** To be written.
308  **
309  *b Callable From:
310  **
311  *- - C++
312  **
313  *b Returns:
314  **
315  ** 0 on success, -1 on failure
316  */
317 BDI_DECLSPEC_diguy
319  float translation[3],
320  float euler_angles[3],
321  diguyEulerAngleOrder euler_angle_order);
322 
323 #endif
324 
325 #ifdef __cplusplus
326 }
327 #endif
328 
329 #endif /* __diguy_api_H */
330 
331 
332 /*********************************************************************
333  ** Copyright (c) 1992-2016 VT MAK
334  ** All rights reserved.
335  *********************************************************************/
336 
int diguy_set_cfg_file(const char *cfg_file)
This function sets the filename of the top-level configuration file that will be read by the DI-Guy s...
diguyEulerAngleOrder
DI-Guy Euler angle orders.
Definition: diguy_constants.h:574
int diguy_convert_euler_angles_to_quaternion(const float *euler_angle_ptr, float *quat_ptr)
This utility function converts a DI-Guy ZXY Euler angle triple into a quaternion. ...
int diguy_destroy_scenario(diguyScenario *scenario)
Description:
diguyApp * diguy_get_app()
This function returns a pointer to the DI-Guy application object.
int diguy_create_matrix_from_translation_and_euler_angles(float mat[4][4], float translation[3], float euler_angles[3], diguyEulerAngleOrder euler_angle_order)
To be written.
int diguy_convert_euler_angle_order(float src_rx, float src_ry, float src_rz, diguyEulerAngleOrder src_order, float *dest_rx, float *dest_ry, float *dest_rz, diguyEulerAngleOrder dest_order)
This utility function changes the order of Euler angle triples.
int diguy_extract_translation_and_euler_angles_from_matrix(float mat[4][4], float *translation, float *euler_angles, diguyEulerAngleOrder euler_angle_order)
To be written.
diguyScenario * diguy_create_scenario()
Description:
Represents the scenario currently being portrayed.
Definition: diguyScenario.h:92
int diguy_deinitialize()
This function shuts down the DI-Guy software, removing all characters and cleaning up memory allocate...
int diguy_set_diguy_base_dir_path(const char *directory_name)
This function sets the base directory in which to search for DI-Guy files.
An Singleton class representing the DI-Guy Application.
Definition: diguyApp.h:53
static diguyScenario * scenario
Definition: simple_playback_ogl.cpp:56