VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
humanStateRepository.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
11 
13 
14 #include <vlutil/vlMachineTypes.h>
15 
20 
21 class DtHumanParameters;
22 
34 {
35 private:
38 
41 
44  const DtHumanStateRepository& orig);
45 
46 public:
47 
49  DtHumanStateRepository (DtLocalObject* vrfObject, const DtString& rwName = DtString::nullString(),
50  DtReaderWriterRegistry* parentRegistry = 0);
51 
53  virtual ~DtHumanStateRepository();
54 
55  virtual bool init();
56 
58  virtual DtString type() const;
59 
61  virtual const int vrfMovingObjectStateRepositorySubType() const;
62 
64  virtual const int humanStateRepositorySubType() const;
65 
66  virtual void initializeFromParameters();
67  const DtHumanParameters* humanParameters() const;
68 
70  virtual void setAssignedPosture(DtLifeformState newPosture);
71  virtual DtLifeformState assignedPosture() const;
72 
74  virtual void setHeadingToTurnTo(double);
75  virtual double headingToTurnTo() const;
76 
78  virtual void setTurnToMode(int);
79  virtual int turnToMode() const;
80 
82  virtual DtVector localEyepoint() const;
83  virtual DtVector localEyepoint(const DtVector& localPosition) const;
84 
86  virtual void setCurrentPosture (DtLifeformState newPosture);
87 
89  virtual void setAssignedWeaponState(DtWeaponState newWeaponState);
90  virtual DtWeaponState assignedWeaponState() const;
91 
93  virtual DtWeaponState currentWeaponState() const;
94  virtual void setCurrentWeaponState (DtWeaponState newWeaponState);
95 
103  virtual void clampToGround (const DtVector& location, const DtReal heading,
104  bool* dataAvailable = 0, bool requireAllData = false);
105 
113  virtual void calculateBodyEyepointOffset(DtLifeformState posture,
114  DtVector& bodyEyepointOffset) const;
115 
118  virtual bool uprightPosture(DtLifeformState posture) const;
119 
122  virtual bool staticPosture(DtLifeformState posture) const;
123 
126  virtual bool movingPosture(DtLifeformState posture) const;
127 
128  static DtVrfObjectStateRepository* creator (const DtString& name,
129  DtLocalObject* vrfObject, DtReaderWriterRegistry* parentRegistry);
130 
132  virtual void embarkedParentDeleted();
133 
134 protected:
135 
140  virtual void preGetSelf();
141 
147  virtual void postGetSelf();
148 
149  virtual void initializePosture();
150  virtual void restoreFromLegacyRWData();
151 
152 protected:
160 
161 public:
164  VRF4API_METHOD virtual DtLifeformState currentPosture() const;
165 
166  VRF4API_METHOD virtual void setLifeformState(int);
167  VRF4API_METHOD virtual void setPrimaryWeaponState(int);
168 
170  {
171  return rep->as<DtHumanStateRepository>();
172  }
174 };
virtual void embarkedParentDeleted()
Called when the embarked parent is deleted.
Contains the DtVrfMovingObjectStateRepository class declaration.
virtual bool init()
Our &#39;virtual&#39; constructor. Calls all the create&lt;&gt;() methods.
Description: Readable, Writable DtRwIndividualLifeFormWeaponStateType.
Definition: rwIndividualLifeFormWeaponStateType.h:30
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:31
Description: This repository holds all information that is common to all the forms of humans within t...
Definition: humanStateRepository.h:33
DtRwIndividualLifeFormWeaponStateType myCurrentWeaponState
Definition: humanStateRepository.h:156
virtual void initializeFromParameters()
static DtVrfObjectStateRepository * creator(const DtString &name, DtLocalObject *vrfObject, DtReaderWriterRegistry *parentRegistry)
DtVrfMovingObjectStateRepository & operator=(const DtVrfMovingObjectStateRepository &orig)
Assignment Operator.
Definition: simObjectStateRepository.h:59
Definition: readerWriterRegistry.h:39
virtual const int vrfMovingObjectStateRepositorySubType() const
Returns DtVrfMovingObjectStateRepositorySubTypeBase.
Description: This repository is an internal repository accessible only by local objects. It holds all information that is common to all the forms of all entity/aggregate/control objects within VR-Forces.
Definition: vrfObjectStateRepository.h:90
DtHumanLocalObjectFacade myHumanLocalObjectFacade
Definition: humanStateRepository.h:159
virtual DtString type() const
returns DtSimObjectStateRepositoryType
DtRwIndividualLifeFormWeaponStateType myAssignedWeaponState
Definition: humanStateRepository.h:155
static VRF4API_METHOD DtHumanStateRepository * isHumanStateRepository(DtSimObjectStateRepository *rep)
These are backwards compatible methods that can be used if you define ALLOW_VRF4API in your header fi...
Definition: humanStateRepository.h:169
DtRwIndividualLifeFormStateType myAssignedPosture
Definition: humanStateRepository.h:153
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
virtual void clampToGround(const DtVector &location, const DtReal heading, bool *dataAvailable=0, bool requireAllData=false)
Place entity on ground at location and heading. Calls clampToGround with gravity of false...
Description: Readable, Writable int.
Definition: rwInt.h:25
DtRwIndividualLifeFormStateType myCurrentPosture
Definition: humanStateRepository.h:154
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
DtHumanParameters; used to hold all of the configurable parameters for the DtIndividualLifeFormStateR...
Definition: humanParameters.h:28
DtRwInt myTurnToMode
Definition: humanStateRepository.h:158
DtRwReal myHeadingToTurnTo
Definition: humanStateRepository.h:157
virtual void postGetSelf()
Hook function called immediately following getSelf().
const T_SRType * as() const
Convenience function to cast to particular state rep type.
Definition: simObjectStateRepository.h:101
virtual void preGetSelf()
Hook function called immediately prior to getSelf().
virtual void restoreFromLegacyRWData()
#define VRF4API_METHOD
Include this header file to allow for the definition/usage of the ability to mark something as deprec...
Definition: vrf4XAPI.h:22
Description: Readable, Writable DtRwIndividualLifeFormStateType.
Definition: rwIndividualLifeFormStateType.h:30
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)