Colobot
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Gfx::CCamera Class Reference

Camera moving in 3D scene. More...

#include <camera.h>

Public Member Functions

bool EventProcess (const Event &event)
 Management of an event. More...
 
void Init (Math::Vector eye, Math::Vector lookat, float delay)
 Initializes the camera. More...
 
void SetControllingObject (CObject *object)
 Sets the object controlling the camera. More...
 
CObjectGetControllingObject ()
 
void SetType (CameraType type)
 Change the type of camera. More...
 
CameraType GetType ()
 
void SetSmooth (CameraSmooth type)
 Management of the smoothing mode. More...
 
CameraSmooth GetSmooth ()
 
void SetDist (float dist)
 Management of the setback distance. More...
 
float GetDist ()
 
void SetFixDirectionH (float angle)
 Manage angle mode CAM_TYPE_FIX. More...
 
float GetFixDirectionH ()
 
void SetFixDirectionV (float angle)
 
float GetFixDirectionV ()
 
void SetRemotePan (float value)
 Managing the triggering mode of the camera panning. More...
 
float GetRemotePan ()
 
void SetRemoteZoom (float value)
 Management of the remote zoom (0 .. 1) of the camera. More...
 
float GetRemoteZoom ()
 
void StartVisit (Math::Vector goal, float dist)
 Start with a tour round the camera. More...
 
void StopVisit ()
 Circular end of a visit with the camera. More...
 
void GetCamera (Math::Vector &eye, Math::Vector &lookat)
 Returns the point of view of the camera. More...
 
bool StartCentering (CObject *object, float angleH, float angleV, float dist, float time)
 Specifies a special movement of camera to frame action. More...
 
bool StopCentering (CObject *object, float time)
 Ends a special movement of camera to frame action. More...
 
void AbortCentering ()
 Stop framing special in the current position. More...
 
void FlushEffect ()
 Removes the special effect with the camera. More...
 
void StartEffect (CameraEffect effect, Math::Vector pos, float force)
 Starts a special effect with the camera. More...
 
void FlushOver ()
 Removes the effect of superposition in the foreground. More...
 
void SetOverBaseColor (Color color)
 Specifies the base color. More...
 
void StartOver (CameraOverEffect effect, Math::Vector pos, float force)
 
void FixCamera ()
 Sets the soft movement of the camera. More...
 
void SetScriptEye (Math::Vector eye)
 
void SetScriptLookat (Math::Vector lookat)
 
void SetEffect (bool enable)
 
bool GetEffect ()
 
void SetBlood (bool enable)
 
bool GetBlood ()
 
void SetOldCameraScroll (bool scroll)
 
bool GetOldCameraScroll ()
 
void SetCameraInvertX (bool invert)
 
bool GetCameraInvertX ()
 
void SetCameraInvertY (bool invert)
 
bool GetCameraInvertY ()
 
void SetCameraSpeed (float speed)
 

Protected Member Functions

bool EventMouseMove (const Event &event)
 Changes the camera according to the mouse moved. More...
 
void EventMouseWheel (const Event &event)
 Mouse wheel operation. More...
 
void EventMouseButton (const Event &event)
 Mouse button handling. More...
 
bool EventFrame (const Event &event)
 Changes the camera according to the time elapsed. More...
 
bool EventFrameFree (const Event &event)
 Moves the point of view. More...
 
bool EventFrameEdit (const Event &event)
 Moves the point of view. More...
 
bool EventFrameDialog (const Event &event)
 Moves the point of view. More...
 
bool EventFrameBack (const Event &event)
 Moves the point of view. More...
 
bool EventFrameFix (const Event &event)
 Moves the point of view. More...
 
bool EventFrameExplo (const Event &event)
 Moves the point of view. More...
 
bool EventFrameOnBoard (const Event &event)
 Moves the point of view. More...
 
bool EventFrameInfo (const Event &event)
 Moves the point of view. More...
 
bool EventFrameVisit (const Event &event)
 Moves the point of view. More...
 
bool EventFrameScript (const Event &event)
 Moves the point of view. More...
 
void SetViewTime (const Math::Vector &eyePt, const Math::Vector &lookatPt, float rTime)
 Specifies the location and direction of view to the 3D engine. More...
 
bool IsCollision (Math::Vector &eye, Math::Vector lookat)
 Avoid the obstacles. More...
 
bool IsCollisionBack (Math::Vector &eye, Math::Vector lookat)
 Avoid the obstacles. More...
 
