Source: src/glsolid.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
	vim:tabstop=4
						glsolid.h  -  description
                        	-------------------
	begin				: Wed Jul 4 2001
	copyright			: (C) 2001 by Francois Biot
	email				: fbiot@mail.dotcom.fr
 ***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef GLSOLID_H
#define GLSOLID_H

#include 

/**
  * A glsolid is a class that must be entirely closed if the
  * collision dection mechanism has to be used.
  */
class glsolid : public glsurface
{
public:
	glsolid(const CString& sName)	:	glsurface(sName)	{};
	virtual	~glsolid();

	// from glsurface
	virtual	void		Translate	(const vect&);
	virtual	void		Render		() const;
	virtual	glsurface*	Duplicate	()const=0;
	virtual planesurf*	Collision	(
							const point	&poStart,
							const vect	&vPath,
							point*		pptInter,
							glsolid*	&pSolid);
	virtual	void		SetColor	(const couleur&);
	virtual point		GPoint		() const;
	
	// new methods
	virtual	bool		UpdatePosition	(float dt,zone* p=0);
	virtual	bool		UpdatePosition	(float dt,zone &p)
						{	return UpdatePosition(dt,&p);	};
	void				Clear		();



	// Check if a point is inside the glsolid
	// The check is made inside the border
	//bool	IsInsideFast(point &p);
	virtual	bool	IsInside	(const point &p) const=0;	

	const vitesse&		GetSpeed		()	const	{	return	mv;	};
	const acceleration&	GetAcceleration	()	const	{	return	ma;	};

	void	SetSpeed		(const vitesse	&v)		{	mv=v;		};
	void	SetAcceleration	(const acceleration &a)	{	ma=a;		};

	void	AddBorder		(glsurface	*p)			{	mlborder.push_back(p);	};
	void	AddSurface		(glsurface	*p)			{	mlist.push_back(p);		};
	
protected:
	vitesse				mv;
	acceleration		ma;
	CList	mlborder;
	CList	mlist;
	float				mdt;
	
	// This method is used to duplicate both mlborder & mlist into a glsolid
	void	FillSolid(glsolid*) const;

private:
	glsolid&	operator=(const glsolid&);
	glsolid(const glsolid&);
	
};



#endif

Generated by: saturn on FrancoisLinux on Sun Feb 3 20:01:44 2002, using kdoc 2.0a53.