TargetCamera Class Reference

#include <TargetCamera.h>

List of all members.

Public Types

enum  CamType {
  CamTop = 0, CamBehind, CamTank,
  CamGun, CamAction, CamLeft,
  CamRight, CamLeftFar, CamRightFar,
  CamSpectator, CamFree
}

Public Member Functions

 TargetCamera ()
virtual ~TargetCamera ()
GLCameragetCamera ()
CamType getCameraType ()
ParticleEnginegetPrecipitationEngine ()
void setCameraType (CamType type)
void resetCam ()
void simulate (float frameTime, bool playing)
void draw ()
void drawPrecipitation ()
void mouseWheel (int x, int y, int z, bool &skipRest)
void mouseDown (GameState::MouseButton button, int x, int y, bool &skipRest)
void mouseUp (GameState::MouseButton button, int x, int y, bool &skipRest)
void mouseDrag (GameState::MouseButton button, int mx, int my, int x, int y, bool &skipRest)
bool keyboardCheck (float frameTime, char *buffer, unsigned int keyState, KeyboardHistory::HistoryElement *history, int hisCount, bool &skipRest)

Static Public Member Functions

static const char ** getCameraNames ()
static ToolTipgetCameraToolTips ()
static int getNoCameraNames ()
static float minHeightFunc (int x, int y, void *heightData)
static float maxHeightFunc (int x, int y, void *heightData)

Protected Member Functions

bool moveCamera (float frameTime, bool playing)
bool getLandIntersect (int x, int y, Vector &intersect)

Protected Attributes

GLCamera mainCam_
CamType cameraPos_
ParticleEmitter rainEmitter_
ParticleEmitter snowEmitter_
ParticleEngine particleEngine_
float totalTime_
bool useHeightFunc_
int dragXStart_
int dragYStart_
bool dragging_
bool lastLandIntersectValid_
Vector lastLandIntersect_


Detailed Description

Definition at line 30 of file TargetCamera.h.


Member Enumeration Documentation

enum TargetCamera::CamType

Enumerator:
CamTop 
CamBehind 
CamTank 
CamGun 
CamAction 
CamLeft 
CamRight 
CamLeftFar 
CamRightFar 
CamSpectator 
CamFree 

Definition at line 33 of file TargetCamera.h.


Constructor & Destructor Documentation

TargetCamera::TargetCamera (  ) 

Definition at line 96 of file TargetCamera.cpp.

References DIALOG_ASSERT, mainCam_, maxHeightFunc(), minHeightFunc(), noCameraNames, particleEngine_, rainEmitter_, resetCam(), ParticleEngine::setAllowSorting(), ParticleEmitter::setAttributes(), GLCamera::setMaxHeightFunc(), GLCamera::setMinHeightFunc(), and snowEmitter_.

TargetCamera::~TargetCamera (  )  [virtual]

Definition at line 142 of file TargetCamera.cpp.


Member Function Documentation

GLCamera& TargetCamera::getCamera (  )  [inline]

Definition at line 51 of file TargetCamera.h.

References mainCam_.

Referenced by CameraDialog::draw(), MainCamera::getCamera(), MainCamera::keyboardCheck(), ClientStartGameHandler::processMessage(), Sun::setLightPosition(), MainCamera::setQuick(), MainCamera::simulate(), and MainCamera::useQuick().

CamType TargetCamera::getCameraType (  )  [inline]

Definition at line 52 of file TargetCamera.h.

References cameraPos_.

Referenced by CameraDialog::draw(), MainCamera::getMenuItems(), GLWWindView::mouseDown(), CameraDialog::mouseDown(), CameraDialog::savePosition(), and MainCamera::simulate().

ParticleEngine& TargetCamera::getPrecipitationEngine (  )  [inline]

Definition at line 53 of file TargetCamera.h.

References particleEngine_.

void TargetCamera::setCameraType ( CamType  type  )  [inline]

Definition at line 54 of file TargetCamera.h.

References cameraPos_.

Referenced by ClientNewGameHandler::actualProcessMessage(), CameraDialog::CameraDialog(), MainCamera::keyboardCheck(), CameraDialog::loadPosition(), MainCamera::menuSelection(), GLWWindView::mouseDown(), GLWTankModel::mouseDown(), GLWPlanView::mouseDown(), CameraDialog::mouseDown(), ClientStartGameHandler::processMessage(), MainCamera::simulate(), AnimatedBackdropDialog::simulate(), and MainCamera::useQuick().

void TargetCamera::resetCam (  ) 

Definition at line 147 of file TargetCamera.cpp.

References at, cameraPos_, CamSpectator, mainCam_, and GLCamera::setLookAt().

Referenced by TargetCamera().

void TargetCamera::simulate ( float  frameTime,
bool  playing 
)

Definition at line 205 of file TargetCamera.cpp.

