DI-Guy SDK Documentation  13.8
diguyOsgGraphicsInstanceGroup Class Reference

#include <diguyOsgGraphicsInstanceGroup.h>

Inheritance diagram for diguyOsgGraphicsInstanceGroup:
diguyGraphicsInstanceGroup

Public Member Functions

 diguyOsgGraphicsInstanceGroup (void *internal_data)
 
 ~diguyOsgGraphicsInstanceGroup ()
 
virtual void build () override
 This function will be called by DI-Guy when it is time for a renderer specific instance group to be created. More...
 
virtual void unbuild () override
 This function will be called by DI-Guy when it is time for a instance group to be destroyed. More...
 
virtual void update () override
 This function will be called by DI-Guy when it is time for the instance group to be updated with new data. More...
 
- Public Member Functions inherited from diguyGraphicsInstanceGroup
long get_uid () const
 Instance groups are assigned a unique identifier, or uid. More...
 
int get_num_instances () const
 Returns the number of instances in the instance group. More...
 
int get_start_base_offset () const
 Return the offset, in floats, of the base data for the instance group. More...
 
int get_start_link_offset () const
 Return the offset, in floats, of the link data for the instance group. More...
 
int get_num_links () const
 Returns the number of links for instances with skinned geometry. More...
 
void get_debug_color (float &r, float &g, float &b, float &a) const
 Returns the debug color of an instance group. More...
 
int get_show_debug_colors () const
 Returns if debug colors should be used to render. More...
 
diguyGraphicsShaderProgramget_shader_program () const
 This function returns a pointer to the shader program designated for this instance group. More...
 
diguyGraphicsMeshget_diguy_mesh ()
 Returns a pointer to the low level geometry mesh object that comprises the renderable for the instances in the group. More...
 
int get_graphics_state_switch_index ()
 Returns a index to which swapped texture state to use for drawing this instance group. More...
 
const float * get_instance_data ()
 Returns a pointer to the raw instance data for the instance group. More...
 
int get_instance_data_size ()
 Return the size of the data for the instance group in bytes. More...
 
const float * get_instance_base_data ()
 Returns a pointer to the raw instance data for the instance group. More...
 
int get_instance_base_data_size ()
 Return the size of the data for the instance group in bytes. More...
 
const float * get_instance_link_data ()
 Returns a pointer to the raw instance data for the instance group. More...
 
int get_instance_link_data_size ()
 Return the size of the data for the instance group in bytes. More...
 
int get_instance_data_all_groups_size ()
 Return the size of the data for all instance groups in bytes. More...
 
int get_num_extra_per_instance_data_floats ()
 Return the number of extra floats the user has requested for the tbo, must be multiple of 4. More...
 
virtual int bind_instance_group_data (int base_start, int link_start, int count)
 This function will be called by DI-Guy when variables for using the instance data needs to be sent to the graphics card. More...
 
virtual int bind_instance_buffer_data (int num_floats, const float *instance_data)
 This function will be called by DI-Guy when data for instance groups needs to be sent to the graphics card. More...
 
diguyGraphicsShapeget_instanced_shape_at_index (int index)
 Returns a pointer to a instanced shape. index should be less then get_num_instances() More...
 
diguyGraphicsStateget_graphics_state ()
 returns a pointer to the instanced state More...
 
bdiInstanceGroupget_scripted_object ()
 

Private Member Functions

void create_and_add_shared_tbo_to_state_set (osg::StateSet &state_set)
 
void build_shared_tbo ()
 

Private Attributes

osg::ref_ptr< osg::Geode > m_geode
 
osg::ref_ptr< osg::Geometry > m_geometry
 
osg::ref_ptr< osg::PrimitiveSet > m_primitiveSet
 
osg::ref_ptr< osg::Uniform > ufrm_base_matrices_start
 
osg::ref_ptr< osg::Uniform > ufrm_link_matrices_start
 
osg::ref_ptr< osg::Uniform > ufrm_link_matrices_count
 
osg::ref_ptr< osg::Uniform > ufrm_extra_per_instance_data
 
osg::ref_ptr< osg::Uniform > ufrm_apply_matrices_flag
 
