13 // A landing gear has the following parameters:
15 // position: a point in the aircraft's local coordinate system where the
16 // fully-extended wheel will be found.
17 // compression: a vector from position where a fully-compressed wheel
18 // will be, also in aircraft-local coordinates.
19 // spring coefficient: force coefficient along the compression axis, in
21 // damping coefficient: force per compression speed, in Ns/m
22 // static coefficient of friction: force along the ground plane exerted
23 // by a motionless wheel. A unitless scalar.
24 // dynamic coefficient of friction: force along the ground plane exerted
25 // by a sliding/skidding wheel.
26 // braking fraction: fraction of the dynamic friction that will be
27 // actually exerted by a rolling wheel
28 // rotation: the angle from "forward" by which the wheel is rotated
29 // around its compression axis. In radians.
35 // Externally set values
36 void setPosition(float* position);
37 void setCompression(float* compression);
38 void setSpring(float spring);
39 void setDamping(float damping);
40 void setStaticFriction(float sfric);
41 void setDynamicFriction(float dfric);
42 void setBrake(float brake);
43 void setRotation(float rotation);
44 void setExtension(float extension);
45 void setCastering(bool castering);
46 void setOnWater(bool c);
47 void setOnSolid(bool c);
48 void setSpringFactorNotPlaning(float f);
49 void setSpeedPlaning(float s);
50 void setReduceFrictionByExtension(float s);
51 void setInitialLoad(float l);
52 void setIgnoreWhileSolving(bool c);
53 void setGlobalGround(double* global_ground, float* global_vel,
54 double globalX, double globalY,
55 const simgear::BVHMaterial *material);
56 void getPosition(float* out);
57 void getCompression(float* out);
58 void getGlobalGround(double* global_ground);
61 float getStaticFriction();
62 float getDynamicFriction();
66 float getInitialLoad() {return _initialLoad; }
68 float getCasterAngle() { return _casterAngle; }
69 float getRollSpeed() { return _rollSpeed; }
70 float getBumpAltitude();
71 bool getGroundIsSolid();
72 float getGroundFrictionFactor() { return (float)_ground_frictionFactor; }
74 // Takes a velocity of the aircraft relative to ground, a rotation
75 // vector, and a ground plane (all specified in local coordinates)
76 // and make a force and point of application (i.e. ground contact)
77 // available via getForce().
78 void calcForce(RigidBody* body, State* s, float* v, float* rot);
80 // Computed values: total force, weight-on-wheels (force normal to
81 // ground) and compression fraction.
82 void getForce(float* force, float* contact);
84 float getCompressFraction();
85 float getCompressDist() { return _compressDist; }
86 bool getSubmergable() {return (!_ground_isSolid)&&(!_isContactPoint); }
87 bool getIgnoreWhileSolving() {return _ignoreWhileSolving; }
88 void setContactPoint(bool c);
91 float calcFriction(float wgt, float v);
92 float calcFrictionFluid(float wgt, float v);
110 double _global_ground[4];
111 float _global_vel[3];
114 bool _isContactPoint;
117 float _spring_factor_not_planing;
118 float _speed_planing;
119 float _reduceFrictionByExtension;
120 bool _ignoreWhileSolving;
122 double _ground_frictionFactor;
123 double _ground_rollingFriction;
124 double _ground_loadCapacity;
125 double _ground_loadResistance;
126 double _ground_bumpiness;
127 bool _ground_isSolid;
132 }; // namespace yasim