References ParticleEmitter::emitPrecipitation(), LandscapeTexType::ePrecipitationRain, LandscapeTexType::ePrecipitationSnow, GLCamera::getCurrentPos(), ParticleEngine::getFast(), ScorchedContext::getLandscapeMaps(), LandscapeTexType::getType(), ScorchedClient::instance(), OptionsDisplay::instance(), mainCam_, moveCamera(), particleEngine_, LandscapeTexPrecipitation::particles, LandscapeTex::precipitation, rainEmitter_, GLCamera::simulate(), ParticleEngine::simulate(), snowEmitter_, and totalTime_.

Referenced by MainCamera::simulate(), and CameraDialog::simulate().

void TargetCamera::draw (  ) 

Definition at line 243 of file TargetCamera.cpp.

References GLCamera::draw(), and mainCam_.

Referenced by MainCamera::draw(), and CameraDialog::draw().

void TargetCamera::drawPrecipitation (  ) 

Definition at line 248 of file TargetCamera.cpp.

References ParticleEngine::draw(), and particleEngine_.

Referenced by MainCamera::Precipitation::draw(), and CameraDialog::drawLandscape().

void TargetCamera::mouseWheel ( int  x,
int  y,
int  z,
bool &  skipRest 
)

Definition at line 474 of file TargetCamera.cpp.

References cameraPos_, CamFree, mainCam_, and GLCamera::movePositionDelta().

Referenced by MainCamera::mouseWheel().

void TargetCamera::mouseDown ( GameState::MouseButton  button,
int  x,
int  y,
bool &  skipRest 
)

Definition at line 482 of file TargetCamera.cpp.

References dragXStart_, dragYStart_, getLandIntersect(), lastLandIntersect_, and lastLandIntersectValid_.

Referenced by MainCamera::mouseDown().

void TargetCamera::mouseUp ( GameState::MouseButton  button,
int  x,
int  y,
bool &  skipRest 
)

Definition at line 492 of file TargetCamera.cpp.

References MovementMap::calculatePosition(), cameraPos_, CamFree, dragging_, MovementMap::eMovement, Accessory::ePositionSelectFuel, Accessory::ePositionSelectFuelLimit, Accessory::ePositionSelectLimit, Accessory::ePositionSelectNone, TankKeyboardControlUtil::fireShot(), Tank::getAccessories(), Accessory::getAccessoryId(), ScorchedContext::getAccessoryStore(), TankWeapon::getCurrent(), MovementMap::getEntry(), MovementMap::getFuel(), ScorchedContext::getLandscapeMaps(), Target::getLife(), Tank::getPosition(), Accessory::getPositionSelect(), Accessory::getPositionSelectLimit(), TargetLife::getTargetPosition(), TankAccessories::getWeapons(), ScorchedClient::instance(), int(), lastLandIntersect_, lastLandIntersectValid_, mainCam_, GLCamera::setLookAt(), TankPosition::setSelectPosition(), ClientState::StatePlaying, and MovementMap::MovementMapEntry::type.

Referenced by MainCamera::mouseUp().

void TargetCamera::mouseDrag ( GameState::MouseButton  button,
int  mx,
int  my,
int  x,
int  y,
bool &  skipRest 
)

Definition at line 426 of file TargetCamera.cpp.

References cameraPos_, CamFree, dragging_, dragXStart_, dragYStart_, ScorchedContext::getLandscapeMaps(), ScorchedClient::instance(), OptionsDisplay::instance(), mainCam_, GameState::MouseButtonLeft, GameState::MouseButtonRight, GLCamera::movePositionDelta(), and GLCamera::scroll().

Referenced by MainCamera::mouseDrag().

bool TargetCamera::keyboardCheck ( float  frameTime,
char *  buffer,
unsigned int  keyState,
KeyboardHistory::HistoryElement history,
int  hisCount,
bool &  skipRest 
)

Definition at line 603 of file TargetCamera.cpp.

References CamAction, CamBehind, cameraPos_, CamFree, CamGun, CamLeft, CamLeftFar, CamRight, CamRightFar, CamSpectator, CamTank, CamTop, ScorchedClient::instance(), KEYBOARDKEY, LANG_RESOURCE, mainCam_, GLCamera::movePositionDelta(), GLCamera::setUseHeightFunc(), ChannelManager::showText(), and useHeightFunc_.

Referenced by MainCamera::keyboardCheck().

const char ** TargetCamera::getCameraNames (  )  [static]

Definition at line 154 of file TargetCamera.cpp.

References cameraNames.

Referenced by CameraDialog::draw(), getCameraToolTips(), and MainCamera::getMenuItems().

ToolTip * TargetCamera::getCameraToolTips (  )  [static]

Definition at line 159 of file TargetCamera.cpp.

References getCameraNames(), LANG_RESOURCE, ToolTip::setText(), and ToolTip::ToolTipHelp.

Referenced by MainCamera::getMenuItems().

