/*
 * Jeffrey Ladino - jnl22@ccs.neu.edu
 *
 * File: bb.h
 *
 * Change Log
 ************
 ** August 18, 1999 - Jeff Ladino
 * Created.
 *
 */

#ifndef MY_BB_H
#define MY_BB_H

#include "circle2d.h"
#include "character2d.h"
#include "simpledraw.h"

#define FULL_CIRCLE 6.283185

// bouncing ball object
// contains a bouncing ball and two characters
class bb{
 private:
  circle2d ball;
  Real radius;

  character2d led[2]; // 2 led digits in the bouncing ball

  vector3d position;
  vector3d velocity;
  
  unsigned long ballcolor;
  unsigned long ledcolor;

  Real rotation;
  Real angular_velocity;

  void setup(Real xc, Real yc, Real xv, Real yv, Real r);
  void movebb(Real xc, Real yc);

 public:
  bb();
  bb(Real xc, Real yc, Real xv, Real yv, Real r);
  bb(Real xc, Real yc, Real xv, Real yv, Real r, unsigned num);

  void init(Real xc, Real yc, Real xv, Real yv, Real r, Real av, 
	    unsigned num, unsigned long bc, unsigned long lc);

  void setballcolor(unsigned long color);
  void setledcolor(unsigned long color);
  void setangularvelocity(Real av);
  void setvelocity(vector3d& v);
  void setcenter(vector3d& v);

  vector3d& getcenter();
  vector3d& getvelocity();
  Real getradius();

  void draw(SimpleDraw& s, matrix3d m);
  void draw_color(SimpleDraw& s, matrix3d m);
  void move(Real xmin, Real ymin, Real xmax, Real ymax);
  void collide_with(bb& b, Real radius);
  void print();
};

#endif //#ifndef MY_BB_H

