![]() |
VR-Forces 5.0.2 Developer's Guide
|
DI-Guy Character model. This class manages a DI-Guy character (diguyCharacter) instance and makes calls to it after receiving requests that come in from the networking layer. The chain goes as follows: Network message processing layer (e.g. processDiGuyPdu()) to DtEntityStateInterceptor to DtEntityStateListener to DtEntityDIGuyStateVisualizer to DtCharacterModelAgent to DtCharacterModel.

Public Member Functions | |
| DtDiGuyCharacterModel (DtDe &de, DtUniqueID id) | |
| virtual | ~DtDiGuyCharacterModel () |
| virtual void | setModelDefinition (const std::string &modelDefinition) |
| virtual void | discoverDynamicRegions (const DtModelDefinition *definition) |
| diguyCharacter * | character () |
| DtDiGuyScenario & | getScenario () |
| virtual const std::string & | className () const |
| virtual void | addToScene (const DtUniqueID &sceneObjectId, int modelSet, int visualizerType) |
| virtual void | removeFromScene () |
| void | setPositionAndVelocityState (const DtVector &vrvLoc, const DtTaitBryan &vrvOri, const DtVector32 &vrvVel, const DtVector32 &vrvAngularVel, bool needsTopoUpdate) |
| virtual void | setPosition (int vtx, const DtVector &position) |
| const DtVector & | getPosition () |
| virtual void | setPositionOffset (const DtVector &position) |
| virtual void | setOrientation (int vtx, const DtTaitBryan &orientation) |
| const DtTaitBryan & | getOrientation () |
| virtual void | setOrientationOffset (const DtTaitBryan &orientationOffset) |
| virtual void | setPositionAndOrientation (int vtx, const DtVector &position, const DtTaitBryan &orientation) |
| virtual void | setCharacterModel (const std::string &characterType) |
| virtual void | setFlamesPresent (bool val) |
| virtual void | setEnginePlume (bool val) |
| virtual void | setEngineSmoke (bool val) |
| virtual void | setTrailState (bool val) |
| virtual void | setLightState (unsigned int light, unsigned int lightState) |
| virtual void | beginAppearanceEffect (const std::string &effect, const std::string &overrideLink, float overrideScale, const DtVector &overrideOffset, float overrideDuration) |
| virtual void | endAppearanceEffect (int instant, const std::string &effect, const std::string &overrideLink) |
| virtual void | executeGesture (const std::string &gestureName, int reps, float overallDuration, float channelAWeight) |
| virtual void | endGesture (const std::string &gestureName, float rampDown) |
| virtual void | setEnableAnimationSmoothing (bool) |
| virtual bool | enableAnimationSmoothing () const |
| virtual void | setDesiredAction (const std::string &action, float speed) |
| virtual void | fireWeapon () |
| virtual void | forceAction (const std::string &action, float speed, bool usePositioning, const DtVector &offset, int autoChooseTransitionBehavior, float transitionSpeedScale) |
| virtual int | currentArcChangeCb (diguyCharacter *character) |
| virtual void | forceTemporaryAction (const std::string &action, double duration) |
| virtual void | unforceAction () |
| virtual void | setSpeed (float speed) |
| virtual void | setPosture (int posture) |
| virtual bool | weaponDeployed () const override |
| virtual EntityStateListener::WeaponState | weaponState () const override |
| virtual void | setWeaponState (EntityStateListener::WeaponState deployed) override |
| void | setFullUpdateNeeded (bool updated) |
| bool | fullUpdateNeeded () const |
| virtual void | die (const std::string &deathAction) |
| virtual void | revive (const std::string &aliveAction) |
| virtual void | setPaused (bool paused) |
| bool | paused () const |
| virtual bool | getVRForcesEntity () |
| bool | autoGenerateActions () const |
| bool | autoGenerateActionSpeed () const |
| virtual void | setModelScalingEnabled (bool b) |
| virtual void | setIsSupportModel (bool isSupport) |
| virtual void | setEmbarked (bool embarkedState) |
| virtual bool | embarked () const |
| virtual void | setStationName (int name) |
| virtual int | getStationName () const |
| virtual void | setStationNumber (DtU16 number) |
| virtual void | setScale (const DtVector &scale) |
| virtual void | setWeight (float weightScale) |
| virtual void | setPartOrientation (int partNumber, const DtTaitBryan &orientation, const DtVector &rotationalVelocity) |
| virtual void | setPartTranslation (int partNumber, const DtVector &translation, const DtVector &velocity) |
| virtual void | setLinkRotationOverride (const std::string &linkName, const DtTaitBryan &rotation, float rampTime) |
| virtual void | setLinkTranslationOverride (const std::string &linkName, const DtVector &offsets, float rampTime) |
| virtual void | setPartVisibility (int partNumber, bool visible) |
| void | updateAimingAndGaze () |
| void | setupGuides () |
| virtual diguyCharacterGuide * | getGuide () |
| virtual void | setGuide (diguyCharacterGuide *guide) |
| virtual void | setupCoordSystem (const DtVector &vrvLoc, bool overrideEmbarked=false) |
| virtual bool | getAndResetTerrainHasChangedBit () |
| virtual void | setTerrainHasChanged () |
| void | convertToLocalFrame (const DtVector32 &velocity, const DtTaitBryan &orientation, DtVector32 &outVelocity, DtTaitBryan &outOrientation) |
| bool | getIsVehicle () |
| virtual void | setSelected (bool value) |
| virtual bool | selected () |
| virtual void | setTextureVariations (std::vector< DtCharacterTextureVariationInfo > &varationInfoArray, int force) override |
| virtual void | setDynamicSensorRegion (const std::string ®ion, bool state) |
| virtual bool | dynamicSensorRegion (const std::string ®ion) |
| virtual DtVector | positionOffsetWorld () |
| virtual bool | hasPositionOffset () |
| virtual DtTaitBryan | orientationOffsetWithBase (const DtTaitBryan &baseOri) |
| virtual bool | hasOrientationOffset () |
| virtual void | setUseTransitions (bool use) |
| virtual bool | useTransitions () |
| virtual void | setEnabled (bool enabled) |
| virtual bool | enabled () |
| virtual void | setIsOccupant (bool occupant) |
| virtual bool | occupant () |
| virtual DtSceneObject * | sceneObject () |
| virtual bool | isPostureTransitioning () |
| virtual bool | usingActionPositioningFlag () |
| virtual void | updateLights () |
| virtual void | resetLightsWithLink (DtDiGuyOsgGraphicsLink *link) |
| virtual void | draw_character_skeleton (DtOsgGizmoRenderer *renderer) |
| virtual void | draw_movement_info (DtOsgGizmoRenderer *renderer) |
| std::vector< DtDiGuyLightRtInfo > & | lights () |
| const std::list < DtDiGuyDebugEventStream > & | recentActions () |
| const std::list < DtDiGuyDebugEventStream > & | recentHandItems () |
DI-Guy Appearance Setters | |
| virtual void | setDefaultAppearance (const std::string &appearanceName) |
| virtual void | setAppearance (const std::string &appearanceName) |
| virtual void | setHeadAppearance (const std::string &appearanceName) |
| virtual void | setItemAppearance (const std::string &appearanceName) |
| virtual void | setCharacterEquipment (const std::string &appearanceName) |
| virtual void | setUnit (unsigned short country, unsigned char service, unsigned short patch, bool setPersonal) override |
| virtual void | setPersonalUnit (unsigned short country, unsigned char service, unsigned short patch) override |
| virtual void | setRank (unsigned short country, unsigned char service, unsigned short patch) override |
| virtual void | setCharacterName (const std::string &name) override |
Public Member Functions inherited from makVrv::DtCharacterModel | |
| DtCharacterModel (DtDe &de, DtUniqueID id) | |
| virtual | ~DtCharacterModel () |
Public Member Functions inherited from makVrv::DtModel | |
| DtModel (DtDe &de, DtUniqueID id) | |
| virtual | ~DtModel () |
| DtModelInstance * | createModelInstance (const std::string &modelDefName, bool realize=true) |
| virtual const std::string & | modelDefinitionName () |
| virtual void | saveModelToFile (const std::string &filename) |
| unsigned int | transformSize () const |
| virtual const DtVector & | position (int vtx=0) const |
| virtual void | removePosition (int vtx) |
| virtual const DtVector & | positionOffset () const |
| virtual const DtTaitBryan & | orientation (int vtx=0) const |
| virtual const DtTaitBryan & | orientationOffset () const |
| virtual void | enableColorBlending (bool b) |
| virtual void | setBlendColor (float r, float g, float b, float a) |
| virtual void | getBlendColor (float &r, float &g, float &b, float &a) |
| virtual bool | colorBlendingEnabled () const |
| virtual void | setColor (float r, float g, float b, float a) |
| virtual void | enableLighting (bool l) |
| virtual int | modelSet () const |
| const DtVector & | boundingBoxExtents () const |
| void | getBoundingBoxExtents (double &x, double &y, double &z) const |
| const DtVector & | boundingBoxCenter () const |
| virtual void | getBoundingBoxCenter (double &x, double &y, double &z) const |
| virtual void | getBoundingBoxComponents (DtVector &minimum, DtVector &maximum) |
| void | setContributesToBound (bool trueOrFalse) |
| bool | contributesToBound () const |
| DtDe & | de () |
| virtual void | setModelInstance (DtModelInstance *modelInstance) |
| virtual void | promoteBackgroundModelInstance (DtModelDefinition &defintion) |
| virtual void | setVisible (bool isVisible) |
| virtual bool | visible () const |
| DtUniqueID | parentSceneObjectID () const |
| virtual void | addedToSceneObjectAsProp (const DtUniqueID &sceneObj) |
| virtual void | addedToSceneObject (const DtUniqueID &sceneObj, int modelSet, int visualizerType) |
| virtual void | setElementId (DtUniqueID id) |
| virtual void | removedFromSceneObject () |
| virtual void | setSolid (bool isSolid) |
| virtual bool | isProp () |
| virtual void | updateMinLastFrameDistance (float distance) |
| virtual void | resetLastFrameDistance () |
| virtual float | minLastFrameDistance () const |
| virtual DtModelInstance * | modelInstance () |
| virtual const DtModelInstance * | modelInstance () const |
| int | visualizerType () const |
| virtual bool | supportsMultithreadedLoad () |
| virtual void | backgroundLoad () |
| virtual void | foregroundLoad () |
| virtual bool | isActivelyBackgroundLoading () |
| virtual DtLoaderHandle * | getLoadQueueHandle () |
Static Public Member Functions | |
| static void | setDiGuyAttachGroup (osg::Group *diguy_attach_pt) |
Protected Types | |
| typedef boost::unordered_map < std::string, bool > | SensorRegionStateMap |
Protected Types inherited from makVrv::DtModel | |
| typedef std::vector < ObjectTransform > | TransformList |
Protected Member Functions | |
| virtual void | setSceneObjectIdOnCollisionBoxes () |
| void | slot_modelInstanceToBeDestroyed (DtModelInstance *, DtModel *) |
| void | slot_modelInstanceCreated (DtModelInstance *, DtModel *) |
| virtual void | updateModelInstance () |
| virtual void | setMotionModelByName (const std::string &modelName) |
| virtual void | updateVisibility () |
| virtual void | createLights (int id) |
Protected Member Functions inherited from makVrv::DtModel | |
| virtual void | addToSceneAsProp (const DtUniqueID &sceneObjectId) |
| virtual void | initializeModelInstance () |
| void | slot_modelInstanceChanged (DtModelInstance *instance) |
| virtual void | waitAndClearLoadHandle () |
| virtual void | removedFromLoadQueue () |
| virtual void | setDoneBackgroundLoading () |
| virtual void | setActivelyBackgroundLoading () |
Static Protected Attributes | |
| static osg::Group * | DiguyAttachGroup |
Static Protected Attributes inherited from makVrv::DtModel | |
| static bool | theInittedState |
Private Member Functions | |
| DtDiGuyCharacterModel (const DtDiGuyCharacterModel &)=delete | |
| DtDiGuyCharacterModel & | operator= (const DtDiGuyCharacterModel &)=delete |
Additional Inherited Members | |
Public Types inherited from makVrv::DtCharacterModel | |
| enum | Posture { Upright, Crouched, Prone, Sitting, Kneeling, Swimming, Parachuting, Jumping, Squatting, Wading } |
Public Attributes inherited from makVrv::DtModel | |
| boost::signalslib::signal < void(DtModel *)> | signal_modelToBeDestroyed |
| boost::signalslib::signal < void(DtModel *)> | signal_modelChanged |
| boost::signalslib::signal < bool(DtModel *, bool), SlotReturnOR > | signal_visibilityChangeRequested |
| boost::signalslib::signal < void(DtModelInstance *, DtModel *)> | signal_modelInstanceCreated |
| boost::signalslib::signal < void(DtModelInstance *, DtModel *)> | signal_modelInstanceToBeDestroyed |
|
protected |
| makVrv::DtDiGuyCharacterModel::DtDiGuyCharacterModel | ( | DtDe & | de, |
| DtUniqueID | id | ||
| ) |
CTOR.
|
virtual |
DTOR.
|
privatedelete |
not allowed
|
privatedelete |
not allowed
|
virtual |
Set the model definition.
Reimplemented from makVrv::DtModel.
|
virtual |
initialize the dynamic regions based on what is in the model definition.
| diguyCharacter* makVrv::DtDiGuyCharacterModel::character | ( | ) |
Get the character.
| DtDiGuyScenario& makVrv::DtDiGuyCharacterModel::getScenario | ( | ) |
gets the scenario
|
virtual |
Get the class name of the model instance owner. This is used to control how model instances are created.
Reimplemented from makVrv::DtCharacterModel.
|
virtual |
Virtual Functions to be implemented, add this model to the scene.
Implements makVrv::DtModel.
|
virtual |
Virtual Functions to be implemented, remove this model from the scene.
Implements makVrv::DtModel.
| void makVrv::DtDiGuyCharacterModel::setPositionAndVelocityState | ( | const DtVector & | vrvLoc, |
| const DtTaitBryan & | vrvOri, | ||
| const DtVector32 & | vrvVel, | ||
| const DtVector32 & | vrvAngularVel, | ||
| bool | needsTopoUpdate | ||
| ) |
Establish the underlying DIGuy character's position, orientation, and velocity. Location, orientation, velocity, and angular velocity are all in the VRV system's format – they might or might not be geocentric.
|
virtual |
Set position, called by scene object It is also possible to offset position with setPositionOffset.
Reimplemented from makVrv::DtModel.
|
inline |
|
virtual |
Sets the position offset. Override of DtModel function so the position for the instance can be updated.
Reimplemented from makVrv::DtModel.
|
virtual |
Set orientation, called by scene object It is also possible to offset the orientation (pivot around local model center before translating) with setOrientationOffset.
Reimplemented from makVrv::DtModel.
|
inline |
|
virtual |
Sets the orientation offset. Override of DtModel function so the orientation for the instance can be updated.
Reimplemented from makVrv::DtModel.
|
virtual |
Set the position and orientation at the same time, called by scene object it updates both the position and orientation at the same time to avoid excess calculations related to the orientation affecting the position.
Reimplemented from makVrv::DtModel.
|
virtual |
Override the character model in the model definition. This is necessary when explicitly setting the character via custom network messages.
Implements makVrv::DtCharacterModel.
|
virtual |
set the base body appearance
Implements makVrv::DtCharacterModel.
|
virtual |
set the base body appearance
Implements makVrv::DtCharacterModel.
|
virtual |
sets the current character head
Implements makVrv::DtCharacterModel.
|
virtual |
sets the character current hand item
Implements makVrv::DtCharacterModel.
|
virtual |
sets additional equipment the character has | separated list, empty string to reset
Implements makVrv::DtCharacterModel.
|
overridevirtual |
Sets the character's primary unit patch.
Implements makVrv::DtCharacterModel.
|
overridevirtual |
Sets the character's personal unit patch.
Implements makVrv::DtCharacterModel.
|
overridevirtual |
Sets the character's rank patch.
Implements makVrv::DtCharacterModel.
|
overridevirtual |
Sets the text on the character's uniform.
Implements makVrv::DtCharacterModel.
|
virtual |
turn on/off flames
Implements makVrv::DtCharacterModel.
|
virtual |
turn on/off engine smoke plume
Implements makVrv::DtCharacterModel.
|
virtual |
turn on/off engine smoke
Implements makVrv::DtCharacterModel.
|
virtual |
turn on/off missle trail
Implements makVrv::DtCharacterModel.
|
virtual |
turn on/off various lights
Implements makVrv::DtCharacterModel.
|
virtual |
starts a diguy particles effect
Implements makVrv::DtCharacterModel.
|
virtual |
ends a diguy particle effect
Implements makVrv::DtCharacterModel.
|
virtual |
starts a diguy gesture, an animation that plays a limited amount
Implements makVrv::DtCharacterModel.
|
virtual |
aborts the gesture playback
Implements makVrv::DtCharacterModel.
|
virtual |
Sets whether or not to use DI-Guy use_guides for positioning and orientation. Note this will only have an effect if use_guides is set to 1. The default, if use_guides is 1, to use position smoothing.
Implements makVrv::DtCharacterModel.
|
virtual |
Get whether animation smoothing (DI-Guy guides) is enabled.
|
virtual |
Set the action to attempt.
Implements makVrv::DtCharacterModel.
|
virtual |
play fire weapon gesture and trigger effects.
Implements makVrv::DtCharacterModel.
|
virtual |
Force an action. speed: travel speed while performing action. usePositioning: indicates the positioning from the action should be applied to the character. offset: offset to apply over the course of the action. if the action has scoot start/stop points set, offset will only be applied between them. transitionSpeedScale: speed scale factor for transitions. if 0, transition is skipped, resulting in visual popping.
Implements makVrv::DtCharacterModel.
|
virtual |
callback for finding out an action changed
|
virtual |
Force an action for a specific amount of time.
Implements makVrv::DtCharacterModel.
|
virtual |
Restore the ability to use posture/weapon state, which is disabled when an explicit action is set.
Implements makVrv::DtCharacterModel.
|
virtual |
Set the speed of the character.
Implements makVrv::DtCharacterModel.
|
virtual |
Set the posture of the model.
Implements makVrv::DtCharacterModel.
|
overridevirtual |
Get whether the weapon is deployed. myWeaponState == WeaponInFirePosition.
Implements makVrv::DtCharacterModel.
|
overridevirtual |
Get the current state of the weapon.
Implements makVrv::DtCharacterModel.
|
overridevirtual |
Set the current state of the weapon.
Implements makVrv::DtCharacterModel.
| void makVrv::DtDiGuyCharacterModel::setFullUpdateNeeded | ( | bool | updated | ) |
Set if the model has been fully updated, set to true if the diguy character or scenario has been updated.
| bool makVrv::DtDiGuyCharacterModel::fullUpdateNeeded | ( | ) | const |
Check to see if the model needs a full update.
|
virtual |
Tell the character to 'die. Dead characters perform their death action then disable most dynamic behavior (saving CPU cycles).
Implements makVrv::DtCharacterModel.
|
virtual |
Revive a previously dead character.
Implements makVrv::DtCharacterModel.
|
virtual |
Set the paused state.
Implements makVrv::DtCharacterModel.
| bool makVrv::DtDiGuyCharacterModel::paused | ( | ) | const |
Get if the model is paused.
|
inlinevirtual |
| bool makVrv::DtDiGuyCharacterModel::autoGenerateActions | ( | ) | const |
Get if the character will need to auto generate actions. Until explicitly set via setDesiredAction or forceAction this is true and the motion model will generate actions.
| bool makVrv::DtDiGuyCharacterModel::autoGenerateActionSpeed | ( | ) | const |
Get if the character will need to auto generate action speed. This is enabled when the character has an action with default/unknown speed (DtEntityStateListener::UnknownActionSpeed)
|
virtual |
Indicate whether or not this model may be model-scaled Default is false.
Implements makVrv::DtCharacterModel.
|
virtual |
Is this model part of the support group? (determines whether or not other scene objects can ground clamp to this model)
Implements makVrv::DtModel.
|
virtual |
Set/Get embarked state.
Implements makVrv::DtCharacterModel.
|
virtual |
|
virtual |
Set/Get embarked state station name.
Implements makVrv::DtCharacterModel.
|
virtual |
|
virtual |
Set embarked state station number (diguy use this for bone index)
Implements makVrv::DtCharacterModel.
|
virtual |
Implements makVrv::DtCharacterModel.
|
virtual |
Implements makVrv::DtCharacterModel.
|
virtual |
Rotate the part.
Implements makVrv::DtCharacterModel.
|
virtual |
translate the part.
Implements makVrv::DtCharacterModel.
|
virtual |
override the dof rotation state of a joint.
|
virtual |
override the dof translation state of a joint.
|
virtual |
control part visibility, not connected yet.
Implements makVrv::DtCharacterModel.
| void makVrv::DtDiGuyCharacterModel::updateAimingAndGaze | ( | ) |
Updates the DIGuy character's aim (of weapon) and gaze. Only needs to be called when the aim angles themselves change, not when the character orientation changes.
| void makVrv::DtDiGuyCharacterModel::setupGuides | ( | ) |
Sets up any guides that are necessary, otherwise does nothing.
|
virtual |
|
virtual |
|
virtual |
updates the coordinate system
|
virtual |
did the terrain change, and reset the flag
|
virtual |
flip the terrain bit to on
| void makVrv::DtDiGuyCharacterModel::convertToLocalFrame | ( | const DtVector32 & | velocity, |
| const DtTaitBryan & | orientation, | ||
| DtVector32 & | outVelocity, | ||
| DtTaitBryan & | outOrientation | ||
| ) |
|
inline |
|
virtual |
Implements makVrv::DtCharacterModel.
|
virtual |
|
overridevirtual |
Implements makVrv::DtCharacterModel.
|
virtual |
Set the state of a dynamic sensor region.
Implements makVrv::DtCharacterModel.
|
virtual |
Get the state of a dynamic sensor region.
|
virtual |
Get the position offset converted to world coordinates.
|
virtual |
Does this DiGuy have an offset.
|
virtual |
Given a base orientation Returns the combined orientation = base orientation.
|
virtual |
Does this DiGuy have an orientation offset.
|
virtual |
Include transitions and ramp down in animations (ex. start occupants sitting instead of transition to sitting)
Implements makVrv::DtCharacterModel.
|
virtual |
Return whether animation transitions are instant or not.
|
virtual |
Set whether the DI-Guy is enabled (processing updates, etc.)
Implements makVrv::DtCharacterModel.
|
virtual |
Whether the DI-Guy is enabled (processing updates, etc.)
|
virtual |
Set whether this DI-Guy is used as a pilot/driver/occupant for a vehicle.
Implements makVrv::DtCharacterModel.
|
virtual |
Whether the DI-Guy is enabled (processing updates, etc.)
|
inlinevirtual |
|
virtual |
Whether the DI-Guy is transitioning posture.
|
virtual |
Whether the DI-Guy currently getting in or out of a vehicle and having diguy animation data controlling the positions.
|
virtual |
helper function that updates light positions
|
virtual |
clears light link pointer
|
virtual |
draws the skeleton with the gizmo renderer system
|
virtual |
draws movement info with the gizmo renderer system
| std::vector<DtDiGuyLightRtInfo>& makVrv::DtDiGuyCharacterModel::lights | ( | ) |
returns list of light data
|
inline |
|
inline |
|
inlinestatic |
where diguys attach to the scene graph
|
protectedvirtual |
|
protected |
Signal emitted when the model instance is going to be destroyed.
|
protected |
Signal emitted when the model instance is created.
|
protectedvirtual |
|
protectedvirtual |
Update the motion model (DtDeadReckonUpdater) for this character. Used for occupants to help with instanced characters.
Implements makVrv::DtCharacterModel.
|
protectedvirtual |
|
protectedvirtual |
create lights post object creation
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |