![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2009 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtEntityKinStateVisualizer.h,v $ $Revision: 1.43 $ $SceneObject: Exp $ 00007 ******************************************************************************/ 00008 00013 00014 #pragma once 00015 #include <vrvCore/DtSceneObjectVisualizer.h> 00016 #include <vrvCore/DtDeadReckonGroundClampUpdater.h> 00017 00018 class DtVector; 00019 class DtTaitBryan; 00020 00021 namespace makVrv 00022 { 00023 class DtEntityStateListener; 00024 00025 class DtDeadReckonGroundClampUpdaterAgent; 00026 class DtAttachableDeadReckonUpdaterAgent; 00027 00031 class DT_DLL_VRVCORE DtEntityKinStateVisualizer : 00032 public DtSceneObjectVisualizer 00033 { 00034 public: 00036 DtEntityKinStateVisualizer(DtBaseConnection& simulation, 00037 DtStateListener& listener, int modelSet); 00038 00040 virtual ~DtEntityKinStateVisualizer(); 00041 00043 virtual void setLocation(const DtVector&); 00044 00046 virtual void setOrientation(const DtTaitBryan&); 00047 00049 virtual void setVelocity(const DtVector&); 00050 00052 virtual void setAngularVelocity(const DtVector&); 00053 00055 virtual void setAcceleration(const DtVector&); 00056 00057 virtual void setDeadReckoning(bool position, bool velocity, 00058 bool orientation); 00059 00061 virtual void setEmbarked(const DtUniqueID& id); 00062 00064 virtual void setVisualizerDefinition(const DtVisualizerDefinition& visDef); 00065 00067 void setSmoothingEnabled(bool enabled); 00068 00070 void setSmoothingPeriod(float scale); 00071 00073 00075 virtual void setGroundClampingCullingEnabled(bool enabled); 00076 00078 virtual void setGroundClampingScale(float scale); 00079 00081 virtual void setGroundClamping(bool enabled); 00082 00085 virtual void setGroundClampingMode( 00086 DtGroundClampingUpdater::GroundClampingMode mode); 00087 00089 virtual void setPossibleGroundClampingModes( 00090 DtGroundClampingUpdater::GroundClampingMode possibleModes); 00091 00093 virtual DtGroundClampingUpdater::GroundClampingMode groundClampingMode(); 00094 00095 void setAutoEnableGroundClamping(bool b) 00096 { 00097 myAutoEnableGroundClamping = b; 00098 } 00099 00100 bool autoEnableGroundClamping() const 00101 { 00102 return myAutoEnableGroundClamping; 00103 } 00104 00105 virtual void resetSpatialAttributes(); 00106 00107 DtEntityStateListener& entityStateListener() 00108 { 00109 return *myEntityListener; 00110 } 00111 00113 virtual const DtStateVisualizer::TypeInfo& typeInfo() const; 00114 00116 static const DtStateVisualizer::TypeInfo& theTypeInfo(); 00117 00118 protected: 00119 00120 virtual void createModelAgents(); 00121 virtual void destroyModelAgents(); 00122 virtual void setModelDefinitionForAgents(); 00123 virtual void embarkedStateChanged(); 00124 00125 void createEmbarkedUpdater(); 00126 void createUpdater(); 00127 00128 virtual void initializeObjectAgent(); 00129 00130 protected: 00131 00132 DtDeadReckonGroundClampUpdaterAgent* myDeadReckonGroundClampUpdaterAgent; 00133 DtAttachableDeadReckonUpdaterAgent* myEmbarkedUpdaterAgent; 00134 00135 bool myEmbarkedFlag; 00136 DtUniqueID myEmbarkedParentID; 00137 00139 bool myGroundClampingEnabled; 00140 float myGroundClampingScale; 00141 bool myAutoEnableGroundClamping; 00142 bool myGroundClampingCullingEnabled; 00143 00144 bool mySmoothingEnabled; 00145 float mySmoothingPeriod; 00146 00147 std::string myMotionModel; 00148 00149 DtGroundClampingUpdater::GroundClampingMode myGroundClampingMode; 00150 DtGroundClampingUpdater::GroundClampingMode myPossibleGroundClampingModes; 00151 bool myDRPos; 00152 bool myDRVel; 00153 bool myDROri; 00154 00156 DtEntityStateListener* myEntityListener; 00157 }; 00158 00159 00160 typedef DtStateVisualizerCreatorTemplate<DtEntityKinStateVisualizer> 00161 DtEntityKinStateVisualizerCreator; 00162 }