Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 19c19
- < var svg_keys = ["LindSpeed","SpeedNonLint","SpeedLastDigitLint", "Horizon","bankPointer","bankPointerLineL", "bankPointerLineR","Compass","AltNonLintBig","AltNonLintSmall","AltLint","SlipSkid","CompassText","VSI","VSIText","PitchScale","HorizonLine"];
- ---
- > var svg_keys = ["LindSpeed","SpeedNonLint","SpeedLastDigitLint", "Horizon","bankPointer","bankPointerLineL", "bankPointerLineR","Compass","AltNonLintBig","AltNonLintSmall","AltLint","SlipSkid","CompassText","VSI","VSIText","HorizonLine", "PitchScale"];
- 22,27c22,27
- < m[key] = {};
- < m[key].Element = pfd.getElementById(key);
- < m[key].Element.updateCenter();
- < m[key].center = m[key].Element.getCenter();
- < m[key].roll = m[key].Element.createTransform();
- < m[key].pitch = m[key].Element.createTransform();
- ---
- > m[key] = nil;
- > m[key] = pfd.getElementById(key);
- > m[key].updateCenter();
- > m[key].trans = m[key].createTransform();
- > m[key].rot = m[key].createTransform();
- >
- 32,35c32,34
- <
- < m.bankPointerLineL.Element.set("clip", "rect(0,1024,768,459.500)");
- < m.bankPointerLineR.Element.set("clip", "rect(0,459.500,768,0)");
- < m.PitchScale.Element.set("clip", "rect(134,590,394,330)");
- ---
- > m.bankPointerLineL.set("clip", "rect(0,1024,768,459.500)");
- > m.bankPointerLineR.set("clip", "rect(0,459.500,768,0)");
- > m.PitchScale.set("clip", "rect(134,590,394,330)");
- 40,60c39,61
- < updateAi: func(Roll,Pitch){
- < #offset = 392.504021806/2;
- < offset = 10;
- < #if(Pitch < 1.3962634)
- < #{
- < # Pitch = 1.3962634;
- < #}
- < #elsif (Pitch > -1.3962634)
- < #{
- < # Pitch = 1.3962634;
- < #};
- < RollR = -Roll*D2R;
- <
- < Bpc = me.bankPointer.Element.getCenter();
- < me.bankPointer.roll.setRotation(RollR, Bpc);
- < me.bankPointerLineL.roll.setRotation(RollR, Bpc);
- < me.bankPointerLineR.roll.setRotation(RollR, Bpc);
- <
- < me.Horizon.roll.setRotation(RollR, Bpc);
- < me.HorizonLine.roll.setRotation(RollR, Bpc);
- < me.PitchScale.roll.setRotation(RollR, Bpc);
- ---
- > updateAi: func(roll,pitch){
- > if (pitch > 80 )
- > {
- > pitch = 80;
- > }
- > elsif(pitch < -80)
- > {
- > pitch = -80;
- > }
- >
- > RollR = -roll*D2R;
- >
- > me.Horizon.rot.setRotation(RollR, me.PitchScale.getCenter());
- > me.Horizon.trans.setTranslation(0,pitch*6.8571428);
- > me.HorizonLine.rot.setRotation(RollR, me.PitchScale.getCenter());
- > me.HorizonLine.trans.setTranslation(0,pitch*6.8571428);
- > me.PitchScale.rot.setRotation(RollR, me.PitchScale.getCenter());
- > me.PitchScale.trans.setTranslation(0,pitch*6.8571428);
- >
- > brot = me.bankPointer.getCenter();
- > me.bankPointer.rot.setRotation(RollR,brot);
- > me.bankPointerLineL.rot.setRotation(RollR,brot);
- > me.bankPointerLineR.rot.setRotation(RollR,brot);
- 62d62
- < print(Bpc);
- 65,66c65,66
- < me.bankPointerLineL.Element.set("clip", "rect(0,1,1,0)"); #459,500
- < me.bankPointerLineR.Element.set("clip", "rect(0,459.500,768,0)");
- ---
- > me.bankPointerLineL.set("clip", "rect(0,1,1,0)"); #459,500
- > me.bankPointerLineR.set("clip", "rect(0,459.500,768,0)");
- 70,71c70,71
- < me.bankPointerLineL.Element.set("clip", "rect(0,1024,768,459.500)"); #459,500
- < me.bankPointerLineR.Element.set("clip", "rect(0,1,1,0)");
- ---
- > me.bankPointerLineL.set("clip", "rect(0,1024,768,459.500)"); #459,500
- > me.bankPointerLineR.set("clip", "rect(0,1,1,0)");
- 75,76c75,76
- < me.bankPointerLineL.Element.set("clip", "rect(0,1024,768,459.500)"); #459,500
- < me.bankPointerLineR.Element.set("clip", "rect(0,459.500,768,0)");
- ---
- > me.bankPointerLineL.set("clip", "rect(0,1024,768,459.500)"); #459,500
- > me.bankPointerLineR.set("clip", "rect(0,459.500,768,0)");
- 78,80d77
- < me.Horizon.pitch.setTranslation(0,Pitch*offset);
- < me.HorizonLine.pitch.setTranslation(0,Pitch*offset);
- < me.PitchScale.pitch.setTranslation(0,Pitch*offset);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement