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