![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtDiGuyMotionModel.h,v $ $Revision: 1.18 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 #include <vrvDiGuy/vrvDiGuy.h> 00015 #include <vrvCore/DtMotionModel.h> 00016 #include <vrvCore/DtFixedSmoother.h> 00017 00018 class DtTaitBryan; 00019 class DtVector; 00020 00021 namespace makVrv 00022 { 00023 class DtModel; 00024 class DtDiGuyCharacterModel; 00025 class DtDe; 00026 00029 class DT_DLL_VRVDIGUY DtDiGuyMotionModel : public DtVRLDeadReckonerMotionModel<DtFixedSmoother> 00030 { 00031 public: 00032 00034 DtDiGuyMotionModel(DtDe& igs,DtSceneObject* owner); 00035 00037 DtDiGuyMotionModel(const DtDiGuyMotionModel& orig, double time); 00038 00040 virtual ~DtDiGuyMotionModel(); 00041 00043 virtual DtMotionModel* clone(double simTime); 00044 00047 virtual bool motionModelHandlesUpdate() const; 00048 00049 virtual void updateMotion(double simulationTime); 00050 00052 virtual void modelAdded(DtModel*); 00053 00055 virtual void modelRemoved(DtModel*); 00056 00057 protected: 00058 00059 //Calculate the direction Forward/Back/Left/Right 00060 int calculateDirectionFBLR( const DtTaitBryan& ori, const DtVector& vel); 00061 00062 //Calculate the direction Forward/Back 00063 int calculateDirectionFB( const DtTaitBryan& ori, const DtVector& vel); 00064 00065 void setCharacter(DtDiGuyCharacterModel* character); 00066 00067 protected: 00068 DtDe& myDe; 00069 00070 mutable DtVector myPositionReturn; 00071 mutable DtTaitBryan myOrientationReturn; 00072 00073 DtVector myAcceleration; 00074 00075 DtDiGuyCharacterModel* myCharacter; 00076 DtSceneObject* myObjectToMove; 00077 int myLastDirection; 00078 int myLastPosture; 00079 double myLastSpeed; 00080 const char* myLastAction; 00081 double myLastActionTime; 00082 bool myLastWeaponDeployed; 00083 00084 }; 00085 00088 class DT_DLL_VRVDIGUY DtDiGuyMotionModelCreator : public DtMotionModelCreator 00089 { 00090 public: 00092 virtual ~DtDiGuyMotionModelCreator(); 00093 00095 virtual DtMotionModel* create(DtSceneObject* owner,DtDe& de); 00096 }; 00097 }