gCamera Class Reference

#include <gCamera.h>

Inheritance diagram for gCamera:

Inheritance graph
[legend]
Collaboration diagram for gCamera:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 gCamera (eGrid *grid, rViewport *vp, ePlayerNetID *owner, ePlayer *lp, eCamMode m=CAMERA_IN)
virtual ~gCamera ()
virtual eCoord CenterCycleDir ()
virtual REAL SpeedMultiplier () const
virtual void Timestep (REAL ts)

Public Attributes

eGameObjectlastCenter

Private Member Functions

void MyInit ()


Detailed Description

Definition at line 33 of file gCamera.h.


Constructor & Destructor Documentation

gCamera::gCamera ( eGrid grid,
rViewport vp,
ePlayerNetID owner,
ePlayer lp,
eCamMode  m = CAMERA_IN 
)

Definition at line 44 of file gCamera.cpp.

References MyInit().

00045         :eCamera(grid, view,p,lp,m), lastCenter(NULL){
00046     MyInit();
00047 }

Here is the call graph for this function:

gCamera::~gCamera (  )  [virtual]

Definition at line 50 of file gCamera.cpp.

References x.

00050                  {
00051     int x;
00052     x =0;
00053 }


Member Function Documentation

void gCamera::MyInit (  )  [private]

Reimplemented from eCamera.

Definition at line 36 of file gCamera.cpp.

References CAMERA_SMART, eCamera::Center(), eCamera::CenterPos(), eCamera::dir, eCoord, gGameSettings::finishType, gFINISH_EXPRESS, lastCenter, eCamera::mode, nCLIENT, eCamera::pos, sg_currentSettings, and sn_GetNetState().

Referenced by gCamera().

00036                     {
00037     if (mode == CAMERA_SMART)
00038         if (sg_currentSettings->finishType==gFINISH_EXPRESS && sn_GetNetState() != nCLIENT )
00039             pos=CenterPos()+dir.Turn(eCoord(-2,-10)) ;
00040 
00041     lastCenter=Center();
00042 }

Here is the call graph for this function:

Here is the caller graph for this function:

eCoord gCamera::CenterCycleDir (  )  [virtual]

Definition at line 55 of file gCamera.cpp.

References c, gCycle::CamDir(), eCamera::Center(), and eCamera::CenterDir().

00055                               {
00056     gCycle *c = dynamic_cast<gCycle *>( Center());
00057     if (c)
00058         return c->CamDir();
00059     else
00060         return CenterDir();
00061 }

Here is the call graph for this function:

REAL gCamera::SpeedMultiplier (  )  const [virtual]

Reimplemented from eCamera.

Definition at line 63 of file gCamera.cpp.

References gCycleMovement::SpeedMultiplier().

00064 {
00065     return gCycle::SpeedMultiplier();
00066 }

Here is the call graph for this function:

void gCamera::Timestep ( REAL  ts  )  [virtual]

Reimplemented from eCamera.

Definition at line 68 of file gCamera.cpp.

References eCamera::center, eCamera::Center(), con, eSoundMixer::GetMixer(), ePlayerNetID::GetName(), lastCenter, eCamera::netPlayer, NULL, eNetGameObject::Player(), eSoundMixer::SetMicrophoneOwner(), tOutput::SetTemplateParameter(), eCamera::Timestep(), and x.

00068                              {
00069     eCamera::Timestep(ts);
00070     if (Center()!=lastCenter){
00071         if (!netPlayer || !netPlayer->Object() ||
00072                 netPlayer->Object()!=center){
00073             if (dynamic_cast<gCycle *>(Center())){
00074                 eNetGameObject *x=dynamic_cast<eNetGameObject *>(Center());
00075                 if (x){
00076                     const ePlayerNetID *p=x->Player();
00077                     if (p==NULL)
00078                         con << tOutput("$camera_watching_ai");
00079                     else{
00080                         tOutput o;
00081                         o.SetTemplateParameter(1, p->GetName());
00082                         o << "$camera_watching_player";
00083                         con << o;
00084                     }
00085                 }
00086             }
00087             lastCenter=Center();
00088 
00089             eSoundMixer* mixer = eSoundMixer::GetMixer();
00090             mixer->SetMicrophoneOwner(Center());
00091         }
00092     }
00093 }

Here is the call graph for this function:


Member Data Documentation

eGameObject* gCamera::lastCenter

Definition at line 36 of file gCamera.h.

Referenced by MyInit(), and Timestep().


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