VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
surfaceEntitySimpleActuator.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 #pragma once
11 
14 
15 class DtString;
16 class DtSimManager;
20 class DtAnalogInputPort;
21 class DtBooleanInputPort;
24 
25 
42 {
43 
44 public:
45 
50  DtVrfObject* owner,
51  DtSimManager* simManager,
52  DtComponentDescriptor* desc = 0,
53  DtReaderWriterRegistry* parentRegistry = 0);
54 
60 
63  virtual bool init();
64 
67  virtual const char* type() const;
68 
70  virtual bool postAddComponentsInit();
71 
74  virtual void initProcessSR();
75 
90  virtual void tick();
91 
100  virtual void decrementFuelResource(double fuelUsed);
101 #if 0
102 
109  virtual double fuelLeft() const;
110 #endif
111  static DtSimComponent * creator(const DtString& name,
115  DtVrfObject* owner,
116  DtSimManager* simManager,
117  DtComponentDescriptor* desc = 0,
118  DtReaderWriterRegistry* parentRegistry = 0);
119 
120 protected:
121 
124  virtual bool createPortGroups();
125 
129  virtual bool createPorts();
130 
131  virtual void updateHeading(const double dT, double& newHeading);
132 
146  virtual void updateVelocity(const double dT, const double newHeading,
147  const double newVerticalSpeed,
148  double& acceleratingDT, double& newSpeed,
149  DtVector& newVelocity, bool& maxSpeedAchieved);
150 
155  virtual double updateVerticalSpeed(const double dT);
156 
175  virtual void updateOrientationAndPosition(const double dT,
176  const double acceleratingDT, const double newHeading,
177  DtVector& newVelocity, const double newSpeed,
178  DtDcm& newBodyToLocalMatrix, DtVector& newPosition);
179 
186  virtual void adjustAttitude(const double newSpeed, const DtVector& position,
187  const double yawRate,
188  double &roll, double &pitch, double &altitudeAdj);
189 
197  virtual void setAltitude(DtVector& localPosition, const Coordinate_System* cs,
198  const double altitudeAdjustment);
199 
207  virtual bool getTerrainSurfaces(const DtVector& databaseLocation,
208  double& groundHeight, DtSurface& groundSurface, DtVector& groundNormal,
209  double& waterHeight, DtSurface::DtMedium & topSurfaceMedium,
210  bool* dataAvailable = 0, bool overrideBlockingAssert = false);
211 
219  virtual bool isShipAground(const DtVector& localPosition,
220  const DtDcm& bodyToLocalMatrix,
222 
225  virtual void sinkingAttitude(const DtVector& newPosition,
226  DtDcm& newBodyToLocalMatrix);
227 
232  virtual void setOrientationToBottom(const DtVector& newPosition,
233  const double newHeading, const DtVector& groundNormal,
234  DtDcm& newBodyToLocalMatrix);
235 
246  virtual void computeNewRates(
247  const double turnRate, const double newSpeed, const double newHeading,
248  const double acceleration, const DtDcm& bodyToLocalMatrix,
249  DtVector& bodyRotationRates, DtVector& relativeAcceleration,
250  double & limitedAcceleration);
251 
256  virtual void sinkingRates(DtVector& newPosition,
257  DtVector& newVelocity, DtVector& newRelativeAcceleration,
258  DtVector& newBodyRotationRates);
259 
265  virtual void unpoweredDriftRates(const double newSpeed,
266  const double newHeading,
267  DtVector& newBodyRotationRates, DtVector& newRelativeAcceleration);
271  double driftDecelerationMagnitude() const;
272 
278  virtual void updateRepository(
279  const DtVector& newPosition,
280  const DtVector& newVelocity,
281  const DtVector& newAcceleration,
282  const DtTaitBryan& newOrientation,
283  const DtVector& newBodyRotationRates);
284 
287  virtual double computeFuelUsed(const double dT);
288 
289  DtSurfaceEntityStateRepository * surfaceEntityState (void) const;
290 
296  virtual bool createPSR();
297 
298 protected:
299 
302 
305  (const DtSurfaceEntitySimpleActuator & orig);
306 
308  const DtSurfaceEntitySimpleActuator & operator=
309  (const DtSurfaceEntitySimpleActuator & orig);
310 
311 
312 protected:
317 
320 
324 
343 
345 
349 
353 
356 
360 
368 
372 
379 };
381 
double mySinkingPitchRate
Parameters that define how this ship will sink.
Definition: surfaceEntitySimpleActuator.h:376
#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:144
Definition: surfaceEntityParameters.h:24
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtInputPortGroup * mySurfaceControlPortGroup
Input Port Group Name: surface-control Input Port Group Description:
Definition: surfaceEntitySimpleActuator.h:323
double myWaterHeight
Definition: surfaceEntitySimpleActuator.h:365
Definition: surfaceMovementPSR.h:58
virtual bool init()
Overridden to cache a pointer to the entity's radio in this class.
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
Definition: readerWriterRegistry.h:39
const DtSurfaceEntityParameters * myParameters
Definition: surfaceEntitySimpleActuator.h:315
Definition: surface.h:179
End User Description: DtActuator is the base class for all actuator model components.
Definition: actuatorComponent.h:48
DtAnalogInputPort * myClampSpeedPort
Clamp speed is the speed that the controller is trying to accelerate (or decelerate) to; if dT is une...
Definition: surfaceEntitySimpleActuator.h:335
DtSurfaceMovementPSR * myProcessState
Container for state data associated with this component.
Definition: surfaceEntitySimpleActuator.h:352
DtAnalogInputPort * myTurnRatePort
Turn rate in radians/sec, with positive meaning a turn to the right.
Definition: surfaceEntitySimpleActuator.h:340
Definition: coordSystem.h:54
virtual void tick()
This gives the thread of control to the component.
This repository holds all information that is common to all the forms of local surface entities withi...
Definition: surfaceEntityStateRepository.h:29
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
double mySinkingRollRate
Definition: surfaceEntitySimpleActuator.h:377
DtAnalogInputPort * myAccelerationPort
Acceleration can be positive or negative.
Definition: surfaceEntitySimpleActuator.h:330
virtual bool createPorts()
Called by init.
Contains class declaration for DtSurfaceEntityActuatorDescriptor, descriptor for the DtSurfaceEntityA...
Definition: surfaceEntityActuatorDescriptor.h:26
Definition: surface.h:190
DtUpdateRepositoryOutputPortGroup * myUpdateRepositoryOutputPortGroup
Port group used to set what values should be set into the VRF state repository.
Definition: surfaceEntitySimpleActuator.h:348
virtual bool createPortGroups()
Called by init.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
bool myAgroundAndDestroyed
Remembered after this state is first entered, to avoid recomputation in future ticks.
Definition: surfaceEntitySimpleActuator.h:371
DtSurfaceEntityStateRepository * mySurfaceEntityState
Cache some pointers.
Definition: surfaceEntitySimpleActuator.h:314
double mySinkingStartRate
Definition: surfaceEntitySimpleActuator.h:378
DtInputPortGroup is a data port group of a data consumer.
Definition: inputPortGroup.h:32
Contains class declarations for DtAnalogInputPort, DtAnalogOutputPort, and DtAnalogPortData.
Definition: analogIOPort.h:25
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
DtAnalogInputPort * myFinalHeadingPort
Final heading that the entity is clamped to, if dT is too large.
Definition: surfaceEntitySimpleActuator.h:342
double myMaxRollRate
Remember a reasonable value for maximum roll rate for this entity, based on mass. ...
Definition: surfaceEntitySimpleActuator.h:359
DtSurfaceEntityActuatorDescriptor * myDescriptor
Definition: surfaceEntitySimpleActuator.h:316
DtMedium
Definition: surface.h:185
bool myOutOfFuelWarningPrinted
Remembers if the warning has been printed, so it's only printed once.
Definition: surfaceEntitySimpleActuator.h:355
DtUpdateRepositoryOutputPortGroup is a data port group of a data consumer that contains methods and p...
Definition: updateRepositoryOutputPortGroup.h:28
Provides a simple, kinematics-based model for surface vessels.
Definition: surfaceEntitySimpleActuator.h:41
virtual const char * type() const =0
Returns a string identifies the class type of component.
bool myIsAground
Definition: surfaceEntitySimpleActuator.h:366
double mySeaFloorHeight
Computed at the beginning of every tick; remembered for use in the tick:
Definition: surfaceEntitySimpleActuator.h:364

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)