DI-Guy SDK Documentation  13.6
diguy_api.h File Reference
#include <diguy_constants.h>
#include "diguy_typedefs.h"
#include <declspec_diguy.h>

Go to the source code of this file.

Macros

#define CPLUSPLUS_ONLY
 

Functions

Initialization Functions
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 software. More...
 
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. More...
 
int diguy_deinitialize ()
 This function shuts down the DI-Guy software, removing all characters and cleaning up memory allocated by the library. More...
 
Scenario Creation Functions
diguyAppdiguy_get_app ()
 This function returns a pointer to the DI-Guy application object. More...
 
diguyScenariodiguy_create_scenario ()
 Description: More...
 
int diguy_destroy_scenario (diguyScenario *scenario)
 Description: More...
 
Utility Functions
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Variables

comment line count1comment line count1comment line count1
 

Macro Definition Documentation

#define CPLUSPLUS_ONLY

Function Documentation

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 software.

The default is "diguy.cfg".

This function must be called before diguy_initialize_[platform]().

It should rarely be necessary to use this function.

Callable From:

  • C++
Parameters
cfg_filefilename of desired configuration file

Returns:

0 on success, -1 on failure

C++ Example:

1 #include <diguy_graphics_ogl.h>
2 
3  diguy_set_cfg_file("custom.cfg");
4  diguy_ogl_initialize(NULL);
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.

This function must be called before diguy_initialize_[platform]().

It should rarely be necessary to use this function. In typical use, this directory will be read from the DIGUY environment variable.

Calling this function will override the directory specified in the DIGUY environment variable.

The base directory can be retrieved by using the function diguyApp::get_diguy_base_dir_path().

Callable From:

  • C++
Parameters
directory_nameoverride directory in which to search for DI-Guy files

Returns:

0 on success, -1 on failure

C++ Example:

1 #include <diguy_graphics_ogl.h>
2 
3  diguy_set_diguy_base_dir_path("c:/DI-Guy_alternate_directory");
4  diguy_ogl_initialize(NULL);
int diguy_deinitialize ( )

This function shuts down the DI-Guy software, removing all characters and cleaning up memory allocated by the library.

No objects created by the DI-Guy software should be referenced after this call is made.

This function should only be called once per program execution. Do not try to re-initialize the DI-Guy software after calling this function.

Callable From:

  • C++

Returns:

0 on success, -1 on failure

C++ Example:

1 diguy_deinitialize();
diguyApp* diguy_get_app ( )

This function returns a pointer to the DI-Guy application object.

Only one application object exists per DI-Guy run. The application object is created during DI-Guy initialize calls; e.g. diguy_ogl_initialize().

Returns:

a pointer of type diguyApp

Callable From:

  • C++

C++ Example:

1 diguyApp* app = diguy_get_app();
diguyScenario* diguy_create_scenario ( )

Description:

This function allocates and returns an empty object of type diguyScenario. This is the top-level "container" of most DI-Guy types, and includes objects of type diguyCharacter, diguyViewCamera, diguySceneObject, and diguySignal.

Callable From:

  • C++

Returns:

Pointer to object of type diguyScenario if successful; NULL if not.

C++ Example:

1 diguyScenario* sc = diguy_create_scenario();
2 if (sc)
3 {
4  sc->load("my_scenario.dss");
5 }
int diguy_destroy_scenario ( diguyScenario scenario)

Description:

This function destroys an object of type diguyScenario allocated by diguy_create_scenario().

Callable From:

  • C++

Returns:

0 on success, -1 on failure

C++ Example:

1 diguyScenario* sc = diguy_create_scenario();
2 // ...
3 diguy_destroy_scenario(sc);
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.

DI-Guy uses the order ZXY for all 3D rotations.

Callable From:

  • C++

Returns:

0 on success, -1 on failure

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.

Callable From:

  • C++

Returns:

0 on success, -1 on failure

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.

Callable From:

  • C++

Returns:

0 on success, -1 on failure

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.

Callable From:

  • C++

Returns:

0 on success, -1 on failure

Variable Documentation

comment line count1comment line count1comment line count1