DI-Guy SDK Documentation  13.6
diguyMotionDirection.h File Reference
#include <declspec_diguy.h>

Go to the source code of this file.

Macros

#define CPLUSPLUS_ONLY
 

Enumerations

enum  diguyMotionDirection {
  DIGUY_MOTION_DIRECTION_NONE = 0, DIGUY_MOTION_DIRECTION_FORWARD, DIGUY_MOTION_DIRECTION_BACKWARD, DIGUY_MOTION_DIRECTION_LEFT,
  DIGUY_MOTION_DIRECTION_RIGHT, DIGUY_MOTION_DIRECTION_LOCOMOTION, DIGUY_MOTION_DIRECTION_UP, DIGUY_MOTION_DIRECTION_DOWN,
  DIGUY_MOTION_DIRECTION_TURN_LEFT, DIGUY_MOTION_DIRECTION_TURN_RIGHT, DIGUY_MOTION_DIRECTION_NONLINEAR, DIGUY_MOTION_DIRECTION_LINEAR_OFFAXIS,
  DIGUY_MOTION_DIRECTION_INHERIT, DIGUY_MOTION_DIRECTION_UNKNOWN, DIGUY_MOTION_DIRECTION_COUNT
}
 

Functions

const char * diguy_motion_direction_to_string (diguyMotionDirection direction)
 This function converts the passed direction enumeration into a NULL-terminated C-style string. More...
 
diguyMotionDirection diguy_motion_direction_from_string (const char *string)
 This function converts the passed C-style string into an enumerated value. More...
 
float diguy_motion_direction_to_angle (diguyMotionDirection direction)
 This function converts the passed direction enumeration into a floating point angle. More...
 
diguyMotionDirection diguy_motion_direction_from_angle (float angle, float allowed_error=1.0f)
 This function converts the passed angle into a direction enumeration. More...
 

Macro Definition Documentation

#define CPLUSPLUS_ONLY

Enumeration Type Documentation

Enumerator
DIGUY_MOTION_DIRECTION_NONE 
DIGUY_MOTION_DIRECTION_FORWARD 
DIGUY_MOTION_DIRECTION_BACKWARD 
DIGUY_MOTION_DIRECTION_LEFT 
DIGUY_MOTION_DIRECTION_RIGHT 
DIGUY_MOTION_DIRECTION_LOCOMOTION 
DIGUY_MOTION_DIRECTION_UP 
DIGUY_MOTION_DIRECTION_DOWN 
DIGUY_MOTION_DIRECTION_TURN_LEFT 
DIGUY_MOTION_DIRECTION_TURN_RIGHT 
DIGUY_MOTION_DIRECTION_NONLINEAR 
DIGUY_MOTION_DIRECTION_LINEAR_OFFAXIS 
DIGUY_MOTION_DIRECTION_INHERIT 
DIGUY_MOTION_DIRECTION_UNKNOWN 
DIGUY_MOTION_DIRECTION_COUNT 

Function Documentation

const char* diguy_motion_direction_to_string ( diguyMotionDirection  direction)

This function converts the passed direction enumeration into a NULL-terminated C-style string.

Returns:

C-style string identifying direction

Callable From:

  • C++
  • Script
diguyMotionDirection diguy_motion_direction_from_string ( const char *  string)

This function converts the passed C-style string into an enumerated value.

Directions are used in functions such as diguyCharacter::get_action_from_description().

Returns:

enumeration value of direction

Callable From:

  • C++
  • Script
float diguy_motion_direction_to_angle ( diguyMotionDirection  direction)

This function converts the passed direction enumeration into a floating point angle.

The returned angle is in degrees.

Currently only the following directions return useful angles:

  • DIGUY_MOTION_DIRECTION_FORWARD (angle = 0)
  • DIGUY_MOTION_DIRECTION_BACKWARD (angle = 180)
  • DIGUY_MOTION_DIRECTION_LEFT (angle = 90)
  • DIGUY_MOTION_DIRECTION_RIGHT (angle = 270)

All other directions return an angle of 0.

Returns:

yaw angle of direction in degrees

Callable From:

  • C++
  • Script
diguyMotionDirection diguy_motion_direction_from_angle ( float  angle,
float  allowed_error = 1.0f 
)

This function converts the passed angle into a direction enumeration.

Currently only the following directions will be returned:

  • DIGUY_MOTION_DIRECTION_FORWARD (angle approx. 0)
  • DIGUY_MOTION_DIRECTION_BACKWARD (angle approx. 180)
  • DIGUY_MOTION_DIRECTION_LEFT (angle approx. 90)
  • DIGUY_MOTION_DIRECTION_RIGHT (angle approx. 270)
  • DIGUY_MOTION_DIRECTION_UNKNOWN (everything else)

If the passed angle isn't within the specified error amount of any direction's "exact" angle, the value DIGUY_MOTION_DIRECTION_UNKNOWN will be returned.

Parameters
angleangle for which to retrieve direction, in degrees
allowed_errorhow much error there can be from the direction's "exact" angle

Returns:

enumeration value of direction

Callable From:

  • C++
  • Script