eWallRim Class Reference

#include <eAdvWall.h>

Inheritance diagram for eWallRim:

Inheritance graph
[legend]
Collaboration diagram for eWallRim:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

Definition at line 37 of file eAdvWall.h.


Constructor & Destructor Documentation

eWallRim::eWallRim ( eGrid grid,
bool  backface_cull = true,
REAL  h = 10000000 
)

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();}

Here is the call graph for this function:

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 }

Here is the call graph for this function:


Member Function Documentation

bool eWallRim::Splittable (  )  const [virtual]

Reimplemented from eWall.

Reimplemented in gWallRim.

Definition at line 70 of file eAdvWall.cpp.

00071 {
00072     return 0;
00073 }

virtual void eWallRim::RenderReal ( const eCamera cam  )  [pure virtual]

Implemented in gWallRim.

Referenced by Render().

Here is the caller graph for this function:

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     }

Here is the call graph for this function:

virtual REAL eWallRim::Height ( void   )  const [inline, virtual]

Reimplemented from eWall.

Reimplemented in gWallRim.

Definition at line 59 of file eAdvWall.h.

References height.

00059 {return height;}

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;}

Here is the caller graph for this function:

virtual REAL eWallRim::BlockHeight (  )  const [inline, virtual]

Reimplemented from eWall.

Definition at line 63 of file eAdvWall.h.

References bf_cull, and SeeHeight().

00063                                     {
00064         if (bf_cull)
00065             return 0;
00066         else
00067             return SeeHeight();
00068     }

Here is the call graph for this function:

bool eWallRim::IsBound ( const eCoord &  x,
REAL  offset = 0 
) [static]

is x by offset inside the bounds of the rim eWalls?

Parameters:
x point to be checked
offset extra distance kept to the walls
Returns:
true if the point is inside the rim

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

void eWallRim::RenderAll ( eCamera camera  )  [static]

renders all rim walls

Parameters:
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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

REAL eWallRim::Bound ( eCoord &  x,
REAL  offset = 0 
) [static]

brings x into the bounds of the rim eWalls with a min distance of offset

Parameters:
x point to be clamped to the inside of the rim walls
offset extra distance kept to the walls
Returns:
if positive, that's the distance moved. If negative, it's the distance to the rim.

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

REAL eWallRim::Clip ( const eCoord &  in,
eCoord &  out,
REAL  offset = 0 
) [static]

brings out inside the bounds of the rim walls, moving it closer to in.

Parameters:
in point inside of the rim
out point possibly outside of the rim to correct
offset extra distance kept to the walls
Returns:
fraciton of line in->out left (1 for no clipping)

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

const eRectangle & eWallRim::GetBounds ( void   )  [static]

returns the bounding rectangle enclosing all rim walls

Returns:

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 }

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

int eWallRim::rim_id [protected]

Definition at line 39 of file eAdvWall.h.

Referenced by eWallRim(), Render(), and ~eWallRim().

bool eWallRim::bf_cull [protected]

Definition at line 40 of file eAdvWall.h.

Referenced by BlockHeight().

REAL eWallRim::height [protected]

Definition at line 41 of file eAdvWall.h.

Referenced by eWallRim(), Height(), gWallRim::RenderReal(), SeeHeight(), and gWallRim::Split().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:32:29 2008 for Armagetron Advanced by  doxygen 1.5.4