![]() |
DI-Guy SDK Documentation
13.2
|
Shapes are the high-level containers of visible geometry. More...
#include <diguyOsgGraphicsShape.h>
Public Member Functions | |
| diguyOsgGraphicsShape (void *internal_data) | |
| virtual void | build () |
| This function will be called by DI-Guy when it is time for renderer-specific shape objects to be created. More... | |
| virtual void | unbuild () |
| This function will be called by DI-Guy when it is time for the renderer-specific shape objects created during the build() call to be destroyed. More... | |
| virtual void | show () |
| This function will be called by DI-Guy when the shape should be shown, typically due to a change in the motion data that controls the switch. More... | |
| virtual void | hide () |
| This function will be called by DI-Guy when the shape should be hidden, typically due to a change in the motion data that controls the switch. More... | |
| virtual void | instancing_state_changed (int val) |
| virtual void | set_graphics_lod_ranges (float *lod_ranges) |
| This function will be called by DI-Guy when the LOD ranges of this shape need to be updated after the shape has initially been built in the Build Stage. More... | |
| virtual void | set_graphics_lod (int lod) |
| This function will be called by DI-Guy when the LOD of this link is "manually" set by a diguyCharacter::set_graphics_lod() function call. More... | |
| virtual void | update () |
| This function will be called by DI-Guy when it is time for renderer-specific shape objects created during the build() call to be updated with new data. More... | |
| virtual void | update_variation_texture (int num_pixels, unsigned char *pixel_data) |
| Pushes a char * pixel buffer of length num_pixels that represents the unique per shape texture. More... | |
Public Member Functions inherited from diguyGraphicsShape | |
| virtual void | draw (int lod) |
| This function will be called by DI-Guy when it is time for the geometry of this shape to be drawn. More... | |
| int | get_bind_color_array (int *num_colors, const float **color_data) |
| Returns the unique color of the character links. More... | |
| int | get_link_to_matrix_table (int *num_matrices, const float **lookup_data) |
| int | get_bone_index_from_link_index (int link_index) |
| accesses underlying shader matrix lookup table. More... | |
| int | get_has_offset_matrix () const |
| Returns true if this shape is attached to a link with a connection point offset. More... | |
| int | get_offset_matrix_4x4_ptr (float *matrix, int transpose=0) const |
| Fills out a 4x4 matrix with the connection point's offset from parent link. More... | |
| int | get_local_transformation_matrix_4x4_ptr (float *matrix, int transpose=0) const |
| This function fills out the passed float array with the character-local-coordinate system transformation matrix of this shape, will only be different from it's parent link if it has an offset matrix. More... | |
| int | get_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 the bounding box dimensions for this shape. More... | |
| const char * | get_name () |
| This function returns the name of the shape. More... | |
| long | get_uid () |
| All shapes are assigned a unique identifier, or uid. More... | |
| diguyCharacter * | get_character () |
| This function returns a pointer to the diguyCharacter to which this shape belongs. More... | |
| const char * | get_shape_set_name () |
| This function returns the name of the shape set of which this shape is a part. More... | |
| const char * | get_shape_set_shape_name () |
| This function returns the name of the shape. More... | |
| const char * | get_recommended_attachment_link_name () |
| This function returns the name of the link to which this shape is typically attached. More... | |
| int | get_num_lods () |
| This function returns how many LODs this shape has. More... | |
| float * | get_lod_ranges () |
| This function returns the LOD ranges of this shape. More... | |
| int | get_graphics_lod () |
| This function returns the most recent lod setting as set by set_graphics_lod(), or as set by diguyCharacter::set_graphics_lod(). More... | |
| const char * | get_shape_set_filename_for_lod (int lod) |
| This function returns the filename of the geometry file from which the shape is read for a specific LOD. More... | |
| int | get_num_meshes (int lod) |
| This function returns the number of low-level geometry meshes that comprise this shape. More... | |
| diguyGraphicsMesh * | get_mesh_at_index_for_lod (int index, int lod) |
| This function returns a pointer to one of the low-level geometry mesh objects that comprise this shape. More... | |
| diguyGraphicsLink * | get_link () |
| This function returns a pointer to the link to which this shape is actually attached. More... | |
| const char * | get_switch_var_name () |
| This function returns the name of the DI-Guy motion data variable that controls whether this shape should be visible. More... | |
| int | get_switch_value () |
| This function returns the value of the DI-Guy motion data variable for which the shape should be visible. More... | |
| int | get_is_hidden () const |
| This function returns whether this shape should currently be hidden or shown, based on the value of the shape's switch variable (if any). More... | |
| int | set_is_hidden (int hidden) |
| hides or shows the shape More... | |
| const char * | get_class_type () const |
| returns the class type of the shape... More... | |
| const char * | get_object_type () const |
| returns the object type of the shape... More... | |
| const char * | get_material_type () const |
| returns the material type of the shape... this is an optional data More... | |
| int | get_is_pbr_ready () const |
| returns if pbr shader should be used More... | |
| diguyGraphicsFile * | get_diguy_graphics_file (int lod) |
| This function returns the geometry file from which geometry for the shape was read. More... | |
| void * | get_diguy_graphics_file_part (int lod) |
| This function returns a pointer to an object that represents the geometry for the shape. More... | |
| int | get_graphics_state_switch_index () |
| Some shapes have meshes that have multiple selectable graphics states, including materials and textures. More... | |
| int | get_num_switched_graphics_states () |
| Returns the number of switched graphics states available to this shape. More... | |
| diguyGraphicsState * | get_switched_graphics_state (int switch_value=-1) |
| Returns the graphics state associated with the passed switch value. More... | |
| int | set_state_switch_index (int index) |
| Sets current material swap index, allows overriding of value that was set based on appearance settings. More... | |
| int | get_unique_color (unsigned char *r, unsigned char *g, unsigned char *b) |
| Returns in the passed pointers the unique color of this shape. More... | |
| int | get_contains_skinned_file () |
| This function identifies if this shape has skinned data. More... | |
| int | set_material_parameter_4f (const char *parameter_name, float x, float y, float z, float w, float blend_time=0.0) |
| By default DI-Guy provides three 4 float uniforms at the shape level that can be used by end users to customize the appearance of characters via shaders and misc textures. More... | |
| int | get_material_parameter_4f (const char *parameter_name, float *x, float *y, float *z, float *w) |
| Allow access to the current values of a material parameter, accounting for value blending. More... | |
| unsigned char * | get_variation_texture () |
| Returns a char * of length get_variation_texture_size() that represents the pixels in a unique per shape texture. More... | |
| int | get_variation_texture_size () |
| Returns the size of the texture specified in get_variation_texture() More... | |
| int | get_num_variations () |
| Returns the number of texture variations that this shape has. More... | |
| const char * | get_variation_name (int variation_index) |
| Returns the name of the texture variations at variation_index. More... | |
| int | set_variation_index (int variation_index) |
| Sets the shape to have the variation specified at variation_index, returns -1 if out of array bounds. More... | |
| int | get_has_custom_variation () |
| true if set_unique_ramp_data() is ever called on this object. More... | |
| int | get_num_variation_components () |
| Returns the number of different components in the current variation texture. More... | |
| const char * | get_variation_component_name (int index) |
| Returns the name of the component at index in the current variation texture. More... | |
| int | get_variation_component_row (const char *name) |
| Returns the row of the shared variation texture to use for this drawable. More... | |
| int | set_variation_component_value (int index, float color_shift_r, float color_shift_g, float color_shift_b) |
| Sets the color shift value of the component at index in the current variation texture. More... | |
| int | get_variation_texture_row () |
| Returns the row of the large global variation texture map to use for this shapes data. More... | |
| void | set_variation_texture_data (unsigned char *texture_data) |
| takes ownership of the data More... | |
| int | get_shader_matrix_data (int *num_matrixes, const float **matrix_data) |
| This function is typically called by scene graph renderers as part of diguyGraphicsShape::update(). More... | |
| int | get_are_shader_matrices_transposed () |
| Returns the transpose state of the shader matrices. More... | |
| bdiShape * | get_scripted_object () |
Static Public Member Functions | |
| static void | set_use_pixel_lods (bool use_pixel_lods) |
Static Public Member Functions inherited from diguyGraphicsShape | |
| static int | get_shared_variation_texture_size () |
| Returns the number of rows in the shared variation texture. More... | |
Static Public Attributes | |
| static char * | s_ufrm_link_matrices_string = NULL |
| static char * | s_ufrm_link_colors_string = NULL |
Additional Inherited Members | |
Protected Member Functions inherited from diguyGraphicsShape | |
| diguyGraphicsShape (void *internal_data) | |
| A protected constructor. More... | |
| virtual | ~diguyGraphicsShape () |
| A protected destructor. More... | |
Shapes are the high-level containers of visible geometry.
They are attached to links, and contain zero or more mesh objects.
The class diguyOsgGraphicsShape is an example of a diguyGraphicsShape subclass for a scene graph environment using the DI-Guy Loader. The example subclass shows how to use the accessors of the diguyGraphicsShape class and which virtual functions should be overridden for a scene graph environment such as OSG.
| diguyOsgGraphicsShape::diguyOsgGraphicsShape | ( | void * | internal_data | ) |
|
virtual |
This function will be called by DI-Guy when it is time for renderer-specific shape objects to be created.
All information necessary to build the shape should be available via the Accessor Functions above when this function is called.
The build() function for the link to which a shape is attached will be called before the shape's build() function.
Immediate Mode:
Immediate mode renderers can override this function, to create a pre-compiled object that expedites the draw(). Display lists in OpenGL are an example of this.
Scene Graph:
Scene graph renderers usually do override this function, to create scene graph nodes that will hold geometry nodes of meshes attached to the shape.
The following nodes are typically created:
a geometry parent or group-type object to which mesh nodes can be attached
The scene graph nodes created by this function should be attached to the nodes of the link to which the shape is attached. Use the get_link() function to get a pointer to the link.
In addition, the scene graph objects of meshes attached to the shape should be retrieved and attached to the shape's nodes. Use the get_mesh_at_index_for_lod() function to get pointers to the meshes.
Callable From:
Reimplemented from diguyGraphicsShape.
|
virtual |
This function will be called by DI-Guy when it is time for the renderer-specific shape objects created during the build() call to be destroyed.
The unbuild() function for the shape will be called before the unbuild() function of the link to which the shape is attached.
Immediate Mode:
Scene graph renderers can override this function, to destroy the scene graph nodes created by build().
Scene Graph:
Scene graph renderers usually do override this function, to destroy the scene graph nodes created by build().
Callable From:
Reimplemented from diguyGraphicsShape.
|
virtual |
This function will be called by DI-Guy when the shape should be shown, typically due to a change in the motion data that controls the switch.
See get_switch_var_name() and get_switch_value().
Immediate Mode:
Immediate mode renderers usually do not override this function. DI-Guy does not call the draw() function of hidden shapes.
Scene Graph:
Scene graph renderers usually do override this function, to update the state of the switch node created during the build() call.
Callable From:
Reimplemented from diguyGraphicsShape.
|
virtual |
This function will be called by DI-Guy when the shape should be hidden, typically due to a change in the motion data that controls the switch.
See get_switch_var_name() and get_switch_value().
Immediate Mode:
Immediate mode renderers usually do not override this function. DI-Guy does not call the draw() function of hidden shapes.
Scene Graph:
Scene graph renderers usually do override this function, to update the state of the switch node created during the build() call.
Callable From:
Reimplemented from diguyGraphicsShape.
|
virtual |
Reimplemented from diguyGraphicsShape.
|
virtual |
This function will be called by DI-Guy when the LOD ranges of this shape need to be updated after the shape has initially been built in the Build Stage.
| lod_ranges | new lod ranges for this shape |
See diguyScenario::set_default_lod_ranges() for a description of what will be in the lod_ranges argument.
Immediate Mode:
Immediate mode renderers usually do not override this function. Instead, they use the lod passed into the draw() function.
Scene Graph:
Scene graph renderers can override this function, to update the ranges of LOD nodes created in the Build Stage, if any.
If there were LOD-type nodes created in the Build Stage, their ranges should be updated based on the passed values.
If no LOD-type nodes were created in the Build Stage, this function should have no effect.
Typically only one of set_graphics_lod_ranges() or set_graphics_lod() is implemented.
Callable From:
Reimplemented from diguyGraphicsShape.
|
virtual |
This function will be called by DI-Guy when the LOD of this link is "manually" set by a diguyCharacter::set_graphics_lod() function call.
Immediate Mode:
Immediate mode renderers usually do not override this function. Instead, they use the lod passed into the draw() function.
Scene Graph:
Scene graph renderers sometimes override this function, to update the state of switch nodes created in the Build Stage.
Typically only one of set_graphics_lod_ranges() or set_graphics_lod() is implemented.
Callable From:
Reimplemented from diguyGraphicsShape.
|
inlinestatic |
|
virtual |
This function will be called by DI-Guy when it is time for renderer-specific shape objects created during the build() call to be updated with new data.
Shape updates control whether the shape is visible based on motion data. The DI-Guy Graphics software looks at the switch value and calls show() or hide() as appropriate, so it is likely that this function does not need to be overridden in immediate mode.
The update() function for the link to which a shape is attached will be called before the shape's update() function.
Immediate Mode:
Immediate mode renderers usually do not override this function.
Scene Graph:
Scene graph renderers should override this function if they are supporting skinned characters. Each skinned shape can potentially have different uniforms that need to be sent to the video card; see get_shader_matrix_data().
Callable From:
Reimplemented from diguyGraphicsShape.
|
virtual |
Pushes a char * pixel buffer of length num_pixels that represents the unique per shape texture.
Typically a Immediate mode renderer would need to use this to create or update a texture see diguyOglGraphicsShape.cpp for an example. For an retained mode renderer we have get_variation_texture() as an accessor.
Callable From:
Reimplemented from diguyGraphicsShape.
|
static |
|
static |