VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
translatablePartActuator.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
19 
20 class DtString;
22 class DtSimObjectBaseObjectStateRepository;
24 
25 namespace makVrf
26 {
27  class DtArticulatedPartStateRepository;
28 }
29 
39  public DtBindableLuaComponent<DtTranslatablePartActuator>
40 {
41 public:
42 
44 
48  DtLocalObject* owner,
49  DtSimulationServices* simManager,
50  DtComponentDescriptor* desc = 0,
51  DtReaderWriterRegistry* parentRegistry = 0);
52 
54  virtual ~DtTranslatablePartActuator() override;
55 
56  virtual bool init() override;
57 
59  virtual bool postAddComponentsInit() override;
60 
63  virtual const char* type() const override;
64 
66  virtual void tick() override;
67 
71  static DtSimComponent * creator(const DtString& name,
72  DtLocalObject* owner,
73  DtSimulationServices* simManager,
74  DtComponentDescriptor* desc = 0,
75  DtReaderWriterRegistry* parentRegistry = 0);
76 
77 public:
81  virtual void lower();
82 
84  virtual void raise();
85 
87  virtual void left();
88 
90  virtual void right();
91 
93  virtual void forward();
94 
96  virtual void backward();
97 
99  virtual void stop();
100 
102  virtual void pause();
103 
105  virtual void resume();
106 
108  virtual bool isFullyTranslatedToMaximum() const;
109 
111  virtual bool isFullyTranslatedToMinimum() const;
112 
120  virtual int state() const;
121 
123  virtual bool paused() const;
125 
128  virtual void bindLuaFunctions(lua_State* L) override;
129  virtual void bindLuaGlobals(lua_State* L) override;
130 
131 protected:
137  virtual DtTranslatablePartActuatorPSR* createPSR();
138 
140  virtual double currentPosition();
141 
143  virtual void setPositionAndRate(double newPos, double newRate);
144 
147  virtual void updatePartState();
148 
150  virtual void initializePartState();
151 
153  virtual TranslationDirection translationDirection() const;
154 
156  virtual double rangeChangeRate() const;
157 
159  virtual double minRange() const;
160 
162  virtual double maxRange() const;
163 
164  static const DtString& translationDirectionString(TranslationDirection dir);
165 
166 private:
174 
175 protected:
176 
180 
183 
185 
188 
191 };
DtTranslatablePartActuator is a simple actuator which controls the movement of an articulated part as...
Definition: translatablePartActuator.h:38
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual bool postAddComponentsInit()
Called after all components have been created, initialized and added to the component manager...
Definition: simComponent.h:126
bool myHasDuplicatePSR
Definition: translatablePartActuator.h:187
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
const DtTranslatablePartActuatorDescriptor * myDescriptor
Definition: translatablePartActuator.h:184
virtual void bindLuaFunctions(lua_State *)=0
Override to bind lua functions.
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
Definition: bindableLuaComponent.h:53
End User Description: DtActuator is the base class for all actuator model components. Developer Description: The DtActuator base class caches a pointer to the entity&#39;s radio for convenience. Derived classes may have articulated parts that are configured from the DtActuatorComponentDescriptor&#39;s DtSimArtPartDescriptorList. For each articulated part in the list a DtArticulatedPartStateRepository will be created to store the data for the part such as it&#39;s location, rotation and so forth. These are created in the entity&#39;s DtVrfObjectStateRepository createParts() function. This call creates all the attached parts for all the actuators. These articulated state repositories are managed by the DtAttachmentManager. They are cached by their partType which is the DIS Enumeration describing the part from the disEnums.h file and was specified in the actuator&#39;s DtActuatorComponentDescriptor as descriped above. The partType is used as the category of the DtEntityType used to look up articulated parts in the DtAttachementManager. When an actuator needs access to a particular articulated part it looks it up by the part&#39;s object type.
Definition: actuatorComponent.h:47
DtSwingingPartActuatorDescriptor is the descriptor for DtSwingingPartActuator components. It contains all parameters which can be specified in the OPD file for this component. For an example of using a swinging part actuator and how it is described in an OPD file see fixed-wing-fighter-jet.sysdef in the systems/movement folder.
Definition: translatablePartActuatorDescriptor.h:21
makVrf::DtArticulatedPartStateRepository * myArtPartStateRep
Definition: translatablePartActuator.h:182
virtual bool init() override
Overridden to cache a pointer to the entity&#39;s radio in this class.
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtTranslatablePartActuatorPSR * myProcessState
Definition: translatablePartActuator.h:186
TranslationDirection
Definition: translatablePartActuatorDescriptor.h:25
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
The DtArticulatedPartStateRepository class is used to represent articulated parts for an entity...
Definition: articulatedPartStateRepository.h:40
DtTranslatablePartActuatorDescriptor::TranslationDirection TranslationDirection
Definition: translatablePartActuator.h:43
virtual void bindLuaGlobals(lua_State *)=0
Override to bind lua globals.
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: translatablePartActuator.h:190
Definition: translatablePartActuatorPSR.h:21
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
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)