VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
makVrv::DtDiGuyScenario Class Reference

Owns a DiGuy scenario for the application. More...

Inheritance diagram for makVrv::DtDiGuyScenario:
Inheritance graph
[legend]

Public Types

typedef std::list< DtStringStringList
typedef std::vector< StringListStringListVec

Public Member Functions

void initializeVisualComponent ()
virtual ~DtDiGuyScenario ()
 DTOR.
diguyScenario & scenario ()
 Get the scenario.:
void clearScene ()
virtual osg::Node * characterRoot ()
 Get the OSG root node for the DI-Guy character geometry.
int getUseGuides ()
float getGuideSyncGain ()
int getUseInstancing ()
const charmapEffect (const char *diguy_effect_name)
std::string findCharacterName (DtElementID parentSceneObjectID)
 Finds the character name, given the parent scene object ID.
int getSupportsWeightVariations (DtElementID parentSceneObjectID)
 Returns if character supports weight variations (skinny to fat)
bool evalScript (const std::string &script)
 Evaluates a script using the diguyScenario's interpreter.
int getNumCharacterTypes ()
 
Info about particular character types or appearances.
const chargetCharacterTypeAtIndex (int index)
 Get name of a DI-Guy character type.
int getCharacterTypeNumAppearances (const char *typeName)
 Get number of appearances associated with a particular character type.
const chargetCharacterTypeAppearanceAtIndex (const char *typeName, int index)
 Get name of appearance.
