Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <camera.h>
Public Types | |
enum | ProjectionType { PARALLEL, PERSPECTIVE } |
Public Member Functions | |
void | setCockpitOffset (float c) |
float | getCockpitOffset () |
Camera (ProjectionType proj=PERSPECTIVE) | |
for GetUnit (); More... | |
void | LookDirection (const Vector &forevec, const Vector &up) |
void | SetNebula (Nebula *neb) |
Nebula * | GetNebula () |
void | UpdateCameraSounds () |
This function updates the sound if sound is not updated on a per frame basis. More... | |
void | GetView (Matrix &) |
const Vector & | GetR () |
void | GetPQR (Vector &p1, Vector &q1, Vector &r1) |
void | UpdateGFX (GFXBOOL clip, GFXBOOL updateFrustum, GFXBOOL centerCamera, GFXBOOL overrideZFrustum, float overrideZNear, float overrideZFar) |
void | UpdateGFX (GFXBOOL clip=GFXTRUE, GFXBOOL updateFrustum=GFXTRUE, GFXBOOL centerCamera=GFXFALSE) |
void | UpdateGFXFrustum (GFXBOOL overrideZFrustum, float overrideZNear, float overrideZFar) |
void | UpdateGFXAgain () |
void | UpdatePlanetGFX () |
Matrix * | GetPlanetGFX () |
void | UpdateGLCenter () |
void | SetPosition (const QVector &origin, const Vector &velocity, const Vector &angular_velocity, const Vector &acceleration) |
void | GetPosition (QVector &vect) |
Vector | GetAngularVelocity () const |
Vector | GetVelocity () const |
Vector | GetAcceleration () const |
void | GetOrientation (Vector &p, Vector &q, Vector &r) |
const QVector & | GetPosition () const |
float | GetZDist (const Vector &v) const |
void | SetOrientation (const Vector &p, const Vector &q, const Vector &r) |
void | SetSubwindow (float x, float y, float xsize, float ysize) |
void | SetProjectionType (ProjectionType t) |
void | SetZoom (float z) |
float | GetZoom () const |
void | SetFov (float f) |
float | GetFov () const |
void | Yaw (float rad) |
void | Pitch (float rad) |
void | Roll (float rad) |
void | XSlide (float factor) |
void | YSlide (float factor) |
void | ZSlide (float factor) |
void | RestoreViewPort (float xoffset, float yoffset) |
Public Attributes | |
Vector | P |
Vector | Q |
Vector | R |
PhysicsSystem | myPhysics |
|
explicit |
for GetUnit ();
Definition at line 36 of file camera.cpp.
References game_data_t::fov, g_game, GFXFALSE, GFXTRUE, P, PI, Q, R, ResetVectors(), Vector, and Yaw().
|
inline |
Definition at line 147 of file camera.h.
Referenced by GameCockpit::Draw().
|
inline |
Definition at line 139 of file camera.h.
Referenced by Background::Draw(), and Stars::Draw().
|
inline |
Definition at line 52 of file camera.h.
Referenced by BaseInterface::Room::BaseShip::Draw().
float Camera::GetFov | ( | ) | const |
Definition at line 295 of file camera.cpp.
Referenced by GameCockpit::Draw(), BaseInterface::Room::BaseShip::Draw(), and GameCockpit::DrawNavSystem().
Nebula * Camera::GetNebula | ( | ) |
Definition at line 173 of file camera.cpp.
References UnitContainer::GetUnit().
Referenced by ContinuousTerrain::Draw(), GameStarSystem::Draw(), VDU::Draw(), GameUnit< UnitType >::Draw(), GameUnit< UnitType >::DrawNow(), Mesh::DrawNow(), NebulaUpdate(), and SetupFogState().
Definition at line 151 of file camera.h.
Referenced by Bolt::Draw(), BaseInterface::Room::BaseShip::Draw(), NavigationSystem::Draw(), GameCockpit::SetupViewPort(), and ShoveCamBelowUnit().
Matrix * Camera::GetPlanetGFX | ( | ) |
GetView (Matrix x) returns the view matrix (inverse matrix based on camera pqr)
Definition at line 241 of file camera.cpp.
Referenced by GamePlanet::DrawTerrain().
|
inline |
Definition at line 135 of file camera.h.
Referenced by ContinuousTerrain::AdjustTerrain(), CalculateOrientation(), ParticlePoint::Draw(), Bolt::Draw(), WarpTrail::Draw(), GameStarSystem::Draw(), Animation::Draw(), GamePlanet::Draw(), SphereMesh::Draw(), Stars::Draw(), AtmosphereHalo::Draw(), GameUnit< UnitType >::Draw(), BaseInterface::Room::BaseShip::Draw(), NavigationSystem::Draw(), ParticleTrail::DrawAndUpdate(), DrawDockingBoxes(), GameUnit< UnitType >::DrawNow(), GamePlanet::DrawTerrain(), FaceCamTarget(), UnitUtil::getPhysicsPriority(), Animation::ProcessDrawQueue(), Mesh::ProcessUndrawnMeshes(), Mesh::ProcessZFarMeshes(), ClickList::queryShip(), GameUnit< UnitType >::querySphereClickList(), Unit::reactToCollision(), QuadTree::Render(), Briefing::Render(), ClickList::requestShip(), QuadTree::Update(), CoordinateSelect::UpdateMouse(), and GameNebula::UpdatePhysics2().
|
inline |
Definition at line 65 of file camera.cpp.
Referenced by CalculateOrientation(), GameCockpit::Draw(), ParticleTrail::DrawAndUpdate(), ClickList::queryShip(), GameUnit< UnitType >::querySphereClickList(), StarVlist::StarVlist(), StarVlist::UpdateGraphics(), and CoordinateSelect::UpdateMouse().
|
inline |
Definition at line 93 of file camera.h.
References R.
Referenced by Animation::Draw(), Stars::Draw(), Unit::reactToCollision(), GameCockpit::SetupViewPort(), and ShoveCamBehindUnit().
|
inline |
Definition at line 143 of file camera.h.
Referenced by Background::Draw(), Stars::Draw(), GameUnit< UnitType >::Draw(), UnitUtil::getPhysicsPriority(), and UpdateCameraSounds().
void Camera::GetView | ( | Matrix & | vw) |
Definition at line 163 of file camera.cpp.
References GFXGetMatrixView().
Referenced by GameUnit< UnitType >::querySphereClickList(), and ClickList::requestIterator().
Definition at line 161 of file camera.h.
References DotProduct(), QVector, and R.
float Camera::GetZoom | ( | ) | const |
Definition at line 285 of file camera.cpp.
void Camera::Pitch | ( | float | rad) |
Definition at line 183 of file camera.cpp.
References GFXSubwindow().
Referenced by GameCockpit::RestoreViewPort(), GameCockpit::SetupViewPort(), and UpdateGLCenter().
void Camera::Roll | ( | float | rad) |
|
inline |
Definition at line 47 of file camera.h.
Referenced by BaseInterface::Room::BaseShip::Draw(), GameCockpit::DrawNavSystem(), and GameCockpit::SetupViewPort().
void Camera::SetFov | ( | float | f) |
Definition at line 290 of file camera.cpp.
Referenced by GameCockpit::Draw(), BaseInterface::Room::BaseShip::Draw(), GameCockpit::DrawNavSystem(), and GameCockpit::SetupViewPort().
void Camera::SetNebula | ( | Nebula * | neb) |
Definition at line 168 of file camera.cpp.
References UnitContainer::SetUnit().
Referenced by NebulaUpdate(), and GameNebula::PutInsideCam().
Definition at line 257 of file camera.cpp.
References GFXTRUE, myPhysics, P, q, Q, R, PhysicsSystem::SetAngularVelocity(), and Vector.
Referenced by GameCockpit::Autopilot(), Briefing::Briefing(), FaceCamTarget(), BriefingUtil::setCamOrientation(), GameCockpit::SetupViewPort(), and GameUnit< UnitType >::UpdateHudMatrix().
void Camera::SetPosition | ( | const QVector & | origin, |
const Vector & | velocity, | ||
const Vector & | angular_velocity, | ||
const Vector & | acceleration | ||
) |
Definition at line 225 of file camera.cpp.
References FINITE, GFXTRUE, and VSFileSystem::vs_fprintf().
Referenced by GameCockpit::Autopilot(), Briefing::Briefing(), Briefing::Render(), BriefingUtil::setCamPosition(), ShoveCamBehindUnit(), ShoveCamBelowUnit(), and GameUnit< UnitType >::UpdateHudMatrix().
void Camera::SetProjectionType | ( | ProjectionType | t) |
Definition at line 275 of file camera.cpp.
Definition at line 266 of file camera.cpp.
References GFXTRUE.
Referenced by GameUniverse::StartDraw().
void Camera::SetZoom | ( | float | z) |
Definition at line 280 of file camera.cpp.
void Camera::UpdateCameraSounds | ( | ) |
This function updates the sound if sound is not updated on a per frame basis.
Definition at line 135 of file camera.cpp.
References AUDListener(), AUDListenerOrientation(), GetVelocity(), P, Q, and R.
Referenced by UpdateCameraSnds().
void Camera::UpdateGFX | ( | GFXBOOL | clip, |
GFXBOOL | updateFrustum, | ||
GFXBOOL | centerCamera, | ||
GFXBOOL | overrideZFrustum, | ||
float | overrideZNear, | ||
float | overrideZFar | ||
) |
Definition at line 78 of file camera.cpp.
References game_data_t::aspect, AUDListener(), AUDListenerOrientation(), g_game, GetElapsedTime(), GFXCalculateFrustum(), GFXLoadIdentity(), GFXLookAt(), GFXParallel(), GFXPerspective(), GFXSubwindow(), myPhysics, P, PARALLEL, PERSPECTIVE, PI, PROJECTION, Q, QVector, R, PhysicsSystem::Update(), Vector, GFXMatrices::view, game_data_t::zfar, and game_data_t::znear.
Referenced by GameStarSystem::Draw(), Stars::Draw(), GameCockpit::Draw(), BaseInterface::Room::BaseShip::Draw(), NavigationSystem::Draw(), GameCockpit::DrawNavSystem(), Briefing::Render(), GameCockpit::SetupViewPort(), GameUniverse::StartDraw(), UpdateGFX(), UpdateGFXAgain(), and UpdateGFXFrustum().
|
inline |
|
inline |
|
inline |
Definition at line 113 of file camera.h.
References UpdateGFX().
Referenced by Mesh::ProcessUndrawnMeshes(), and Mesh::ProcessZFarMeshes().
void Camera::UpdateGLCenter | ( | ) |
Definition at line 188 of file camera.cpp.
References game_data_t::aspect, g_game, GFXLoadIdentity(), GFXLookAt(), GFXParallel(), GFXPerspective(), ITISDEPRECATED, PARALLEL, PERSPECTIVE, PI, PROJECTION, Q, QVector, R, RestoreViewPort(), VIEW, game_data_t::zfar, and game_data_t::znear.
void Camera::UpdatePlanetGFX | ( | ) |
Definition at line 178 of file camera.cpp.
References Identity().
Referenced by GamePlanet::DrawTerrain().
void Camera::XSlide | ( | float | factor) |
void Camera::Yaw | ( | float | rad) |
void Camera::YSlide | ( | float | factor) |
void Camera::ZSlide | ( | float | factor) |
PhysicsSystem Camera::myPhysics |
Definition at line 89 of file camera.h.
Referenced by CockpitKeys::_PitchDown(), CockpitKeys::_PitchUp(), CockpitKeys::_YawLeft(), CockpitKeys::_YawRight(), SetOrientation(), UpdateGFX(), and GameCockpit::UpdAutoPilot().
Vector Camera::P |
Definition at line 78 of file camera.h.
Referenced by CockpitKeys::_YawLeft(), CockpitKeys::_YawRight(), Camera(), GetOrientation(), GetPQR(), LookDirection(), Pitch(), Roll(), SetOrientation(), UpdateCameraSounds(), UpdateGFX(), XSlide(), and Yaw().
Vector Camera::Q |
Definition at line 78 of file camera.h.
Referenced by CockpitKeys::_PitchDown(), CockpitKeys::_PitchUp(), Camera(), GetOrientation(), GetPQR(), LookDirection(), Pitch(), Roll(), SetOrientation(), UpdateCameraSounds(), UpdateGFX(), UpdateGLCenter(), Yaw(), and YSlide().
Vector Camera::R |
Definition at line 78 of file camera.h.
Referenced by CockpitKeys::_PitchDown(), CockpitKeys::_PitchUp(), CockpitKeys::_YawLeft(), CockpitKeys::_YawRight(), Camera(), GetOrientation(), GetPQR(), GetR(), GetZDist(), LookDirection(), Pitch(), Roll(), SetOrientation(), UpdateCameraSounds(), UpdateGFX(), UpdateGLCenter(), Yaw(), and ZSlide().