DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguySceneObject Class Reference

A scene object is a static (that is, non-moving) object in the scenario. Scene objects are the basic terrain that characters are ground clamped and navigate around. Scene objects do not typically animate. More...

#include <diguySceneObject.h>

Public Member Functions

const char * get_name ()
 Returns the name of the scene object. More...
 
int set_name (const char *name)
 This function sets the name of this object. More...
 
long get_uid ()
 All scene objects are assigned a unique identifier, or uid. More...
 
const char * get_filename ()
 Returns the filename of the scene object. More...
 
const char * get_nodename ()
 Returns: node within the scene object file; returned string is 0 length if contents of entire file should be used. More...
 
const char * get_alternate_filename ()
 Returns: alternate filename of the scene object. More...
 
const char * get_fully_resolved_filename ()
 Returns the fully resolved filename of the scene object. More...
 
int show ()
 Attempts to load the file returned by get_filename() and construct an object that can be rendered in the current graphics environment by the call draw_visual(). More...
 
int hide ()
 Hides the scene object. More...
 
int add_vertex_to_user_defined (float x, float y, float z)
 Adds a vertex to a user defined scene object. More...
 
int add_triangle_to_user_defined (int index0, int index1, int index2)
 Adds a triangle to a user defined scene object. More...
 
int add_vertex_array_to_user_defined (const float *const vertices, int num_vertices, int skipBytes=12)
 Adds an array of vertices to a user defined scene object. More...
 
int add_triangle_array_to_user_defined (const int *const indices, int num_indices)
 Adds an array of triangles to a user defined scene object. More...
 
int add_triangle_to_user_defined (const float *const pos0, const float *const pos1, const float *const pos2)
 Adds a triangle to a user defined object. More...
 
int build_user_defined ()
 Builds the geometry of the user defined scene object from data passed via add_vertex_* and add_triangle_* calls. More...
 
Shader Functions
int set_render_mode_shader (const char *shader_name, const char *render_mode=NULL)
 This function is essentially the same as the function diguyCharacter::set_render_mode_shader(), but applies to this scene object. More...
 
void reset_render_mode_shader_to_default (const char *render_mode=NULL)
 This function is essentially the same as the function diguyCharacter::reset_render_mode_shader_to_default(), but applies to this scene object. More...
 
const char * get_render_mode_shader (const char *render_mode=NULL)
 This function is essentially the same as the function diguyCharacter::get_render_mode_shader(), but applies to this to this scene object. More...
 
diguyGraphicsShaderProgramget_shader_program ()
 This function is essentially the same as the function diguyCharacter::get_shader_program(), but applies to this to this scene object. More...
 
diguyGraphicsShaderTechniqueget_shader_technique ()
 This function is essentially the same as the function diguyCharacter::get_shader_technique(), but applies to this to this scene object. More...
 
int set_temporary_current_shader (const char *shader_name)
 This function is essentially the same as the function diguyCharacter::set_temporary_current_shader_program(), but applies to this to this scene object. More...
 
void reset_current_shader_to_default ()
 This function is essentially the same as the function diguyCharacter::reset_current_shader_to_default(), but applies to this to this scene object. More...
 
diguyGraphicsShaderInstanceget_shader_instance ()
 This function is essentially the same as the function diguyCharacter::get_shader_instance(), but applies to this to this scene object. More...
 
void reset_shader_instance_variables_to_initial_values ()
 This function is essentially the same as the function diguyCharacter::reset_shader_instance_variables_to_initial_values(), but applies to this scene object. More...
 
void reset_shader_instance_variables_to_program_defaults ()
 This function is essentially the same as the function diguyCharacter::reset_shader_instance_variables_to_program_defaults(), but applies to this scene object. More...
 
Deprecated Functions
int set_switch_state (const char *switch_name, int state)
 Set the state of a switch belonging to this scene object. More...
 
int get_switch_state (const char *switch_name)
 Get the state of a switch belonging to this scene object. More...
 
int set_dof_state (const char *dof_name, float tx, float ty, float tz, float rz, float rx, float ry)
 Set the state of a DOF element belonging to this scene object. More...
 
int set_dof_state_flt (const char *dof_name, float tx, float ty, float tz, float rx, float ry, float rz)
 Set the state of a DOF element belonging to this scene object. More...
 
int get_dof_state (const char *dof_name, float *tx, float *ty, float *tz, float *rz, float *rx, float *ry)
 Get the state of a DOF element belonging to this scene object. More...
 