const chargetHandItemClass (const char *typeName)
 Get the name of the hand item class available to a particular character type (e.g.
int getNumHandItemsInClass (const char *className)
const chargetHandItemFromClass (const char *className, int index)
 Gets the name of a hand item (e.g. "m16")
int getCharacterTypeNumHeads (const char *typeName, const char *appearanceName)
 Get number of heads available for a particular character type/appearance combo.
const chargetCharacterTypeHeadAtIndex (const char *typeName, const char *appearanceName, int index)
 Get name of a head appearance.
int getCharacterTypeNumActions (const char *typeName)
 Get number of actions (i.e. animations) available to a particular character type.
const chargetCharacterTypeActionAtIndex (const char *typeName, int index)
 Get name of an action.
float getCharacterTypeActionDuration (const char *typeName, const char *actionName)
 How long an action (animation) is expected to take, in seconds.
float getCharacterTypeActionSpeed (const char *typeName, const char *actionName)
 The default speed (m/s) at which a character will move while carrying out the animation.
const chargetCharacterTypeActionPosture (const char *typeName, const char *actionName)
 Get name of posture associated with a particular character type and action ("upright", "crouching", "prone", "sitting", "kneeling", "any")
const chargetCharacterTypeActionDirection (const char *typeName, const char *actionName)
 Get name of direction associated with a particular character type and action ("none", "forward", "backward", "left", "right", "locomotion", "up", "down", "turn_left", "turn_right", "nonlinear", "linear_offaxis", "inherit", "unknown")
const chargetCharacterTypeActionPrimaryVariant (const char *typeName, const char *actionName)
 Get name of variant associated with a particular character type and action ("normal", "aim", "dead", "angry", "ambient", "assault", "curious", "exercise", "funky", "injured", "ready", "sick", "socialize", "other", "misc0", "misc1", "misc2", "misc3", "misc4", "misc5", "misc6", "misc7", "misc8", "misc9", "unknown", "any", "count")
int getNumTypeMapEntries ()
 
Type Map Functions
const chargetTypeMapCharacterType (int index)
 Get name of character type associated with a type map entry.
const chargetTypeMapCharacterAppearance (int index)
 Get name of character appearance associated with a type map entry.
const chargetTypeMapFieldValue (int index, const char *fieldName)
 Get actual type map field value.
const chargetTypeMapFieldValue (int index, int fieldIndex)
int getNumTypeMapCharacterClasses ()
const chargetTypeMapCharacterClassAtIndex (int index)
int getNumTypeMapCategories (const char *character_class)
const chargetTypeMapCategoryAtIndex (const char *character_class, int index)
int getNumTypeMapSubcategories (const char *character_class, const char *category)
const chargetTypeMapSubcategoryAtIndex (const char *character_class, const char *category, int index)
virtual void getAppearancesMatchingDiGuyTypeMap (const DtString &characterType, std::vector< DtString > &fields, std::vector< DtString > &retAppearances)
 Given a DI-Guy character type and a complete set of type map field values, any of which can be a wildcard ("*"), return all matching character appearances.
virtual void getAppearancesMatchingPartialDiGuyTypeMap (const DtString &characterType, std::vector< DtString > &partialFields, std::vector< int > &fieldIndices, std::vector< DtString > &retAppearances)
 Similar to above, but only some fields are specified.
virtual void getTypeMapFieldOptions (const DtString &characterType, std::vector< DtString > &fields, StringListVec &retValues)
 Given a DI-Guy character type and a complete set of type map field values, any of which can be a wildcard ("*"), return the possible choices for each type map field.
virtual void getTypeMapPartialFieldOptions (const DtString &characterType, std::vector< DtString > &partialFields, std::vector< int > &fieldIndices, StringListVec &retValues)
 Uses the same idea as getAppearancesMatchingPartialDiGuyTypeMap(). retValues only contains a set of lists for the fields passed in.
virtual void initTypeMapNodes ()
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Member Functions

static DtDiGuyScenarioinstance (DtDe &de, bool initVisualComponent=true)
static DtDiGuyScenariolightweight_instance ()

Protected Member Functions

virtual void slot_windowDestroyed (DtWindow *window)
 Called when the window manager destroys a window.
virtual void slot_windowCreated (DtWindow *window)
 Called when the window manager creates a window.
virtual void slot_reloadShader ()
 Called when someone presses the reload shader button.
virtual void slot_preDraw ()
 Called before rendering the scene.
virtual void slot_postDraw ()
 Called after rendering the scene.
virtual void slot_postUpdate ()
 Called after updating the scene.
virtual void syncToSharedDiGuySettings ()
 pass settings from vrv shared diguy settings down to diguy scenario
virtual void slot_diGuyInstancingEnabledChanged (bool enabled)
 Receives notification that the user changed the instancing enabled checkbox.
virtual void slot_diGuyInstancedLodChanged (int lod)
 Receives notification that the user changed the instancing lod value (1-7).
virtual void slot_diGuyVisualizeInstancingChanged (bool enabled)
 Receives notification that the user changed the visualize instancing checkbox.
virtual void slot_diGuyMaxDrawDistanceChanged (float distance)
 Receives notification that the user changed the max draw distance.
virtual void slot_diGuyMultiThreadUpdateChanged (bool enabled)
 Receives notification that the user changed the multi threaded update checkbox.
diguyCharacter * getCharacter (DtElementID parentSceneObjectID)
void updateScenario (double simTime)
void setComponentVisualizationMode (int mode)
 DtDiGuyScenario (DtDe &de)
 DtDiGuyScenario ()
void createDiGuyScenario ()
void reloadConfigInfo ()

Static Protected Member Functions

static DtDiGuyScenariocreateInstance (DtDe *de=NULL, bool initVisualComponent=true)
static void slot_displayToBeDestroyed (const std::string &displayName, DtDe *de)

Protected Attributes

DtDemyDe
bool myDeIsValid
diguyScenario * myScenario
osg::ref_ptr< osg::Group > myDiguyRoot
osg::ref_ptr< osg::Group > myCharacterRoot
osg::ref_ptr< osg::Group > myInstancingRoot
double myFirstUpdateT
double myPreviousUpdateTime
int myUseGuides
float myGuideSyncGain
int myUseInstancing
bool myVisualComponentInitialized
bool myLightweightInstance
DiGuyTypeMapFieldNode myTypeMapFieldsRootNode
bool myHaveSetupTypeMapFieldsNodes
DtSignalConnectionManager myConnections

Detailed Description

Owns a DiGuy scenario for the application.

Member Typedef Documentation

Constructor & Destructor Documentation

virtual makVrv::DtDiGuyScenario::~DtDiGuyScenario ( )
virtual

DTOR.

makVrv::DtDiGuyScenario::DtDiGuyScenario ( DtDe de)
protected
makVrv::DtDiGuyScenario::DtDiGuyScenario ( )
protected

Member Function Documentation

static DtDiGuyScenario& makVrv::DtDiGuyScenario::instance ( DtDe de,
bool  initVisualComponent = true 
)
static
void makVrv::DtDiGuyScenario::initializeVisualComponent ( )
static DtDiGuyScenario* makVrv::DtDiGuyScenario::lightweight_instance ( )
static
diguyScenario& makVrv::DtDiGuyScenario::scenario ( )

Get the scenario.:

void makVrv::DtDiGuyScenario::clearScene ( )
virtual osg::Node* makVrv::DtDiGuyScenario::characterRoot ( )
virtual

Get the OSG root node for the DI-Guy character geometry.

int makVrv::DtDiGuyScenario::getUseGuides ( )
inline
float makVrv::DtDiGuyScenario::getGuideSyncGain ( )
inline
int makVrv::DtDiGuyScenario::getUseInstancing ( )
inline
const char* makVrv::DtDiGuyScenario::mapEffect ( const char diguy_effect_name)
std::string makVrv::DtDiGuyScenario::findCharacterName ( DtElementID  parentSceneObjectID)

Finds the character name, given the parent scene object ID.

int makVrv::DtDiGuyScenario::getSupportsWeightVariations ( DtElementID  parentSceneObjectID)

Returns if character supports weight variations (skinny to fat)

bool makVrv::DtDiGuyScenario::evalScript ( const std::string &  script)

Evaluates a script using the diguyScenario's interpreter.

int makVrv::DtDiGuyScenario::getNumCharacterTypes ( )


Info about particular character types or appearances.

These are categories in DI-Guy, sets of settings

and attributes that are available to characters at creation time or afterwards.

Get number of total available DI-Guy character types

const char* makVrv::DtDiGuyScenario::getCharacterTypeAtIndex ( int  index)

Get name of a DI-Guy character type.

int makVrv::DtDiGuyScenario::getCharacterTypeNumAppearances ( const char typeName)

Get number of appearances associated with a particular character type.

const char* makVrv::DtDiGuyScenario::getCharacterTypeAppearanceAtIndex ( const char typeName,
int  index 
)

Get name of appearance.

const char* makVrv::DtDiGuyScenario::getHandItemClass ( const char typeName)

Get the name of the hand item class available to a particular character type (e.g.

"street_implements", "weapons")

int makVrv::DtDiGuyScenario::getNumHandItemsInClass ( const char className)
const char* makVrv::DtDiGuyScenario::getHandItemFromClass ( const char className,
int  index 
)

Gets the name of a hand item (e.g. "m16")

int makVrv::DtDiGuyScenario::getCharacterTypeNumHeads ( const char typeName,
const char appearanceName 
)

Get number of heads available for a particular character type/appearance combo.

const char* makVrv::DtDiGuyScenario::getCharacterTypeHeadAtIndex ( const char typeName,
const char appearanceName,
int  index 
)

Get name of a head appearance.

int makVrv::DtDiGuyScenario::getCharacterTypeNumActions ( const char typeName)

Get number of actions (i.e. animations) available to a particular character type.

const char* makVrv::DtDiGuyScenario::getCharacterTypeActionAtIndex ( const char typeName,
int  index 
)

Get name of an action.

float makVrv::DtDiGuyScenario::getCharacterTypeActionDuration ( const char typeName,
const char actionName 
)

How long an action (animation) is expected to take, in seconds.

float makVrv::DtDiGuyScenario::getCharacterTypeActionSpeed ( const char typeName,
const char actionName 
)

The default speed (m/s) at which a character will move while carrying out the animation.

const char* makVrv::DtDiGuyScenario::getCharacterTypeActionPosture ( const char typeName,
const char actionName 
)

Get name of posture associated with a particular character type and action ("upright", "crouching", "prone", "sitting", "kneeling", "any")

const char* makVrv::DtDiGuyScenario::getCharacterTypeActionDirection ( const char typeName,
const char actionName 
)

Get name of direction associated with a particular character type and action ("none", "forward", "backward", "left", "right", "locomotion", "up", "down", "turn_left", "turn_right", "nonlinear", "linear_offaxis", "inherit", "unknown")

const char* makVrv::DtDiGuyScenario::getCharacterTypeActionPrimaryVariant ( const char typeName,
const char actionName 
)

Get name of variant associated with a particular character type and action ("normal", "aim", "dead", "angry", "ambient", "assault", "curious", "exercise", "funky", "injured", "ready", "sick", "socialize", "other", "misc0", "misc1", "misc2", "misc3", "misc4", "misc5", "misc6", "misc7", "misc8", "misc9", "unknown", "any", "count")

int makVrv::DtDiGuyScenario::getNumTypeMapEntries ( )


Type Map Functions

A type map contains several extra fields that can be used to classify a character These fields are: "character_class", "category", "subcategory", "sex", "age", "race", "country", "military_branch", and "carried_object"

Samples set of values: "human/military/soldier/male/adult/black/usa/army/m16" "vehicle/civilian/automobile/-/-/-/-/-/-"

"object/prop/unspecified/warehouse/industry/industrial/-/-/-"

Gets total number of type map entries in the system. Besides the map described above, there's also a character type string and an appearance string.

const char* makVrv::DtDiGuyScenario::getTypeMapCharacterType ( int  index)

Get name of character type associated with a type map entry.

const char* makVrv::DtDiGuyScenario::getTypeMapCharacterAppearance ( int  index)

Get name of character appearance associated with a type map entry.

const char* makVrv::DtDiGuyScenario::getTypeMapFieldValue ( int  index,
const char fieldName 
)

Get actual type map field value.

const char* makVrv::DtDiGuyScenario::getTypeMapFieldValue ( int  index,
int  fieldIndex 
)
int makVrv::DtDiGuyScenario::getNumTypeMapCharacterClasses ( )
const char* makVrv::DtDiGuyScenario::getTypeMapCharacterClassAtIndex ( int  index)
int makVrv::DtDiGuyScenario::getNumTypeMapCategories ( const char character_class)
const char* makVrv::DtDiGuyScenario::getTypeMapCategoryAtIndex ( const char character_class,
int  index 
)
int makVrv::DtDiGuyScenario::getNumTypeMapSubcategories ( const char character_class,
const char category 
)
const char* makVrv::DtDiGuyScenario::getTypeMapSubcategoryAtIndex ( const char character_class,
const char category,
int  index 
)
virtual void makVrv::DtDiGuyScenario::getAppearancesMatchingDiGuyTypeMap ( const DtString characterType,
std::vector< DtString > &  fields,
std::vector< DtString > &  retAppearances 
)
virtual

Given a DI-Guy character type and a complete set of type map field values, any of which can be a wildcard ("*"), return all matching character appearances.

virtual void makVrv::DtDiGuyScenario::getAppearancesMatchingPartialDiGuyTypeMap ( const DtString characterType,
std::vector< DtString > &  partialFields,
std::vector< int > &  fieldIndices,
std::vector< DtString > &  retAppearances 
)
virtual

Similar to above, but only some fields are specified.

The entries in fieldIndices correspond to the entries in partialFields, and each is the index of a type map field. partialFields contains the values of those particular fields; all others are assumed to be wildcards.

virtual void makVrv::DtDiGuyScenario::getTypeMapFieldOptions ( const DtString characterType,
std::vector< DtString > &  fields,
StringListVec retValues 
)
virtual

Given a DI-Guy character type and a complete set of type map field values, any of which can be a wildcard ("*"), return the possible choices for each type map field.

The idea is that choices made in a more significant field narrow down the available choices in less significant fields. Each vector entry in retValues contains a list of choices corresponding to that type map field index.

virtual void makVrv::DtDiGuyScenario::getTypeMapPartialFieldOptions ( const DtString characterType,
std::vector< DtString > &  partialFields,
std::vector< int > &  fieldIndices,
StringListVec retValues 
)
virtual

Uses the same idea as getAppearancesMatchingPartialDiGuyTypeMap(). retValues only contains a set of lists for the fields passed in.

virtual void makVrv::DtDiGuyScenario::initTypeMapNodes ( )
virtual
virtual void makVrv::DtDiGuyScenario::slot_windowDestroyed ( DtWindow window)
protectedvirtual

Called when the window manager destroys a window.

virtual void makVrv::DtDiGuyScenario::slot_windowCreated ( DtWindow window)
protectedvirtual

Called when the window manager creates a window.

virtual void makVrv::DtDiGuyScenario::slot_reloadShader ( )
protectedvirtual

Called when someone presses the reload shader button.

virtual void makVrv::DtDiGuyScenario::slot_preDraw ( )
protectedvirtual

Called before rendering the scene.

virtual void makVrv::DtDiGuyScenario::slot_postDraw ( )
protectedvirtual

Called after rendering the scene.

virtual void makVrv::DtDiGuyScenario::slot_postUpdate ( )
protectedvirtual

Called after updating the scene.

virtual void makVrv::DtDiGuyScenario::syncToSharedDiGuySettings ( )
protectedvirtual

pass settings from vrv shared diguy settings down to diguy scenario

virtual void makVrv::DtDiGuyScenario::slot_diGuyInstancingEnabledChanged ( bool  enabled)
protectedvirtual

Receives notification that the user changed the instancing enabled checkbox.

virtual void makVrv::DtDiGuyScenario::slot_diGuyInstancedLodChanged ( int  lod)
protectedvirtual

Receives notification that the user changed the instancing lod value (1-7).

virtual void makVrv::DtDiGuyScenario::slot_diGuyVisualizeInstancingChanged ( bool  enabled)
protectedvirtual

Receives notification that the user changed the visualize instancing checkbox.

virtual void makVrv::DtDiGuyScenario::slot_diGuyMaxDrawDistanceChanged ( float  distance)
protectedvirtual

Receives notification that the user changed the max draw distance.

virtual void makVrv::DtDiGuyScenario::slot_diGuyMultiThreadUpdateChanged ( bool  enabled)
protectedvirtual

Receives notification that the user changed the multi threaded update checkbox.

diguyCharacter* makVrv::DtDiGuyScenario::getCharacter ( DtElementID  parentSceneObjectID)
protected
static DtDiGuyScenario* makVrv::DtDiGuyScenario::createInstance ( DtDe de = NULL,
bool  initVisualComponent = true 
)
staticprotected
static void makVrv::DtDiGuyScenario::slot_displayToBeDestroyed ( const std::string &  displayName,
DtDe de 
)
staticprotected
void makVrv::DtDiGuyScenario::updateScenario ( double  simTime)
protected
void makVrv::DtDiGuyScenario::setComponentVisualizationMode ( int  mode)
protected
void makVrv::DtDiGuyScenario::createDiGuyScenario ( )
protected
void makVrv::DtDiGuyScenario::reloadConfigInfo ( )
protected

Member Data Documentation

DtDe& makVrv::DtDiGuyScenario::myDe
protected
bool makVrv::DtDiGuyScenario::myDeIsValid
protected
diguyScenario* makVrv::DtDiGuyScenario::myScenario
protected
osg::ref_ptr<osg::Group> makVrv::DtDiGuyScenario::myDiguyRoot
protected
osg::ref_ptr<osg::Group> makVrv::DtDiGuyScenario::myCharacterRoot
protected
osg::ref_ptr<osg::Group> makVrv::DtDiGuyScenario::myInstancingRoot
protected
double makVrv::DtDiGuyScenario::myFirstUpdateT
protected
double makVrv::DtDiGuyScenario::myPreviousUpdateTime
protected
int makVrv::DtDiGuyScenario::myUseGuides
protected
float makVrv::DtDiGuyScenario::myGuideSyncGain
protected
int makVrv::DtDiGuyScenario::myUseInstancing
protected
bool makVrv::DtDiGuyScenario::myVisualComponentInitialized
protected
bool makVrv::DtDiGuyScenario::myLightweightInstance
protected
DiGuyTypeMapFieldNode makVrv::DtDiGuyScenario::myTypeMapFieldsRootNode
protected
bool makVrv::DtDiGuyScenario::myHaveSetupTypeMapFieldsNodes
protected
DtSignalConnectionManager makVrv::DtDiGuyScenario::myConnections
protected

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

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)