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() override;
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 
139  virtual void initializePosture();
140  virtual void restoreFromLegacyRWData() override;
141 
142 protected:
151 
152 public:
155  VRF4API_METHOD virtual DtLifeformState currentPosture() const;
156 
157  VRF4API_METHOD virtual void setLifeformState(int);
158  VRF4API_METHOD virtual void setPrimaryWeaponState(int);
159 
161  {
162  return rep->as<DtHumanStateRepository>();
163  }
165 };
virtual void embarkedParentDeleted()
Called when the embarked parent is deleted.
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:146
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:149
DtRwIndividualLifeFormWeaponStateType myAssignedWeaponState
Definition: humanStateRepository.h:145
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:160
virtual void restoreFromLegacyRWData() override
DtRwIndividualLifeFormStateType myAssignedPosture
Definition: humanStateRepository.h:143
#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:150
Description: Readable, Writable int.
Definition: rwInt.h:25
virtual void initializeFromParameters() override
DtRwIndividualLifeFormStateType myCurrentPosture
Definition: humanStateRepository.h:144
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
DtRwInt myTurnToMode
Definition: humanStateRepository.h:148
DtRwReal myHeadingToTurnTo
Definition: humanStateRepository.h:147
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:23
Description: Readable, Writable DtRwIndividualLifeFormStateType.
Definition: rwIndividualLifeFormStateType.h:30
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)