#include <eWall.h>
Public Member Functions | |
eWall (eGrid *grid) | |
eHalfEdge * | Edge () const |
REAL | Len () const |
void | CalcLen () |
const eCoord & | EndPoint (int i) const |
eCoord | Point (REAL a) const |
eCoord | Vec () const |
virtual void | Flip () |
virtual bool | Splittable () const |
virtual bool | Deletable () const |
virtual void | Split (eWall *&w1, eWall *&w2, REAL a) |
void | SplitComplete (eWall *&w1, eWall *&w2, REAL a) |
virtual bool | Massive () const |
virtual void | PassingGameObject (eGameObject *pass, REAL time, REAL pos, int recursion=1) |
virtual void | SplitByActive (eWall *oldWall) |
virtual void | SplitByPassive (eWall *newWall) |
virtual bool | RunsParallelActive (eWall *oldWall) |
virtual bool | RunsParallelPassive (eWall *newWall) |
virtual void | Render (const eCamera *cam) |
virtual REAL | Height () const |
virtual REAL | BlockHeight () const |
virtual REAL | SeeHeight () const |
void | BlocksCamera (eCamera *cam, REAL height) const |
called by the camera code when this wall is between the cycle and the camera | |
void | Insert () |
void | Remove () |
void | SetVisHeight (int v, REAL h) |
Public Attributes | |
int | id |
Protected Member Functions | |
tCHECKED_PTR (eWallHolder) holder_ | |
virtual void | OnBlocksCamera (eCamera *cam, REAL height) const |
called by the camera code when this wall is between the cycle and the camera | |
virtual | ~eWall () |
Protected Attributes | |
tJUST_CONTROLLED_PTR< eGrid > | grid |
REAL | len |
int | flipped |
Private Attributes | |
eWallView | view [MAX_VIEWERS] |
Friends | |
class | tReferencable< eWall > |
class | eWallView |
class | eWallHolder |
Definition at line 89 of file eWall.h.
eWall::eWall | ( | eGrid * | grid | ) |
Definition at line 56 of file eWall.cpp.
References tHeap< T >::Insert(), MAX_VIEWERS, eWallView::Set(), and view.
00056 :holder_(NULL), grid(g), flipped(0) 00057 { 00058 id = -1; 00059 //Remove(); 00060 //initialize viewers 00061 for(int i=MAX_VIEWERS-1;i>=0;i--){ 00062 view[i].Set(i,this); 00063 se_wallsVisible[i].Insert(&view[i]); 00064 } 00065 }
eWall::~eWall | ( | ) | [protected, virtual] |
Definition at line 67 of file eWall.cpp.
References Insert(), MAX_VIEWERS, NULL, Remove(), tCHECK_DEST, and view.
00068 { 00069 if (holder_ ) 00070 holder_->wall_ = NULL; 00071 00072 for(int i=MAX_VIEWERS-1;i>=0;i--) 00073 se_wallsVisible[i].Remove(&view[i]); 00074 tCHECK_DEST; 00075 00076 Insert(); 00077 }
eWall::tCHECKED_PTR | ( | eWallHolder | ) | [protected] |
eHalfEdge * eWall::Edge | ( | ) | const |
Definition at line 79 of file eWall.cpp.
References NULL.
Referenced by gEnemyInfluence::AddWall(), CalcLen(), gCycleChatBot::Sensor::DoExtraDetectionStuff(), EndPoint(), eCameraSensor::LookAround(), eSensor::PassEdge(), eGrid::ProcessWallsInRange(), eWallRim::Render(), gWallRim::RenderReal(), sg_TopologyPoliceCheck(), gPlayerWall::SplitByActive(), and Vec().
00080 { 00081 if ( holder_ ) 00082 { 00083 return static_cast< eHalfEdge* >( holder_ ); 00084 } 00085 else 00086 { 00087 return NULL; 00088 } 00089 }
REAL eWall::Len | ( | ) | const [inline] |
Definition at line 115 of file eWall.h.
Referenced by draw_eWall(), and eCameraSensor::PassEdge().
00115 {return len;}
void eWall::CalcLen | ( | ) |
Definition at line 91 of file eWall.cpp.
References Edge(), len, sqrt(), and Vec().
Referenced by gNetPlayerWall::real_Update(), eHalfEdge::SetWall(), and eHalfEdge::Split().
const eCoord & eWall::EndPoint | ( | int | i | ) | const |
Definition at line 228 of file eWall.cpp.
References Edge(), flipped, eHalfEdge::Other(), eHalfEdge::Point(), and se_zeroCoord.
Referenced by draw_eWall(), cWidget::Map::DrawRimWalls(), eCameraSensor::PassEdge(), Point(), gWallRim::RenderReal(), S_BlowHoles(), and eWallRim::UpdateBounds().
00228 { 00229 eHalfEdge* edge = this->Edge(); 00230 00231 if (edge) 00232 { 00233 if (flipped != i) 00234 return *edge->Other()->Point(); 00235 else 00236 return *(edge->Point()); 00237 } 00238 else 00239 return se_zeroCoord; 00240 }
eCoord eWall::Point | ( | REAL | a | ) | const |
Definition at line 242 of file eWall.cpp.
References eCoord, and EndPoint().
Referenced by gCycle::PassEdge(), gCycleExtrapolator::PassEdge(), eSensor::PassEdge(), and gPlayerWall::RunsParallelActive().
00242 { 00243 eCoord beg = EndPoint(0); 00244 eCoord end = EndPoint(1); 00245 00246 return beg + ( end - beg ) * a; 00247 }
eCoord eWall::Vec | ( | ) | const |
Definition at line 249 of file eWall.cpp.
References eCoord, Edge(), flipped, and eHalfEdge::Vec().
Referenced by CalcLen(), gCycleExtrapolator::EdgeIsDangerous(), eSensor::PassEdge(), and S_BlowHoles().
00249 { 00250 eHalfEdge* edge = this->Edge(); 00251 00252 if (edge) 00253 return (edge->Vec())*((1 - 2*flipped)*.5f); 00254 else 00255 return eCoord(0,0); 00256 }
virtual void eWall::Flip | ( | ) | [inline, virtual] |
Reimplemented in gPlayerWall.
Definition at line 126 of file eWall.h.
References flipped.
Referenced by gPlayerWall::Flip(), and eHalfEdge::SetWall().
bool eWall::Splittable | ( | ) | const [virtual] |
Reimplemented in eWallRim, gWallRim, and gPlayerWall.
Definition at line 150 of file eWall.cpp.
Referenced by eHalfEdge::Check(), eTempEdge::CopyIntoGrid(), eGrid::DrawLine(), eHalfEdge::Split(), and eHalfEdge::Splittable().
bool eWall::Deletable | ( | ) | const [virtual] |
Reimplemented in gWallRim, and gPlayerWall.
Definition at line 153 of file eWall.cpp.
References tNEW.
Referenced by eHalfEdge::Split().
Definition at line 158 of file eWall.cpp.
00158 { 00159 /* 00160 if ( !edge ) 00161 return Split( s1, s2, a ); 00162 00163 eHalfEdge* other = edge->other(); 00164 00165 00166 situation: 00167 00168 *--------------* 00169 | / | 00170 | / | 00171 | e / | 00172 | /o | 00173 | / | 00174 | / | 00175 |/ | 00176 *--------------* 00177 00178 grid->Check(); 00179 */ 00180 }
virtual bool eWall::Massive | ( | ) | const [inline, virtual] |
Definition at line 141 of file eWall.h.
Referenced by eSensor::PassEdge().
void eWall::PassingGameObject | ( | eGameObject * | pass, | |
REAL | time, | |||
REAL | pos, | |||
int | recursion = 1 | |||
) | [virtual] |
Definition at line 182 of file eWall.cpp.
References eGameObject::Kill().
00182 { 00183 pass->Kill(); 00184 }
void eWall::SplitByActive | ( | eWall * | oldWall | ) | [virtual] |
Reimplemented in gPlayerWall.
Definition at line 186 of file eWall.cpp.
References SplitByPassive().
Referenced by gPlayerWall::SplitByActive().
00187 { 00188 if ( oldWall ) 00189 oldWall->SplitByPassive( this ); 00190 }
void eWall::SplitByPassive | ( | eWall * | newWall | ) | [virtual] |
Definition at line 192 of file eWall.cpp.
Referenced by SplitByActive().
bool eWall::RunsParallelActive | ( | eWall * | oldWall | ) | [virtual] |
Reimplemented in gPlayerWall.
Definition at line 196 of file eWall.cpp.
References RunsParallelPassive().
Referenced by eHalfEdge::SetWall().
00197 { 00198 if ( oldWall ) 00199 return oldWall->RunsParallelPassive( this ); 00200 else 00201 return true; 00202 }
bool eWall::RunsParallelPassive | ( | eWall * | newWall | ) | [virtual] |
Reimplemented in gWallRim.
Definition at line 204 of file eWall.cpp.
Referenced by gPlayerWall::RunsParallelActive(), and RunsParallelActive().
virtual void eWall::Render | ( | const eCamera * | cam | ) | [inline, virtual] |
Reimplemented in eWallRim, and gPlayerWall.
Definition at line 161 of file eWall.h.
Referenced by draw_eWall().
virtual REAL eWall::Height | ( | void | ) | const [inline, virtual] |
Reimplemented in eWallRim, and gWallRim.
Definition at line 165 of file eWall.h.
Referenced by draw_eWall(), and eCameraSensor::PassEdge().
virtual REAL eWall::BlockHeight | ( | ) | const [inline, virtual] |
virtual REAL eWall::SeeHeight | ( | void | ) | const [inline, virtual] |
Reimplemented in eWallRim, gWallRim, and gPlayerWall.
Definition at line 167 of file eWall.h.
Referenced by SetVisHeight().
called by the camera code when this wall is between the cycle and the camera
cam | the camera that is blocked | |
height | the maximal height the wall would be allowed to have without blocking the view |
Definition at line 213 of file eWall.h.
References OnBlocksCamera().
Referenced by eCameraSensor::LookAround().
00214 { 00215 OnBlocksCamera( cam, height ); 00216 }
void eWall::Insert | ( | ) |
Reimplemented in gPlayerWall.
Definition at line 217 of file eWall.cpp.
References grid.
Referenced by eTempEdge::CopyIntoGrid(), gPlayerWall::Insert(), and ~eWall().
void eWall::Remove | ( | ) |
Definition at line 223 of file eWall.cpp.
References grid.
Referenced by gNetPlayerWall::MyInitAfterCreation(), gNetPlayerWall::PartialCopyIntoGrid(), and ~eWall().
void eWall::SetVisHeight | ( | int | v, | |
REAL | h | |||
) |
Definition at line 209 of file eWall.cpp.
References EPS, SeeHeight(), eWallView::SetValue(), and view.
Referenced by gNetPlayerWall::MyInitAfterCreation().
00209 { 00210 if (h>=SeeHeight()-EPS) 00211 view[v].SetValue(h); 00212 else 00213 view[v].SetValue(-1000); 00214 }
called by the camera code when this wall is between the cycle and the camera
camera | the camera that is blocked | |
height | the maximal height the wall would be allowed to have without blocking the view |
Reimplemented in gWallRim.
Definition at line 319 of file eWall.cpp.
Referenced by BlocksCamera().
friend class tReferencable< eWall > [friend] |
friend class eWallHolder [friend] |
eWallView eWall::view[MAX_VIEWERS] [private] |
Definition at line 96 of file eWall.h.
Referenced by eWallView::Belongs(), eWall(), SetVisHeight(), and ~eWall().
tJUST_CONTROLLED_PTR<eGrid> eWall::grid [protected] |
REAL eWall::len [protected] |
int eWall::flipped [protected] |