VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtDiGuyMotionModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvDiGuy/vrvDiGuy.h>
13 #include <vrvCore/DtMotionModel.h>
14 #include <vlpi/exponentialSmoother.h>
15 #include <diguyMotionDirection.h>
16 #include <diguyMotionPosture.h>
17 #include <matrix/vlVector.h>
18 
19 class DtTaitBryan;
20 class diguyCharacterGuide;
21 
22 namespace makVrv
23 {
24  class DtModel;
25  class DtDiGuyCharacterModel;
26  class DtDe;
27 
30  class DT_DLL_VRVDIGUY DtDiGuyMotionModel : public DtVRLDeadReckonerMotionModel<DtExponentialSmoother>
31  {
32  public:
33 
36 
38  DtDiGuyMotionModel(const DtDiGuyMotionModel& orig, double time);
39 
41  virtual ~DtDiGuyMotionModel();
42 
44  virtual DtMotionModel* clone(double simTime);
45 
48  virtual bool motionModelHandlesUpdate() const;
49 
51  virtual void updateMotion(double simulationTime);
52 
54  virtual const char* getActionFromDescription(diguyMotionDirection direction, diguyMotionPosture posture, double actualSpeed);
55 
57  virtual void modelAdded(DtModel*);
58 
60  virtual void modelRemoved(DtModel*);
61 
62  virtual void setLocation(const DtVector & loc, DtTime t);
63 
64  //#ifdef USE_DIGUY_GUIDES
65  virtual const DtVector& approxLocation(DtTime curTime) const;
66  //#endif
67 
68  virtual void setOrientation(const DtTaitBryan& ori, DtTime curTime);
69  virtual void setVelocity(const DtVector32& vel, DtTime curTime);
70  virtual void setRotationalVelocity(const DtVector32& vel, DtTime curTime);
71 
72  protected:
73 
74  //Calculate the direction Forward/Back/Left/Right
75  int calculateDirectionFBLR( const DtTaitBryan& ori, const DtVector32& vel);
76 
77  //Calculate the direction Forward/Back
78  int calculateDirectionFB( const DtTaitBryan& ori, const DtVector32& vel);
79 
81  void setCharacter(DtDiGuyCharacterModel* character);
82 
83 
84  protected:
86 
88  mutable DtTaitBryan myOrientationReturn;
91 
97  double myLastSpeed;
98  const char* myLastAction;
102 
103  // These are the last values known to have come across the network,
104  // before any smoothing is applied.
107  DtVector32 myLastFirmVelocity;
110  };
111 
115  {
116  public:
118  virtual ~DtDiGuyMotionModelCreator();
119 
121  virtual DtMotionModel* create(DtSceneObject* owner,DtDe& de);
122  };
123 }

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)