int get_dof_state_flt (const char *dof_name, float *tx, float *ty, float *tz, float *rx, float *ry, float *rz)
 Get the state of a DOF element belonging to this scene object. More...
 
int add_switch_target (const char *switch_name, int state, float t)
 Set a trigger to change the state of a switch at a given time. More...
 
int abort_all_switch_targets (const char *switch_name)
 Abort all the targets states for a given switch which have been set either using the DI-Guy function, add_dof_target() or using a behavior file. More...
 
int add_dof_target (const char *dof_name, float tx, float ty, float tz, float rz, float rx, float ry, float blend_tin, float blend_tout, const char *blend_function_name=0)
 Set a trigger to change the state of a DOF at a given time. More...
 
int add_dof_target_flt (const char *dof_name, float tx, float ty, float tz, float rx, float ry, float rz, float blend_tin, float blend_tout, const char *blend_function_name=0)
 Set a trigger to change the state of a DOF at a given time. More...
 
int abort_all_dof_targets (const char *dof_name)
 Abort all the targets states for a given DOF which have been set either using the DI-Guy function, add_dof_target() or using a behavior file. More...
 
int set_shader_program (const char *shader_name)
 Deprecated as of 10.5.2. More...
 

Experimental Functions

The following functions are experimental and may change or disappear with no warning.

int set_position (float x, float y, float z)
 
int get_position (float *x, float *y, float *z)
 
int set_orientation (float rz, float rx, float ry)
 
int get_orientation (float *rz, float *rx, float *ry)
 
int set_scale (float sx, float sy, float sz)
 
int get_scale (float *sx, float *sy, float *sz)
 
int set_filename (const char *file_name)
 
int get_is_sky_box ()
 
int set_is_sky_box (int skybox)
 
int draw_visual ()
 Draws the scene object. More...
 
int get_include_in_octtree ()
 
int set_include_in_octtree (int val)
 
int set_include_in_physics_sim_scene (int include_in_simulation_terrain)
 
int get_include_in_physics_sim_scene ()
 
int set_physics_collision_group (diguyPhysicsCollisionGroup collision_group)
 
diguyPhysicsCollisionGroup get_physics_collision_group ()
 
int get_min (float *x, float *y, float *z)
 
int get_max (float *x, float *y, float *z)
 
void set_scene_graph_mask (unsigned int mask)
 
unsigned int get_scene_graph_mask ()
 
int get_enabled ()
 
int set_enabled (int enabled)
 
int get_visible ()
 
int set_visible (int visible)
 
static int set_texture_load_behavior (diguyGraphicsTextureLoadingBehavior mode)
 Documentation Pending should be a member of diguyGraphicsTextureLoadingBehavior DIGUY_LOAD_INSTANTLY, DIGUY_LOAD_PRIORITY_ASYNC, DIGUY_LOAD_ASYNC. More...
 
static
diguyGraphicsTextureLoadingBehavior 
get_texture_load_behavior ()
 

Private Functions

The functions and variables past this point are for internal use only.

No external access to them is expected or necessary.

bdiScenarioSceneObjectm_scripted_object
 A pointer to internal data. More...
 
class bdiScenarioSceneObject
 
bdiScenarioSceneObjectget_scripted_object ()
 
 diguySceneObject (bdiScenarioSceneObject *scene_object)
 A private constructor. More...
 
 ~diguySceneObject ()
 A private destructor. More...
 

Detailed Description

A scene object is a static (that is, non-moving) object in the scenario. Scene objects are the basic terrain that characters are ground clamped and navigate around. Scene objects do not typically animate.

Constructor & Destructor Documentation

diguySceneObject::diguySceneObject ( bdiScenarioSceneObject scene_object)
private

A private constructor.

diguySceneObject::~diguySceneObject ( )
private

A private destructor.

Member Function Documentation

const char* diguySceneObject::get_name ( )

Returns the name of the scene object.

This pointer will never be NULL.

Returns:

name of the scene object

Callable From:

  • C++
  • Script
int diguySceneObject::set_name ( const char *  name)

This function sets the name of this object.

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
long diguySceneObject::get_uid ( )

All scene objects are assigned a unique identifier, or uid.

This function returns this scene object's uid.

Note: unique identifiers will change between DI-Guy runs!

Returns:

unique identifier of object

Callable From:

  • C++
  • Script
const char* diguySceneObject::get_filename ( )

Returns the filename of the scene object.

This pointer will never be NULL.

The returned filename may be relative to another directory, such as $DIGUY/geometry/sets. Call get_fully_resolved_filename() to have DI-Guy search for the fully resolved filename.

