52 unsigned _nSegmentIndex;
63 unsigned _nBackgroundElement;
66 unsigned _nLitterBoxCount;
70 laTile _arTiles[M_SEGW][M_SEGH];
71 unsigned _nCompilationID;
73 unsigned _nCollisionDomains;
74 unsigned _nCollisionDomainSize;
82 std::list<class laObject*> _listObjects;
83 M_BOOL _bObjectListReset;
85 inline void _migrate_object(
class laObject* pobj ) {
86 _listObjects.insert( _listObjects.begin(), pobj );
87 pobj->setSegment(
this );
90 void _init_object_list (
class laObject** par,
unsigned n );
94 double _arWave[M_SEGW+1];
100 double _arTerrainCurvitureParams[4];
102 void _update_curviture_parameters();
109 inline laSegment* previous()
const {
return _pPrev; }
110 inline laSegment* next()
const {
return _pNext; }
114 ASSERT(pnext,
"Can't set NULL for next domain");
116 _pNext->_pPrev =
this;
118 lastDomain()->setNextDomain( next()->firstDomain() );
130 void drawFx(
laRenderer *r,
const laPoint3 &pos);
134 void animate(laTimer &t);
142 void setTS(
laTileset* pTileset) { _pTileset = pTileset; };
143 void setLevel(
class laLevel* pLvl) { _pLevel = pLvl; };
145 void setBackgroundElement(
unsigned i) {_nBackgroundElement = i;};
148 unsigned getBackgroundElement() {
return _nBackgroundElement; }
150 inline laTile*
get(
int ix,
int iy) {
151 ASSERT( (ix>=0) && (ix<M_SEGW),
"ix out of bounds");
152 ASSERT( (iy>=0) && (iy<M_SEGH),
"iy out of bounds");
160 return _arTiles[ix]+iy;
163 inline laTile*
get(
const laPoint3 &pos ) {
169 void bulidDomains(laPoint3 pos);
170 inline unsigned collisionDomains() {
return _nCollisionDomains; }
172 unsigned countDomains(
unsigned range)
174 ASSERT(range,
"Nil range");
179 n += ps->collisionDomains();
182 while( ps && (--range) );
188 return get(0,0)->getDomain();
192 return get(M_SEGW-1, M_SEGH-1)->getDomain();
198 while( !(pd->countLines()) )
200 if( !(pd->nextDomain()) )
return pd;
201 pd = pd->nextDomain();
209 inline double getWave(
int nX) {
214 return _pPrev ? _pPrev->getWave(M_SEGW-1) : getWave(0);
215 else if( nX>=M_SEGW )
216 return _pNext ? _pNext->getWave(0) : getWave(M_SEGW-1);
223 double terrainZOffset(
int nX);
224 double terrainAngle(
int nX);
225 double terrainScale(
int nX);
227 inline void curvitureParams(
double* ar4) {
228 memcpy(ar4, _arTerrainCurvitureParams,
sizeof(
double)*4);
233 #endif //#ifndef M_SEGMENT_H
Level Terrain Building-block.
#define M_UNIT
Unit of 1 meter.
Interface for loadable objects.
Virtual interface for the Engine graphics renderer.
Base Class for Level Objects.