hedgewars/uGearsUtils.pas
changeset 7825 1b96361a7ef4
parent 7767 d1ea9b3f543e
child 8003 7d8bce524daf
equal deleted inserted replaced
7824:3df73ec7fcf2 7825:1b96361a7ef4
   321 
   321 
   322 procedure CalcRotationDirAngle(Gear: PGear);
   322 procedure CalcRotationDirAngle(Gear: PGear);
   323 var 
   323 var 
   324     dAngle: real;
   324     dAngle: real;
   325 begin
   325 begin
   326 // Frac/Round to be kind to JS as of 2012-08-27 where there is yet no int64/uint64
   326     // Frac/Round to be kind to JS as of 2012-08-27 where there is yet no int64/uint64
   327     dAngle := (Gear^.dX.Round + Gear^.dY.Round) / 2 + (Gear^.dX.Frac+Gear^.dY.Frac) / $80000000;
   327     //dAngle := (Gear^.dX.QWordValue + Gear^.dY.QWordValue) / $80000000;
       
   328     dAngle := (Gear^.dX.Round + Gear^.dY.Round) / 2 + (Gear^.dX.Frac/$100000000+Gear^.dY.Frac/$100000000);
   328     if not Gear^.dX.isNegative then
   329     if not Gear^.dX.isNegative then
   329         Gear^.DirAngle := Gear^.DirAngle + dAngle
   330         Gear^.DirAngle := Gear^.DirAngle + dAngle
   330     else
   331     else
   331         Gear^.DirAngle := Gear^.DirAngle - dAngle;
   332         Gear^.DirAngle := Gear^.DirAngle - dAngle;
   332 
   333