


#include	"..\SCOL\ZooSCOL.h"





// definition d'une boite
struct Atcbox
{
	int			type;
    int			first;
    int			active;								// boite active si !=0 
    ZVector3	m;									// coordonnees du milieu 
    ZVector3	n[6];
    float		d[6];
    float		sizemax;
};
typedef struct Atcbox *atcbox;




// definition d'un lien
struct Linkbox
{
    short num;
    short nxt;
};
typedef struct Linkbox *linkbox;



struct BoxNet
{
	atcbox box;
	linkbox link;
	int nbox;
	int nlink;
	int maxbox;
	int maxlink;
};
typedef struct BoxNet *boxnet;



/* initialisation des structures d'anticollision */
int BOXinit(boxnet s,int nbox,int nlink);

/* reinitialisation des structures d'anticollision */
int BOXreset(boxnet s);

/* liberation des structures d'anticollision */
int BOXend(boxnet s);

/* lecture des boites */
int BOXload(boxnet s,char *file);

/* projette le point p sur un ensemble de boites (utiliser au debut) */
int BOXprojection(boxnet s, ZVector3 *u, ZVector3 *p, int rayon);

/* nouvelle position suite a un deplacement */
int BOXmove(boxnet s, int lastbox, ZVector3 *newpos, int rayon);

/* recuperation du centre d'une boite */
int BOXcenter(boxnet s, int n, ZVector3 *v);

/* recuperation du numero d'une boite en fonction de son type */
int BOXbyNum(boxnet s,int n);

/* activation d'une boite */
int BOXactivate(boxnet s,int n);

/* desactivation d'une boite */
int BOXdesactivate(boxnet s,int n);

/* recuperation de la taille d'une boite */
int BOXsize(boxnet s,int n);

/* recuperation du type d'une boite */
int BOXnumber(boxnet s,int n);