bool IsCollisionFix (Math::Vector &eye, Math::Vector lookat)
 Avoid the obstacles. More...
 
Math::Vector ExcludeTerrain (Math::Vector eye, Math::Vector lookat, float &angleH, float &angleV)
 Adjusts the camera not to enter the ground. More...
 
Math::Vector ExcludeObject (Math::Vector eye, Math::Vector lookat, float &angleH, float &angleV)
 Adjusts the camera not to enter an object. More...
 
void SetViewParams (const Math::Vector &eye, const Math::Vector &lookat, const Math::Vector &up)
 Specifies the location and direction of view. More...
 
void EffectFrame (const Event &event)
 Advances the effect of the camera. More...
 
void OverFrame (const Event &event)
 Advanced overlay effect in the foreground. More...
 

Protected Attributes

CEnginem_engine
 
CRobotMainm_main
 
CTerrainm_terrain
 
CWaterm_water
 
CInputm_input
 
CameraType m_type
 The type of camera. More...
 
CameraSmooth m_smooth
 Type of smoothing. More...
 
CObjectm_cameraObj
 Object linked to the camera. More...
 
float m_eyeDistance
 Distance between the eyes. More...
 
float m_initDelay
 Time of initial centering. More...
 
Math::Vector m_actualEye
 Current eye. More...
 
Math::Vector m_actualLookat
 Current aim. More...
 
Math::Vector m_finalEye
 Final eye. More...
 
Math::Vector m_finalLookat
 Final aim. More...
 
Math::Vector m_normEye
 Normal eye. More...
 
Math::Vector m_normLookat
 Normal aim. More...
 
float m_focus
 
Math::Vector m_eyePt
 CAM_TYPE_FREE: eye. More...
 
float m_directionH
 CAM_TYPE_FREE: horizontal direction. More...
 
float m_directionV
 CAM_TYPE_FREE: vertical direction. More...
 
float m_heightEye
 CAM_TYPE_FREE: height above the ground. More...
 
float m_heightLookat
 CAM_TYPE_FREE: height above the ground. More...
 
float m_speed
 CAM_TYPE_FREE: speed of movement. More...
 
float m_backDist
 CAM_TYPE_BACK: distance. More...
 
float m_backMin
 CAM_TYPE_BACK: distance minimal. More...
 
float m_addDirectionH
 CAM_TYPE_BACK: additional direction. More...
 
float m_addDirectionV
 CAM_TYPE_BACK: additional direction. More...
 
bool m_transparency
 
float m_fixDist
 CAM_TYPE_FIX: distance. More...
 
float m_fixDirectionH
 CAM_TYPE_FIX: direction. More...
 
float m_fixDirectionV
 CAM_TYPE_FIX: direction. More...
 
Math::Vector m_visitGoal
 CAM_TYPE_VISIT: target position. More...
 
float m_visitDist
 CAM_TYPE_VISIT: distance. More...
 
float m_visitTime
 CAM_TYPE_VISIT: relative time. More...
 
CameraType m_visitType
 CAM_TYPE_VISIT: initial type. More...
 
float m_visitDirectionV
 CAM_TYPE_VISIT: direction. More...
 
float m_editHeight
 CAM_TYPE_EDIT: height. More...
 
float m_remotePan
 
Math::Point m_mousePos = Math::Point(0.5f, 0.5f)
 Last known mouse position, used to calculate change since last frame. More...
 
Math::Point m_mouseDelta = Math::Point(0.0f, 0.0f)
 
Math::Point m_mouseDeltaEdge = Math::Point(0.0f, 0.0f)
 
CenteringPhase m_centeringPhase
 
float m_centeringAngleH
 
float m_centeringAngleV
 
float m_centeringDist
 
float m_centeringCurrentH
 
float m_centeringCurrentV
 
float m_centeringTime
 
float m_centeringProgress
 
CameraEffect m_effectType
 
Math::Vector m_effectPos
 
float m_effectForce
 
float m_effectProgress
 
Math::Vector m_effectOffset
 
CameraOverEffect m_overType
 
float m_overForce
 
float m_overTime
 
Color m_overColorBase
 
Color m_overColor
 
int m_overMode
 
float m_overFadeIn
 
float m_overFadeOut
 
Math::Vector m_scriptEye
 
Math::Vector m_scriptLookat
 
bool m_effect
 Shocks if explosion? More...
 