osg::ref_ptr< osg::Uniform > ufrm_instance_group_color
 

Static Private Attributes

static osg::ref_ptr< osg::Group > s_shared_tbo_node
 
static diguyOsgTextureBufferObjects_diguy_texture_buffer
 
static osg::ref_ptr< diguyOsgTextureBufferObjectApplyAttributes_diguy_texture_buffer_attribute
 

Additional Inherited Members

- Protected Member Functions inherited from diguyGraphicsInstanceGroup
 diguyGraphicsInstanceGroup (void *internal_data)
 A protected constructor. More...
 
virtual ~diguyGraphicsInstanceGroup ()
 A protected destructor. More...
 

Constructor & Destructor Documentation

diguyOsgGraphicsInstanceGroup::diguyOsgGraphicsInstanceGroup ( void *  internal_data)
diguyOsgGraphicsInstanceGroup::~diguyOsgGraphicsInstanceGroup ( )

Member Function Documentation

virtual void diguyOsgGraphicsInstanceGroup::build ( )
overridevirtual

This function will be called by DI-Guy when it is time for a renderer specific instance group to be created.

All information to construct the instance group for consumption by either an immediate mode or scene graph renderer is avaiable via the Accessor Functions above when this function is called.

Immediate Mode:

Immediate mode renderers do not usually override this function.

Scene Graph:

Scene graph renderers override this function to create scene graph specific objects to handle mangement and rendering of the instance group.

Callable From:

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

Reimplemented from diguyGraphicsInstanceGroup.

virtual void diguyOsgGraphicsInstanceGroup::unbuild ( )
overridevirtual

This function will be called by DI-Guy when it is time for a instance group to be destroyed.

Immediate Mode:

Immediate mode renderers may override this function, to destroy any object that may have been created by build().

Scene Graph:

Scene graph renderers usually do override this function, to destroy any object that may have been created by build().

Callable From:

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

Reimplemented from diguyGraphicsInstanceGroup.

virtual void diguyOsgGraphicsInstanceGroup::update ( )
overridevirtual

This function will be called by DI-Guy when it is time for the instance group to be updated with new data.

Immediate Mode:

Immediate mode renderers usually do not override this function.

Scene Graph:

Scene graph renderers should override this function if they are supporting instancing.

Callable From:

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

Reimplemented from diguyGraphicsInstanceGroup.

void diguyOsgGraphicsInstanceGroup::create_and_add_shared_tbo_to_state_set ( osg::StateSet &  state_set)
private
void diguyOsgGraphicsInstanceGroup::build_shared_tbo ( )
private

Member Data Documentation

osg::ref_ptr<osg::Group> diguyOsgGraphicsInstanceGroup::s_shared_tbo_node
staticprivate
diguyOsgTextureBufferObject* diguyOsgGraphicsInstanceGroup::s_diguy_texture_buffer
staticprivate
osg::ref_ptr<diguyOsgTextureBufferObjectApplyAttribute> diguyOsgGraphicsInstanceGroup::s_diguy_texture_buffer_attribute
staticprivate
osg::ref_ptr<osg::Geode> diguyOsgGraphicsInstanceGroup::m_geode
private
osg::ref_ptr<osg::Geometry> diguyOsgGraphicsInstanceGroup::m_geometry
private
osg::ref_ptr<osg::PrimitiveSet> diguyOsgGraphicsInstanceGroup::m_primitiveSet
private
osg::ref_ptr<osg::Uniform> diguyOsgGraphicsInstanceGroup::ufrm_base_matrices_start
private
osg::ref_ptr<osg::Uniform> diguyOsgGraphicsInstanceGroup::ufrm_link_matrices_start
private
osg::ref_ptr<osg::Uniform> diguyOsgGraphicsInstanceGroup::ufrm_link_matrices_count
private
osg::ref_ptr<osg::Uniform> diguyOsgGraphicsInstanceGroup::ufrm_extra_per_instance_data
private
osg::ref_ptr<osg::Uniform> diguyOsgGraphicsInstanceGroup::ufrm_apply_matrices_flag
private
osg::ref_ptr<osg::Uniform> diguyOsgGraphicsInstanceGroup::ufrm_instance_group_color
private

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