Frankiek,
The classes I got didn't include that updated compass code. I worked around the differences between the new and 'stock' 109G-1 cockpit class to start with, and sorta kinda have things working. The compass seems to behave, for both the dial and the waypoint indicator.
But a bunch of odd things have cropped up:
- The rudder pedals have reversed movement.
- The slip ball is rotated 180 degrees (effectively yielding reversed movement).
- The night mats are always on and the lights remain off; they cannot be toggled.
- The gun sight's Sun shade cannot be raised.
- The blood spatter and armored glass impact damage textures are always on.
Clearly I've not fully accounted for the differences; the new class is rather more complex.
Here's the full G-1 cockpit class as I have it at this moment:
package com.maddox.il2.objects.air;
import com.maddox.JGP.*;
import com.maddox.il2.ai.*;
import com.maddox.il2.engine.*;
import com.maddox.il2.fm.*;
import com.maddox.il2.objects.weapons.Gun;
import com.maddox.il2.objects.weapons.GunEmpty;
import com.maddox.rts.Property;
import com.maddox.rts.Time;
import com.maddox.util.HashMapExt;
// Referenced classes of package com.maddox.il2.objects.air:
// CockpitPilot, Aircraft, Cockpit, NetAircraft
public class CockpitBF_109G1 extends CockpitPilot
{
class Interpolater extends InterpolateRef
{
public boolean tick()
{
setTmp = setOld;
setOld = setNew;
setNew = setTmp;
setNew.altimeter = fm.getAltitude();
boolean flag = ((FlightModelMain) (fm)).EI.engines[0].getStage() > 0 && ((FlightModelMain) (fm)).EI.engines[0].getStage() < 7;
boolean flag1 = ((FlightModelMain) (fm)).EI.engines[0].getStage() == 1 || ((FlightModelMain) (fm)).EI.engines[0].getStage() == 2;
if(flag)
{
if(setNew.masterPosition < 1.0F)
setNew.masterPosition = setOld.masterPosition + 0.1F;
if(setNew.fuelPump0Position < 1.0F)
setNew.fuelPump0Position = setOld.fuelPump0Position + 0.1F;
if(setNew.fuelSelectorPosition > 0.0F)
setNew.fuelSelectorPosition = setOld.fuelSelectorPosition - 0.03F;
if(setNew.masterSwitchPosition < 1.0F)
setNew.masterSwitchPosition = setOld.masterSwitchPosition + 0.1F;
if(setNew.oxyPressurePosition < 1.0F)
setNew.oxyPressurePosition = setOld.oxyPressurePosition + 0.01F;
if(setNew.circuitBreakers0Position < 1.0F)
setNew.circuitBreakers0Position = setOld.circuitBreakers0Position + 0.1F;
if(setNew.generator0Position < 1.0F)
setNew.generator0Position = setOld.generator0Position + 0.1F;
if(setNew.radioSwitch0Position < 1.0F)
setNew.radioSwitch0Position = setOld.radioSwitch0Position + 0.1F;
if(setNew.circuitBreakers2Position < 1.0F)
setNew.circuitBreakers2Position = setOld.circuitBreakers2Position + 0.1F;
if(setNew.radioSwitch2Position < 1.0F)
setNew.radioSwitch2Position = setOld.radioSwitch2Position + 0.1F;
if(setNew.generator2Position < 1.0F)
setNew.generator2Position = setOld.generator2Position + 0.1F;
} else
{
if(setNew.masterPosition > 0.0F)
setNew.masterPosition = setOld.masterPosition - 0.1F;
if(setNew.fuelPump0Position > 0.0F)
setNew.fuelPump0Position = setOld.fuelPump0Position - 0.1F;
if(setNew.fuelSelectorPosition < 1.0F)
setNew.fuelSelectorPosition = setOld.fuelSelectorPosition + 0.03F;
if(setNew.masterSwitchPosition > 0.0F)
setNew.masterSwitchPosition = setOld.masterSwitchPosition - 0.1F;
if(setNew.oxyPressurePosition > 0.0F)
setNew.oxyPressurePosition = setOld.oxyPressurePosition - 0.01F;
if(setNew.circuitBreakers0Position > 0.0F)
setNew.circuitBreakers0Position = setOld.circuitBreakers0Position - 0.1F;
if(setNew.generator0Position > 0.0F)
setNew.generator0Position = setOld.generator0Position - 0.1F;
if(setNew.radioSwitch0Position > 0.0F)
setNew.radioSwitch0Position = setOld.radioSwitch0Position - 0.1F;
if(setNew.circuitBreakers2Position > 0.0F)
setNew.circuitBreakers2Position = setOld.circuitBreakers2Position - 0.1F;
if(setNew.fuelPump2Position < 1.0F)
setNew.fuelPump2Position = setOld.fuelPump2Position + 0.1F;
if(setNew.fuelPump2Position > 0.0F)
setNew.fuelPump2Position = setOld.fuelPump2Position - 0.1F;
if(setNew.radioSwitch2Position > 0.0F)
setNew.radioSwitch2Position = setOld.radioSwitch2Position - 0.1F;
if(setNew.generator2Position > 0.0F)
setNew.generator2Position = setOld.generator2Position - 0.1F;
}
if(flag1)
{
if(setNew.starterPosition < 1.0F)
setNew.starterPosition = setOld.starterPosition + 0.1F;
if(setNew.starter2Position < 1.0F)
setNew.starter2Position = setOld.starter2Position + 0.1F;
} else
{
if(setNew.starterPosition > 0.0F)
setNew.starterPosition = setOld.starterPosition - 0.1F;
if(setNew.starter2Position > 0.0F)
setNew.starter2Position = setOld.starter2Position - 0.1F;
}
if(setNew.masterArmPosition < 1.0F)
setNew.masterArmPosition = setOld.masterArmPosition + 0.5F;
if(flag)
{
for(int i = 0; i < 3; i++)
if(!((FlightModelMain) (fm)).CT.WeaponControl[triggerForBreechControl[i]])
{
if(setNew.shotPosition[i] < 1.0F)
setNew.shotPosition[i] += 0.5F;
} else
if(gun[i].haveBullets())
{
boolean flag3 = false;
long l = Time.current();
if(timePerShot[i] < l - lastBreechTime[i])
{
flag3 = true;
lastBreechTime[i] = l;
}
if(flag3)
{
setNew.shotPosition[i] = setNew.shotPosition[i] > 0.5F ? 0.0F : 1.0F;
setOld.shotPosition[i] = setNew.shotPosition[i];
}
} else
if(setNew.shotPosition[i] > 0.0F)
setNew.shotPosition[i] -= 0.5F;
} else
{
for(int j = 0; j < 3; j++)
if(setNew.shotPosition[j] > 0.0F)
setNew.shotPosition[j] = setOld.shotPosition[j] - 0.5F;
}
if(((FlightModelMain) (fm)).CT.GearControl == 1.0F)
{
if(setNew.gearLeverPosition > 0.0F)
setNew.gearLeverPosition = setOld.gearLeverPosition - 0.5F;
} else
if(setNew.gearLeverPosition < 1.0F)
setNew.gearLeverPosition = setOld.gearLeverPosition + 0.5F;
if(((FlightModelMain) (fm)).CT.GearControl == 0.0F && ((FlightModelMain) (fm)).CT.getGear() > 0.5F)
{
if(setNew.gearUpPosition > 0.0F)
setNew.gearUpPosition = setOld.gearUpPosition - 0.1F;
} else
if(setNew.gearUpPosition < 1.0F)
setNew.gearUpPosition = setOld.gearUpPosition + 0.1F;
if(((FlightModelMain) (fm)).CT.GearControl == 1.0F && ((FlightModelMain) (fm)).CT.getGear() < 0.5F)
{
if(setNew.gearDownPosition > 0.0F)
setNew.gearDownPosition = setOld.gearDownPosition - 0.1F;
} else
if(setNew.gearDownPosition < 1.0F)
setNew.gearDownPosition = setOld.gearDownPosition + 0.1F;
if(((FlightModelMain) (fm)).CT.BayDoorControl == 0.0F)
{
if(setNew.kg13TriggerPosition > 0.0F)
setNew.kg13TriggerPosition = setOld.kg13TriggerPosition - 0.05F;
} else
if(setNew.kg13TriggerPosition < 1.0F)
setNew.kg13TriggerPosition = setOld.kg13TriggerPosition + 0.05F;
if(!((FlightModelMain) (fm)).CT.getRadiatorControlAuto())
{
if(setNew.radiatorPosition > 0.0F)
setNew.radiatorPosition = setOld.radiatorPosition - 0.05F;
} else
if(setNew.radiatorPosition < 1.0F)
setNew.radiatorPosition = setOld.radiatorPosition + 0.05F;
if(setNew.quickBrakePosition1 < 1.0F)
setNew.quickBrakePosition1 = setOld.quickBrakePosition1 + 0.05F;
if(setNew.quickBrakePosition2 < 1.0F)
setNew.quickBrakePosition2 = setOld.quickBrakePosition2 + 0.05F;
if(UnLockedTState)
{
if(setNew.lockTailWheel0Position > 0.0F)
setNew.lockTailWheel0Position = setOld.lockTailWheel0Position - 0.07F;
} else
if(setNew.lockTailWheel0Position < 1.0F)
setNew.lockTailWheel0Position = setOld.lockTailWheel0Position + 0.07F;
if(!LockedTDelayState)
{
if(setNew.lockTailWheelPosition1 > 0.0F)
setNew.lockTailWheelPosition1 = setOld.lockTailWheelPosition1 - 0.07F;
} else
if(setNew.lockTailWheelPosition1 < 1.0F)
setNew.lockTailWheelPosition1 = setOld.lockTailWheelPosition1 + 0.07F;
if(((FlightModelMain) (fm)).CT.cockpitDoorControl == 1.0F)
{
if(setNew.topCablePosition1 > 0.0F)
setNew.topCablePosition1 = setOld.topCablePosition1 - 0.022F;
} else
if(setNew.topCablePosition1 < 1.0F)
setNew.topCablePosition1 = setOld.topCablePosition1 + 0.022F;
if(fm.getAltitude() > 3000F)
{
if(setNew.oxyButtonPosition < 1.0F)
setNew.oxyButtonPosition = setOld.oxyButtonPosition + 0.05F;
} else
if(setNew.oxyButtonPosition > 0.0F)
setNew.oxyButtonPosition = setOld.oxyButtonPosition - 0.05F;
if(fm.getAltitude() > 5000F)
{
if(setNew.glassCleanerPosition < 1.0F)
setNew.glassCleanerPosition = setOld.glassCleanerPosition + 0.05F;
} else
if(setNew.glassCleanerPosition > 0.0F)
setNew.glassCleanerPosition = setOld.glassCleanerPosition - 0.05F;
if(!CanopyClosedState)
{
if(setNew.canopyHandlePosition > 0.0F)
setNew.canopyHandlePosition = setOld.canopyHandlePosition - 0.05F;
} else
if(setNew.canopyHandlePosition < 1.0F)
setNew.canopyHandlePosition = setOld.canopyHandlePosition + 0.05F;
if(UnLockedTState)
{
if(setNew.lockTailWheel3Position > 0.0F)
setNew.lockTailWheel3Position = setOld.lockTailWheel3Position - 0.07F;
} else
if(setNew.lockTailWheel3Position < 1.0F)
setNew.lockTailWheel3Position = setOld.lockTailWheel3Position + 0.07F;
if(UnLockedTState)
{
if(setNew.lockTailWheelPosition2 > 0.0F)
setNew.lockTailWheelPosition2 = setOld.lockTailWheelPosition2 - 0.07F;
} else
if(setNew.lockTailWheelPosition2 < 1.0F)
setNew.lockTailWheelPosition2 = setOld.lockTailWheelPosition2 + 0.07F;
if(UnLockedTState)
{
if(setNew.lockTailWheel5Position > 0.0F)
setNew.lockTailWheel5Position = setOld.lockTailWheel5Position - 0.07F;
} else
if(setNew.lockTailWheel5Position < 1.0F)
setNew.lockTailWheel5Position = setOld.lockTailWheel5Position + 0.07F;
if(!cockpitLightControl)
{
if(setNew.cockpitLights0Position > 0.0F)
setNew.cockpitLights0Position = setOld.cockpitLights0Position - 0.1F;
} else
if(setNew.cockpitLights0Position < 1.0F)
setNew.cockpitLights0Position = setOld.cockpitLights0Position + 0.1F;
if(!((FlightModelMain) (fm)).AS.bNavLightsOn)
{
if(setNew.navLights0Position > 0.0F)
setNew.navLights0Position = setOld.navLights0Position - 0.1F;
} else
if(setNew.navLights0Position < 1.0F)
setNew.navLights0Position = setOld.navLights0Position + 0.1F;
if(((FlightModelMain) (fm)).EI.engines[0].isPropAngleDeviceOperational())
{
if(setNew.propPitchPosition < 1.0F)
setNew.propPitchPosition = setOld.propPitchPosition + 0.1F;
if(setNew.propPitch4Position < 1.0F)
setNew.propPitch4Position = setOld.propPitch4Position + 0.1F;
} else
{
if(setNew.propPitchPosition > 0.0F)
setNew.propPitchPosition = setOld.propPitchPosition - 0.1F;
if(setNew.propPitch4Position > 0.0F)
setNew.propPitch4Position = setOld.propPitch4Position - 0.1F;
}
if(!cockpitLightControl)
{
if(setNew.cockpitLights2Position > 0.0F)
setNew.cockpitLights2Position = setOld.cockpitLights2Position - 0.1F;
} else
if(setNew.cockpitLights2Position < 1.0F)
setNew.cockpitLights2Position = setOld.cockpitLights2Position + 0.1F;
if(!((FlightModelMain) (fm)).AS.bNavLightsOn)
{
if(setNew.navLights2Position > 0.0F)
setNew.navLights2Position = setOld.navLights2Position - 0.1F;
} else
if(setNew.navLights2Position < 1.0F)
setNew.navLights2Position = setOld.navLights2Position + 0.1F;
if(!AccelerationState1)
{
if(setNew.cockpit0Position > 0.0F)
setNew.cockpit0Position = setOld.cockpit0Position - 0.02F;
} else
if(setNew.cockpit0Position < 1.0F)
setNew.cockpit0Position = setOld.cockpit0Position + 0.02F;
if(((FlightModelMain) (fm)).AS.astateSootStates[0] > 0)
{
if(setNew.smoke1Position < 1.0F)
setNew.smoke1Position = setOld.smoke1Position + 1E-005F;
if(setNew.smoke2Position < 1.0F)
setNew.smoke2Position = setOld.smoke2Position + 2E-005F;
} else
{
if(setNew.smoke1Position > 0.0F)
setNew.smoke1Position = setOld.smoke1Position - 1E-005F;
if(setNew.smoke2Position > 0.0F)
setNew.smoke2Position = setOld.smoke2Position - 2E-005F;
}
if(((FlightModelMain) (fm)).EI.engines[0].getReadyness() < 0.8F)
{
if(setNew.smoke3Position < 1.0F)
setNew.smoke3Position = setOld.smoke3Position + 1E-005F;
if(setNew.smoke4Position < 1.0F)
setNew.smoke4Position = setOld.smoke4Position + 2E-005F;
} else
{
if(setNew.smoke3Position > 0.0F)
setNew.smoke3Position = setOld.smoke3Position - 1E-005F;
if(setNew.smoke4Position > 0.0F)
setNew.smoke4Position = setOld.smoke4Position - 2E-005F;
}
if(((FlightModelMain) (fm)).CT.GearControl == 1.0F)
{
if(setNew.gearIndicatorPosition > 0.0F)
setNew.gearIndicatorPosition = setOld.gearIndicatorPosition - 0.005F;
} else
if(setNew.gearIndicatorPosition < 1.0F)
setNew.gearIndicatorPosition = setOld.gearIndicatorPosition + 0.005F;
boolean flag2 = false;
if(((NetAircraft) ((Aircraft)((Interpolate) (fm)).actor)).thisWeaponsName.toLowerCase().startsWith("u5") && ((FlightModelMain) (fm)).CT.Weapons[9][0].haveBullets())
flag2 = true;
if(flag2)
{
if(setNew.dropTankPosition < 1.0F)
setNew.dropTankPosition = setOld.dropTankPosition + 0.1F;
} else
if(setNew.dropTankPosition > 0.0F)
setNew.dropTankPosition = setOld.dropTankPosition - 0.1F;
if(((FlightModelMain) (fm)).CT.cockpitDoorControl == 1.0F)
{
if(setNew.topCablePosition2 > 0.0F)
setNew.topCablePosition2 = setOld.topCablePosition2 - 0.022F;
} else
if(setNew.topCablePosition2 < 1.0F)
setNew.topCablePosition2 = setOld.topCablePosition2 + 0.022F;
boolean flag4 = false;
if(((NetAircraft) ((Aircraft)((Interpolate) (fm)).actor)).thisWeaponsName.toLowerCase().startsWith("r1") && ((FlightModelMain) (fm)).CT.Weapons[3][0].haveBullets())
flag4 = true;
if(flag4)
{
if(setNew.bombsContact1Position < 1.0F)
setNew.bombsContact1Position = setOld.bombsContact1Position + 0.5F;
if(setNew.bombsContact2Position < 1.0F)
setNew.bombsContact2Position = setOld.bombsContact2Position + 0.5F;
if(setNew.bombsPanel1Position < 1.0F)
setNew.bombsPanel1Position = setOld.bombsPanel1Position + 1.0F;
} else
if(setNew.bombsPanel1Position > 0.0F)
setNew.bombsPanel1Position = setOld.bombsPanel1Position - 1.0F;
if(setNew.leftPedalBase1Position < 1.0F)
setNew.leftPedalBase1Position = setOld.leftPedalBase1Position + 1.0F;
if(setNew.rightPedalBase1Position < 1.0F)
setNew.rightPedalBase1Position = setOld.rightPedalBase1Position + 1.0F;
if(!cockpitDimControl)
{
if(setNew.dimPosition > 0.0F)
setNew.dimPosition = setOld.dimPosition - 0.05F;
} else
if(setNew.dimPosition < 1.0F)
setNew.dimPosition = setOld.dimPosition + 0.05F;
setNew.throttle = (10F * setOld.throttle + ((FlightModelMain) (fm)).CT.PowerControl) / 11F;
// setNew.azimuth = ((FlightModelMain) (fm)).Or.getYaw(); //original
// if(setOld.azimuth > 270F && setNew.azimuth < 90F)
// setOld.azimuth -= 360F;
// if(setOld.azimuth < 90F && setNew.azimuth > 270F)
// setOld.azimuth += 360F;
setNew.azimuth.setDeg(setOld.azimuth.getDeg(1.0F), fm.Or.azimut()); //for AnglesFork()
// setNew.waypointAzimuth = (10F * setOld.waypointAzimuth + (waypointAzimuth() - setOld.azimuth) + World.Rnd().nextFloat(-30F, 30F)) / 11F; //original
setNew.waypointAzimuth.setDeg(setOld.waypointAzimuth.getDeg(1.0F), waypointAzimuth()); //for AnglesFork()
buzzerFX(((FlightModelMain) (fm)).CT.getGear() < 0.999999F && ((FlightModelMain) (fm)).CT.getFlap() > 0.1F);
return true;
}
Interpolater()
{
}
}
private class Variables
{
float altimeter;
float throttle;
float dimPosition;
// float azimuth; //original
// float waypointAzimuth; //original
AnglesFork azimuth = new AnglesFork();
AnglesFork waypointAzimuth = new AnglesFork();
float masterPosition;
float starterPosition;
float starter2Position;
float masterArmPosition;
float shotPosition[];
float gearLeverPosition;
float gearUpPosition;
float gearDownPosition;
float kg13TriggerPosition;
float radiatorPosition;
float fuelPump0Position;
float quickBrakePosition1;
float quickBrakePosition2;
float fuelSelectorPosition;
float primer0Position;
float primer1Position;
float primer2Position;
float primer3Position;
float primer4Position;
float primer5Position;
float ejectCanopyPosition;
float lockTailWheel0Position;
float lockTailWheelPosition1;
float masterSwitchPosition;
float topCablePosition1;
float oxyButtonPosition;
float oxyPressurePosition;
float glassCleanerPosition;
float canopyHandlePosition;
float lockTailWheel3Position;
float lockTailWheelPosition2;
float lockTailWheel5Position;
float circuitBreakers0Position;
float cockpitLights0Position;
float navLights0Position;
float propPitchPosition;
float generator0Position;
float radioSwitch0Position;
float circuitBreakers2Position;
float cockpitLights2Position;
float navLights2Position;
float fuelPump2Position;
float propPitch4Position;
float radioSwitch2Position;
float generator2Position;
float cockpit0Position;
float smoke1Position;
float smoke2Position;
float smoke3Position;
float smoke4Position;
float gearIndicatorPosition;
float dropTankPosition;
float topCablePosition2;
float bombsContact1Position;
float bombsPanel1Position;
float bombsContact2Position;
float leftPedalBase1Position;
float rightPedalBase1Position;
float leftPedalBase2Position;
float rightPedalBase2Position;
public Variables()
{
shotPosition = new float[3];
this.azimuth = new AnglesFork(); //experimental placement here
this.waypointAzimuth = new AnglesFork(); //experimental placement here
}
/* private Variables() //NEW, for AnglesFork(); conflicts with above
{
this.azimuth = new AnglesFork();
this.waypointAzimuth = new AnglesFork();
} */
Variables(Variables variables) //NEW, for AnglesFork()
{
this();
} }
/* protected float waypointAzimuth()
{
WayPoint waypoint = ((FlightModelMain) (super.fm)).AP.way.curr();
if(waypoint == null)
{
return 0.0F;
} else
{
waypoint.getP(tmpP);
tmpV.sub(tmpP, ((FlightModelMain) (super.fm)).Loc);
return (float)(57.295779513082323D * Math.atan2(((Tuple3d) (tmpV)).y, ((Tuple3d) (tmpV)).x));
}
} */
protected float waypointAzimuth() //REPLACES ABOVE
{
return this.waypointAzimuthInvertMinus(30F);
}
public CockpitBF_109G1()
{
super("3do/cockpit/Bf-109G-2/G1.him", "bf109");
setOld = new Variables();
setNew = new Variables();
oldctl = -1F;
curctl = -1F;
AccelerationState1 = false;
IceState1 = false;
IceState2 = false;
IceState3 = false;
CleanIceState1 = false;
CanopyClosedState = false;
EjectCanopyState = false;
timeCounterIce1 = 0.0F;
timeIce1 = 60F;
timeCounterIce2 = 0.0F;
timeIce2 = 120F;
timeCounterIce3 = 0.0F;
timeIce3 = 180F;
timeCounterCleanIce1 = 0.0F;
timeCleanIce1 = 60F;
LockedTDelayState = false;
UnLockedTState = false;
timeCounterLockT = 0.0F;
timeLockT = 10F;
timeCounterUnLockT = 0.0F;
timeUnLockT = 10F;
GunsightMove = false;
RotGunsightDelay = false;
timeCounterGunsightMove2 = 0.0F;
timeGunsightMove2 = 20F;
ReticleCut = false;
timeCounterReticle = 0.0F;
timeReticle = 34F;
pictManifold = 0.0F;
setOld = new Variables();
setNew = new Variables();
pictAiler = 0.0F;
pictElev = 0.0F;
tmpP = new Point3d();
tmpV = new Vector3d();
setNew.dimPosition = 1.0F;
HookNamed hooknamed = new HookNamed(super.mesh, "LAMPHOOK1");
Loc loc = new Loc(0.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F);
hooknamed.computePos(this, new Loc(0.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F), loc);
light1 = new LightPointActor(new LightPoint(), loc.getPoint());
light1.light.setColor(126F, 232F, 245F);
light1.light.setEmit(0.0F, 0.0F);
super.pos.base().draw.lightMap().put("LAMPHOOK1", light1);
hooknamed = new HookNamed(super.mesh, "LAMPHOOK2");
loc = new Loc(0.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F);
hooknamed.computePos(this, new Loc(0.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F), loc);
light2 = new LightPointActor(new LightPoint(), loc.getPoint());
light2.light.setColor(126F, 232F, 245F);
light2.light.setEmit(0.0F, 0.0F);
super.pos.base().draw.lightMap().put("LAMPHOOK2", light2);
super.cockpitNightMats = (new String[] {
"ZClocks1", "ZClocksDMG", "ZClocks2", "ZClocks3", "Needles", "ZClocks4"
});
setNightMats(false);
interpPut(new Interpolater(), null, Time.current(), null);
loadBuzzerFX();
bNeedSetUp = true;
hasCanopy = true;
super.printCompassHeading = true;
/* limits6DoF = (new float[] {0.5F, 0.08F, -0.05F, 0.15F, 0.2F, -0.2F, 0.05F, -0.05F}); DEFAULTS GUIDE
(0)spineL, (1)faceL, (2)spineOffsetX, (3)leanSideMax, (4)leanForwardMax, (5)leanForwardMin, (6)raiseMax, (7)raiseMin */
// super.limits6DoF = (new float[] {0.7F, 0.055F, -0.07F, 0.11F, 0.07F, -0.13F, 0.03F, -0.03F}); original
super.limits6DoF = (new float[] {0.7F, 0.055F, -0.07F, 0.13F, 0.24F, -0.14F, 0.05F, -0.08F});
}
public void reflectWorldToInstruments(float f)
{
if(bNeedSetUp)
{
reflectPlaneMats();
bNeedSetUp = false;
}
boolean flag = ((FlightModelMain) (super.fm)).EI.engines[0].getStage() > 0 && ((FlightModelMain) (super.fm)).EI.engines[0].getStage() < 7;
boolean flag1 = false;
if(((NetAircraft) ((Aircraft)((Interpolate) (super.fm)).actor)).thisWeaponsName.toLowerCase().startsWith("r1"))
flag1 = true;
boolean flag2 = false;
if(((NetAircraft) ((Aircraft)((Interpolate) (super.fm)).actor)).thisWeaponsName.toLowerCase().startsWith("r1") && ((FlightModelMain) (super.fm)).CT.Weapons[3][0].haveBullets())
flag2 = true;
resetYPRmodifier();
super.mesh.chunkSetAngles("Top", 0.0F, 80F * ((FlightModelMain) (super.fm)).CT.getCockpitDoor(), 0.0F);
super.mesh.chunkSetAngles("Z_TrimIndicator", 330F * ((FlightModelMain) (super.fm)).CT.getTrimElevatorControl(), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_TrimWheel", 720F * ((FlightModelMain) (super.fm)).CT.getTrimElevatorControl(), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_LeftPedal2", -25F * ((FlightModelMain) (super.fm)).CT.getBrake(), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_RightPedal2", -25F * ((FlightModelMain) (super.fm)).CT.getBrake(), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_FlapsWheel", -360F * ((FlightModelMain) (super.fm)).CT.FlapsControl, 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_ReviLever", cvt(interp(setNew.dimPosition, setOld.dimPosition, f), 0.0F, 1.0F, 0.0F, 29F), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Starter", 0.0F, cvt(interp(setNew.starterPosition, setOld.starterPosition, f), 0.0F, 1.0F, 0.0F, 45F), 0.0F);
super.mesh.chunkSetAngles("Z_MasterArm", 0.0F, cvt(interp(setNew.masterArmPosition, setOld.masterArmPosition, f), 0.0F, 1.0F, 0.0F, -35F), 0.0F);
for(int i = 0; i < 3; i++)
super.mesh.chunkSetAngles("Z_Shot" + (i + 1), 0.0F, cvt(interp(setNew.shotPosition[i], setOld.shotPosition[i], f), 0.0F, 1.0F, 0.0F, -60F), 0.0F);
super.mesh.chunkSetAngles("Z_GearLever", 0.0F, cvt(interp(setNew.gearLeverPosition, setOld.gearLeverPosition, f), 0.0F, 1.0F, 0.0F, -65F), 0.0F);
super.mesh.chunkSetAngles("Z_KG13Trigger", 0.0F, cvt(interp(setNew.kg13TriggerPosition, setOld.kg13TriggerPosition, f), 0.0F, 1.0F, 0.0F, -270F), 0.0F);
super.mesh.chunkSetAngles("Z_RadiatorSelector", 0.0F, cvt(interp(setNew.radiatorPosition, setOld.radiatorPosition, f), 0.0F, 1.0F, 0.0F, -90F), 0.0F);
super.mesh.chunkSetAngles("Z_RadiatorSelector2", cvt(((FlightModelMain) (super.fm)).CT.getRadiatorControl(), 0.0F, 1.0F, -180F, 0.0F), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_QuickBrake", 0.0F, cvt(interp(setNew.quickBrakePosition1, setOld.quickBrakePosition1, f), 0.0F, 1.0F, 0.0F, 38F), 0.0F);
super.mesh.chunkSetAngles("Z_QuickBrake2", 0.0F, cvt(interp(setNew.quickBrakePosition2, setOld.quickBrakePosition2, f), 0.0F, 1.0F, 0.0F, -15F), 0.0F);
super.mesh.chunkSetAngles("Z_FuelSelector", 0.0F, cvt(interp(setNew.fuelSelectorPosition, setOld.fuelSelectorPosition, f), 0.0F, 1.0F, 0.0F, -58F), 0.0F);
super.mesh.chunkSetAngles("Z_LockTWheel2", 0.0F, cvt(interp(setNew.lockTailWheelPosition1, setOld.lockTailWheelPosition1, f), 0.0F, 1.0F, 0.0F, 135F), 0.0F);
super.mesh.chunkSetAngles("Z_LockTWheel4", 0.0F, cvt(interp(setNew.lockTailWheelPosition2, setOld.lockTailWheelPosition2, f), 0.0F, 1.0F, 0.0F, -25F), 0.0F);
super.mesh.chunkSetAngles("Z_TopCable", 0.0F, cvt(interp(setNew.topCablePosition1, setOld.topCablePosition1, f), 0.0F, 1.0F, 0.0F, 87F), 0.0F);
super.mesh.chunkSetAngles("Z_OxyButton", 0.0F, cvt(interp(setNew.oxyButtonPosition, setOld.oxyButtonPosition, f), 0.0F, 1.0F, 0.0F, 180F), 0.0F);
super.mesh.chunkSetAngles("Z_OxyPressure", 0.0F, cvt(interp(setNew.oxyPressurePosition, setOld.oxyPressurePosition, f), 0.0F, 1.0F, -258F, 0.0F), 0.0F);
super.mesh.chunkSetAngles("Z_GlassCleaner", 0.0F, cvt(interp(setNew.glassCleanerPosition, setOld.glassCleanerPosition, f), 0.0F, 1.0F, 0.0F, -88F), 0.0F);
super.mesh.chunkSetAngles("Z_CanopyHandle", 0.0F, cvt(interp(setNew.canopyHandlePosition, setOld.canopyHandlePosition, f), 0.0F, 1.0F, 0.0F, 120F), 0.0F);
super.mesh.chunkSetAngles("Smoke1", 0.0F, cvt(interp(setNew.smoke1Position, setOld.smoke1Position, f), 0.0F, 1.0F, 0.0F, 18000F), 0.0F);
super.mesh.chunkSetAngles("Smoke2", 0.0F, cvt(interp(setNew.smoke2Position, setOld.smoke2Position, f), 0.0F, 1.0F, 0.0F, 18000F), 0.0F);
super.mesh.chunkSetAngles("Smoke3", 0.0F, cvt(interp(setNew.smoke3Position, setOld.smoke3Position, f), 0.0F, 1.0F, 0.0F, 18000F), 0.0F);
super.mesh.chunkSetAngles("Smoke4", 0.0F, cvt(interp(setNew.smoke4Position, setOld.smoke4Position, f), 0.0F, 1.0F, 0.0F, 18000F), 0.0F);
super.mesh.chunkSetAngles("Z_Altimeter1", cvt(interp(setNew.altimeter, setOld.altimeter, f), 0.0F, 10000F, 0.0F, 3600F), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_Altimeter2", cvt(interp(setNew.altimeter, setOld.altimeter, f), 0.0F, 10000F, 0.0F, 180F), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_ATA1", cvt(pictManifold = 0.75F * pictManifold + 0.25F * ((FlightModelMain) (super.fm)).EI.engines[0].getManifoldPressure(), 0.6F, 1.8F, 0.0F, 325F), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_Speedometer1", floatindex(cvt(Pitot.Indicator((float)((Tuple3d) (((FlightModelMain) (super.fm)).Loc)).z, super.fm.getSpeedKMH()), 0.0F, 800F, 0.0F, 16F), speedometerScale), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_RPM1", floatindex(cvt(((FlightModelMain) (super.fm)).EI.engines[0].getRPM(), 0.0F, 4000F, 0.0F, 8F), rpmScale), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_FuelQuantity1", -44.5F + floatindex(cvt(((FlightModelMain) (super.fm)).M.fuel / 0.72F, 0.0F, 400F, 0.0F, 8F), fuelScale), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_EngTemp1", cvt(((FlightModelMain) (super.fm)).EI.engines[0].tOilOut, 0.0F, 160F, 0.0F, 75F), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_FuelPress1", cvt(((FlightModelMain) (super.fm)).EI.engines[0].getRPM() / 1500F, 0.0F, 3F, 8F, 160F), 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_OilPress1", -cvt(1.0F + 0.05F * ((FlightModelMain) (super.fm)).EI.engines[0].tOilOut + ((FlightModelMain) (super.fm)).EI.engines[0].getRPM() / 1500F, 0.0F, 15F, 10F, -210F), 0.0F, 0.0F);
if (this.useRealisticNavigationInstruments()) //NEW, for AnglesFork()
{
this.mesh.chunkSetAngles("Z_Azimuth1", this.setNew.azimuth.getDeg(f) - this.setNew.waypointAzimuth.getDeg(f), 0.0F, 0.0F);
this.mesh.chunkSetAngles("Z_Compass1", 0.0F, -this.setNew.waypointAzimuth.getDeg(f), 0.0F);
} else
{
this.mesh.chunkSetAngles("Z_Compass1", 0.0F, -this.setNew.azimuth.getDeg(f), 0.0F);
this.mesh.chunkSetAngles("Z_Azimuth1", this.setNew.waypointAzimuth.getDeg(f * 0.1F), 0.0F, 0.0F);
}
// super.mesh.chunkSetAngles("Z_Compass1", 0.0F, interp(setNew.azimuth, setOld.azimuth, f), 0.0F); //original
// super.mesh.chunkSetAngles("Z_Compass1", 0.0F, setNew.azimuth.getDeg(f), 0.0F); //for AnglesFork(), 1st try
if(((FlightModelMain) (super.fm)).EI.engines[0].getStage() == 6)
{
// super.mesh.chunkSetAngles("Z_Azimuth1", -interp(setNew.waypointAzimuth, setOld.waypointAzimuth, f), 0.0F, 0.0F); //original
// super.mesh.chunkSetAngles("Z_Azimuth1", setNew.waypointAzimuth, setOld.waypointAzimuth, f), 0.0F, 0.0F); //for AnglesFork(), 1st try
// float f1 = cvt((setNew.azimuth - setOld.azimuth) / Time.tickLenFs(), -5F, 5F, 18F, -18F); //original
float f1 = cvt((this.setNew.azimuth.getDeg(f) - this.setOld.azimuth.getDeg(f)) / Time.tickLenFs(), -5F, 5F, 18F, -18F);
if(aircraft().fmTrack() != null)
aircraft().fmTrack().setCockpitAzimuthSpeed(f1);
super.mesh.chunkSetAngles("Z_TurnBank1", f1, 0.0F, 0.0F); //turn rate caret on artificial horizon
super.mesh.chunkSetAngles("Z_Horizon1", 0.0F, 0.0F, ((FlightModelMain) (super.fm)).Or.getKren());
super.mesh.chunkSetAngles("Z_Horizon2", cvt(((FlightModelMain) (super.fm)).Or.getTangage(), -45F, 45F, -13F, 13F), 0.0F, 0.0F);
}
super.mesh.chunkSetAngles("Z_TurnBank2", -cvt(getBall(6D), -6F, 6F, -4.5F, 4.5F), 0.0F, 0.0F); //slip ball; REVERSED!
if(flag)
{
super.mesh.chunkSetAngles("Z_PropPitch1", 270F - (float)Math.toDegrees(((FlightModelMain) (super.fm)).EI.engines[0].getPropPhi() - ((FlightModelMain) (super.fm)).EI.engines[0].getPropPhiMin()) * 60F, 0.0F, 0.0F);
super.mesh.chunkSetAngles("Z_PropPitch2", 105F - (float)Math.toDegrees(((FlightModelMain) (super.fm)).EI.engines[0].getPropPhi() - ((FlightModelMain) (super.fm)).EI.engines[0].getPropPhiMin()) * 5F, 0.0F, 0.0F);
}
super.mesh.chunkVisible("BombsPanel1", flag1);
super.mesh.chunkVisible("BombsPanel2", flag1);
super.mesh.chunkVisible("BombsPanel3", flag1);
super.mesh.chunkVisible("Z_BombsContact1", flag1);
super.mesh.chunkVisible("Z_BombsContact2", flag1);
super.mesh.chunkVisible("Z_BombsSelector", flag1);
super.mesh.chunkVisible("RocketsPanel", false);
super.mesh.chunkVisible("Z_RFire1", false);
super.mesh.chunkVisible("Z_RFire2", false);
if(GunsightMove)
{
timeCounterIce1 += f;
timeCounterIce2 += f;
timeCounterIce3 += f;
if(timeCounterIce1 >= timeIce1)
{
timeCounterIce1 = 0.0F;
timeIce1 = 0.0F;
IceState1 = true;
}
if(timeCounterIce2 >= timeIce2)
{
timeCounterIce2 = 0.0F;
timeIce2 = 0.0F;
IceState2 = true;
}
if(timeCounterIce3 >= timeIce3)
{
timeCounterIce3 = 0.0F;
timeIce3 = 0.0F;
IceState3 = true;
}
} else
if(super.fm.getAltitude() <= 300F || CleanIceState1)
{
timeCounterIce1 = 0.0F;
timeIce1 = 60F;
timeCounterIce2 = 0.0F;
timeIce2 = 120F;
timeCounterIce3 = 0.0F;
timeIce3 = 180F;
}
if(((FlightModelMain) (super.fm)).AS.astateEngineStates[0] == 1)
super.mesh.chunkVisible("Smoke1", true);
else
super.mesh.chunkVisible("Smoke1", false);
if(((FlightModelMain) (super.fm)).AS.astateEngineStates[0] == 2)
super.mesh.chunkVisible("Smoke2", true);
else
super.mesh.chunkVisible("Smoke2", false);
if(((FlightModelMain) (super.fm)).AS.astateEngineStates[0] == 3)
super.mesh.chunkVisible("Smoke3", true);
else
super.mesh.chunkVisible("Smoke3", false);
if(((FlightModelMain) (super.fm)).AS.astateEngineStates[0] > 3)
super.mesh.chunkVisible("Smoke4", true);
else
super.mesh.chunkVisible("Smoke4", false);
if(aircraft().chunkDamageVisible("CF") > 0)
super.mesh.chunkVisible("Z_HitArmor1", true);
else
super.mesh.chunkVisible("Z_HitArmor1", false);
super.mesh.chunkVisible("Z_Blood", aircraft().hierMesh().isChunkVisible("Gore2_D0"));
if(IceState1)
{
super.mesh.chunkVisible("GlassIce1", true);
super.mesh.chunkVisible("TopIce1", true);
} else
if(!IceState1)
{
super.mesh.chunkVisible("GlassIce1", false);
super.mesh.chunkVisible("TopIce1", false);
}
if(IceState2)
{
super.mesh.chunkVisible("GlassIce2", true);
super.mesh.chunkVisible("TopIce2", true);
} else
if(!IceState2)
{
super.mesh.chunkVisible("GlassIce2", false);
super.mesh.chunkVisible("TopIce2", false);
}
if(IceState3)
{
super.mesh.chunkVisible("GlassIce3", true);
super.mesh.chunkVisible("TopIce3", true);
} else
if(!IceState3)
{
super.mesh.chunkVisible("GlassIce3", false);
super.mesh.chunkVisible("TopIce3", false);
}
if(super.fm.getAltitude() > 5000F)
{
timeCounterCleanIce1 += f;
if(timeCounterCleanIce1 >= timeCleanIce1)
{
timeCounterCleanIce1 = 0.0F;
timeCleanIce1 = 0.0F;
CleanIceState1 = true;