bool m_blood
 Blood? More...
 
bool m_oldCameraScroll
 Scroll in the edges? More...
 
bool m_cameraInvertX
 X inversion in the edges? More...
 
bool m_cameraInvertY
 Y inversion in the edges? More...
 

Detailed Description

Camera moving in 3D scene.

...

Member Function Documentation

bool Gfx::CCamera::EventProcess ( const Event event)

Management of an event.

void Gfx::CCamera::Init ( Math::Vector  eye,
Math::Vector  lookat,
float  delay 
)

Initializes the camera.

void Gfx::CCamera::SetControllingObject ( CObject object)

Sets the object controlling the camera.

void Gfx::CCamera::SetType ( CameraType  type)

Change the type of camera.

void Gfx::CCamera::SetSmooth ( CameraSmooth  type)

Management of the smoothing mode.

void Gfx::CCamera::SetDist ( float  dist)

Management of the setback distance.

void Gfx::CCamera::SetFixDirectionH ( float  angle)

Manage angle mode CAM_TYPE_FIX.

void Gfx::CCamera::SetRemotePan ( float  value)

Managing the triggering mode of the camera panning.

void Gfx::CCamera::SetRemoteZoom ( float  value)

Management of the remote zoom (0 .. 1) of the camera.

void Gfx::CCamera::StartVisit ( Math::Vector  goal,
float  dist 
)

Start with a tour round the camera.

void Gfx::CCamera::StopVisit ( )

Circular end of a visit with the camera.

void Gfx::CCamera::GetCamera ( Math::Vector eye,
Math::Vector lookat 
)

Returns the point of view of the camera.

bool Gfx::CCamera::StartCentering ( CObject object,
float  angleH,
float  angleV,
float  dist,
float  time 
)

Specifies a special movement of camera to frame action.

bool Gfx::CCamera::StopCentering ( CObject object,
float  time 
)

Ends a special movement of camera to frame action.

void Gfx::CCamera::AbortCentering ( )

Stop framing special in the current position.

void Gfx::CCamera::FlushEffect ( )

Removes the special effect with the camera.

void Gfx::CCamera::StartEffect ( CameraEffect  effect,
Math::Vector  pos,
float  force 
)

Starts a special effect with the camera.

void Gfx::CCamera::FlushOver ( )

Removes the effect of superposition in the foreground.

void Gfx::CCamera::SetOverBaseColor ( Color  color)

Specifies the base color.

void Gfx::CCamera::FixCamera ( )

Sets the soft movement of the camera.

bool Gfx::CCamera::EventMouseMove ( const Event event)
protected

Changes the camera according to the mouse moved.

void Gfx::CCamera::EventMouseWheel ( const Event event)
protected

Mouse wheel operation.

void Gfx::CCamera::EventMouseButton ( const Event event)
protected

Mouse button handling.

bool Gfx::CCamera::EventFrame ( const Event event)
protected

Changes the camera according to the time elapsed.

bool Gfx::CCamera::EventFrameFree ( const Event event)
protected

Moves the point of view.

bool Gfx::CCamera::EventFrameEdit ( const Event event)
protected

Moves the point of view.

bool Gfx::CCamera::EventFrameDialog ( const Event event)
protected

Moves the point of view.

bool Gfx::CCamera::EventFrameBack ( const Event event)
protected

Moves the point of view.

bool Gfx::CCamera::EventFrameFix ( const Event event)
protected

Moves the point of view.

bool Gfx::CCamera::EventFrameExplo ( const Event event)
protected

Moves the point of view.

bool Gfx::CCamera::EventFrameOnBoard ( const Event event)
protected

Moves the point of view.

bool Gfx::CCamera::EventFrameInfo ( const Event event)
protected

Moves the point of view.

bool Gfx::CCamera::EventFrameVisit ( const Event event)
protected

Moves the point of view.

bool Gfx::CCamera::EventFrameScript ( const Event event)
protected

Moves the point of view.

void Gfx::CCamera::SetViewTime ( const Math::Vector eyePt,
const Math::Vector lookatPt,
float  rTime 
)
protected

Specifies the location and direction of view to the 3D engine.

bool Gfx::CCamera::IsCollision ( Math::Vector eye,
Math::Vector  lookat 
)
protected

Avoid the obstacles.

bool Gfx::CCamera::IsCollisionBack ( Math::Vector eye,
Math::Vector  lookat 
)
protected

Avoid the obstacles.