Returns:

filename of the scene object

Callable From:

  • C++
  • Script
const char* diguySceneObject::get_nodename ( )

Returns: node within the scene object file; returned string is 0 length if contents of entire file should be used.

Callable From:

  • C++
  • Script
const char* diguySceneObject::get_alternate_filename ( )

Returns: alternate filename of the scene object.

Callable From:

  • C++
  • Script
const char* diguySceneObject::get_fully_resolved_filename ( )

Returns the fully resolved filename of the scene object.

Returns NULL if the file cannot be found.

Returns:

fully resolved filename of the scene object; NULL if not found

Callable From:

  • C++
  • Script
int diguySceneObject::show ( )

Attempts to load the file returned by get_filename() and construct an object that can be rendered in the current graphics environment by the call draw_visual().

Returns:

0 on success, -1 on failure

OpenGL Version:

Function will create OpenGL display lists.

Direct3D Version:

Function will have no effect. User must load and display object.

Callable From:

  • C++
  • Script
int diguySceneObject::hide ( )

Hides the scene object.

See show() for notes on which platforms do not yet display scene objects.

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::add_vertex_to_user_defined ( float  x,
float  y,
float  z 
)

Adds a vertex to a user defined scene object.

Returns:

0 on success, -1 on failure
int diguySceneObject::add_triangle_to_user_defined ( int  index0,
int  index1,
int  index2 
)

Adds a triangle to a user defined scene object.

Indices refer to vertices added with a add_vertex_* call.

Returns:

0 on success, -1 on failure

int diguySceneObject::add_vertex_array_to_user_defined ( const float *const  vertices,
int  num_vertices,
int  skipBytes = 12 
)

Adds an array of vertices to a user defined scene object.

Parameters
skipBytesbytes between vertex position information

Returns:

0 on success, -1 on failure

int diguySceneObject::add_triangle_array_to_user_defined ( const int *const  indices,
int  num_indices 
)

Adds an array of triangles to a user defined scene object.

The array should contain indices to vertices added with add_vertex_* calls.

Parameters
num_indicesNumber of indices (3 indices per triangle).

Returns:

0 on success, -1 on failure

int diguySceneObject::add_triangle_to_user_defined ( const float *const  pos0,
const float *const  pos1,
const float *const  pos2 
)

Adds a triangle to a user defined object.

Positions are expected to be float[3].

Returns:

0 on success, -1 on failure

int diguySceneObject::build_user_defined ( )

Builds the geometry of the user defined scene object from data passed via add_vertex_* and add_triangle_* calls.

Returns:

0 on success, -1 on failure

int diguySceneObject::set_render_mode_shader ( const char *  shader_name,
const char *  render_mode = NULL 
)

This function is essentially the same as the function diguyCharacter::set_render_mode_shader(), but applies to this scene object.

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
void diguySceneObject::reset_render_mode_shader_to_default ( const char *  render_mode = NULL)

This function is essentially the same as the function diguyCharacter::reset_render_mode_shader_to_default(), but applies to this scene object.

Callable From:

  • C++
  • Script
const char* diguySceneObject::get_render_mode_shader ( const char *  render_mode = NULL)

This function is essentially the same as the function diguyCharacter::get_render_mode_shader(), but applies to this to this scene object.

Returns:

name of shader program; NULL if none

Callable From:

  • C++
  • Script
diguyGraphicsShaderProgram* diguySceneObject::get_shader_program ( )

This function is essentially the same as the function diguyCharacter::get_shader_program(), but applies to this to this scene object.

It's here for backwards compatibility DI-Guy 12 now uses shader techniques as wrappers for shader programs.

Returns:

object of type diguyGraphicsShaderProgram; NULL if none

Callable From:

  • C++
  • Script
diguyGraphicsShaderTechnique* diguySceneObject::get_shader_technique ( )

This function is essentially the same as the function diguyCharacter::get_shader_technique(), but applies to this to this scene object.

Returns:

object of type diguyGraphicsShaderTechnique; NULL if none

Callable From:

  • C++
  • Script
int diguySceneObject::set_temporary_current_shader ( const char *  shader_name)

This function is essentially the same as the function diguyCharacter::set_temporary_current_shader_program(), but applies to this to this scene object.

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
void diguySceneObject::reset_current_shader_to_default ( )

This function is essentially the same as the function diguyCharacter::reset_current_shader_to_default(), but applies to this to this scene object.

Callable From:

  • C++
  • Script
diguyGraphicsShaderInstance* diguySceneObject::get_shader_instance ( )

This function is essentially the same as the function diguyCharacter::get_shader_instance(), but applies to this to this scene object.

Note that the shader instance of a scene object can change over the lifetime of the scene object. Therefore the returned pointer should not be stored, but should be re-read each time it is needed.

Returns:

object of type diguyGraphicsShaderInstance; NULL if none

Callable From:

  • C++
  • Script
void diguySceneObject::reset_shader_instance_variables_to_initial_values ( )

This function is essentially the same as the function diguyCharacter::reset_shader_instance_variables_to_initial_values(), but applies to this scene object.

Callable From:

  • C++
  • Script
void diguySceneObject::reset_shader_instance_variables_to_program_defaults ( )

This function is essentially the same as the function diguyCharacter::reset_shader_instance_variables_to_program_defaults(), but applies to this scene object.

Callable From:

  • C++
  • Script
int diguySceneObject::set_switch_state ( const char *  switch_name,
int  state 
)

Set the state of a switch belonging to this scene object.

Currently only supported on OpenGL platform.

Parameters
switch_namethe name of the switch element
statethe state, i.e. active sub-element, of the switch

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::get_switch_state ( const char *  switch_name)

Get the state of a switch belonging to this scene object.

Currently only supported on OpenGL platform.

Parameters
switch_namethe name of the switch element

Returns:

The state of the switch, -1 if fails.

Callable From:

  • C++
  • Script
int diguySceneObject::set_dof_state ( const char *  dof_name,
float  tx,
float  ty,
float  tz,
float  rz,
float  rx,
float  ry 
)

Set the state of a DOF element belonging to this scene object.

Currently only supported on OpenGL platform.

Parameters
dof_namethe name of the DOF element
tx,ty,tzthe x, y, and z displacements of the DOF
rz,rx,rythe rotation of the DOF about the z, x, and y axes

The DOF will be rotated in ZXY order. For rotation in XYZ order, use set_dof_state_flt().

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::set_dof_state_flt ( const char *  dof_name,
float  tx,
float  ty,
float  tz,
float  rx,
float  ry,
float  rz 
)

Set the state of a DOF element belonging to this scene object.

Currently only supported on OpenGL platform.

Parameters
dof_namethe name of the DOF element
tx,ty,tzthe x, y, and z displacements of the DOF
rz,rx,rythe rotation of the DOF about the z, x, and y axes

The DOF will be rotated in XYZ order. For rotation in ZXY order, use set_dof_state().

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::get_dof_state ( const char *  dof_name,
float *  tx,
float *  ty,
float *  tz,
float *  rz,
float *  rx,
float *  ry 
)

Get the state of a DOF element belonging to this scene object.

Currently only supported on OpenGL platform.

Parameters
dof_namethe name of the DOF element
tx,ty,tzthe x, y, and z displacements of the DOF
rz,rx,rythe rotation of the DOF about the z-, x-, and y-axes

The returned rotation values assume ZXY order. For XYZ order, use get_dof_state_flt().

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::get_dof_state_flt ( const char *  dof_name,
float *  tx,
float *  ty,
float *  tz,
float *  rx,
float *  ry,
float *  rz 
)

Get the state of a DOF element belonging to this scene object.

Currently only supported on OpenGL platform.

Parameters
dof_namethe name of the DOF element
tx,ty,tzthe x, y, and z displacements of the DOF
rx,ry,rzthe rotation of the DOF about the z-, x-, and y-axes

The returned rotation values assume ZXY order. For XYZ order, use get_dof_state_flt().

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::add_switch_target ( const char *  switch_name,
int  state,
float  t 
)

Set a trigger to change the state of a switch at a given time.

Currently only supported on OpenGL platform.

Parameters
switch_namethe name of the switch to be triggered
statethe state the switch should be in after time t
tthe time at which the switch should switch

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::abort_all_switch_targets ( const char *  switch_name)

Abort all the targets states for a given switch which have been set either using the DI-Guy function, add_dof_target() or using a behavior file.

Currently only supported on OpenGL platform.

Parameters
switch_namethe name of the switch whose targets are to be aborted

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::add_dof_target ( const char *  dof_name,
float  tx,
float  ty,
float  tz,
float  rz,
float  rx,
float  ry,
float  blend_tin,
float  blend_tout,
const char *  blend_function_name = 0 
)

Set a trigger to change the state of a DOF at a given time.

Currently only supported on OpenGL platform.

