#include <gWinZone.h>
Public Member Functions | |
gZone (eGrid *grid, const eCoord &pos) | |
local constructor | |
gZone (nMessage &m) | |
network constructor | |
~gZone () | |
destructor | |
void | SetReferenceTime () |
sets the reference time to the current time | |
gZone & | SetPosition (eCoord const &position) |
Sets the current position. | |
eCoord | GetPosition (void) const |
Gets the current position. | |
gZone const & | GetPosition (eCoord &position) const |
Gets the current position. | |
gZone & | SetVelocity (eCoord const &velocity) |
Sets the current velocity. | |
eCoord | GetVelocity (void) const |
Gets the current velocity. | |
gZone const & | GetVelocity (eCoord &velocity) const |
Gets the current velocity. | |
gZone & | SetRadius (REAL radius) |
Sets the current radius. | |
REAL | GetRadius (void) const |
Gets the current radius. | |
gZone const & | GetRadius (REAL &radius) const |
Gets the current radius. | |
gZone & | SetExpansionSpeed (REAL expansionSpeed) |
Sets the current expansion speed. | |
REAL | GetExpansionSpeed (void) const |
Gets the current expansion speed. | |
gZone const & | GetExpansionSpeed (REAL &expansionSpeed) const |
Gets the current expansion speed. | |
gZone & | SetRotationSpeed (REAL rotationSpeed) |
Sets the current rotation speed. | |
REAL | GetRotationSpeed (void) const |
Gets the current rotation speed. | |
tCoord const & | GetRotation (void) const |
Gets the current rotation state. | |
gZone const & | GetRotationSpeed (REAL &rotationSpeed) const |
Gets the current rotation speed. | |
gZone & | SetRotationAcceleration (REAL rotationAcceleration) |
Sets the current acceleration of the rotation. | |
REAL | GetRotationAcceleration (void) const |
Gets the current acceleration of the rotation. | |
gZone const & | GetRotationAcceleration (REAL &rotationAcceleration) const |
Gets the current acceleration of the rotation. | |
rColor const & | GetColor (void) const |
Gets the current color. | |
Protected Member Functions | |
virtual bool | Timestep (REAL currentTime) |
simulates behaviour up to currentTime | |
virtual void | OnVanish () |
called when the zone vanishes | |
Protected Attributes | |
rColor | color_ |
the zone's color | |
REAL | createTime_ |
the time the zone was created at | |
REAL | referenceTime_ |
reference time for function evaluations | |
tFunction | posx_ |
time dependence of x component of position | |
tFunction | posy_ |
time dependence of y component of position | |
tFunction | radius_ |
time dependence of radius | |
tFunction | rotationSpeed_ |
the zone's rotation speed | |
eCoord | rotation_ |
the current rotation state | |
Private Member Functions | |
virtual void | WriteCreate (nMessage &m) |
writes data for network constructor | |
virtual void | WriteSync (nMessage &m) |
writes sync data | |
virtual void | ReadSync (nMessage &m) |
reads sync data | |
virtual void | InteractWith (eGameObject *target, REAL time, int recursion=1) |
looks for objects inzide the zone and reacts on them | |
virtual void | OnEnter (gCycle *target, REAL time) |
reacts on objects inside the zone | |
virtual nDescriptor & | CreatorDescriptor () const |
returns the descriptor to recreate this object over the network | |
REAL | Radius () const |
returns the current radius | |
virtual void | Render (const eCamera *cam) |
renders the zone | |
virtual void | Render2D (tCoord scale) const |
renders the zone | |
virtual bool | RendersAlpha () const |
returns whether the rendering uses alpha blending (massively, so sorting errors would show) | |
REAL | EvaluateFunctionNow (tFunction const &f) const |
evaluates the given function with lastTime - referenceTime_ as argument | |
void | SetFunctionNow (tFunction &f, REAL value) const |
makes sure EvaluateFunctionNow() returns the given value |
Definition at line 51 of file gWinZone.h.
gZone::gZone | ( | eGrid * | grid, | |
const eCoord & | pos | |||
) |
local constructor
grid | Grid to put the zone into | |
pos | Position to spawn the zone at |
Definition at line 131 of file gWinZone.cpp.
References eGameObject::AddToList(), createTime_, eSoundMixer::GetMixer(), eGameObject::lastTime, eSoundMixer::PushButton(), referenceTime_, SetPosition(), sg_Zones, and ZONE_SPAWN.
00132 :eNetGameObject( grid, pos, eCoord( 0,0 ), NULL, true ), rotation_(1,0) 00133 { 00134 // store creation time 00135 referenceTime_ = createTime_ = lastTime = 0; 00136 00137 // add to game grid 00138 this->AddToList(); 00139 00140 sg_Zones.push_back(this); 00141 00142 // initialize position functions 00143 SetPosition( pos ); 00144 eSoundMixer* mixer = eSoundMixer::GetMixer(); 00145 mixer->PushButton(ZONE_SPAWN, pos); 00146 }
gZone::gZone | ( | nMessage & | m | ) |
network constructor
m | Message to read creation data from |
Definition at line 158 of file gWinZone.cpp.
References eGameObject::AddToList(), tColor::b_, color_, createTime_, tColor::g_, eSoundMixer::GetMixer(), eGameObject::lastTime, eGameObject::pos, eSoundMixer::PushButton(), tColor::r_, referenceTime_, SetPosition(), sg_Zones, and ZONE_SPAWN.
00159 :eNetGameObject( m ), rotation_(1,0) 00160 { 00161 // read creation time 00162 m >> createTime_; 00163 referenceTime_ = lastTime = createTime_; 00164 00165 // initialize color to white, ReadSync will fill in the true value if available 00166 color_.r_ = color_.g_ = color_.b_ = 1.0f; 00167 00168 // add to game grid 00169 this->AddToList(); 00170 00171 sg_Zones.push_back(this); 00172 00173 // initialize position functions 00174 SetPosition( pos ); 00175 eSoundMixer* mixer = eSoundMixer::GetMixer(); 00176 mixer->PushButton(ZONE_SPAWN, pos); 00177 }
gZone::~gZone | ( | void | ) |
void gZone::SetReferenceTime | ( | void | ) |
sets the reference time to the current time
Definition at line 1429 of file gWinZone.cpp.
References EvaluateFunctionNow(), eGameObject::lastTime, posx_, posy_, radius_, referenceTime_, rotationSpeed_, and tFunction::SetOffset().
Referenced by gWinZoneHack::OnEnter(), sg_CreateWinDeathZone(), and gBaseZoneHack::Timestep().
01430 { 01431 // set offsets to current values 01432 this->posx_.SetOffset( EvaluateFunctionNow( this->posx_ ) ); 01433 this->posy_.SetOffset( EvaluateFunctionNow( this->posy_ ) ); 01434 this->radius_.SetOffset( EvaluateFunctionNow( this->radius_ ) ); 01435 this->rotationSpeed_.SetOffset( EvaluateFunctionNow( this->rotationSpeed_ ) ); 01436 01437 // reset time 01438 this->referenceTime_ = lastTime; 01439 }
gZone & gZone::SetPosition | ( | eCoord const & | position | ) |
Sets the current position.
position | the current position to set |
Definition at line 1243 of file gWinZone.cpp.
References posx_, posy_, and SetFunctionNow().
Referenced by gZone(), ReadSync(), and SetVelocity().
01244 { 01245 SetFunctionNow( posx_, position.x ); 01246 SetFunctionNow( posy_, position.y ); 01247 return *this; 01248 }
eCoord gZone::GetPosition | ( | void | ) | const |
Gets the current position.
Definition at line 1207 of file gWinZone.cpp.
References eCoord.
Referenced by SetVelocity().
01208 { 01209 eCoord ret; 01210 GetPosition( ret ); 01211 return ret; 01212 }
gZone const & gZone::GetPosition | ( | eCoord & | position | ) | const |
Gets the current position.
position | the current position to fill |
Definition at line 1225 of file gWinZone.cpp.
References EvaluateFunctionNow(), posx_, and posy_.
01226 { 01227 position.x = EvaluateFunctionNow( posx_ ); 01228 position.y = EvaluateFunctionNow( posy_ ); 01229 return *this; 01230 }
gZone & gZone::SetVelocity | ( | eCoord const & | velocity | ) |
Sets the current velocity.
velocity | the current velocity to set |
Definition at line 1298 of file gWinZone.cpp.
References eCoord, GetPosition(), eGameObject::pos, posx_, posy_, SetPosition(), and tFunction::SetSlope().
Referenced by ReadSync().
01299 { 01300 // backup position 01301 eCoord pos; 01302 GetPosition( pos ); 01303 01304 posx_.SetSlope( velocity.x ); 01305 posy_.SetSlope( velocity.y ); 01306 01307 // restore position 01308 SetPosition( pos ); 01309 01310 return *this; 01311 }
eCoord gZone::GetVelocity | ( | void | ) | const |
Gets the current velocity.
Definition at line 1260 of file gWinZone.cpp.
References eCoord.
01261 { 01262 eCoord ret; 01263 GetVelocity( ret ); 01264 01265 return ret; 01266 }
gZone const & gZone::GetVelocity | ( | eCoord & | velocity | ) | const |
Gets the current velocity.
velocity | the current velocity to fill |
Definition at line 1279 of file gWinZone.cpp.
References tFunction::GetSlope(), posx_, and posy_.
01280 { 01281 velocity.x = posx_.GetSlope(); 01282 velocity.y = posy_.GetSlope(); 01283 01284 return *this; 01285 }
Sets the current radius.
radius | the current radius to set |
Definition at line 1360 of file gWinZone.cpp.
References SetFunctionNow().
Referenced by gParser::parseZoneArthemis_v1(), SetExpansionSpeed(), and sg_CreateWinDeathZone().
01361 { 01362 SetFunctionNow( this->radius_, radius ); 01363 01364 return *this; 01365 }
REAL gZone::GetRadius | ( | void | ) | const |
Gets the current radius.
Definition at line 1323 of file gWinZone.cpp.
References EvaluateFunctionNow(), and REAL.
Referenced by GetRadius(), gWinZoneHack::OnEnter(), Radius(), gBaseZoneHack::Timestep(), and Timestep().
01324 { 01325 REAL ret = EvaluateFunctionNow( this->radius_ ); 01326 ret = ret > 0 ? ret : 0; 01327 01328 return ret; 01329 }
Gets the current radius.
radius | the current radius to fill |
Definition at line 1342 of file gWinZone.cpp.
References GetRadius().
01343 { 01344 radius = GetRadius(); 01345 01346 return *this; 01347 }
Sets the current expansion speed.
expansionSpeed | the current expansion speed to set |
Definition at line 1411 of file gWinZone.cpp.
References EvaluateFunctionNow(), radius_, REAL, SetRadius(), and tFunction::SetSlope().
Referenced by gWinZoneHack::OnEnter(), gParser::parseZoneArthemis_v1(), sg_CreateWinDeathZone(), and gBaseZoneHack::Timestep().
01412 { 01413 REAL r = EvaluateFunctionNow( this->radius_ ); 01414 this->radius_.SetSlope( expansionSpeed ); 01415 SetRadius( r ); 01416 01417 return *this; 01418 }
REAL gZone::GetExpansionSpeed | ( | void | ) | const |
Gets the current expansion speed.
Definition at line 1377 of file gWinZone.cpp.
References tFunction::GetSlope(), and radius_.
Referenced by gWinZoneHack::OnEnter(), and Timestep().
Gets the current expansion speed.
expansionSpeed | the current expansion speed to fill |
Definition at line 1393 of file gWinZone.cpp.
References tFunction::GetSlope(), and radius_.
Sets the current rotation speed.
rotationSpeed | The current rotation speed to set |
Definition at line 1499 of file gWinZone.cpp.
References SetFunctionNow().
Referenced by gParser::parseZoneArthemis_v1(), ReadSync(), SetRotationAcceleration(), sg_CreateWinDeathZone(), and gBaseZoneHack::Timestep().
01500 { 01501 SetFunctionNow( this->rotationSpeed_, rotationSpeed ); 01502 return *this; 01503 }
REAL gZone::GetRotationSpeed | ( | void | ) | const |
Gets the current rotation speed.
Definition at line 1451 of file gWinZone.cpp.
References EvaluateFunctionNow(), and rotationSpeed_.
Referenced by GetRotationSpeed(), SetRotationAcceleration(), gBaseZoneHack::Timestep(), and Timestep().
01452 { 01453 return EvaluateFunctionNow( rotationSpeed_ ); 01454 }
tCoord const & gZone::GetRotation | ( | void | ) | const |
Gets the current rotation state.
Definition at line 1466 of file gWinZone.cpp.
References rotation_.
01467 { 01468 return rotation_; 01469 }
Gets the current rotation speed.
rotationSpeed | The current rotation speed to fill |
Definition at line 1482 of file gWinZone.cpp.
References GetRotationSpeed().
01483 { 01484 rotationSpeed = this->GetRotationSpeed(); 01485 return *this; 01486 }
Sets the current acceleration of the rotation.
rotationAcceleration | the current acceleration of the rotation to set |
Definition at line 1563 of file gWinZone.cpp.
References GetRotationSpeed(), REAL, rotationSpeed_, SetRotationSpeed(), and tFunction::SetSlope().
Referenced by ReadSync(), and gBaseZoneHack::Timestep().
01564 { 01565 REAL omega = this->GetRotationSpeed(); 01566 this->rotationSpeed_.SetSlope( rotationAcceleration ); 01567 SetRotationSpeed( omega ); 01568 01569 return *this; 01570 }
REAL gZone::GetRotationAcceleration | ( | void | ) | const |
Gets the current acceleration of the rotation.
Definition at line 1515 of file gWinZone.cpp.
References tFunction::GetSlope(), and rotationSpeed_.
Referenced by GetRotationAcceleration(), and gBaseZoneHack::Timestep().
01516 { 01517 return this->rotationSpeed_.GetSlope(); 01518 }
Gets the current acceleration of the rotation.
rotationAcceleration | the current acceleration of the rotation to fill |
Definition at line 1531 of file gWinZone.cpp.
References GetRotationAcceleration().
01532 { 01533 rotationAcceleration = this->GetRotationAcceleration(); 01534 return *this; 01535 }
rColor const & gZone::GetColor | ( | void | ) | const |
Gets the current color.
Definition at line 1547 of file gWinZone.cpp.
References color_.
01548 { 01549 return color_; 01550 }
bool gZone::Timestep | ( | REAL | time | ) | [protected, virtual] |
simulates behaviour up to currentTime
time | the current time |
Reimplemented from eNetGameObject.
Reimplemented in gBaseZoneHack.
Definition at line 315 of file gWinZone.cpp.
References cos(), dt, eCoord, GetExpansionSpeed(), GetRadius(), GetRotationSpeed(), eGameObject::lastTime, eGameObject::Move(), OnVanish(), posx_, posy_, REAL, referenceTime_, rotation_, and sin().
Referenced by gBaseZoneHack::Timestep().
00316 { 00317 // rotate 00318 REAL speed = GetRotationSpeed(); 00319 REAL angle = ( time - lastTime ) * speed; 00320 // angle /= ( 1 + 2 * 3.14159 * angle/sg_segments ); 00321 rotation_ = rotation_.Turn( cos( angle ), sin( angle ) ); 00322 00323 // move to new position 00324 REAL dt = time - referenceTime_; 00325 Move( eCoord( posx_( dt ), posy_( dt ) ), lastTime, time ); 00326 00327 // update time 00328 lastTime = time; 00329 00330 // kill this zone if it shrunk down to zero radius 00331 if ( GetExpansionSpeed() < 0 && GetRadius() <= 0 ) 00332 { 00333 OnVanish(); 00334 return true; 00335 } 00336 00337 return false; 00338 }
void gZone::OnVanish | ( | void | ) | [protected, virtual] |
called when the zone vanishes
Reimplemented in gBaseZoneHack.
Definition at line 349 of file gWinZone.cpp.
Referenced by Timestep().
void gZone::WriteCreate | ( | nMessage & | m | ) | [private, virtual] |
writes data for network constructor
m | Message to write creation data to |
Reimplemented from eNetGameObject.
Definition at line 211 of file gWinZone.cpp.
References createTime_, and eNetGameObject::WriteCreate().
00212 { 00213 // delegate 00214 eNetGameObject::WriteCreate( m ); 00215 00216 m << createTime_; 00217 }
void gZone::WriteSync | ( | nMessage & | m | ) | [private, virtual] |
writes sync data
m | Message to write sync data to |
Reimplemented from eNetGameObject.
Definition at line 229 of file gWinZone.cpp.
References tColor::b_, color_, tColor::g_, posx_, posy_, tColor::r_, radius_, referenceTime_, rotationSpeed_, and eNetGameObject::WriteSync().
00230 { 00231 // delegate 00232 eNetGameObject::WriteSync( m ); 00233 00234 // write color 00235 m << color_.r_; 00236 m << color_.g_; 00237 m << color_.b_; 00238 00239 // write reference time and functions 00240 m << referenceTime_; 00241 m << posx_; 00242 m << posy_; 00243 m << radius_; 00244 00245 // write rotation speed 00246 m << rotationSpeed_; 00247 }
void gZone::ReadSync | ( | nMessage & | m | ) | [private, virtual] |
reads sync data
m | Message to read sync data from |
Reimplemented from eNetGameObject.
Definition at line 259 of file gWinZone.cpp.
References tColor::b_, color_, createTime_, eCoord, nMessage::End(), tColor::g_, eGameObject::pos, posx_, posy_, tColor::r_, radius_, eNetGameObject::ReadSync(), referenceTime_, rotationSpeed_, se_MakeColorValid(), tFunction::SetOffset(), SetPosition(), SetRotationAcceleration(), SetRotationSpeed(), tFunction::SetSlope(), SetVelocity(), sg_expansionSpeed, and sg_initialSize.
00260 { 00261 // delegage 00262 eNetGameObject::ReadSync( m ); 00263 00264 // read color 00265 if (!m.End()) 00266 { 00267 m >> color_.r_; 00268 m >> color_.g_; 00269 m >> color_.b_; 00270 se_MakeColorValid(color_.r_, color_.g_, color_.b_, 1.0f); 00271 } 00272 00273 // read reference time and functions 00274 if (!m.End()) 00275 { 00276 m >> referenceTime_; 00277 m >> posx_; 00278 m >> posy_; 00279 m >> radius_; 00280 } 00281 else 00282 { 00283 referenceTime_ = createTime_; 00284 00285 // take old default values 00286 this->radius_.SetOffset( sg_initialSize ); 00287 this->radius_.SetSlope( sg_expansionSpeed ); 00288 SetPosition( pos ); 00289 SetVelocity( eCoord() ); 00290 } 00291 00292 // read rotation speed 00293 if (!m.End()) 00294 { 00295 m >> rotationSpeed_; 00296 } 00297 else 00298 { 00299 // set fixed values 00300 SetRotationSpeed( .3f ); 00301 SetRotationAcceleration( 0.0f ); 00302 } 00303 }
void gZone::InteractWith | ( | eGameObject * | target, | |
REAL | time, | |||
int | recursion = 1 | |||
) | [private, virtual] |
looks for objects inzide the zone and reacts on them
target | the other game object | |
time | the current time | |
recursion | if set to true, don't recurse into other InteractWith functions (quite silly now that I think about it...) |
Reimplemented from eGameObject.
Definition at line 365 of file gWinZone.cpp.
References gCycleMovement::Alive(), OnEnter(), eNetGameObject::Player(), eGameObject::Position(), Radius(), and REAL.
00366 { 00367 gCycle* prey = dynamic_cast< gCycle* >( target ); 00368 if ( prey ) 00369 { 00370 REAL r = this->Radius(); 00371 if ( ( prey->Position() - this->Position() ).NormSquared() < r*r ) 00372 { 00373 if ( prey->Player() && prey->Alive() ) 00374 { 00375 OnEnter( prey, time ); 00376 } 00377 } 00378 } 00379 }
reacts on objects inside the zone
target | the cycle that has been found inside the zone | |
time | the current time |
Reimplemented in gWinZoneHack, gDeathZoneHack, and gBaseZoneHack.
Definition at line 392 of file gWinZone.cpp.
Referenced by InteractWith().
nDescriptor & gZone::CreatorDescriptor | ( | void | ) | const [private, virtual] |
returns the descriptor to recreate this object over the network
Implements nNetObject.
Definition at line 409 of file gWinZone.cpp.
References zone_init.
00410 { 00411 return zone_init; 00412 }
REAL gZone::Radius | ( | void | ) | const [private] |
returns the current radius
Definition at line 424 of file gWinZone.cpp.
References GetRadius().
Referenced by InteractWith(), Render(), and Render2D().
00425 { 00426 return GetRadius(); 00427 }
void gZone::Render | ( | const eCamera * | cam | ) | [private, virtual] |
renders the zone
cam | the camera used for rendering |
Reimplemented from eGameObject.
Definition at line 439 of file gWinZone.cpp.
References a, tColor::a_, rColor::Apply(), b, BeginLineStrip(), BeginQuads(), color_, cos(), createTime_, eGameObject::lastTime, ModelMatrix(), eGameObject::pos, Radius(), REAL, RenderEnd(), rotation_, sg_segments, sin(), and sr_alphaBlend.
00440 { 00441 #ifndef DEDICATED 00442 00443 color_.a_ = ( lastTime - createTime_ ) * .2f; 00444 if ( color_.a_ > .7f ) 00445 color_.a_ = .7f; 00446 if ( color_.a_ <= 0 ) 00447 return; 00448 00449 GLfloat m[4][4]={{rotation_.x,rotation_.y,0,0}, 00450 {-rotation_.y,rotation_.x,0,0}, 00451 {0,0,1,0}, 00452 {pos.x,pos.y,0,1}}; 00453 00454 ModelMatrix(); 00455 glPushMatrix(); 00456 00457 glDisable(GL_LIGHT0); 00458 glDisable(GL_LIGHT1); 00459 glDisable(GL_LIGHTING); 00460 glDisable(GL_CULL_FACE); 00461 glDepthMask(GL_FALSE); 00462 glBlendFunc( GL_SRC_ALPHA, GL_ONE ); 00463 00464 //glDisable(GL_TEXTURE); 00465 glDisable(GL_TEXTURE_2D); 00466 00467 // glTranslatef(pos.x,pos.y,0); 00468 00469 glMultMatrixf(&m[0][0]); 00470 // glScalef(.5,.5,.5); 00471 00472 if ( sr_alphaBlend ) 00473 BeginQuads(); 00474 else 00475 BeginLineStrip(); 00476 00477 const REAL seglen = .2f; 00478 const REAL bot = 0.0f; 00479 const REAL top = 5.0f; // + ( lastTime - createTime_ ) * .1f; 00480 00481 color_.Apply(); 00482 00483 REAL r = Radius(); 00484 for ( int i = sg_segments - 1; i>=0; --i ) 00485 { 00486 REAL a = i * 2 * 3.14159 / REAL( sg_segments ); 00487 REAL b = a + seglen; 00488 00489 REAL sa = r * sin(a); 00490 REAL ca = r * cos(a); 00491 REAL sb = r * sin(b); 00492 REAL cb = r * cos(b); 00493 00494 glVertex3f(sa, ca, bot); 00495 glVertex3f(sa, ca, top); 00496 glVertex3f(sb, cb, top); 00497 glVertex3f(sb, cb, bot); 00498 00499 if ( !sr_alphaBlend ) 00500 { 00501 glVertex3f(sa, ca, bot); 00502 RenderEnd(); 00503 BeginLineStrip(); 00504 } 00505 } 00506 00507 RenderEnd(); 00508 00509 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); 00510 glDepthMask(GL_TRUE); 00511 00512 glPopMatrix(); 00513 #endif 00514 }
void gZone::Render2D | ( | tCoord | scale | ) | const [private, virtual] |
renders the zone
Reimplemented from eGameObject.
Definition at line 516 of file gWinZone.cpp.
References a, tColor::a_, rColor::Apply(), b, BeginLines(), color_, cos(), ModelMatrix(), eGameObject::pos, Radius(), REAL, RenderEnd(), rotation_, sg_segments, and sin().
00516 { 00517 #ifndef DEDICATED 00518 if ( color_.a_ <= 0 ) 00519 return; 00520 00521 GLfloat m[4][4]={{rotation_.x,rotation_.y,0,0}, 00522 {-rotation_.y,rotation_.x,0,0}, 00523 {0,0,1,0}, 00524 {pos.x,pos.y,0,1}}; 00525 00526 ModelMatrix(); 00527 glPushMatrix(); 00528 00529 glMultMatrixf(&m[0][0]); 00530 // glScalef(.5,.5,.5); 00531 00532 BeginLines(); 00533 00534 const REAL seglen = .2f; 00535 00536 color_.Apply(); 00537 00538 REAL r = Radius(); 00539 for ( int i = sg_segments - 1; i>=0; --i ) 00540 { 00541 REAL a = i * 2 * 3.14159 / REAL( sg_segments ); 00542 REAL b = a + seglen; 00543 00544 REAL sa = r * sin(a); 00545 REAL ca = r * cos(a); 00546 REAL sb = r * sin(b); 00547 REAL cb = r * cos(b); 00548 00549 glVertex2f(sa, ca); 00550 glVertex2f(sb, cb); 00551 } 00552 00553 RenderEnd(); 00554 00555 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); 00556 glDepthMask(GL_TRUE); 00557 00558 glPopMatrix(); 00559 #endif 00560 }
bool gZone::RendersAlpha | ( | ) | const [private, virtual] |
returns whether the rendering uses alpha blending (massively, so sorting errors would show)
Reimplemented from eGameObject.
Definition at line 572 of file gWinZone.cpp.
References sr_alphaBlend.
00573 { 00574 return sr_alphaBlend; 00575 }
evaluates the given function with lastTime - referenceTime_ as argument
f | function to evaluate |
Definition at line 99 of file gWinZone.cpp.
References eGameObject::lastTime, and referenceTime_.
Referenced by GetPosition(), GetRadius(), GetRotationSpeed(), SetExpansionSpeed(), and SetReferenceTime().
00100 { 00101 return f( lastTime - referenceTime_ ); 00102 }
makes sure EvaluateFunctionNow() returns the given value
f | function to modify | |
value | value the function should have at lastTime - referenceTime_ |
Definition at line 115 of file gWinZone.cpp.
References tFunction::GetSlope(), eGameObject::lastTime, referenceTime_, and tFunction::SetOffset().
Referenced by SetPosition(), SetRadius(), and SetRotationSpeed().
00116 { 00117 f.SetOffset( value + f.GetSlope() * ( referenceTime_ - lastTime ) ); 00118 }
rColor gZone::color_ [protected] |
the zone's color
Definition at line 81 of file gWinZone.h.
Referenced by gDeathZoneHack::gDeathZoneHack(), GetColor(), gWinZoneHack::gWinZoneHack(), gZone(), ReadSync(), Render(), Render2D(), gBaseZoneHack::Timestep(), and WriteSync().
REAL gZone::createTime_ [protected] |
the time the zone was created at
Definition at line 82 of file gWinZone.h.
Referenced by gZone(), ReadSync(), Render(), and WriteCreate().
REAL gZone::referenceTime_ [protected] |
reference time for function evaluations
Definition at line 84 of file gWinZone.h.
Referenced by EvaluateFunctionNow(), gZone(), ReadSync(), SetFunctionNow(), SetReferenceTime(), Timestep(), and WriteSync().
tFunction gZone::posx_ [protected] |
time dependence of x component of position
Definition at line 85 of file gWinZone.h.
Referenced by GetPosition(), GetVelocity(), ReadSync(), SetPosition(), SetReferenceTime(), SetVelocity(), Timestep(), and WriteSync().
tFunction gZone::posy_ [protected] |
time dependence of y component of position
Definition at line 86 of file gWinZone.h.
Referenced by GetPosition(), GetVelocity(), ReadSync(), SetPosition(), SetReferenceTime(), SetVelocity(), Timestep(), and WriteSync().
tFunction gZone::radius_ [protected] |
time dependence of radius
Definition at line 87 of file gWinZone.h.
Referenced by GetExpansionSpeed(), ReadSync(), SetExpansionSpeed(), SetReferenceTime(), and WriteSync().
tFunction gZone::rotationSpeed_ [protected] |
the zone's rotation speed
Definition at line 88 of file gWinZone.h.
Referenced by GetRotationAcceleration(), GetRotationSpeed(), ReadSync(), SetReferenceTime(), SetRotationAcceleration(), and WriteSync().
eCoord gZone::rotation_ [protected] |
the current rotation state
Definition at line 89 of file gWinZone.h.
Referenced by GetRotation(), Render(), Render2D(), and Timestep().