/*
Copyright (C) 1997, 1998, 1999, 2000 by Alex Pfaffe
(Digital Dawn Graphics Inc)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _ddgEcoSystem_Class_
#define _ddgEcoSystem_Class_
#include "math/ddgvec.h"
#include "math/ddgchull.h"
class ddgImage;
class ddgTBinMesh;
class ddgCHull3;
class ddgPlane3;
class ddgEcoBlock;
class ddgBBox3;
class WEXP ddgEcoSystem {
friend class ddgEcoBlock;
unsigned int _size;
ddgTBinMesh *_mesh;
ddgImage *_ecoMap;
ddgVector3 *_pos;
ddgBBox3 *_bbox;
ddgVector3 _osize;
unsigned char _min;
unsigned char _max;
float _farClip;
float _farClipSQ;
public:
ddgEcoBlock **ecoBlocks;
unsigned int blockNum;
ddgEcoSystem( unsigned int s, ddgTBinMesh *m,
ddgBBox3 *b, ddgVector3 *o,
ddgImage *e = NULL, unsigned char min = 0, unsigned char max = 255,
float f = 100)
: ecoBlocks(0), blockNum(0), _size(s), _mesh(m), _bbox(b), _osize(o), _ecoMap(e), _min(min), _max(max), _farClip(f), _farClipSQ(f*f) {}
~ddgEcoSystem(void);
bool init(void);
};
class WEXP ddgEcoBlock {
ddgInside _vis;
unsigned int _size;
ddgEcoSystem *_es;
public:
ddgBBox3 *bbox;
ddgVector3 *pos;
ddgEcoBlock( ddgEcoSystem *es, unsigned int s, ddgBBox3 *b)
: _es(es), _size(s), bbox(b) {}
bool init( ddgEcoSystem *e);
ddgInside vis( ddgCHull3 *frustrum, ddgVector2 pos );
ddgInside vis( void ) { return _vis; }
unsigned int size(void) { return _size; }
ddgVector3 osize(void) { return _es->_osize; }
};
#endif