/*
	Asteroids
    Copyright (C) 2006  Darragh Coy.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/*##############################################################################

Header name: Asteroid.hpp

##############################################################################*/

#ifndef ASTEROID_HPP
#define ASTEROID_HPP

   /****************************************************************************
   Defines
   ****************************************************************************/
   
      #define AST_NUM_POINTS       16      // Number of points in a fully formed asteroid
      #define AST_MAX_ASTEROIDS    64      // Maximum number of asteroids (full ones!)
      #define AST_INIT_ASTEROIDS   4       // How many asteroids at the start ?
      #define AST_MAX_RADIUS       32.0f   // Maximum radius of the asteroid                                       
      #define AST_MIN_RADIUS       2.0f    // Maximum radius of the asteroid
      #define AST_MIN_SPEED        6       // Minimum asteroid speed
      #define AST_OFFSCREEN_DIST   256     // Distance the asteroid has to be before it is offscreen    
      #define AST_MAX_ROTATE_SPEED 80      // Maximum speed of rotation      
      #define AST_MIN_ROTATE_SPEED 10      // Minimum speed of rotation    
      #define AST_MIN_SPAWN_FREQ   0.8f    // How many seconds till another asteroid spawns ? Minimum.
      
      // Difficulty settings: very sensitive to change- modify carefully!
      
      #define AST_SCORE_POINTS_HALF 5               // Number of score points gained when a small asteroid is destroyed   
      #define AST_SCORE_POINTS_FULL 10              // Number of score points gained when a big asteroid is destroyed   
      
      #define AST_SCORE_SPEED_EXPONENT 0.42f        // Mul speed by exp(score,speedExp) to asteroid speed when creating
                                                    // Means asteroids get faster and harder as player score increases  

      #define AST_SCORE_FREQ_EXPONENT 0.14f         // Divide spawn time by pow(score+1,freqExponent)
                                                    // To get minimum delay between spawns                                                    
      
   /****************************************************************************
   Includes
   ****************************************************************************/
      
	  #include <Windows.h>	// Windows
      #include <gl/gl.h>    // OpenGL
      #include <stdlib.h>   // memset func
      #include <time.h>     // clock func
      #include "Vec2D.h"    // Vector operations
      #include "GLWin.h"    // Window information
      #include "Game.h"     // Game information
   
   /****************************************************************************
   Externs
   ****************************************************************************/   
   
      //..
      
   /****************************************************************************
   Structs and enums
   ****************************************************************************/
      
      //..

   /****************************************************************************
   Prototypes
   ****************************************************************************/   
   
   void Asteroid_Init   ( struct GameData_t * gamedata ); // Initialise asteroid data                          
   void Asteroid_Draw   ( struct GameData_t * gamedata ); // Draw all active asteroids
   void Asteroid_Move   ( struct GameData_t * gamedata ); // Do the movements for all asteroids 
  
   // Is a point inside the given asteroid ?
   
   bool Asteroid_Inside ( struct Vec2D_t * point , struct Asteroid_t * asteroid );
   
   // Set the bounding sphere of an asteroid
   
   void Asteroid_SetBoundingSphere(struct Asteroid_t * asteroid);
   
   // Shift all asteroids by a given amount
   
   void Asteroid_Shift ( struct GameData_t * gamedata , float x , float y);  
   
   // Try and split up an asteroid into two:
          
   void Asteroid_Split ( GameData_t * gamedata , Asteroid_t * asteroid );
   
#endif
