VR-Forces 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() override;
56 
58  virtual DtString type() const override;
59 
61  virtual const int vrfMovingObjectStateRepositorySubType() const override;
62 
64  virtual const int humanStateRepositorySubType() const;
65 
66  virtual void initializeFromParameters() override;
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 
81  virtual void setIsFloatingInWater(bool v);
82  virtual bool isFloatingInWater() const;
83 
85  virtual DtVector localEyepoint() const;
86  virtual DtVector localEyepoint(const DtVector& localPosition) const;
87 
89  virtual void setCurrentPosture (DtLifeformState newPosture);
90 
92  virtual void setAssignedWeaponState(DtWeaponState newWeaponState);
93  virtual DtWeaponState assignedWeaponState() const;
94 
96  virtual DtWeaponState currentWeaponState() const;
97  virtual void setCurrentWeaponState (DtWeaponState newWeaponState);
98 
106  virtual void clampToGround (const DtVector& location, const DtReal heading,
107  bool* dataAvailable = 0, bool requireAllData = false) override;
108 
116  virtual void calculateBodyEyepointOffset(DtLifeformState posture,
117  DtVector& bodyEyepointOffset) const;
118 
121  virtual bool uprightPosture(DtLifeformState posture) const;
122 
125  virtual bool staticPosture(DtLifeformState posture) const;
126 
129  virtual bool movingPosture(DtLifeformState posture) const;
130 
131  static DtVrfObjectStateRepository* creator (const DtString& name,
132  DtLocalObject* vrfObject, DtReaderWriterRegistry* parentRegistry);
133 
135  virtual void embarkedParentDeleted() override;
136 
137 protected:
138 
143  virtual void preGetSelf() override;
144 
150  virtual void postGetSelf() override;
151 
152  virtual void initializePosture();
153  virtual void restoreFromLegacyRWData() override;
154 
155 protected:
164 
165 public:
168  VRF4API_METHOD virtual DtLifeformState currentPosture() const;
169 
170  VRF4API_METHOD virtual void setLifeformState(int);
171  VRF4API_METHOD virtual void setPrimaryWeaponState(int);
172 
174  {
175  return rep->as<DtHumanStateRepository>();
176  }
178 };
virtual void embarkedParentDeleted()
Called when the embarked parent is deleted.
virtual void postGetSelf() override
Hook function called immediately following getSelf().
Contains the DtVrfMovingObjectStateRepository class declaration.
virtual bool init() override
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:159
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:91
DtHumanLocalObjectFacade myHumanLocalObjectFacade
Definition: humanStateRepository.h:162
DtRwIndividualLifeFormWeaponStateType myAssignedWeaponState
Definition: humanStateRepository.h:158
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:173
virtual void restoreFromLegacyRWData() override
DtRwIndividualLifeFormStateType myAssignedPosture
Definition: humanStateRepository.h:156
#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...
DtRwBoolean myIsFloatingInWater
Definition: humanStateRepository.h:163
Description: Readable, Writable int.
Definition: rwInt.h:25
virtual void initializeFromParameters() override
DtRwIndividualLifeFormStateType myCurrentPosture
Definition: humanStateRepository.h:157
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
virtual DtString type() const override
returns DtSimObjectStateRepositoryType
DtHumanParameters; used to hold all of the configurable parameters for the DtIndividualLifeFormStateR...
Definition: humanParameters.h:28
virtual void preGetSelf() override
Hook function called immediately prior to getSelf().
DtRwInt myTurnToMode
Definition: humanStateRepository.h:161
DtRwReal myHeadingToTurnTo
Definition: humanStateRepository.h:160
const T_SRType * as() const
Convenience function to cast to particular state rep type.
Definition: simObjectStateRepository.h:101
#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 Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)