VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
surfaceEntityMoveToController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2007 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 #pragma once
12 
15 #include <vrfutil/scriptGeometry.h>
16 
17 class DtString;
19 
31 {
32 public:
33 
37  DtLocalObject* owner,
38  DtSimulationServices* simManager,
39  DtComponentDescriptor* desc = 0,
40  DtReaderWriterRegistry* parentRegistry = 0);
41 
43  virtual ~DtSurfaceEntityMoveToController() override;
44 
47  virtual const char* type() const override;
48 
49  virtual void clearTask() override;
50 
54  virtual void registerTaskMsgCallbacks() override;
55 
64  static void moveToCallback (DtSimMessage* msg, void* user);
65 
73  virtual void processMoveToTask (DtSimMessage* msg);
74 
78  static DtSimComponent* creator(const DtString& name,
79  DtLocalObject* owner,
80  DtSimulationServices* simManager,
81  DtComponentDescriptor* desc = 0,
82  DtReaderWriterRegistry* parentRegistry = 0);
83 
84  virtual void tick() override;
85 
86 private:
89 
92 
96 
97 protected:
100  virtual void initializeLocals(const DtVector& globalTarget);
101 
105  virtual double getAtDistance() const;
106 
111  virtual bool setupControlPoint();
112 
116  virtual bool passedGoal();
117 
119  virtual bool atGoal();
120 
127  virtual void controlMovement();
128 
130  virtual void processEstimatedTotCalculation();
131 
133  virtual void updateTaskVisualizations() override;
134 
135 protected:
138 
141  DtBoolean myPassedGoal = false;
142  DtBoolean myAtGoal = false;
145 
152 
155  double myAtDistance = 0.;
156 
158  const double DtEstimatedTotCalcInterval = 5.0;
159 
161  bool myEstimatedTotCalcEnabled = true;
163  double myEstimatedTotValue = 0.0;
165  double myEstimatedTotLastCalcTime = 0.0;
168 };
DtLocation3D myAimingPoint
Note: in general, this is not the negation of the goal-to-entit...
Definition: surfaceEntityMoveToController.h:151
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtSurfaceEntityMoveToController is a controller that models the movement of a surface entity to a spe...
Definition: surfaceEntityMoveToController.h:29
DtVector myControlPointLastLocation
Stores last known location of the waypoint.
Definition: surfaceEntityMoveToController.h:137
virtual void registerTaskMsgCallbacks()
DtVector2D myCurrentEntityToGoal2DVector
Definition: surfaceEntityMoveToController.h:144
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
virtual void clearTask() override
Calls down to the base class and then calls allowDeactivation() on mySurfaceControlPortGroup.
Definition: readerWriterRegistry.h:39
DtVector myEstimatedTotTextPos
tot text position
Definition: surfaceEntityMoveToController.h:167
const DtSurfaceEntityPilotController & operator=(const DtSurfaceEntityPilotController &orig)
assignment operator; not implemented
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:443
DtVector2D myCurrentGoalToEntity2DVector
Definition: surfaceEntityMoveToController.h:143
virtual const char * type() const override
Returns a string identifies the class type of component. Type values are defined in compTypes...
File: simMsg.h.
Definition: simMessage.h:35
DtLocation3D myEntityPoint
These data are computed each tick and used later in the same tick.
Definition: surfaceEntityMoveToController.h:140
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
DtVector2D is a vector in earth-relative coordinates, e.g. east-north. Its direction in space depends...
Definition: scriptGeometry.h:289
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 DtSurfaceEntityPilotController provides basic movement capabilities for surface entities and crea...
Definition: surfaceEntityPilotController.h:78
virtual void tick() override
Overridden to check for valid myProcessState pointer. If it is null a warning is printed to the objec...
A locally simulated VRF object.
Definition: localObject.h:98
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

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)