int TargetCamera::getNoCameraNames (  )  [static]

Definition at line 174 of file TargetCamera.cpp.

References noCameraNames.

Referenced by MainCamera::getMenuItems().

float TargetCamera::minHeightFunc ( int  x,
int  y,
void *  heightData 
) [static]

Definition at line 179 of file TargetCamera.cpp.

References cameraPos_, CamGun, GLCamera::getCurrentPos(), ScorchedContext::getLandscapeMaps(), GLCamera::getLookAt(), Landscape::getWater(), Water::getWaterHeight(), Water::getWaterOn(), ScorchedClient::instance(), Landscape::instance(), and mainCam_.

Referenced by TargetCamera().

float TargetCamera::maxHeightFunc ( int  x,
int  y,
void *  heightData 
) [static]

Definition at line 197 of file TargetCamera.cpp.

References ScorchedContext::getLandscapeMaps(), and ScorchedClient::instance().

Referenced by TargetCamera().

bool TargetCamera::moveCamera ( float  frameTime,
bool  playing 
) [protected]

Definition at line 253 of file TargetCamera.cpp.

References fixed::asFloat(), FixedVector::asVector(), at, CamAction, CamBehind, cameraPos_, CamGun, CamLeft, CamLeftFar, CamRight, CamRightFar, CamSpectator, CamTank, CamTop, ScorchedClient::getContext(), CameraPositionActionRegistry::getCurrentAction(), TankContainer::getCurrentTank(), getFastCos(), getFastSin(), ScorchedContext::getLandscapeMaps(), Tank::getPosition(), TankPosition::getRotationGunXY(), TankPosition::getRotationGunYZ(), CameraPositionAction::getShowPosition(), TankState::getState(), Tank::getState(), ScorchedContext::getTankContainer(), TankPosition::getTankGunPosition(), TankPosition::getTankTurretPosition(), ScorchedContext::getViewPoints(), HALFPI, ScorchedClient::instance(), mainCam_, GLCamera::movePosition(), GLCamera::setLookAt(), GLCamera::setOffSet(), and TankState::sNormal.

Referenced by simulate().

bool TargetCamera::getLandIntersect ( int  x,
int  y,
Vector intersect 
) [protected]

Definition at line 410 of file TargetCamera.cpp.

References GLCamera::draw(), GLCamera::getDirectionFromPt(), LandscapeMaps::getGroundMaps(), ScorchedContext::getLandscapeMaps(), ScorchedClient::instance(), and mainCam_.

Referenced by mouseDown().


Member Data Documentation

GLCamera TargetCamera::mainCam_ [protected]

Definition at line 80 of file TargetCamera.h.

Referenced by draw(), getCamera(), getLandIntersect(), keyboardCheck(), minHeightFunc(), mouseDrag(), mouseUp(), mouseWheel(), moveCamera(), resetCam(), simulate(), and TargetCamera().

CamType TargetCamera::cameraPos_ [protected]

Definition at line 81 of file TargetCamera.h.

Referenced by getCameraType(), keyboardCheck(), minHeightFunc(), mouseDrag(), mouseUp(), mouseWheel(), moveCamera(), resetCam(), and setCameraType().

ParticleEmitter TargetCamera::rainEmitter_ [protected]

Definition at line 82 of file TargetCamera.h.

Referenced by simulate(), and TargetCamera().

ParticleEmitter TargetCamera::snowEmitter_ [protected]

Definition at line 82 of file TargetCamera.h.

Referenced by simulate(), and TargetCamera().

ParticleEngine TargetCamera::particleEngine_ [protected]

Definition at line 83 of file TargetCamera.h.

Referenced by drawPrecipitation(), getPrecipitationEngine(), simulate(), and TargetCamera().

float TargetCamera::totalTime_ [protected]

Definition at line 84 of file TargetCamera.h.

Referenced by simulate().

bool TargetCamera::useHeightFunc_ [protected]

Definition at line 85 of file TargetCamera.h.

Referenced by keyboardCheck().

int TargetCamera::dragXStart_ [protected]

Definition at line 86 of file TargetCamera.h.

Referenced by mouseDown(), and mouseDrag().

int TargetCamera::dragYStart_ [protected]

Definition at line 86 of file TargetCamera.h.

Referenced by mouseDown(), and mouseDrag().

bool TargetCamera::dragging_ [protected]

Definition at line 87 of file TargetCamera.h.

Referenced by mouseDrag(), and mouseUp().

bool TargetCamera::lastLandIntersectValid_ [protected]

Definition at line 88 of file TargetCamera.h.

Referenced by mouseDown(), and mouseUp().

Vector TargetCamera::lastLandIntersect_ [protected]

Definition at line 89 of file TargetCamera.h.

Referenced by mouseDown(), and mouseUp().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:07 2009 for Scorched3D by  doxygen 1.5.3