VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtFpsFirstPersonUpdater Class Reference

Detailed Description

DtFpsFirstPersonUpdater extends the scene object mimic updater to provide specific control over a first-person model. It manages pitch and heading rotations of the model relative to the parent entity, with configurable pivot joints and rotation axes. This class is used primarily for the first-person view in the human role to control model orientation.

#include <DtFpsFirstPersonUpdater.h>

Inheritance diagram for makVre::DtFpsFirstPersonUpdater:
[legend]

Public Member Functions

 DtFpsFirstPersonUpdater (DtDe &de, DtUniqueID id)
 
virtual ~DtFpsFirstPersonUpdater () override
 
virtual void setModelPitch (float pitch)
 
virtual void setModelHeading (float heading)
 
virtual void setPitchAxis (char axis)
 
virtual void setBaseRotation (DtVector yawPitchRoll)
 
virtual void setPivotJoint (std::string jointName)
 
- Public Member Functions inherited from makVre::DtSceneObjectMimicUpdater
 DtSceneObjectMimicUpdater (DtDe &de, DtUniqueID id)
 
virtual ~DtSceneObjectMimicUpdater () override
 
virtual void update (DtTime tNow) override
 
virtual void setParentSceneObject (DtUniqueID id)
 
virtual void setModelOffset (const DtVector &offset)
 

Protected Types

enum  Axis { X , Y , Z }
 

Protected Member Functions

virtual void initModel (DtModelInstance *modelInstance) override
 
virtual void setupOsgNode (osg::Node *node) override
 
virtual void updatePosition (DtTime tNow) override
 
- Protected Member Functions inherited from makVre::DtSceneObjectMimicUpdater
virtual void checkModel ()
 
virtual void setupOsgNodes (DtOsgModelInstance *osgModelInstance)
 
virtual void slot_parentSceneObjectToBeDeleted (const DtUniqueID &id)
 

Protected Attributes

std::string myDIGuyCharacterName
 
float myModelPitch
 
float myModelHeading
 
bool myModelAiming
 
Axis myPitchAxis
 
std::string myBaseJoint
 
std::string myPivotJoint
 
DtTaitBryan myModelRotationDegrees
 
- Protected Attributes inherited from makVre::DtSceneObjectMimicUpdater
DtSceneObject * myParentSceneObject
 
DtModelInstance * myModelInstance
 
DtVector myModelOffset
 
double myLinearSpeed
 
double myYawSpeed
 

Member Enumeration Documentation

◆ Axis

Enumeration of possible rotation axes.

Enumerator

Constructor & Destructor Documentation

◆ DtFpsFirstPersonUpdater()

makVre::DtFpsFirstPersonUpdater::DtFpsFirstPersonUpdater ( DtDe & de,
DtUniqueID id )

Constructor.

Parameters
deReference to the display element
idUnique identifier for this updater

References de().

◆ ~DtFpsFirstPersonUpdater()

virtual makVre::DtFpsFirstPersonUpdater::~DtFpsFirstPersonUpdater ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ setModelPitch()

virtual void makVre::DtFpsFirstPersonUpdater::setModelPitch ( float pitch)
virtual

Sets the pitch of the first-person model.

Parameters
pitchPitch angle in degrees

Controls the pitch rotation of the first-person model, relative to the parent entity's SceneObject orientation.

◆ setModelHeading()

virtual void makVre::DtFpsFirstPersonUpdater::setModelHeading ( float heading)
virtual

Sets the heading of the first-person model.

Parameters
headingHeading angle in degrees

Controls the heading rotation of the first-person model, relative to the parent entity's SceneObject orientation.

◆ setPitchAxis()

virtual void makVre::DtFpsFirstPersonUpdater::setPitchAxis ( char axis)
virtual

Sets the axis used for pitch rotation.

Parameters
axisCharacter representing the axis ('X', 'Y', or 'Z')

Configuration parameter that controls which axis is used by setModelPitch. Default is 'Y'.

◆ setBaseRotation()

virtual void makVre::DtFpsFirstPersonUpdater::setBaseRotation ( DtVector yawPitchRoll)
virtual

Sets the base rotation for the first-person model.

Parameters
yawPitchRollVector containing yaw, pitch, and roll values in degrees

Configuration parameter that sets a base rotation for the first-person model. Values from setModelPitch and setModelHeading are added to this base rotation. Value is relative to the parent entity's SceneObject. Default is (0,0,0).

◆ setPivotJoint()

virtual void makVre::DtFpsFirstPersonUpdater::setPivotJoint ( std::string jointName)
virtual

Sets the pivot joint for model rotation.

Parameters
jointNameName of the skeletal joint to use as pivot

Configuration parameter that specifies the name of the skeletal joint in the first-person model around which the model should be rotated. Default is "cervical".

◆ initModel()

virtual void makVre::DtFpsFirstPersonUpdater::initModel ( DtModelInstance * modelInstance)
overrideprotectedvirtual

Initializes the model instance.

Parameters
modelInstancePointer to the model instance to initialize

Reimplemented from makVre::DtSceneObjectMimicUpdater.

◆ setupOsgNode()

virtual void makVre::DtFpsFirstPersonUpdater::setupOsgNode ( osg::Node * node)
overrideprotectedvirtual

Sets up the OSG node.

Parameters
nodePointer to the OSG node to set up

Reimplemented from makVre::DtSceneObjectMimicUpdater.

◆ updatePosition()

virtual void makVre::DtFpsFirstPersonUpdater::updatePosition ( DtTime tNow)
overrideprotectedvirtual

Updates the position and orientation for the current frame.

Parameters
tNowCurrent simulation time

Reimplemented from makVre::DtSceneObjectMimicUpdater.

Member Data Documentation

◆ myDIGuyCharacterName

std::string makVre::DtFpsFirstPersonUpdater::myDIGuyCharacterName
protected

Name of the DIGuy character model.

◆ myModelPitch

float makVre::DtFpsFirstPersonUpdater::myModelPitch
protected

Current pitch angle of the model in degrees.

◆ myModelHeading

float makVre::DtFpsFirstPersonUpdater::myModelHeading
protected

Current heading angle of the model in degrees.

◆ myModelAiming

bool makVre::DtFpsFirstPersonUpdater::myModelAiming
protected

Flag indicating if the model is in aiming pose.

◆ myPitchAxis

Axis makVre::DtFpsFirstPersonUpdater::myPitchAxis
protected

Current axis used for pitch rotation.

◆ myBaseJoint

std::string makVre::DtFpsFirstPersonUpdater::myBaseJoint
protected

Name of the base joint for the model.

◆ myPivotJoint

std::string makVre::DtFpsFirstPersonUpdater::myPivotJoint
protected

Name of the pivot joint for model rotation.

◆ myModelRotationDegrees

DtTaitBryan makVre::DtFpsFirstPersonUpdater::myModelRotationDegrees
protected

Base rotation of the model in degrees using Tait-Bryan angles.


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