Example #1
0
 private static function setElevation()
 {
     $pitch = self::$pitch;
     if ($pitch < 0.5 && $pitch > -0.5) {
         self::$elevation = floor($pitch * 4 * floor(self::$height / 2));
     } else {
         if ($pitch < 0) {
             $pitch = -1 - $pitch;
         } else {
             $pitch = 1 - $pitch;
         }
         self::$elevation = floor($pitch * 4 * floor(self::$height / 2));
     }
     if (self::$roll >= 0) {
         self::$elevation = floor(self::$elevation * 2 * abs(self::$roll - 0.5));
     } else {
         self::$elevation = floor(self::$elevation * 2 * abs(self::$roll + 0.5));
     }
 }