Support gear compression along axes other than vertical (Vivian needs
it for the B-29). The gear model itself has supported this always, but there was no interface from the XML file. Should be backwards compatible. I don't think I broke anything...
This commit is contained in:
parent
dafa6ced1b
commit
bd917a47d8
1 changed files with 12 additions and 3 deletions
|
@ -238,9 +238,18 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
|
||||||
float nrm = Math::mag3(v);
|
float nrm = Math::mag3(v);
|
||||||
if (_vehicle_radius < nrm)
|
if (_vehicle_radius < nrm)
|
||||||
_vehicle_radius = nrm;
|
_vehicle_radius = nrm;
|
||||||
v[0] = 0;
|
if(a->hasAttribute("upx")) {
|
||||||
v[1] = 0;
|
v[0] = attrf(a, "upx");
|
||||||
v[2] = attrf(a, "compression", 1);
|
v[1] = attrf(a, "upy");
|
||||||
|
v[2] = attrf(a, "upz");
|
||||||
|
Math::unit3(v, v);
|
||||||
|
} else {
|
||||||
|
v[0] = 0;
|
||||||
|
v[1] = 0;
|
||||||
|
v[2] = 1;
|
||||||
|
}
|
||||||
|
for(int i=0; i<3; i++)
|
||||||
|
v[i] *= attrf(a, "compression", 1);
|
||||||
g->setCompression(v);
|
g->setCompression(v);
|
||||||
g->setBrake(attrf(a, "skid", 0));
|
g->setBrake(attrf(a, "skid", 0));
|
||||||
g->setStaticFriction(attrf(a, "sfric", 0.8));
|
g->setStaticFriction(attrf(a, "sfric", 0.8));
|
||||||
|
|
Loading…
Add table
Reference in a new issue