00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifndef VRS_SG_FLYERPHYSICALNAVIGATION_H
00053 #define VRS_SG_FLYERPHYSICALNAVIGATION_H
00054
00055 #include <vrs/sg/physicalnavigation.h>
00056
00057
00058 namespace VRS {
00059
00083 class VRS_CORE_API FlyerPhysicalNavigation : public PhysicalNavigation {
00084
00085 public:
00086 FlyerPhysicalNavigation(
00087 LookAt* lookAt = NULL,
00088 InputEvent::Button button = InputEvent::MouseButton1,
00089 InputEvent::Modifier must_modifier = InputEvent::NoModifier,
00090 InputEvent::Modifier must_not_modifier = InputEvent::NoModifier,
00091 double meterDefinition = 1.0,
00092 double minHeight = 0.0,
00093 double speed = 1.0,
00094 FilterTag* filterTag = NULL,
00095 Vector gravitationDir = Vector(0.0, -1.0, 0.0),
00096 PhysicalForce::ForceMode forceMode = PhysicalForce::Spring
00097 );
00128 double getMinHeight() const;
00130 void setMinHeight(double minHeight);
00132
00133 double getLeftrightSensitivity() const;
00135 void setLeftrightSensitivity(double);
00137
00138 double getUpdownSensitivity() const;
00140 void setUpdownSensitivity(double);
00142
00143 double getSpeed() const;
00145 void setSpeed(double);
00147
00148
00149
00150 VRS_TYPEINFO(FlyerPhysicalNavigation, PhysicalNavigation);
00151 VRS_SERIALIZABLE(FlyerPhysicalNavigation);
00152
00153
00154 protected:
00155 double minHeight_;
00158 double speed_;
00163 virtual void translateInteractionIntoTargetPos(
00164 Vector& target, Vector& dir,
00165 float x, float y,
00166 double time_now, double time_lastCalc
00167 );
00172 virtual BehaviorNode::InvalidationHint processKeyEvent(KeyEvent*);
00176 virtual bool validateTargetPosition(
00177 Vector& target,
00178 const Vector& oldTarget,
00179 const Vector& dir
00180 );
00188 virtual void updateLookAt(Vector pos, Vector dir);
00196 private:
00197 double speedSensitivity_;
00200 double leftrightSensitivity_;
00203 double updownSensitivity_;
00206 };
00207
00208 inline double FlyerPhysicalNavigation::getMinHeight() const {return minHeight_;}
00209
00210 inline double FlyerPhysicalNavigation::getLeftrightSensitivity() const {return leftrightSensitivity_;}
00211 inline void FlyerPhysicalNavigation::setLeftrightSensitivity(double leftrightSensitivity) \
00212 {leftrightSensitivity_=leftrightSensitivity;}
00213
00214 inline double FlyerPhysicalNavigation::getUpdownSensitivity() const {return updownSensitivity_;}
00215 inline void FlyerPhysicalNavigation::setUpdownSensitivity(double updownSensitivity) \
00216 {updownSensitivity_=updownSensitivity;}
00217
00218 inline double FlyerPhysicalNavigation::getSpeed() const {return speed_;}
00219
00220 }
00221
00222 #endif // VRS_SG_FLYERPHYSICALNAVIGATION_H