9 // A landing gear has the following parameters:
11 // position: a point in the aircraft's local coordinate system where the
12 // fully-extended wheel will be found.
13 // compression: a vector from position where a fully-compressed wheel
14 // will be, also in aircraft-local coordinates.
15 // spring coefficient: force coefficient along the compression axis, in
17 // damping coefficient: force per compression speed, in Ns/m
18 // static coefficient of friction: force along the ground plane exerted
19 // by a motionless wheel. A unitless scalar.
20 // dynamic coefficient of friction: force along the ground plane exerted
21 // by a sliding/skidding wheel.
22 // braking fraction: fraction of the dynamic friction that will be
23 // actually exerted by a rolling wheel
24 // rotation: the angle from "forward" by which the wheel is rotated
25 // around its compression axis. In radians.
31 // Externally set values
32 void setPosition(float* position);
33 void setCompression(float* compression);
34 void setSpring(float spring);
35 void setDamping(float damping);
36 void setStaticFriction(float sfric);
37 void setDynamicFriction(float dfric);
38 void setBrake(float brake);
39 void setRotation(float rotation);
40 void setExtension(float extension);
41 void setCastering(bool castering);
42 void setGlobalGround(double* global_ground, float* global_vel);
44 void getPosition(float* out);
45 void getCompression(float* out);
46 void getGlobalGround(double* global_ground);
49 float getStaticFriction();
50 float getDynamicFriction();
55 float getCasterAngle() { return _casterAngle; }
56 float getRollSpeed() { return _rollSpeed; }
58 // Takes a velocity of the aircraft relative to ground, a rotation
59 // vector, and a ground plane (all specified in local coordinates)
60 // and make a force and point of application (i.e. ground contact)
61 // available via getForce().
62 void calcForce(RigidBody* body, State* s, float* v, float* rot);
64 // Computed values: total force, weight-on-wheels (force normal to
65 // ground) and compression fraction.
66 void getForce(float* force, float* contact);
68 float getCompressFraction();
69 float getCompressDist() { return _compressDist; }
72 float calcFriction(float wgt, float v);
89 double _global_ground[4];