DI-Guy SDK Documentation  13.5
diguyOglGraphicsLink Class Reference

The class diguyOglGraphicsLink is an example of a diguyGraphicsLink subclass for an immediate mode renderer using the DI-Guy Loader. More...

#include <diguyOglGraphicsLink.h>

Inheritance diagram for diguyOglGraphicsLink:
diguyGraphicsLink

Public Member Functions

 diguyOglGraphicsLink (void *internal_data)
 
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...
 
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 fill_out_tbo_position_matrix (diguyGraphicsShape *current_shape, float *data_pointer)
 This function will be called by DI-Guy while building instance groups (which occurs during diguyScenario::draw() or when manually invoked. More...
 

Static Public Attributes

static int sm_links_drawn = 0
 
static int sm_num_chars_drawn = 0
 

Additional Inherited Members

Detailed Description

The class diguyOglGraphicsLink is an example of a diguyGraphicsLink subclass for an immediate mode renderer using the DI-Guy Loader.

DI-Guy 'links' are essentially the same as 'bones' in other APIs.

There are two primary purposes of links:

  • to serve as attachment points for shapes, and
  • to form a skeleton that can be animated using motion data.

The example subclass shows how to use the accessors of the diguyGraphicsLink class and which virtual functions should be overridden for an immediate mode renderer such as OpenGL.

Constructor & Destructor Documentation

diguyOglGraphicsLink::diguyOglGraphicsLink ( void *  internal_data)

Member Function Documentation

void diguyOglGraphicsLink::begin_character_draw ( )
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:

  • applying scale
  • applying the base translation of the character
  • picking a current LOD
  • etc.

Scene Graph:

Scene graph renderers usually do not override this function; transformation states are handled automatically by scene graphs.

Callable From:

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

Reimplemented from diguyGraphicsLink.

void diguyOglGraphicsLink::end_character_draw ( )
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:

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

Reimplemented from diguyGraphicsLink.

void diguyOglGraphicsLink::draw ( )
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:

  • N/A (automatically called by DI-Guy Graphics API during Draw Stage)
//linear draw behavior
{
// push the base transform of the character in the world
// the get_transformation_matrix() of the position link
m_position_link->begin_character_draw();
int i;
for each link in link array
{
// note the ability to skip links with nothing attached to them
if (link->get_num_shapes() > 0 || link->get_is_position_link())
{
// each link should multiply by the get_local_transformation_matrix
// which contains the precalculated concatenated matrix
link->draw();
}
}
m_position_link->end_character_draw();

Reimplemented from diguyGraphicsLink.

void diguyOglGraphicsLink::fill_out_tbo_position_matrix ( diguyGraphicsShape current_shape,
float *  tbo_data 
)
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 from diguyGraphicsLink.

Member Data Documentation

int diguyOglGraphicsLink::sm_links_drawn = 0
static
int diguyOglGraphicsLink::sm_num_chars_drawn = 0
static

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