bool Gfx::CCamera::IsCollisionFix ( Math::Vector eye,
Math::Vector  lookat 
)
protected

Avoid the obstacles.

Math::Vector Gfx::CCamera::ExcludeTerrain ( Math::Vector  eye,
Math::Vector  lookat,
float &  angleH,
float &  angleV 
)
protected

Adjusts the camera not to enter the ground.

Math::Vector Gfx::CCamera::ExcludeObject ( Math::Vector  eye,
Math::Vector  lookat,
float &  angleH,
float &  angleV 
)
protected

Adjusts the camera not to enter an object.

void Gfx::CCamera::SetViewParams ( const Math::Vector eye,
const Math::Vector lookat,
const Math::Vector up 
)
protected

Specifies the location and direction of view.

void Gfx::CCamera::EffectFrame ( const Event event)
protected

Advances the effect of the camera.

void Gfx::CCamera::OverFrame ( const Event event)
protected

Advanced overlay effect in the foreground.

Member Data Documentation

CameraType Gfx::CCamera::m_type
protected

The type of camera.

CameraSmooth Gfx::CCamera::m_smooth
protected

Type of smoothing.

CObject* Gfx::CCamera::m_cameraObj
protected

Object linked to the camera.

float Gfx::CCamera::m_eyeDistance
protected

Distance between the eyes.

float Gfx::CCamera::m_initDelay
protected

Time of initial centering.

Math::Vector Gfx::CCamera::m_actualEye
protected

Current eye.

Math::Vector Gfx::CCamera::m_actualLookat
protected

Current aim.

Math::Vector Gfx::CCamera::m_finalEye
protected

Final eye.

Math::Vector Gfx::CCamera::m_finalLookat
protected

Final aim.

Math::Vector Gfx::CCamera::m_normEye
protected

Normal eye.

Math::Vector Gfx::CCamera::m_normLookat
protected

Normal aim.

Math::Vector Gfx::CCamera::m_eyePt
protected

CAM_TYPE_FREE: eye.

float Gfx::CCamera::m_directionH
protected

CAM_TYPE_FREE: horizontal direction.

float Gfx::CCamera::m_directionV
protected

CAM_TYPE_FREE: vertical direction.

float Gfx::CCamera::m_heightEye
protected

CAM_TYPE_FREE: height above the ground.

float Gfx::CCamera::m_heightLookat
protected

CAM_TYPE_FREE: height above the ground.

float Gfx::CCamera::m_speed
protected

CAM_TYPE_FREE: speed of movement.

float Gfx::CCamera::m_backDist
protected

CAM_TYPE_BACK: distance.

float Gfx::CCamera::m_backMin
protected

CAM_TYPE_BACK: distance minimal.

float Gfx::CCamera::m_addDirectionH
protected

CAM_TYPE_BACK: additional direction.

float Gfx::CCamera::m_addDirectionV
protected

CAM_TYPE_BACK: additional direction.

float Gfx::CCamera::m_fixDist
protected

CAM_TYPE_FIX: distance.

float Gfx::CCamera::m_fixDirectionH
protected

CAM_TYPE_FIX: direction.

float Gfx::CCamera::m_fixDirectionV
protected

CAM_TYPE_FIX: direction.

Math::Vector Gfx::CCamera::m_visitGoal
protected

CAM_TYPE_VISIT: target position.

float Gfx::CCamera::m_visitDist
protected

CAM_TYPE_VISIT: distance.

float Gfx::CCamera::m_visitTime
protected

CAM_TYPE_VISIT: relative time.

CameraType Gfx::CCamera::m_visitType
protected

CAM_TYPE_VISIT: initial type.

float Gfx::CCamera::m_visitDirectionV
protected

CAM_TYPE_VISIT: direction.

float Gfx::CCamera::m_editHeight
protected

CAM_TYPE_EDIT: height.

Math::Point Gfx::CCamera::m_mousePos = Math::Point(0.5f, 0.5f)
protected

Last known mouse position, used to calculate change since last frame.

bool Gfx::CCamera::m_effect
protected

Shocks if explosion?

bool Gfx::CCamera::m_blood
protected

Blood?

bool Gfx::CCamera::m_oldCameraScroll
protected

Scroll in the edges?

bool Gfx::CCamera::m_cameraInvertX
protected

X inversion in the edges?

bool Gfx::CCamera::m_cameraInvertY
protected

Y inversion in the edges?


The documentation for this class was generated from the following files: