/***************************************************************************
 *   Copyright (C) 2004-2005 by                                            *
 *     Paolo Sacconier   <axa1981@tin.it>                                  *
 *     Francesco Tamagni <minchiahead@hacari.org>                          *
 *                                                                         *
 *   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 2 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, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef GILLOSIMPLEBALL_H
#define GILLOSIMPLEBALL_H

#include "entity.h"

namespace gillo {

/**
A simple ssg ball.

@author $AUTHOR$
*/
class SimpleBall : public Entity
{
public:
	static const sgVec4 p1[3];
	static const sgVec4 ne[3];
	static const sgVec4 p2[3];
	static const double weight = ODE_BALL_MASS;
	static const double radius = ODE_BALL_RADIUS;
    
	SimpleBall(Context& c);
	SimpleBall(Context& c, float size, ssgSimpleState* state);
	void update(float dt);
	inline float getScore() { return score; }
	void setScore(float s);
	inline void setPossessionIncrement(float pi) { this->possessionIncrement = pi; };
	void setSize(float size);
	inline float getSize() { return currentSize; }

private:
	float	possessionIncrement;
	float	score;
	float targetSize;
	float currentSize;
	dMass	mass;
	ssgSimpleState* state;
	ssgCutout* ballEffectPtr;
	ssgaFire* fire_obj;
	
	void Init(char* s);
	ssgEntity* createEffect(char* s, int stateId);
};

};

#endif