Parameters
dof_namethe name of the DOF element
tx,ty,tzthe x, y, and z displacements of the DOF
rz,rx,rythe rotation of the DOF about the z-, x-, and y-axes
blend_tinthe time at which the DOF should begin changing states
blend_toutthe time at which the DOF should stop changing states
blend_function_namethe type of interpolation to be used between the current and desired DOF states

Currently, valid function names are "Linear", "HalfSine", and "QuarterSine".

The DOF will be rotated in ZXY order. For rotation in XYZ order, use set_dof_state_flt().

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::add_dof_target_flt ( const char *  dof_name,
float  tx,
float  ty,
float  tz,
float  rx,
float  ry,
float  rz,
float  blend_tin,
float  blend_tout,
const char *  blend_function_name = 0 
)

Set a trigger to change the state of a DOF at a given time.

Currently only supported on OpenGL platform.

Parameters
dof_namethe name of the DOF element
tx,ty,tzthe x, y, and z displacements of the DOF
rx,ry,rzthe rotation of the DOF about the z-, x-, and y-axes The DOF will be rotated in XYZ order. For rotation in ZXY order, use add_dof_target().
blend_tinthe time at which the DOF should begin changing states
blend_toutthe time at which the DOF should stop changing states
blend_function_namethe type of interpolation to be used between the current and desired DOF states

Currently, valid function names are "Linear", "HalfSine", and "QuarterSine".

The DOF will be rotated in XYZ order. For rotation in ZXY order, use set_dof_state_flt().

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::abort_all_dof_targets ( const char *  dof_name)

Abort all the targets states for a given DOF which have been set either using the DI-Guy function, add_dof_target() or using a behavior file.

Currently only supported on OpenGL platform.

Parameters
dof_namethe name of the DOF whose targets are to be aborted

Returns:

0 on success, -1 on failure

Callable From:

  • C++
  • Script
int diguySceneObject::set_shader_program ( const char *  shader_name)

Deprecated as of 10.5.2.

Use set_shader_program_name() instead.

int diguySceneObject::set_position ( float  x,
float  y,
float  z 
)
int diguySceneObject::get_position ( float *  x,
float *  y,
float *  z 
)
int diguySceneObject::set_orientation ( float  rz,
float  rx,
float  ry 
)
int diguySceneObject::get_orientation ( float *  rz,
float *  rx,
float *  ry 
)
int diguySceneObject::set_scale ( float  sx,
float  sy,
float  sz 
)
int diguySceneObject::get_scale ( float *  sx,
float *  sy,
float *  sz 
)
int diguySceneObject::set_filename ( const char *  file_name)
int diguySceneObject::get_is_sky_box ( )
int diguySceneObject::set_is_sky_box ( int  skybox)
static int diguySceneObject::set_texture_load_behavior ( diguyGraphicsTextureLoadingBehavior  mode)
static

Documentation Pending should be a member of diguyGraphicsTextureLoadingBehavior DIGUY_LOAD_INSTANTLY, DIGUY_LOAD_PRIORITY_ASYNC, DIGUY_LOAD_ASYNC.

static diguyGraphicsTextureLoadingBehavior diguySceneObject::get_texture_load_behavior ( )
static
int diguySceneObject::draw_visual ( )

Draws the scene object.

Currently OpenGL only.

Returns:

0 on success, -1 on failure

Callable From:

  • C++
int diguySceneObject::get_include_in_octtree ( )
int diguySceneObject::set_include_in_octtree ( int  val)
int diguySceneObject::set_include_in_physics_sim_scene ( int  include_in_simulation_terrain)
int diguySceneObject::get_include_in_physics_sim_scene ( )
int diguySceneObject::set_physics_collision_group ( diguyPhysicsCollisionGroup  collision_group)
diguyPhysicsCollisionGroup diguySceneObject::get_physics_collision_group ( )
int diguySceneObject::get_min ( float *  x,
float *  y,
float *  z 
)
int diguySceneObject::get_max ( float *  x,
float *  y,
float *  z 
)
void diguySceneObject::set_scene_graph_mask ( unsigned int  mask)
unsigned int diguySceneObject::get_scene_graph_mask ( )
int diguySceneObject::get_enabled ( )
int diguySceneObject::set_enabled ( int  enabled)
int diguySceneObject::get_visible ( )
int diguySceneObject::set_visible ( int  visible)
bdiScenarioSceneObject* diguySceneObject::get_scripted_object ( )
inline

Friends And Related Function Documentation

friend class bdiScenarioSceneObject
friend

Member Data Documentation

bdiScenarioSceneObject* diguySceneObject::m_scripted_object
private

A pointer to internal data.


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