#include <eAdvWall.h>
Public Member Functions | |
eWallRim (eGrid *grid, bool backface_cull=true, REAL h=10000000) | |
virtual | ~eWallRim () |
virtual bool | Splittable () const |
virtual void | RenderReal (const eCamera *cam)=0 |
virtual void | Render (const eCamera *cam) |
virtual REAL | Height () const |
virtual REAL | SeeHeight () const |
virtual REAL | BlockHeight () const |
Static Public Member Functions | |
static bool | IsBound (const eCoord &x, REAL offset=0) |
is x by offset inside the bounds of the rim eWalls? | |
static void | RenderAll (eCamera *camera) |
renders all rim walls | |
static void | DestroyDisplayList () |
destroys the display list (call when geometry is updated) | |
static REAL | Bound (eCoord &x, REAL offset=0) |
brings x into the bounds of the rim eWalls with a min distance of offset | |
static REAL | Clip (const eCoord &in, eCoord &out, REAL offset=0) |
brings out inside the bounds of the rim walls, moving it closer to in. | |
static eRectangle const & | GetBounds () |
returns the bounding rectangle enclosing all rim walls | |
static void | UpdateBounds () |
updates the bounding rectangle enclosing all rim walls (call after arena buildup) | |
Protected Attributes | |
int | rim_id |
bool | bf_cull |
REAL | height |
Definition at line 37 of file eAdvWall.h.
Definition at line 49 of file eAdvWall.cpp.
References tList< T, MALLOC, REFERENCE >::Add(), DestroyDisplayList(), height, rim_id, and sr_highRim.
00050 :eWall(grid), rim_id(-1),bf_cull(backface_cull), height(h) 00051 { 00052 if (h>100 && !sr_highRim) 00053 height=4; 00054 00055 // if(bf_cull && sr_ZTrick) 00056 se_rimWalls.Add(this,rim_id); 00057 DestroyDisplayList();}
eWallRim::~eWallRim | ( | ) | [virtual] |
Definition at line 60 of file eAdvWall.cpp.
References DestroyDisplayList(), tList< T, MALLOC, REFERENCE >::Remove(), and rim_id.
00061 { 00062 se_rimWalls.Remove(this,rim_id); 00063 DestroyDisplayList(); 00064 }
bool eWallRim::Splittable | ( | ) | const [virtual] |
virtual void eWallRim::RenderReal | ( | const eCamera * | cam | ) | [pure virtual] |
virtual void eWallRim::Render | ( | const eCamera * | cam | ) | [inline, virtual] |
Reimplemented from eWall.
Definition at line 53 of file eAdvWall.h.
References eWall::Edge(), RenderReal(), and rim_id.
00053 { 00054 if (rim_id<0 && Edge() ) 00055 RenderReal(cam); 00056 }
virtual REAL eWallRim::Height | ( | void | ) | const [inline, virtual] |
virtual REAL eWallRim::SeeHeight | ( | void | ) | const [inline, virtual] |
Reimplemented from eWall.
Reimplemented in gWallRim.
Definition at line 61 of file eAdvWall.h.
References height.
Referenced by BlockHeight().
00061 {return height*40;}
virtual REAL eWallRim::BlockHeight | ( | ) | const [inline, virtual] |
Reimplemented from eWall.
Definition at line 63 of file eAdvWall.h.
References bf_cull, and SeeHeight().
bool eWallRim::IsBound | ( | const eCoord & | x, | |
REAL | offset = 0 | |||
) | [static] |
is x by offset inside the bounds of the rim eWalls?
x | point to be checked | |
offset | extra distance kept to the walls |
Definition at line 112 of file eAdvWall.cpp.
References eRectangle::Contains(), and se_OffsetBounds().
Referenced by eGameObject::TimestepThisWrapper().
00113 { 00114 // return true; 00115 return se_OffsetBounds( offset ).Contains( x ); 00116 }
void eWallRim::RenderAll | ( | eCamera * | camera | ) | [static] |
renders all rim walls
camera | camera used for rendering |
Definition at line 139 of file eAdvWall.cpp.
References rDisplayList::Call(), rDisplayList::IsRecording(), GrowingArrayBase::Len(), RenderEnd(), se_RimWallNoWrap, se_rimWalls, se_RimWallWrap, se_RimWrapY, and sg_MoviePack().
Referenced by eGrid::display_simple().
00140 { 00141 #ifndef DEDICATED 00142 // call or fill display list 00143 if ( se_rimDisplayList.Call() ) 00144 { 00145 return; 00146 } 00147 rDisplayListFiller filler( se_rimDisplayList ); 00148 00149 glEnable(GL_DEPTH_TEST); 00150 glDisable(GL_CULL_FACE); 00151 00152 if ( !sg_MoviePack() ) 00153 { 00154 ( se_RimWrapY ? se_RimWallWrap : se_RimWallNoWrap).Select(); 00155 } 00156 00157 for(int i=se_rimWalls.Len()-1;i>=0;i--){ 00158 se_rimWalls(i)->RenderReal( rDisplayList::IsRecording() ? 0 : camera ); 00159 } 00160 RenderEnd(); 00161 00162 glEnable(GL_CULL_FACE); 00163 #endif 00164 }
static rCallbackBeforeScreenModeChange unload & eWallRim::DestroyDisplayList | ( | ) | [static] |
destroys the display list (call when geometry is updated)
Definition at line 171 of file eAdvWall.cpp.
References rDisplayList::Clear().
Referenced by eWallRim(), gWallRim::OnBlocksCamera(), gWallRim::RenderReal(), and ~eWallRim().
00172 { 00173 #ifndef DEDICATED 00174 se_rimDisplayList.Clear( 3 ); 00175 #endif 00176 }
brings x into the bounds of the rim eWalls with a min distance of offset
x | point to be clamped to the inside of the rim walls | |
offset | extra distance kept to the walls |
Definition at line 94 of file eAdvWall.cpp.
References eRectangle::Clamp(), and se_OffsetBounds().
Referenced by eCamera::Bound(), eGameObject::Move(), eCamera::Render(), and sg_RespawnPlayer().
00095 { 00096 //return -1E+30; 00097 return se_OffsetBounds( offset ).Clamp( x ); 00098 }
brings out inside the bounds of the rim walls, moving it closer to in.
in | point inside of the rim | |
out | point possibly outside of the rim to correct | |
offset | extra distance kept to the walls |
Definition at line 193 of file eAdvWall.cpp.
References eRectangle::Clip(), and se_OffsetBounds().
Referenced by eGameObject::Move().
00194 { 00195 //return 1; 00196 return se_OffsetBounds( offset ).Clip(in, out); 00197 }
const eRectangle & eWallRim::GetBounds | ( | void | ) | [static] |
returns the bounding rectangle enclosing all rim walls
Definition at line 209 of file eAdvWall.cpp.
Referenced by cWidget::Map::DrawMap(), cWidget::Map::DrawRimWalls(), gArena::GetRandomPos(), and infinity_xy_plane().
00210 { 00211 return se_rimWallBounds; 00212 }
void eWallRim::UpdateBounds | ( | void | ) | [static] |
updates the bounding rectangle enclosing all rim walls (call after arena buildup)
Definition at line 225 of file eAdvWall.cpp.
References eRectangle::Clear(), eWall::EndPoint(), tCoord::GrahamScan(), Include(), eRectangle::Include(), GrowingArrayBase::Len(), se_rimWallRubberBand, and se_rimWalls.
Referenced by gArena::PrepareGrid().
00226 { 00227 std::vector<tCoord> allPoints; 00228 00229 // calculate bounding box 00230 se_rimWallBounds.Clear(); 00231 for(int i = se_rimWalls.Len()-1; i>=0; --i ) 00232 { 00233 eWall * w = se_rimWalls(i); 00234 se_rimWallBounds.Include(w->EndPoint(0)).Include(w->EndPoint(1)); 00235 allPoints.push_back(w->EndPoint(0)); 00236 allPoints.push_back(w->EndPoint(1)); 00237 } 00238 00239 //calculate the bounding polygon of the map 00240 tCoord::GrahamScan(allPoints, se_rimWallRubberBand); 00241 }
int eWallRim::rim_id [protected] |
bool eWallRim::bf_cull [protected] |
REAL eWallRim::height [protected] |
Definition at line 41 of file eAdvWall.h.
Referenced by eWallRim(), Height(), gWallRim::RenderReal(), SeeHeight(), and gWallRim::Split().