VR-Forces 4.2 Class Documentation
humanMovementActuator.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 
13 #include <vrfobjcore/actCmpnt.h>
16 #include <map>
17 
18 class DtInputPortGroup;
19 class DtAnalogInputPort;
22 class DtIntegerInputPort;
24 class DtAttachedTerrain;
25 class DtBooleanInputPort;
27 
36 {
37 private:
42 
43 public:
44 
45  typedef std::map<DtLifeformStaticPosture, DtLifeformState>
47 
48 public:
51  DtHumanMovementActuator(const DtString& name,
52  DtVrfObject* owner,
53  DtSimManager* simManager,
54  DtComponentDescriptor* desc = 0,
55  DtReaderWriterRegistry* parentRegistry = 0);
56 
58  virtual ~DtHumanMovementActuator();
59 
62  virtual bool init();
63 
66  virtual DtString type() const;
67 
68  virtual void tick();
69 
73  static DtSimComponent * creator(const DtString& name,
74  DtVrfObject* owner,
75  DtSimManager* simManager,
76  DtComponentDescriptor* desc = 0,
77  DtReaderWriterRegistry* parentRegistry = 0);
78 
79 protected:
82  virtual double calculateMaxSpeed() const;
83 
84  virtual double maxSpeedSoilFactor() const;
85 
86  virtual DtVector calculateProjectedLocation(
87  const DtVector& oldLocalPosition, const DtVector& newBodyVelocity,
88  double newHeading);
89 
90  virtual void calculateOrientationAndPosition(
91  const DtVector& newLocalProjectedLocation, double newHeading, double newFacingOrientation,
92  DtDcm& newLocalOrientation, DtDcm& newLocalDirectionOfMovement, DtVector& newLocalPosition);
93 
94  virtual void calculateOrientationAndPositionCrawling(
95  const DtVector& newLocalProjectedLocation, double newHeading, double newFacingOrientation,
96  DtDcm& newLocalOrientation, DtDcm& newLocalDirectionOfMovement, DtVector& newLocalPosition);
97 
98  /*virtual void calculateOrientationAndPositionCrawling(
99  const DtVector& newLocalProjectedLocation, double newHeading,
100  DtDcm& newLocalOrientation, DtVector& newLocalPosition);*/
101 
102  virtual void groundClamp(double heading,
103  const DtVector& location, DtAttachedTerrain& terrainDatabase, DtVector& newNormal);
104 
105  virtual void calculateDirectionOfLinearMotion(
106  const DtDcm& newLocalOrientation, double desiredDirectionOfMovement, const DtVector& newLocalPosition,
107  DtDcm& newLocalDirectionOfLinearMotion);
108 
109  virtual void updateRepository(const DtVector & position,
110  const DtVector & velocity, const DtVector & acceleration,
111  const DtTaitBryan & localOrientation, const DtVector& rotationalVelocity,
112  double newHeading);
113 
117  virtual void computeAndSetPosture();
118 
121  virtual DtLifeformState computeDynamicPosture(DtLifeformStaticPosture staticPosture);
122 
127  virtual DtLifeformStaticPosture restrictPostureForTerrain(DtLifeformStaticPosture desiredPosture);
128 
137  virtual bool checkForTerrainCollisions() const;
138 
143  virtual bool checkBlockedByTerrain(const DtVector& oldLocalPosition,
144  DtVector& newLocalProjectedLocation);
145 
151  virtual double maxUprightTerrainPitch() const;
152 
157  virtual double maxWalkingSpeed() const;
158 
160  virtual void initializeStaticToDynamicPostureMap();
161 
163  virtual bool computeEntityDirOfMovement(double& heading) const;
164 
167  virtual double calculateTerrainPitch(const DtVector& localPosition,
168  double heading,
169  const DtAttachedTerrain& terrain) const;
170 
171 protected:
173  virtual bool createPorts();
174 
176  virtual bool createPortGroups();
177 
178 protected:
181 
189 
199 
206 
211 
220 
226 
230  mutable double myMutablePitch;
231  mutable bool myMutablePitchValid;
232 
234 
236 
238 
240 
244 };
245 
251 bool closestIntersectionWithBias(const DtVector& localPosition, DtChordIntersectionRecord& record,
252  DtIntersectionRecord::DtIntersectionType irtFlag, double bias,
253  const DtAttachedTerrain* terrain);
254 
255 
256 

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)