DI-Guy SDK Documentation  13.7.1
diguyDx9GraphicsShape Class Reference

#include <diguyDx9GraphicsShape.h>

Inheritance diagram for diguyDx9GraphicsShape:
diguyGraphicsShape

Public Member Functions

 diguyDx9GraphicsShape (void *internal_data)
 4 Header files and forward declarations More...
 
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 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...
 
- Public Member Functions inherited from diguyGraphicsShape
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 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 set_graphics_lod_ranges (float *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_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...
 
virtual void update_name_texture ()
 creates a decal texture with a name (accessed by get_decal_text()) see sample implementation for a render to texture based implementation More...
 
bdiShapeget_scripted_object ()
 
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...
 
diguyCharacterget_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...
 
float get_graphics_lod_fraction ()
 the percentage into the lod More...
 
bool get_lod_fades_out (int lod)
 should this LOD fade out More...
 
void get_blend_shape_data (int lod, float fraction, float weights[4], int indexes[4])
 needed by osg/retained mode renderers weights, indexes are output vars. 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...
 
diguyGraphicsMeshget_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...
 
int get_mesh_transform_at_index_for_lod (int index, int lod, float *matrix, int transpose=0)
 This function fills out the accumulated xform data for the low-level geometry mesh objects that comprise this shape. More...
 
diguyGraphicsLinkget_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...
 
diguyGraphicsFileget_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...
 
diguyGraphicsStateget_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...
 
const char * find_appearance_parameter (const char *parameter_name) const
 Returns the value of the configured parameter with the given name. 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 allows per shape uniforms that will be restored to <0,0,0,0> after a draw call. 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...
 
int get_decal_index () const
 gets the current index into a texture array needed for arm and rank patches. More...
 
void set_decal_index (int index)
 not really expected to be needed, DI-Guy should automatically set this internally but can be used to debug shape rendering More...
 
const char * get_decal_text ()
 returns the underlying label string for use in update_name_texture() More...
 
int get_bind_color_array (int *num_colors, const float **color_data)
 Returns the unique color of the character links. More...
 
virtual void instancing_state_changed (int val)
 
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_local_transformation_matrix_4x4_ptr (float *matrix, int lod, int transpose) 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, or complex hierarchy. 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...
 

Additional Inherited Members

- 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...
 
- Protected Member Functions inherited from diguyGraphicsShape
 diguyGraphicsShape (void *internal_data)
 A protected constructor. More...
 
virtual ~diguyGraphicsShape ()
 A protected destructor. More...
 

Constructor & Destructor Documentation

diguyDx9GraphicsShape::diguyDx9GraphicsShape ( void *  internal_data)

4 Header files and forward declarations

Member Function Documentation

void diguyDx9GraphicsShape::build ( )
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 switch node to control showing and hiding of the shape
  • an LOD node to control which meshes are shown due to LOD calculations
  • 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:

  • N/A (automatically called by DI-Guy Graphics API during the Build Stage)

Reimplemented from diguyGraphicsShape.

void diguyDx9GraphicsShape::unbuild ( )
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:

  • N/A (automatically called by DI-Guy Graphics API during the Unbuild Stage)

Reimplemented from diguyGraphicsShape.

void diguyDx9GraphicsShape::draw ( int  lod)
virtual

This function will be called by DI-Guy when it is time for the geometry of this shape to be drawn.

Immediate Mode:

Immediate mode renderers usually do not override this function. The actual draw calls happen in diguyGraphicsMesh::draw() calls.

Scene Graph:

Scene graph renderers usually do not override this function; drawing is handled automatically by scene graphs.

Callable From:

  • N/A (automatically called by DI-Guy Graphics API during Draw Stage)

Reimplemented from diguyGraphicsShape.


The documentation for this class was generated from the following files: