![]() |
DI-Guy SDK Documentation
13.2
|
A class that allows end users to override a character's animation on a joint level. More...
#include <diguyCharacterPoseOverride.h>
Public Member Functions | |
| float * | allocate_pose_array () |
| Allocates an array of floats to hold the joint angles for each degree of freedom, or weights to specify how pose angles will affect a character. More... | |
| int | free_pose_array (float *array) |
| Frees an array allocated with allocate_pose_array(). More... | |
| int | get_num_vars () |
| This function returns the number of the variables representing joint angles. More... | |
| char ** | allocate_var_names () |
| This function allocates an array of pointer to char**. More... | |
| int | get_var_names (char **var_names) |
| This function fills out the passed array of strings with the list of the names of the variables representing joint angles. More... | |
| int | free_var_names (char **var_names) |
| This function frees the array of strings allocated by allocate_var_names(). More... | |
| int | get_var_index (const char *varname) |
| Get the index of the given variable in the array of pose angles. More... | |
| int | get_pose_in_radians (float *pose_array) |
| This function fills out the passed array of floats with the most recent values passed in a call to set_pose_in_radians(). More... | |
| int | get_pose_in_quaternions (float *pose_array) |
| same as get_pose_in_radians without the eular to quat conversion More... | |
| int | set_pose_in_radians (float *pose_array, float *weights_array=NULL, float default_weight=1.0f) |
| This function specifies the joint angle data that will modify or override the joint angles the character normally computes. More... | |
| int | set_pose_in_quaternions (float *pose_array, float *weights_array=NULL, float default_weight=1.0f) |
| same as set_pose_in_radians without the eular to quat conversion More... | |
| float | get_default_weight () |
| Get the default weight for pose angles. More... | |
| int | set_default_weight (float default_weight) |
| Set the default weight for pose angles. More... | |
| int | set_weight_array_modifier (float weight_array_modifier) |
| Sets an additional multiplier on the entire weight array. More... | |
| float | get_weight_array_modifier () |
| Returns the additional multiplier on the entire weight array. More... | |
Private Functions | |
The functions and variables past this point are for internal use only. No external access to them is expected or necessary. | |
| bdiPoseOverride * | m_scripted_object |
| bdiScenarioCharacter * | m_character |
| class | bdiPoseOverride |
| class | diguyCharacter |
| class | bdiScenarioCharacter |
| bdiPoseOverride * | get_scripted_object () |
| diguyCharacterPoseOverride (bdiPoseOverride *scripted_object, bdiScenarioCharacter *character) | |
| virtual | ~diguyCharacterPoseOverride () |
A class that allows end users to override a character's animation on a joint level.
|
private |
|
privatevirtual |
| float* diguyCharacterPoseOverride::allocate_pose_array | ( | ) |
Allocates an array of floats to hold the joint angles for each degree of freedom, or weights to specify how pose angles will affect a character.
The size of the array will be equal to the value returned by get_num_vars().
The allocated array should be freed by calling free_pose_array().
The allocated array will contain uninitialized values.
If the array is to hold weights, each entry in the array should be set to a valid value between 0.0 and 1.0.
If the array is to hold pose angles, each pose variable whose corresponding weight is going to be non-0 should be set to a valid value.
Returns:
pointer to array of floats, NULL if the array cannot be allocated
Callable From:
C++ Example:
See example for set_pose_in_radians().
| int diguyCharacterPoseOverride::free_pose_array | ( | float * | array | ) |
Frees an array allocated with allocate_pose_array().
| array | array of pose angles to be freed |
Returns:
0 on success, -1 on failure
Callable From:
| int diguyCharacterPoseOverride::get_num_vars | ( | ) |
This function returns the number of the variables representing joint angles.
Returns:
an integer representing the number of joint angles
Callable From:
| char** diguyCharacterPoseOverride::allocate_var_names | ( | ) |
This function allocates an array of pointer to char**.
(i.e., C-style strings).
This array can then be passed to get_var_names().
It should be freed using the function free_var_names(). The size of the array will be equal to the value returned by get_num_vars().
Returns:
an array of pointers to char*'s (i.e. pointers to strings)
Callable From:
C++ Example:
See example for get_var_names().
| int diguyCharacterPoseOverride::get_var_names | ( | char ** | var_names | ) |
This function fills out the passed array of strings with the list of the names of the variables representing joint angles.
| var_names | an array of strings as allocated by allocate_var_names() |
Returns:
0 on success, -1 on failure
Callable From:
C++ Example:
| int diguyCharacterPoseOverride::free_var_names | ( | char ** | var_names | ) |
This function frees the array of strings allocated by allocate_var_names().
| var_names | an array of strings as allocated by allocate_var_names() |
Returns:
0 on success, -1 on failure
Callable From:
| int diguyCharacterPoseOverride::get_var_index | ( | const char * | varname | ) |
Get the index of the given variable in the array of pose angles.
| varname | the name of the pose angle variable whose index is desired |
Returns:
index of the pose variable, if it exists, -1 if not
Callable From:
C++ Example:
See example for set_pose_in_radians().
| int diguyCharacterPoseOverride::get_pose_in_radians | ( | float * | pose_array | ) |
This function fills out the passed array of floats with the most recent values passed in a call to set_pose_in_radians().
Note that this may not be the actual pose of the character; this is only the pose angles for this specific pose override. Other pose overrides, gazing, etc., will also affect the pose of the character. Use the function diguyCharacter::get_pose_in_radians() to read the "real" pose of the character, as computed by the DI-Guy motion engine.
| pose_array | array of floats allocated by allocate_pose_array() |
Returns:
0 on success, -1 on failure
Callable From:
| int diguyCharacterPoseOverride::get_pose_in_quaternions | ( | float * | pose_array | ) |
same as get_pose_in_radians without the eular to quat conversion
| int diguyCharacterPoseOverride::set_pose_in_radians | ( | float * | pose_array, |
| float * | weights_array = NULL, |
||
| float | default_weight = 1.0f |
||
| ) |
This function specifies the joint angle data that will modify or override the joint angles the character normally computes.
The replacement data is in pose_array.
If weights array is non-NULL, then each element specifies the proportion of the value on pose array to mix in with the value normally computed by the character. A weight of 0.0 means to ignore the value in pose_array. A weight of 1.0 means fully override the value computed by the character.
If weights_array is NULL, then default_weight will be used for all of the joint angles.
Note that all weights for an Euler triple (e.g. - q.cervical_rz/rx/ry) must be equal to ensure proper interpolation.
Also note that the first six variables that contain the character's overall position and orientation cannot be changed using a pose override. These values must be changed using the functions diguyCharacter::set_position() and diguyCharacter::set_orientation().
| pose_array | the array containing the pose angles for this override object |
| weight_array | the multiplier used to determine how the new pose_array values are to be combined with the existing pose |
| default_weight | the value to be used to set the weights if weights_array is NULL |
Returns:
0 on success, -1 on failure
Callable From:
C++ Example:
| int diguyCharacterPoseOverride::set_pose_in_quaternions | ( | float * | pose_array, |
| float * | weights_array = NULL, |
||
| float | default_weight = 1.0f |
||
| ) |
same as set_pose_in_radians without the eular to quat conversion
| float diguyCharacterPoseOverride::get_default_weight | ( | ) |
Get the default weight for pose angles.
Returns:
the default pose angle weight
Callable From:
| int diguyCharacterPoseOverride::set_default_weight | ( | float | default_weight | ) |
Set the default weight for pose angles.
The default weight will be used to set values in a pose's weights array if the array passed in, for instance, set_pose_in_radians(), is NULL.
| default_weight | the desired default weight |
Returns:
0 on success, -1 on failure
Callable From:
| int diguyCharacterPoseOverride::set_weight_array_modifier | ( | float | weight_array_modifier | ) |
Sets an additional multiplier on the entire weight array.
Defaults to 1.0f
| weight_array_modifier | the desired weight |
Returns:
0 on success, -1 on failure
Callable From:
| float diguyCharacterPoseOverride::get_weight_array_modifier | ( | ) |
Returns the additional multiplier on the entire weight array.
|
inline |
|
friend |
|
friend |
|
friend |
|
private |
|
private |