![]() |
DI-Guy SDK Documentation
13.8
|
A class that represents the unique per-character non-shared joint of a character. A diguyCharacter is a hierarchy of links and joints. Think of the links as the bones of the characters while joints are the articulations. Note that the links themselves do not have any geometry directly associated with them; instead geometry is associated with shapes, which in turn are associated with links. More...
#include <diguyGraphicsLink.h>
Public Member Functions | |
Accessor Functions | |
The functions in this section provide access to data in this object. They are designed to be called by DI-Guy programmers. Unless otherwise noted all functions in this class section are callable from:
| |
| const char * | get_name () |
| Returns the name of the link. More... | |
| long | get_uid () |
| All links are assigned a unique identifier, or uid. More... | |
| int | get_index () |
| Returns: index of the link. More... | |
| diguyCharacter * | get_character () |
| Returns a pointer to the diguyCharacter to which this link belongs. More... | |
| int | get_num_shapes () |
| Returns: number of shapes on this link. More... | |
| diguyGraphicsShape * | get_shape_at_index (int index) |
| Returns: pointer of type diguyGraphicsShape; NULL if no shape at the specified index. More... | |
| diguyGraphicsShape * | find_shape (const char *name) |
| This function returns a pointer to the specified shape. More... | |
| diguyGraphicsShape * | find_shape_by_class_type (const char *name) |
| This function returns a pointer to the specified shape. More... | |
| void | set_shape_switch_override (const char *switch_name, int value) |
| This function overrides the motion data driving the visibility child shapes. More... | |
| diguyGraphicsJointType | get_joint_type () |
| Returns the type of joint that attaches this link to its parent. More... | |
| int | get_translation (float *tx, float *ty, float *tz) |
| Returns in the passed variables the translation amount of the link's joint. More... | |
| int | get_translation_double (double *tx, double *ty, double *tz) |
| Returns in the passed variables the translation amount of the link's joint. More... | |
| int | get_translation_is_static () |
| Returns whether the translation returned by get_translation() is static (unchanging) or dynamic (can change frame to frame). More... | |
| int | get_initial_translation (float *tx, float *ty, float *tz) |
| Returns in the passed variables the initial translation amount of the link's joint. More... | |
| const char * | get_var_name_tx () |
| Returns the name of the DI-Guy motion data variable that controls translation along the X axis. More... | |
| const char * | get_var_name_ty () |
| Returns the name of the DI-Guy motion data variable that controls translation along the Y axis. More... | |
| const char * | get_var_name_tz () |
| Returns the name of the DI-Guy motion data variable that controls translation along the Z axis. More... | |
| int | get_rotation (float *rz, float *rx, float *ry) |
| Returns in the passed variables the rotation amount of the link's joint. More... | |
| int | get_rotation_euler (float *rz, float *rx, float *ry) |
| Returns in the passed variables the rotation amount of the link's joint. More... | |
| int | get_rotation_quat (float *qx, float *qy, float *qz, float *qw) |
| Returns in the passed variables the rotation amount of the link's joint. More... | |
| int | get_rotation_is_static () |
| Returns whether the rotation returned by get_rotation() is static (unchanging) or dynamic (can change frame to frame). More... | |
| const char * | get_var_name_rz () |
| Returns the name of the DI-Guy motion data variable that controls rotation about the Z axis. More... | |
| const char * | get_var_name_rx () |
| Returns the name of the DI-Guy motion data variable that controls rotation about the X axis. More... | |
| const char * | get_var_name_ry () |
| Returns the name of the DI-Guy motion data variable that controls rotation about the Y axis. More... | |
| diguyGraphicsLink * | get_parent_link () |
| Returns a pointer to this link's parent link. More... | |
| diguyGraphicsLink * | get_position_link () |
| Returns a pointer to this character's base position link. More... | |
| diguyGraphicsLink * | get_position_link () const |
| diguyGraphicsLink * | get_attached_to_link () |
| Returns a pointer to this link's attached to link. More... | |
| int | get_is_position_link () |
| Returns 1 if this link is the position link, or 0 if not. More... | |
| int | get_num_child_links () |
| Returns how many child links this link has. More... | |
| diguyGraphicsLink * | get_child_link_at_index (int index) |
| Returns a pointer to this link's child link at the specified index. More... | |
Matrix Retrieval Functions | |
All functions in this class section are restricted to C++. | |
| int | get_transformation_matrix (float matrix_array[4][4], int transpose=0) |
| This function fills out the passed float array with the world-coordinate system transformation matrix of this link. More... | |
| int | get_transformation_matrix_4x4_ptr (float *matrix, int transpose=0) |
| Pointer version of get_transformation_matrix(), see for docs. More... | |
| int | get_local_transformation_matrix (float matrix_array[4][4], int transpose=0) |
| This function fills out the passed float array with the character-local-coordinate system transformation matrix of this link. More... | |
| int | get_local_transformation_matrix_4x4_ptr (float *matrix, int transpose=0) |
| Pointer version of get_local_transformation_matrix(), see for docs. More... | |
| int | get_local_translation (float *x, float *y, float *z) |
| int | get_link_transformation_matrix (float matrix_array[4][4], int transpose=0) |
| This function fills out the passed float array with the link-local-coordinate system transformation matrix of this link. More... | |
| int | get_link_transformation_matrix_4x4_ptr (float *matrix, int transpose=0) |
| Pointer version of get_link_transformation_matrix(), see for docs. More... | |
| const float * | get_data_ptr () |
| Returns a pointer to the current motion data array. More... | |
| const float * | get_quat_data_ptr () |
| This function is similar to get_data_ptr(), except rotations in the returned array will be in quaternions instead of Euler angles. More... | |
| int | get_translation_data_index () |
| Returns the index of this link's translation data in the float array returned by get_data_ptr() or get_quat_data_ptr(). More... | |
| int | get_rotation_data_index () |
| Returns the index of this link's rotation data in the float array returned by get_data_ptr(). More... | |
| int | get_quat_data_index () |
| Returns the index of this link's rotation data in the float array returned by get_quat_data_ptr(). More... | |
| int | get_unique_color (unsigned char *r, unsigned char *g, unsigned char *b) |
| Returns in the passed pointers the unique color of this link. More... | |
Virtual Functions | |
The functions in this section are all virtual functions that will be called by DI-Guy at various times during DI-Guy execution. Because the functions are all virtual, DI-Guy programmers can create a subclass of this class and override them. Unless otherwise stated, the base class functions do not need to be called. | |
| virtual void | build () |
| This function will be called by DI-Guy when it is time for renderer-specific link objects to be created. More... | |
| virtual void | post_build () |
| This function will be called by DI-Guy when all links and shapes of a DI-Guy character have been built, providing an opportunity for final touch-ups to be made to the built hierarchy. More... | |
| virtual void | unbuild () |
| This function will be called by DI-Guy when it is time for the renderer-specific link objects created during the build() call to be destroyed. More... | |
| virtual void | attach_to_scene () |
| This function will be called by DI-Guy when it is time for renderer-specific link objects created during the build() call to be attached to their attach points. More... | |
| virtual void | detach_from_scene () |
| This function will be called by DI-Guy when it is time for renderer-specific link objects created during the build() call to be detached from their attach points. More... | |
| virtual void | update () |
| This function will be called by DI-Guy when it is time for renderer-specific link objects created during the build() call to be updated with new transformation data. More... | |
| virtual void | draw () |
| This function will be called by DI-Guy when it is time for the transformations of this link to be applied. More... | |
| virtual void | set_shader_instance (diguyGraphicsShaderInstance *shader_instance) |
| This function will be called by DI-Guy when it a shader should be bound to this link. More... | |
| virtual void | instancing_state_changed (int instanced) |
| virtual void | fill_out_tbo_position_matrix (diguyGraphicsShape *current_shape, int lod, float *tbo_data) const |
| This function will be called by DI-Guy while building instance groups (which occurs during diguyScenario::draw() or when manually invoked. More... | |
| virtual void | fill_out_tbo_additional_data (diguyGraphicsShape *current_shape, float *tbo_data) |
| This function will be called by DI-Guy while building instance groups (which occurs during diguyScenario::draw() or when manually invoked. More... | |
Experimental Functions | |
The following functions are experimental and may change or disappear with no warning. | |
| virtual void | begin_character_draw () |
| This function will be called by DI-Guy when the drawing of a new character is beginning. More... | |
| virtual void | end_character_draw () |
| This function will be called by DI-Guy when the drawing traversal of the character's link hierarchy has completed. More... | |
| int | get_inverse_rotation_matrix (float matrix_array[4][4], int transpose=0, int include_translation=1) |
| Gets the inverse of the rotation matrix as a 4x4 float array. More... | |
| int | get_inverse_rotation_matrix_4x4_ptr (float *matrix_array, int transpose=0, int include_translation=1) |
| Gets the inverse of the rotation matrix as a 16-float array pointer. More... | |
| int | get_approximate_bounding_box (float *bbox_min_x, float *bbox_min_y, float *bbox_min_z, float *bbox_max_x, float *bbox_max_y, float *bbox_max_z) |
| Gets an approximation of the bounding box of this bone based on it's position in the skeleton. More... | |
Deprecated Functions | |
The following functions are deprecated. As these functions may disappear in a future version of DI-Guy, it is recommended that you remove calls to these functions from your application. | |
| int | get_is_base_link () |
| Deprecated as of 9.1.4; use diguyGraphicsLink::get_is_position_link() instead. More... | |
| int | get_scale (float *sz, float *sx, float *sy) |
| Deprecated as of 12.0.0 due to architecture change. More... | |
| int | get_scale_is_static () |
| Returns whether the scale returned by get_scale() is static (unchanging) or dynamic (can change frame to frame). More... | |
| const char * | get_var_name_sx () |
| Returns the name of the DI-Guy motion data variable that controls scale in the Z dimension. More... | |
| const char * | get_var_name_sy () |
| Returns the name of the DI-Guy motion data variable that controls scale in the Y dimension. More... | |
| const char * | get_var_name_sz () |
| Returns the name of the DI-Guy motion data variable that controls scale in the X dimension. More... | |
| int | get_scale_data_index () |
| Returns the index of this link's scale data in the float array returned by get_data_ptr() or get_quat_data_ptr(). More... | |
| void | set_selected (bool value) |
| bool | get_selected () |
Private Functions | |
The functions and variables past this point are for internal use only. No external access to them is expected or necessary. | |
| bdiLink * | m_scripted_object |
| A pointer to internal data. More... | |
| class | bdiLink |
| class | bdiGraphicsFactory |
| bdiLink * | get_scripted_object () |
| diguyGraphicsLink (void *internal_data) | |
| A protected constructor. More... | |
| virtual | ~diguyGraphicsLink () |
| A protected destructor. More... | |
A class that represents the unique per-character non-shared joint of a character. A diguyCharacter is a hierarchy of links and joints. Think of the links as the bones of the characters while joints are the articulations. Note that the links themselves do not have any geometry directly associated with them; instead geometry is associated with shapes, which in turn are associated with links.
Can be subclassed by filling out the diguy_graphics_set_link_create_func().
|
protected |
A protected constructor.
Constructors are called automatically by DI-Guy.
|
protectedvirtual |
A protected destructor.
Destructors are called automatically by DI-Guy.
| const char* diguyGraphicsLink::get_name | ( | ) |
Returns the name of the link.
This pointer will never be NULL.
Returns:
name of the link
| long diguyGraphicsLink::get_uid | ( | ) |
All links are assigned a unique identifier, or uid.
This function returns this links's uid.
Note: unique identifiers will change between DI-Guy runs!
Returns:
unique identifier of object
| int diguyGraphicsLink::get_index | ( | ) |
Returns: index of the link.
| diguyCharacter* diguyGraphicsLink::get_character | ( | ) |
Returns a pointer to the diguyCharacter to which this link belongs.
| int diguyGraphicsLink::get_num_shapes | ( | ) |
Returns: number of shapes on this link.
| diguyGraphicsShape* diguyGraphicsLink::get_shape_at_index | ( | int | index | ) |
Returns: pointer of type diguyGraphicsShape; NULL if no shape at the specified index.
| index | index of the shape; indices start at 0 |
| diguyGraphicsShape* diguyGraphicsLink::find_shape | ( | const char * | name | ) |
This function returns a pointer to the specified shape.
| name | name of link to be found |
Returns:
pointer of type diguyGraphicsShape; NULL if not found
| diguyGraphicsShape* diguyGraphicsLink::find_shape_by_class_type | ( | const char * | name | ) |
This function returns a pointer to the specified shape.
| name | name of shape with class_type to be found, currently works with heads |
Returns:
pointer of type diguyGraphicsShape; NULL if not found
| void diguyGraphicsLink::set_shape_switch_override | ( | const char * | switch_name, |
| int | value | ||
| ) |
This function overrides the motion data driving the visibility child shapes.
| switch_name | the name of the motion data stream that controls the visibility |
| of | a child shape, see also get_switch_var_name(), set to 1 to allow the underlying motion data to resume control |
| diguyGraphicsJointType diguyGraphicsLink::get_joint_type | ( | ) |
Returns the type of joint that attaches this link to its parent.
Returns:
joint type of the link
| int diguyGraphicsLink::get_translation | ( | float * | tx, |
| float * | ty, | ||
| float * | tz | ||
| ) |
Returns in the passed variables the translation amount of the link's joint.
If there is a current render camera set, the position link's values will be in the local space of the camera. This is useful for rendering far from the origin.
The values may or may not stay constant frame to frame; see get_translation_is_static().
Returned values are in meters, and should be applied after the rotational offset (if any).
| tx,ty,tz | pointers to floats into which result should be placed |
Returns:
0 on success, -1 on failure
| int diguyGraphicsLink::get_translation_double | ( | double * | tx, |
| double * | ty, | ||
| double * | tz | ||
| ) |
Returns in the passed variables the translation amount of the link's joint.
The values may or may not stay constant frame to frame; see get_translation_is_static().
Returned values are in meters, and should be applied after the rotational offset (if any).
| tx,ty,tz | pointers to doubles into which result should be placed |
Returns:
0 on success, -1 on failure
| int diguyGraphicsLink::get_translation_is_static | ( | ) |
Returns whether the translation returned by get_translation() is static (unchanging) or dynamic (can change frame to frame).
If the translation is dynamic the translation values will come from one or more DI-Guy motion variables; the names of the variables are accessible using the functions get_var_name_tx(), etc.
If the translation is static it will remain so; the value returned by this function should not change frame to frame.
Returns:
1 if translation is static, 0 if not, -1 on failure
| int diguyGraphicsLink::get_initial_translation | ( | float * | tx, |
| float * | ty, | ||
| float * | tz | ||
| ) |
Returns in the passed variables the initial translation amount of the link's joint.
This value is static and typically represents the offset to the parent link
Returned values are in meters
| tx,ty,tz | pointers to floats into which result should be placed |
Returns:
0 on success, -1 on failure
| const char* diguyGraphicsLink::get_var_name_tx | ( | ) |
Returns the name of the DI-Guy motion data variable that controls translation along the X axis.
The returned pointer will be NULL if there is no associated variable.
Returns:
name of the variable; NULL if there is no variable
| const char* diguyGraphicsLink::get_var_name_ty | ( | ) |
Returns the name of the DI-Guy motion data variable that controls translation along the Y axis.
The returned pointer will be NULL if there is no associated variable.
Returns:
name of the variable; NULL if there is no variable
| const char* diguyGraphicsLink::get_var_name_tz | ( | ) |
Returns the name of the DI-Guy motion data variable that controls translation along the Z axis.
The returned pointer will be NULL if there is no associated variable.
Returns:
name of the variable; NULL if there is no variable
| int diguyGraphicsLink::get_rotation | ( | float * | rz, |
| float * | rx, | ||
| float * | ry | ||
| ) |
Returns in the passed variables the rotation amount of the link's joint.
The values may or may not stay constant frame to frame; see get_rotation_is_static().
Returned values are an Euler triple in degrees, and should be applied in RZ -> RX -> RY order, after the translation.
| rz,rx,ry | pointers to floats into which result should be placed |
Returns:
0 on success, -1 on failure
| int diguyGraphicsLink::get_rotation_euler | ( | float * | rz, |
| float * | rx, | ||
| float * | ry | ||
| ) |
Returns in the passed variables the rotation amount of the link's joint.
The values may or may not stay constant frame to frame; see get_rotation_is_static().
Returned values are an Euler triple in degrees, and should be applied in RZ -> RX -> RY order, after the translation.
| rz,rx,ry | pointers to floats into which result should be placed |
Returns:
0 on success, -1 on failure
| int diguyGraphicsLink::get_rotation_quat | ( | float * | qx, |
| float * | qy, | ||
| float * | qz, | ||
| float * | qw | ||
| ) |
Returns in the passed variables the rotation amount of the link's joint.
The values may or may not stay constant frame to frame; see get_rotation_is_static().
Returned values are a quaternion and should be applied after the translation.
| qx,qy,qz,qw | pointers to floats into which result should be placed |
Returns:
0 on success, -1 on failure
| int diguyGraphicsLink::get_rotation_is_static | ( | ) |
Returns whether the rotation returned by get_rotation() is static (unchanging) or dynamic (can change frame to frame).
If the rotation is dynamic the rotation values will come from one or more DI-Guy motion variables; the names of the variables are accessible using the functions get_var_name_rz(), etc.
If the rotation is static it will remain so; the value returned by this function should not change frame to frame.
Returns:
1 if rotation is static, 0 if not, -1 on failure
| const char* diguyGraphicsLink::get_var_name_rz | ( | ) |
Returns the name of the DI-Guy motion data variable that controls rotation about the Z axis.
The returned pointer will be NULL if there is no associated variable.
| const char* diguyGraphicsLink::get_var_name_rx | ( | ) |
Returns the name of the DI-Guy motion data variable that controls rotation about the X axis.
The returned pointer will be NULL if there is no associated variable.
| const char* diguyGraphicsLink::get_var_name_ry | ( | ) |
Returns the name of the DI-Guy motion data variable that controls rotation about the Y axis.
The returned pointer will be NULL if there is no associated variable.
| diguyGraphicsLink* diguyGraphicsLink::get_parent_link | ( | ) |
Returns a pointer to this link's parent link.
Parent links are always links within the same character. If a link is attached to a link in another character (i.e., it is "parented to" another link), that link pointer can be obtained by calling get_attached_to_link().
The returned pointer will be NULL if the link is the position link and has no parent.
Returns:
object of type diguyGraphicsLink
| diguyGraphicsLink* diguyGraphicsLink::get_position_link | ( | ) |
Returns a pointer to this character's base position link.
| diguyGraphicsLink* diguyGraphicsLink::get_position_link | ( | ) | const |
| diguyGraphicsLink* diguyGraphicsLink::get_attached_to_link | ( | ) |
Returns a pointer to this link's attached to link.
The attached to link is different than the parent link in that a parent link is always a link in the same character, while an attached to link is always a link in a different character.
Only position links can be attached to links of another character.
The returned pointer will be NULL if the link is not attached to the link of another character.
| int diguyGraphicsLink::get_is_position_link | ( | ) |
Returns 1 if this link is the position link, or 0 if not.
The position link is the root link of the DI-Guy character's link and shape hierarchy, and has no parent link.
Returns:
1 if this link is the position link, 0 if not, -1 on error
| int diguyGraphicsLink::get_num_child_links | ( | ) |
Returns how many child links this link has.
Child links can be accessed using the get_child_link_at_index() function.
Returns:
number of child links
| diguyGraphicsLink* diguyGraphicsLink::get_child_link_at_index | ( | int | index | ) |
Returns a pointer to this link's child link at the specified index.
The returned pointer will be NULL if there is no link at that index.
| index | index of the child link; indices start at 0 |
| int diguyGraphicsLink::get_transformation_matrix | ( | float | matrix_array[4][4], |
| int | transpose = 0 |
||
| ) |
This function fills out the passed float array with the world-coordinate system transformation matrix of this link.
ie -> character->get_position_transformation_matrix() * link->get_cached_matrix();
| matrix_array | two-dimensional array of floats into which the matrix should be copied |
| transpose | defaults to zero, sets if the matrix should be |
| treated | as row major or column-major |
Returns:
0 on success, -1 on failure
| int diguyGraphicsLink::get_transformation_matrix_4x4_ptr | ( | float * | matrix, |
| int | transpose = 0 |
||
| ) |
Pointer version of get_transformation_matrix(), see for docs.
Some end users might prefer this version to avoid copying data from an explicit float[4][4].
| int diguyGraphicsLink::get_local_transformation_matrix | ( | float | matrix_array[4][4], |
| int | transpose = 0 |
||
| ) |
This function fills out the passed float array with the character-local-coordinate system transformation matrix of this link.
Also known as the cached matrix.
| matrix_array | two-dimensional array of floats into which the matrix should be copied |
| transpose | defaults to 0, sets if the matrix should be treated |
| as | row major or column-major |
Returns:
0 on success, -1 on failure
| int diguyGraphicsLink::get_local_transformation_matrix_4x4_ptr | ( | float * | matrix, |
| int | transpose = 0 |
||
| ) |
Pointer version of get_local_transformation_matrix(), see for docs.
Some end users might prefer this version to avoid copying data from an explicit float[4][4].
| int diguyGraphicsLink::get_local_translation | ( | float * | x, |
| float * | y, | ||
| float * | z | ||
| ) |
| int diguyGraphicsLink::get_link_transformation_matrix | ( | float | matrix_array[4][4], |
| int | transpose = 0 |
||
| ) |
This function fills out the passed float array with the link-local-coordinate system transformation matrix of this link.
This is the same value as the matrix built from get_rotation() and get_translation()
| matrix_array | two-dimensional array of floats into which the matrix should be copied |
| transpose | defaults to 0, sets if the matrix should be treated |
| as | row major or column-major |
Returns:
0 on success, -1 on failure
| int diguyGraphicsLink::get_link_transformation_matrix_4x4_ptr | ( | float * | matrix, |
| int | transpose = 0 |
||
| ) |
Pointer version of get_link_transformation_matrix(), see for docs.
Some end users might prefer this version to avoid copying data from an explicit float[4][4].
| const float* diguyGraphicsLink::get_data_ptr | ( | ) |
Returns a pointer to the current motion data array.
Along with data indices returned below, motion data can be directly read from this state vector instead of making multiple calls for getting transform data.
The rotations in this array will be in Euler angles. If quaternions are being used, get_quat_data_ptr() should be called instead.
This function may return NULL, in which case the functions get_translation(), get_rotation(), and get_scale() must be used.
The pointer returned by this function may change from frame to frame, and therefore should not be saved.
This function should not be used for the position link (when get_is_position_link() returns 1).
This function should not be called in a derived class's constructor; the pointer will not yet be valid.
Returns:
pointer to floats; may return NULL if array isn't available
Callable From:
| const float* diguyGraphicsLink::get_quat_data_ptr | ( | ) |
This function is similar to get_data_ptr(), except rotations in the returned array will be in quaternions instead of Euler angles.
Returns:
pointer to floats; may return NULL if array isn't available
Callable From:
| int diguyGraphicsLink::get_translation_data_index | ( | ) |
Returns the index of this link's translation data in the float array returned by get_data_ptr() or get_quat_data_ptr().
The translation values are in (tx, ty, tz) order in the array.
This function may return -1, in which case this link has no translation data.
The index returned by this function will not change from frame to frame, and can therefore be saved once it has been obtained.
This function should not be used for the position link (when get_is_position_link() returns 1). Use get_translation() instead.
This function should not be called in a derived class's constructor; the index will not yet be valid.
Returns:
index into float array; -1 if no translation data for link
| int diguyGraphicsLink::get_rotation_data_index | ( | ) |
Returns the index of this link's rotation data in the float array returned by get_data_ptr().
If quaternion data is being used, call get_quat_data_ptr() instead.
The rotation values in the data array will be Euler angles in (rz, rx, ry) order.
This function may return -1, in which case this link has no rotation data.
This function should not be used for the position link (when get_is_position_link() returns 1). Use get_rotation() instead.
This function should not be called in a derived class's constructor; the index will not yet be valid.
Returns:
index into float array; -1 if no rotation data for link
| int diguyGraphicsLink::get_quat_data_index | ( | ) |
Returns the index of this link's rotation data in the float array returned by get_quat_data_ptr().
If Euler angle data is being used, call get_data_ptr() instead.
The rotation values in the data array will be a quaternion in (qx, qy, qz, qw) order.
This function may return -1, in which case this link has no rotation data.
The index returned by this function will not change from frame to frame, and can therefore be saved once it has been obtained.
This function should not be used for the position link (when get_is_position_link() returns 1). Use get_rotation() instead.
This function should not be called in a derived class's constructor; the index will not yet be valid.
Returns:
index into float array; -1 if no rotation data for link
| int diguyGraphicsLink::get_unique_color | ( | unsigned char * | r, |
| unsigned char * | g, | ||
| unsigned char * | b | ||
| ) |
Returns in the passed pointers the unique color of this link.
All links in a DI-Guy appearance are assigned a unique RGB color that can be used in pick/selection operations.
Also see diguyScenario::map_color_to_impact().
See programming_examples/diguy_graphics_api/ogl_examples/intersection_test for an example of its usage.
Returns:
0 on success, -1 on failure
Test with lua probably non-functional
|
virtual |
This function will be called by DI-Guy when it is time for renderer-specific link objects to be created.
All information necessary to build the link should be available via the Accessor Functions above when this function is called.
Builds happen in depth-first traversal order, so the parent's build() function will always be called before this link's build() function.
Immediate Mode:
Immediate mode renderers usually do not override this function.
Scene Graph:
Scene graph renderers usually do override this function, to create scene graph nodes that allow for the various transformations to happen.
The following nodes are commonly created:
either an LOD or switch node to allow graphics LODs to be applied
LOD nodes, that automatically handle LOD switching, should be created if automatic LOD switching is desired.
A switch node should be created if manual setting of the graphics LOD is desired.
If this link is a position link (it has no parent link), the scene graph nodes should not yet be attached to the scene graph; that should be done during the call to attach().
Otherwise the scene graph nodes should start out attached to their attach points (a scene graph node of the parent link).
Callable From:
Reimplemented in diguyOsgGraphicsLink.
|
virtual |
This function will be called by DI-Guy when all links and shapes of a DI-Guy character have been built, providing an opportunity for final touch-ups to be made to the built hierarchy.
This function will be called only for the top-level position link.
Immediate Mode:
Immediate mode renderers usually do not override this function.
Scene Graph:
Scene graph renderers sometimes override this function. They might to so to do renderer-specific optimizations to the created hierarchy.
Callable From:
Reimplemented in diguyOsgGraphicsLink.
|
virtual |
This function will be called by DI-Guy when it is time for the renderer-specific link objects created during the build() call to be destroyed.
Unbuilds happen in reverse depth-first traversal order, so this link's unbuild() function will always be called before the parent's unbuild() function.
Immediate Mode:
Immediate mode renderers usually do not override this function.
Scene Graph:
Scene graph renderers usually do override this function, to destroy the scene graph nodes created by build().
Callable From:
Reimplemented in diguyOsgGraphicsLink.
|
virtual |
This function will be called by DI-Guy when it is time for renderer-specific link objects created during the build() call to be attached to their attach points.
This function will only be called for the position link.
Immediate Mode:
Immediate mode renderers usually do not override this function.
Scene Graph:
Scene graph renderers usually do override this function, to attach the scene graph nodes created during build() to somewhere on the scene graph.
Callable From:
Reimplemented in diguyOsgGraphicsLink.
|
virtual |
This function will be called by DI-Guy when it is time for renderer-specific link objects created during the build() call to be detached from their attach points.
Immediate Mode:
Immediate mode renderers usually do not override this function.
Scene Graph:
Scene graph renderers usually do override this function, to detach the scene graph nodes created during build() from the scene graph.
Callable From:
Reimplemented in diguyOsgGraphicsLink.
|
virtual |
This function will be called by DI-Guy when it is time for renderer-specific link objects created during the build() call to be updated with new transformation data.
Updates happen in depth-first traversal order, so the parent's update() function will always be called before this link's update() function.
Immediate Mode:
Immediate mode renderers usually do not override this function.
Scene Graph:
Scene graph renderers usually do override this function, to update the scene graph nodes created during build() with new values.
These values should be obtained by calling get_translation(), get_rotation(), and get_scale().
Callable From:
Reimplemented in diguyOsgGraphicsLink.
|
virtual |
This function will be called by DI-Guy when it is time for the transformations of this link to be applied.
Immediate Mode:
Immediate mode renderers usually do override this function, to apply transformations to the transformation stack.
Scene Graph:
Scene graph renderers usually do not override this function; transformation states are handled automatically by scene graphs.
Callable From:
Reimplemented in diguyOglGraphicsLink, diguyDx9GraphicsLink, and diguyDx11GraphicsLink.
|
virtual |
This function will be called by DI-Guy when it a shader should be bound to this link.
This is important in some scene graph environments, when the scene graph is responsible for binding the shader.
Immediate Mode:
Immediate mode renderers usually do not override this function.
Scene Graph:
Scene graph renderers can override this function but some don't need to.
Callable From:
Reimplemented in diguyOsgGraphicsLink.
|
virtual |
Reimplemented in diguyOsgGraphicsLink.
|
virtual |
This function will be called by DI-Guy while building instance groups (which occurs during diguyScenario::draw() or when manually invoked.
It gives the user a chance to set the contents of the tbo on a per shape basis. tbo_data should be a 4x3 matrix. Will only be called if diguyScenario::set_instancing_position_callback_enabled() is set to true.
Reimplemented in diguyOglGraphicsLink.
|
virtual |
This function will be called by DI-Guy while building instance groups (which occurs during diguyScenario::draw() or when manually invoked.
Will allow the end user to add additional data to the tbo. This is required to be in blocks of 4 floats. Will only be called if diguyScenario::set_num_extra_per_instance_data_floats(int number); is set to a reasonable number.
|
virtual |
This function will be called by DI-Guy when the drawing of a new character is beginning.
This happens when the position link is drawn.
Immediate Mode:
Immediate mode renderers can override this function. Typically some type of transformation matrix stack push operation is performed. This is also an appropriate place to do any per-character modifications, such as:
Scene Graph:
Scene graph renderers usually do not override this function; transformation states are handled automatically by scene graphs.
Callable From:
Reimplemented in diguyOglGraphicsLink, diguyDx9GraphicsLink, and diguyDx11GraphicsLink.
|
virtual |
This function will be called by DI-Guy when the drawing traversal of the character's link hierarchy has completed.
Immediate Mode:
Immediate mode renderers can override this function. Typically any matrix stack push operation done in begin_character_draw() is undone here by an appropriate pop operation.
Scene Graph:
Scene graph renderers usually do not override this function; transformation states are handled automatically by scene graphs.
Callable From:
Reimplemented in diguyOglGraphicsLink, diguyDx9GraphicsLink, and diguyDx11GraphicsLink.
| int diguyGraphicsLink::get_inverse_rotation_matrix | ( | float | matrix_array[4][4], |
| int | transpose = 0, |
||
| int | include_translation = 1 |
||
| ) |
Gets the inverse of the rotation matrix as a 4x4 float array.
| int diguyGraphicsLink::get_inverse_rotation_matrix_4x4_ptr | ( | float * | matrix_array, |
| int | transpose = 0, |
||
| int | include_translation = 1 |
||
| ) |
Gets the inverse of the rotation matrix as a 16-float array pointer.
| int diguyGraphicsLink::get_approximate_bounding_box | ( | float * | bbox_min_x, |
| float * | bbox_min_y, | ||
| float * | bbox_min_z, | ||
| float * | bbox_max_x, | ||
| float * | bbox_max_y, | ||
| float * | bbox_max_z | ||
| ) |
Gets an approximation of the bounding box of this bone based on it's position in the skeleton.
This bounding box is in the space of the local_transformation_matrix Not always accurate.
| int diguyGraphicsLink::get_is_base_link | ( | ) |
Deprecated as of 9.1.4; use diguyGraphicsLink::get_is_position_link() instead.
| int diguyGraphicsLink::get_scale | ( | float * | sz, |
| float * | sx, | ||
| float * | sy | ||
| ) |
Deprecated as of 12.0.0 due to architecture change.
Deprecated, we don't currently support scaling links
Returns in the passed variables the scale amount of the link's joint.
The values may or may not stay constant frame to frame; see get_scale_is_static().
Returned values unitless scale factors, and should be applied after the rotation.
| sx,sy,sz | pointers to floats into which result should be placed |
Returns:
0 on success, -1 on failure
| int diguyGraphicsLink::get_scale_is_static | ( | ) |
Returns whether the scale returned by get_scale() is static (unchanging) or dynamic (can change frame to frame).
If the scale is dynamic the scale values will come from one or more DI-Guy motion variables; the names of the variables are accessible using the functions get_var_name_sx(), etc.
If the scale is static it will remain so; the value returned by this function should not change frame to frame.
Returns:
1 if scale is static, 0 if not, -1 on failure
| const char* diguyGraphicsLink::get_var_name_sx | ( | ) |
Returns the name of the DI-Guy motion data variable that controls scale in the Z dimension.
The returned pointer will be NULL if there is no associated variable.
| const char* diguyGraphicsLink::get_var_name_sy | ( | ) |
Returns the name of the DI-Guy motion data variable that controls scale in the Y dimension.
The returned pointer will be NULL if there is no associated variable.
| const char* diguyGraphicsLink::get_var_name_sz | ( | ) |
Returns the name of the DI-Guy motion data variable that controls scale in the X dimension.
The returned pointer will be NULL if there is no associated variable.
| int diguyGraphicsLink::get_scale_data_index | ( | ) |
Returns the index of this link's scale data in the float array returned by get_data_ptr() or get_quat_data_ptr().
The scale values are in (sx, sy, sz) order in the array.
This function may return -1, in which case this link has no scale data.
The index returned by this function will not change from frame to frame, and can therefore be saved once it has been obtained.
This function should not be used for the position link (when get_is_position_link() returns 1). Use get_scale() instead.
This function should not be called in a derived class's constructor; the index will not yet be valid.
Returns:
index into float array; -1 if no scale data for link
| void diguyGraphicsLink::set_selected | ( | bool | value | ) |
| bool diguyGraphicsLink::get_selected | ( | ) |
|
inline |
|
friend |
|
friend |
|
private |
A pointer to internal data.