VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfMovingObjectStateRepository.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
15 
18 class DtPatchIdentifier;
19 
32 {
33 private:
34 
37 
40 
41 public:
42 
45  const DtString& rwName = DtString::nullString(), DtReaderWriterRegistry* parentRegistry = 0 );
46 
49 
50  static DtVrfObjectStateRepository* creator( const DtString& name,
51  DtLocalObject* vrfObject, DtReaderWriterRegistry* parentRegistry );
52 
54  virtual void tick() override;
55 
56  virtual DtString type() const override;
57 
59  virtual const int vrfObjectStateRepositorySubType() const override;
60 
62  virtual const int vrfMovingObjectStateRepositorySubType() const;
63 
64  virtual void initializeFromParameters() override;
65 
67  const DtMovingObjectParameters* movingObjectParameters() const;
68 
69  virtual bool canPivot() const;
70  virtual void setCanPivot( const bool canPivot );
71 
72  virtual DtReal maxPivotSpeed() const;
73  virtual void setMaxPivotSpeed( DtReal maxPivotSpeed );
74 
76  virtual const DtGroundInteractionPt* rightSupport() const;
77  virtual DtGroundInteractionPt* rightSupport();
78  virtual void setRightSupport( const DtVector& vec );
79 
80  virtual const DtGroundInteractionPt* leftSupport() const;
81  virtual DtGroundInteractionPt* leftSupport();
82  virtual void setLeftSupport( const DtVector& vec );
83 
84  virtual const DtGroundInteractionPt* otherSupport() const;
85  virtual DtGroundInteractionPt* otherSupport();
86  virtual void setOtherSupport( const DtVector& vec );
87 
88  virtual DtReal maxSpeed() const;
89  virtual void setMaxSpeed( const DtReal speed );
90 
91  virtual DtReal maxReverseSpeed() const;
92  virtual void setMaxReverseSpeed( const DtReal speed );
93 
94  virtual DtReal turningRadius() const;
95  virtual void setTurningRadius( const DtReal turningRadius );
96 
97  virtual DtReal maxSlope() const;
98  virtual void setMaxSlope( const DtReal slope );
99 
100 
103 
104  virtual DtReal orderedSpeed() const;
105  virtual void setOrderedSpeed(const DtReal speed);
107 
109  virtual DtReal orderedSpeedConstrained() const;
110 
112  virtual void setOrderedHeading(const DtReal heading);
113  virtual DtReal orderedHeading() const;
114 
118  virtual DtReal maneuverAggressiveness() const;
119  virtual void setManeuverAggressiveness(const DtReal fraction);
121 
125  virtual DtActionUrgencyLevel actionUrgency() const;
126  virtual void setActionUrgency( DtActionUrgencyLevel urgency );
128 
132  virtual void setCurrentPitch( double );
133 
136  virtual DtReal orderedAltitude() const;
137  virtual void setOrderedAltitude( const DtReal orderedAltitude );
138  virtual bool orderedAltitudeSpecified() const;
139  virtual void setOrderedAltitudeSpecified( bool );
140  virtual bool useOrderedAltitudeForRoutes() const;
141  virtual void setUseOrderedAltitureForRoutes( bool c );
142 
143  virtual DtReal maxAcceleration() const;
144  virtual void setMaxAcceleration( const DtReal maxAcceleration );
145 
146  virtual DtReal maxStoppingDeceleration() const;
147  virtual void setMaxStoppingDeceleration( const DtReal maxStoppingDeceleration );
148 
151  virtual DtReal maxLateralAcceleration() const;
152  virtual void setMaxLateralAcceleration( const DtReal maxLateralAcceleration );
153 
154  virtual DtReal fuelEfficiency() const;
155  virtual void setFuelEfficiency( const DtReal fuelEfficiency );
156 
158  virtual DtReal inverseStoppingDeceleration() const;
159 
162  virtual bool haveSupplies() const;
163  virtual void setHaveSupplies( const bool doHave );
165 
169  virtual double nextSupplyCheckTime() const;
170  virtual void setNextSupplyCheckTime( const double time );
172 
173  virtual bool forward() const;
174  virtual void setForward( const bool forward );
175 
177  virtual bool amClampedToGround() const;
178  virtual void setAmClampedToGround( const bool clamp );
179 
181  virtual void reclampToGround();
182 
186  virtual bool usingRailMovement() const;
187  virtual void setUsingRailMovement(const bool rails);
188 
196  virtual void clampToGround( const DtVector& location, const DtReal heading,
197  bool* dataAvailable = 0, bool requireAllData = false );
198 
209  virtual void clampToGround( const DtVector& location, const DtReal heading,
210  bool gravityAligned, bool* dataAvailable = 0, bool requireAllData = false );
211 
216  virtual void updateSupportPoints( const DtVector& newPosition, const DtReal newHeading );
217 
227  virtual void place( const DtVector& location, bool* dataAvailable = 0,
228  bool requireAllData = false );
229 
239  virtual void place( const DtReal heading, bool* dataAvailable = 0,
240  bool requireAllData = false );
241 
254  virtual void place( const DtVector& location, const DtReal heading,
255  bool clampToGroundFlag = true, bool* dataAvailable = 0,
256  bool requireAllData = false );
257 
259  virtual void placeAtAltitude( const DtVector& location, const DtReal heading );
260 
262  bool hasHumanComponent() const;
263 
266  virtual void setDIGuyCharacterState( const DtRwDIGuyCharacterState& info );
267  virtual DtRwDIGuyCharacterState diGuyCharacterState() const;
268 
274  virtual void setDiguyCharacter( const DtString& animation );
275  virtual DtString diguyCharacter() const;
277 
280  virtual void setDiguyAnimation( const DtString& animation );
281  virtual DtString diguyAnimation() const;
283 
286  virtual void setDiguyUsingAnimationOffset( bool usingOffset );
287  virtual bool diguyUsingAnimationOffset() const;
289 
295  virtual void setDiguyAnimationOffset( const DtVector& offset );
296  virtual DtVector diguyAnimationOffset() const;
298 
303  virtual void setDiguyTransitionSpeed( float transitionSpeed );
304  virtual float diguyTransitionSpeed() const;
306 
309  virtual void setDiguyBodyWeight( double w );
310  virtual double diguyBodyWeight() const;
312 
315  virtual void setDiguyAppearance( const DtString& app );
316  virtual DtString diguyAppearance() const;
318 
320  virtual const DtRwNLengthStringVector& randomAppearancesList() const;
321 
324  virtual void setDiguyHandItem( const DtString& app );
325  virtual DtString diguyHandItem() const;
327 
330  virtual void setDiguyHead( const DtString& app );
331  virtual DtString diguyHead() const;
333 
336 
337  virtual void setDiguyPrimaryUnitPatch( const DtPatchIdentifier& patchId );
338  virtual DtPatchIdentifier diguyPrimaryUnitPatch() const;
339  virtual void setDiguySecondaryUnitPatch( const DtPatchIdentifier& patchId );
340  virtual DtPatchIdentifier diguySecondaryUnitPatch() const;
341  virtual void setDiguyRankPatch( const DtPatchIdentifier& patchId );
342  virtual DtPatchIdentifier diguyRankPatch() const;
343  virtual void setDiguyCharacterName( const DtString& name );
344  virtual DtString diguyCharacterName() const;
345 
347 
349  boost::signals2::signal<void ()> signal_currentPitchChanged;
350 
351 protected:
352 
353  virtual void createLegacyRWData() override;
354  virtual void setToLegacyRWData() override;
355  virtual void restoreFromLegacyRWData() override;
356  virtual void preGetSelf() override;
357  virtual void prePutSelf() override;
358 
360  virtual void determineDiGuyAppearance();
361 
363  virtual void determineVisualMarkingAppearance();
364 
365 protected:
366 
369 
373 
393 
396 
400 
403 
406 
409 
414 
415 public:
416 
419 
421  {
422  return rep->as<DtVrfMovingObjectStateRepository>();
423  }
424 
425  VRF4API_METHOD const DtMovingObjectParameters* vrfParameters() const { return movingObjectParameters(); };
426 
428 
429 };
static DtVrfObjectStateRepository * creator(const DtString &name, DtLocalObject *simObject, DtReaderWriterRegistry *parentRegistry)
DtRwReal myMaxAcceleration
Definition: vrfMovingObjectStateRepository.h:384
DtRwBoolean myUsingRailMovement
If true keeps the entity clamped to the route segment it is on, no steering just follows the segment...
Definition: vrfMovingObjectStateRepository.h:391
DtRwReal myTurningRadius
Definition: vrfMovingObjectStateRepository.h:381
DtGroundInteractionPt myOtherSupport
Definition: vrfMovingObjectStateRepository.h:372
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:31
DtRwBoolean myCanPivot
Definition: vrfMovingObjectStateRepository.h:388
DtRwNLengthStringVector is a named, readable/writable vector of strings of arbitrary length...
Definition: rwNLengthStringVector.h:28
DtRwReal myMaxSlope
Definition: vrfMovingObjectStateRepository.h:382
virtual void createLegacyRWData() override
Creates the legacy data used for any pre/put operation. Override this to create your legacy data atta...
boost::signals2::signal< void()> signal_currentPitchChanged
Signal sent when the current pitch has changed for this state rep.
Definition: vrfMovingObjectStateRepository.h:349
DtReal myInverseStoppingDeceleration
Derived quantity (1/myMaxStoppingDeceleration) - no need to make it read-write.
Definition: vrfMovingObjectStateRepository.h:399
DtRwReal myMaxReverseSpeed
Definition: vrfMovingObjectStateRepository.h:380
DtRwBoolean myForward
Definition: vrfMovingObjectStateRepository.h:383
DtRwBoolean myPitchSet
Records if the pitch has been set by the user to respect when clamping to ground or setting at altitu...
Definition: vrfMovingObjectStateRepository.h:405
DtRwInt myActionUrgency
Definition: vrfMovingObjectStateRepository.h:376
Definition: simObjectStateRepository.h:59
Definition: readerWriterRegistry.h:39
DtActionUrgencyLevel
Enumeration for various predefined urgency levels. The urgency levels in this enumeration roughly cor...
Definition: actionUrgencyLevel.h:25
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
DtRwReal myOrderedAltitude
Definition: vrfMovingObjectStateRepository.h:377
DtRwReal myMaxLateralAcceleration
Definition: vrfMovingObjectStateRepository.h:386
DtRwBoolean myKeepGroundClampingFlag
Records whether we should keep ground clamping b/c not all terrain was loaded.
Definition: vrfMovingObjectStateRepository.h:402
virtual DtString type() const override
returns DtSimObjectStateRepositoryType
DtString myDIGuyCharacter
Stores the character type string for remote entities.
Definition: vrfMovingObjectStateRepository.h:395
DtRwReal myManeuverAggressiveness
Definition: vrfMovingObjectStateRepository.h:375
DtGroundInteractionPt myLeftSupport
Definition: vrfMovingObjectStateRepository.h:370
DtRwBoolean myUseOrderedAltitudeForRoutes
Definition: vrfMovingObjectStateRepository.h:378
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
VRF4API_METHOD const DtMovingObjectParameters * vrfParameters() const
These are backwards compatible methods that can be used if you define ALLOW_VRF4API in your header fi...
Definition: vrfMovingObjectStateRepository.h:425
virtual void updateSupportPoints(const DtVector &newPosition, const DtReal newHeading)
reading in a scenario, want to make sure the support points get set up properly. Base class is empty...
Description: Readable, Writable int.
Definition: rwInt.h:25
DtRwReal myMaxSpeed
Definition: vrfMovingObjectStateRepository.h:379
The moving-object-param parameter type is used for objects that are capable of movement, such as individual entities and aggregates. DtMovingObjectParameters; holds all of the configurable parameters for the DtVrfMovingObjectStateRepository class. Parameters include support points, maximum speed, maximum reverse speed, turning radius, maximum slope, ordered speed, maximum acceleration, maximum deceleration, and fuel efficiency. Aggregates are moving objects and have this parameter type. All of the platform-specific parameter types derive from this one. .
Definition: movingObjectParameters.h:32
DtRwReal myNextSupplyCheckTime
Records the next time that supplies should be checked (in general, this isn&#39;t done every tick...
Definition: vrfMovingObjectStateRepository.h:413
virtual void restoreFromLegacyRWData() override
virtual void tick()
This method is called each simulation frame, and may include any processing that needs to be done on ...
DtRwBoolean myHaveSupplies
Records whether the entity has appropriate supplies to keep it moving.
Definition: vrfMovingObjectStateRepository.h:408
virtual const int vrfObjectStateRepositorySubType() const
Returns DtVrfObjectStateRepositorySubTypeBase.
virtual void prePutSelf() override
Hook function called immediately prior to putSelf().
virtual void place(const DtVector &location, bool *dataAvailable=nullptr, bool requireAllData=false)
Place entity at &#39;location&#39;, on the ground, keeping its current heading. Since no terrain intersection...
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
DtRwReal myFuelEfficiency
Definition: vrfMovingObjectStateRepository.h:387
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
Class Invariant: The DtGroundInteractionPt class must always have a valid DtAttachedTerrain or DtSimM...
Definition: groundInteractionPt.h:28
DtRwReal myOrderedSpeed
Definition: vrfMovingObjectStateRepository.h:374
DtRwReal myMaxStoppingDeceleration
Definition: vrfMovingObjectStateRepository.h:385
virtual void preGetSelf() override
Hook function called immediately prior to getSelf().
const T_SRType * as() const
Convenience function to cast to particular state rep type.
Definition: simObjectStateRepository.h:101
const DtVrfObjectStateRepository & operator=(const DtVrfObjectStateRepository &orig)
Assignment Operator.
virtual void initializeFromParameters()
The DtRwDIGuyCharacterState class is a readable/writable class that can store itself and read itself ...
Definition: rwDIGuyCharacterState.h:37
virtual void reclampToGround()
Will cause the object to be replaced at it&#39;s current position and clamped to the terrain.
voidpf uLong offset
Definition: ioapi.h:42
virtual void setToLegacyRWData() override
DtGroundInteractionPt myRightSupport
Definition: vrfMovingObjectStateRepository.h:371
static VRF4API_METHOD DtVrfMovingObjectStateRepository * isVrfMovingObjectStateRepository(DtSimObjectStateRepository *rep)
These are backwards compatible methods that can be used if you define ALLOW_VRF4API in your header fi...
Definition: vrfMovingObjectStateRepository.h:420
#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
DtRwBoolean myClampToGround
Definition: vrfMovingObjectStateRepository.h:389
DtRwReal myMaxPivotSpeed
Definition: vrfMovingObjectStateRepository.h:392
Contains the DtActionUrgencyLevel enumeration declaration.
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)