#include <gCamera.h>
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 | |
eGameObject * | lastCenter |
Private Member Functions | |
void | MyInit () |
Definition at line 33 of file gCamera.h.
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 }
gCamera::~gCamera | ( | ) | [virtual] |
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 }
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 }
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 }
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 }