53f09ff6a5
""" - ground properties (e.g. feel bumpiness and the reduced friction of grass or go swimming with the beaver) - initial load for yasim gears (to get rid of the jitter the beaver has on ground) - glider/winch/aerotow (do winch start with YASim glider or do aerotow over the net) I will place a how-to on the wiki soon, here very short: use the sgs233y (or the bocian if you have AJ (up ot now) non-GPL bocian) winch start: Ctrl-w for placing the winch, hold w to winch, press Shift-w to release the tow aerotow: Place the glider within 60m to a MP-aircraft, press Ctrl-t to tow to this aircraft. If the MP-aircraft is the J3 and the patch is installed on both sides, the J3 feels the forces, too. The J3-pilot has to taxi very slow up to the moment, the glider starts moving. Increase the throttle gently. Don't lift the J3 early, wait for the glider being lifted, lift gently. """
93 lines
2.1 KiB
C++
93 lines
2.1 KiB
C++
#ifdef HAVE_CONFIG_H
|
|
#include <config.h>
|
|
#endif
|
|
|
|
#include <FDM/flight.hxx>
|
|
|
|
#include "Glue.hpp"
|
|
#include "Ground.hpp"
|
|
|
|
#include "FGGround.hpp"
|
|
namespace yasim {
|
|
|
|
FGGround::FGGround(FGInterface *iface) : _iface(iface)
|
|
{
|
|
_toff = 0.0;
|
|
}
|
|
|
|
FGGround::~FGGround()
|
|
{
|
|
}
|
|
|
|
void FGGround::getGroundPlane(const double pos[3],
|
|
double plane[4], float vel[3])
|
|
{
|
|
// Return values for the callback.
|
|
double loadCapacity, frictionFactor, agl;
|
|
double cp[3], dvel[3];
|
|
int type;
|
|
_iface->get_agl_m(_toff, pos, cp, plane, dvel,
|
|
&type, &loadCapacity, &frictionFactor, &agl);
|
|
|
|
// The plane below the actual contact point.
|
|
plane[3] = plane[0]*cp[0] + plane[1]*cp[1] + plane[2]*cp[2];
|
|
|
|
for(int i=0; i<3; i++) vel[i] = dvel[i];
|
|
}
|
|
|
|
void FGGround::getGroundPlane(const double pos[3],
|
|
double plane[4], float vel[3],
|
|
int *type, const SGMaterial **material
|
|
)
|
|
{
|
|
// Return values for the callback.
|
|
double agl;
|
|
double cp[3], dvel[3];
|
|
_iface->get_agl_m(_toff, pos, cp, plane, dvel,
|
|
type, material, &agl);
|
|
|
|
// The plane below the actual contact point.
|
|
plane[3] = plane[0]*cp[0] + plane[1]*cp[1] + plane[2]*cp[2];
|
|
|
|
for(int i=0; i<3; i++) vel[i] = dvel[i];
|
|
}
|
|
|
|
bool FGGround::caughtWire(const double pos[4][3])
|
|
{
|
|
return _iface->caught_wire_m(_toff, pos);
|
|
}
|
|
|
|
bool FGGround::getWire(double end[2][3], float vel[2][3])
|
|
{
|
|
double dvel[2][3];
|
|
bool ret = _iface->get_wire_ends_m(_toff, end, dvel);
|
|
for (int i=0; i<2; ++i)
|
|
for (int j=0; j<3; ++j)
|
|
vel[i][j] = dvel[i][j];
|
|
return ret;
|
|
}
|
|
|
|
void FGGround::releaseWire(void)
|
|
{
|
|
_iface->release_wire();
|
|
}
|
|
|
|
float FGGround::getCatapult(const double pos[3], double end[2][3],
|
|
float vel[2][3])
|
|
{
|
|
double dvel[2][3];
|
|
float dist = _iface->get_cat_m(_toff, pos, end, dvel);
|
|
for (int i=0; i<2; ++i)
|
|
for (int j=0; j<3; ++j)
|
|
vel[i][j] = dvel[i][j];
|
|
return dist;
|
|
}
|
|
|
|
void FGGround::setTimeOffset(double toff)
|
|
{
|
|
_toff = toff;
|
|
}
|
|
|
|
|
|
}; // namespace yasim
|
|
|