Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
View Class Referenceabstract

#include <View.h>

Inherits Snapshot.

Inherited by PlaceholderView, and W3DView.

Public Types

enum  CameraShakeType {
  SHAKE_SUBTLE = 0 , SHAKE_NORMAL , SHAKE_STRONG , SHAKE_SEVERE ,
  SHAKE_CINE_EXTREME , SHAKE_CINE_INSANE , SHAKE_COUNT
}
 Add an impulse force to shake the camera. More...
 
enum  WorldToScreenReturn { WTS_INSIDE_FRUSTUM = 0 , WTS_OUTSIDE_FRUSTUM , WTS_INVALID , WTS_COUNT }
 
enum  CameraLockType { LOCK_FOLLOW , LOCK_TETHER }
 

Public Member Functions

 View (void)
 
virtual ~View (void)
 
virtual void init (void)
 
virtual void reset (void)
 
virtual UnsignedInt getID (void)
 
virtual void setZoomLimited (Bool limit)
 limit the zoom height
 
virtual Bool isZoomLimited (void)
 get status of zoom limit
 
virtual DrawablepickDrawable (const ICoord2D *screen, Bool forceAttack, PickType pickType)=0
 pick drawable given the screen pixel coords. If force attack, picks bridges as well.
 
virtual Int iterateDrawablesInRegion (IRegion2D *screenRegion, Bool(*callback)(Drawable *draw, void *userData), void *userData)=0
 all drawables in the 2D screen region will call the 'callback'
 
virtual void getScreenCornerWorldPointsAtZ (Coord3D *topLeft, Coord3D *topRight, Coord3D *bottomLeft, Coord3D *bottomRight, Real z)
 
virtual void setWidth (Int width)
 
virtual Int getWidth (void)
 
virtual void setHeight (Int height)
 
virtual Int getHeight (void)
 
virtual void setOrigin (Int x, Int y)
 Sets location of top-left view corner on display.
 
virtual void getOrigin (Int *x, Int *y)
 Return location of top-left view corner on display.
 
virtual void forceRedraw ()=0
 
virtual void lookAt (const Coord3D *o)
 Center the view on the given coordinate.
 
virtual void initHeightForMap (void)
 
virtual void scrollBy (Coord2D *delta)
 Init the camera height for the map at the current position.
 
virtual void moveCameraTo (const Coord3D *o, Int frames, Int shutter, Bool orient, Real easeIn, Real easeOut)
 
virtual void moveCameraAlongWaypointPath (Waypoint *way, Int frames, Int shutter, Bool orient, Real easeIn, Real easeOut)
 
virtual Bool isCameraMovementFinished (void)
 
virtual void cameraModFinalZoom (Real finalZoom, Real easeIn, Real easeOut)
 
virtual void cameraModRollingAverage (Int framesToAverage)
 Final zoom for current camera movement.
 
virtual void cameraModFinalTimeMultiplier (Int finalMultiplier)
 Number of frames to average movement for current camera movement.
 
virtual void cameraModFinalPitch (Real finalPitch, Real easeIn, Real easeOut)
 Final time multiplier for current camera movement.
 
virtual void cameraModFreezeTime (void)
 Final pitch for current camera movement.
 
virtual void cameraModFreezeAngle (void)
 Freezes time during the next camera movement.
 
virtual void cameraModLookToward (Coord3D *pLoc)
 Sets a look at point during camera movement.
 
virtual void cameraModFinalLookToward (Coord3D *pLoc)
 Sets a look at point during camera movement.
 
virtual void cameraModFinalMoveTo (Coord3D *pLoc)
 
virtual void cameraEnableSlaveMode (const AsciiString &thingtemplateName, const AsciiString &boneName)
 Sets a final move to.
 
virtual void cameraDisableSlaveMode (void)
 
virtual void Add_Camera_Shake (const Coord3D &position, float radius, float duration, float power)
 
virtual enum FilterModes getViewFilterMode (void)
 Turns on viewport special effect (black & white mode)
 
virtual enum FilterTypes getViewFilterType (void)
 Turns on viewport special effect (black & white mode)
 
virtual Bool setViewFilterMode (enum FilterModes filterMode)
 Turns on viewport special effect (black & white mode)
 
virtual void setViewFilterPos (const Coord3D *pos)
 
virtual Bool setViewFilter (enum FilterTypes filter)
 Passes a position to the special effect filter.
 
virtual void setFadeParameters (Int fadeFrames, Int direction)
 
virtual void set3DWireFrameMode (Bool enable)
 
virtual void resetCamera (const Coord3D *location, Int frames, Real easeIn, Real easeOut)
 
virtual void rotateCamera (Real rotations, Int frames, Real easeIn, Real easeOut)
 Move camera to location, and reset to default angle & zoom.
 
virtual void rotateCameraTowardObject (ObjectID id, Int milliseconds, Int holdMilliseconds, Real easeIn, Real easeOut)
 Rotate camera about current viewpoint.
 
virtual void rotateCameraTowardPosition (const Coord3D *pLoc, Int milliseconds, Real easeIn, Real easeOut, Bool reverseRotation)
 Rotate camera to face an object, and hold on it.
 
virtual Bool isTimeFrozen (void)
 Rotate camera to face a location.
 
virtual Int getTimeMultiplier (void)
 
virtual void setTimeMultiplier (Int multiple)
 Get the time multiplier.
 
virtual void setDefaultView (Real pitch, Real angle, Real maxHeight)
 Set the time multiplier.
 
virtual void zoomCamera (Real finalZoom, Int milliseconds, Real easeIn, Real easeOut)
 
virtual void pitchCamera (Real finalPitch, Int milliseconds, Real easeIn, Real easeOut)
 
virtual void setAngle (Real angle)
 Rotate the view around the up axis to the given angle.
 
virtual Real getAngle (void)
 
virtual void setPitch (Real angle)
 Rotate the view around the horizontal axis to the given angle.
 
virtual Real getPitch (void)
 Return current camera pitch.
 
virtual void setAngleAndPitchToDefault (void)
 Set the view angle back to default.
 
virtual void getPosition (Coord3D *pos)
 Returns position camera is looking at (z will be zero)
 
virtual const Coord3Dget3DCameraPosition () const =0
 Returns the actual camera position.
 
virtual Real getZoom ()
 
virtual void setZoom (Real z)
 
virtual Real getHeightAboveGround ()
 
virtual void setHeightAboveGround (Real z)
 
virtual void zoomIn (void)
 Zoom in, closer to the ground, limit to min.
 
virtual void zoomOut (void)
 Zoom out, farther away from the ground, limit to max.
 
virtual void setZoomToDefault (void)
 Set zoom to default value.
 
virtual Real getMaxZoom (void)
 return max zoom value
 
virtual void setOkToAdjustHeight (Bool val)
 Set this to adjust camera height.
 
virtual Real getTerrainHeightUnderCamera ()
 
virtual void setTerrainHeightUnderCamera (Real z)
 
virtual Real getCurrentHeightAboveGround ()
 
virtual void setCurrentHeightAboveGround (Real z)
 
virtual void setFieldOfView (Real angle)
 Set the horizontal field of view angle.
 
virtual Real getFieldOfView (void)
 Get the horizontal field of view angle.
 
Bool worldToScreen (const Coord3D *w, ICoord2D *s)
 Transform world coordinate "w" into screen coordinate "s".
 
virtual WorldToScreenReturn worldToScreenTriReturn (const Coord3D *w, ICoord2D *s)=0
 Like worldToScreen(), but with a more informative return value.
 
virtual void screenToWorld (const ICoord2D *s, Coord3D *w)=0
 Transform screen coordinate "s" into world coordinate "w".
 
virtual void screenToTerrain (const ICoord2D *screen, Coord3D *world)=0
 transform screen coord to a point on the 3D terrain
 
virtual void screenToWorldAtZ (const ICoord2D *s, Coord3D *w, Real z)=0
 transform screen point to world point at the specified world Z value
 
virtual void getLocation (ViewLocation *location)
 write the view's current location in to the view location object
 
virtual void setLocation (const ViewLocation *location)
 set the view's current location from to the view location object
 
virtual void drawView (void)=0
 Render the world visible in this view.
 
virtual void updateView (void)=0
 called once per frame to determine the final camera and object transforms
 
virtual ObjectID getCameraLock () const
 
virtual void setCameraLock (ObjectID id)
 
virtual void snapToCameraLock (void)
 
virtual void setSnapMode (CameraLockType lockType, Real lockDist)
 
virtual DrawablegetCameraLockDrawable () const
 
virtual void setCameraLockDrawable (Drawable *drawable)
 
virtual void setMouseLock (Bool mouseLocked)
 lock/unlock the mouse input to the tactical view
 
virtual Bool isMouseLocked (void)
 is the mouse input locked to the tactical view?
 
virtual void shake (const Coord3D *epicenter, CameraShakeType shakeType)
 Add an impulse force to shake the camera.
 
virtual Real getFXPitch (void) const
 returns the FX pitch angle
 
virtual void forceCameraConstraintRecalc (void)
 
virtual void setGuardBandBias (const Coord2D *gb)=0
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Protected Member Functions

virtual void crc (Xfer *xfer)
 run the "light" crc check on this data structure
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
void setPosition (const Coord3D *pos)
 
const Coord3DgetPosition (void) const
 
virtual ViewprependViewToList (View *list)
 Prepend this view to the given list, return the new list.
 
virtual ViewgetNextView (void)
 Return next view in the set.
 

Protected Attributes

Viewm_next
 List links used by the Display class.
 
UnsignedInt m_id
 Rhe ID of this view.
 
Coord3D m_pos
 Position of this view, in world coordinates.
 
Int m_width
 
Int m_height
 Dimensions of the view.
 
Int m_originX
 
Int m_originY
 Location of top/left view corner.
 
Real m_angle
 Angle at which view has been rotated about the Z axis.
 
Real m_pitchAngle
 Rotation of view direction around horizontal (X) axis.
 
Real m_maxZoom
 Largest zoom value (minimum actual zoom)
 
Real m_minZoom
 Smallest zoom value (maximum actual zoom)
 
Real m_maxHeightAboveGround
 
Real m_minHeightAboveGround
 
Real m_zoom
 Current zoom value.
 
Real m_heightAboveGround
 User's desired height above ground.
 
Bool m_zoomLimited
 Camera restricted in zoom height.
 
Real m_defaultAngle
 
Real m_defaultPitchAngle
 
Real m_currentHeightAboveGround
 Cached value for debugging.
 
Real m_terrainHeightUnderCamera
 Cached value for debugging.
 
ObjectID m_cameraLock
 if nonzero, id of object that the camera should follow
 
Drawablem_cameraLockDrawable
 if nonzero, drawble of object that camera should follow.
 
CameraLockType m_lockType
 are we following or just tethering?
 
Real m_lockDist
 how far can we be when tethered?
 
Real m_FOV
 the current field of view angle
 
Bool m_mouseLocked
 is the mouse input locked to the tactical view?
 
Bool m_okToAdjustHeight
 Should we attempt to adjust camera height?
 
Bool m_snapImmediate
 Should we immediately snap to the object we're following?
 
Coord2D m_guardBandBias
 Exttra beefy margins so huge thins can stay "on-screen".
 

Static Protected Attributes

static UnsignedInt m_idNext = 1
 Used for allocating view ID's for all views.
 

Friends

class Display
 

Detailed Description

The implementation of common view functionality.

Definition at line 69 of file View.h.

Member Enumeration Documentation

◆ CameraLockType

Enumerator
LOCK_FOLLOW 
LOCK_TETHER 

Definition at line 219 of file View.h.

◆ CameraShakeType

Add an impulse force to shake the camera.

Enumerator
SHAKE_SUBTLE 
SHAKE_NORMAL 
SHAKE_STRONG 
SHAKE_SEVERE 
SHAKE_CINE_EXTREME 
SHAKE_CINE_INSANE 
SHAKE_COUNT 

Definition at line 75 of file View.h.

◆ WorldToScreenReturn

Enumerator
WTS_INSIDE_FRUSTUM 
WTS_OUTSIDE_FRUSTUM 
WTS_INVALID 
WTS_COUNT 

Definition at line 87 of file View.h.

Constructor & Destructor Documentation

◆ View()

View::View ( void )

Definition at line 42 of file View.cpp.

◆ ~View()

View::~View ( void )
virtual

Definition at line 85 of file View.cpp.

Member Function Documentation

◆ Add_Camera_Shake()

virtual void View::Add_Camera_Shake ( const Coord3D & position,
float radius,
float duration,
float power )
inlinevirtual

Reimplemented in W3DView.

Definition at line 151 of file View.h.

◆ cameraDisableSlaveMode()

virtual void View::cameraDisableSlaveMode ( void )
inlinevirtual

Reimplemented in W3DView.

Definition at line 150 of file View.h.

◆ cameraEnableSlaveMode()

virtual void View::cameraEnableSlaveMode ( const AsciiString & thingtemplateName,
const AsciiString & boneName )
inlinevirtual

Sets a final move to.

Reimplemented in W3DView.

Definition at line 149 of file View.h.

◆ cameraModFinalLookToward()

virtual void View::cameraModFinalLookToward ( Coord3D * pLoc)
inlinevirtual

Sets a look at point during camera movement.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 145 of file View.h.

◆ cameraModFinalMoveTo()

virtual void View::cameraModFinalMoveTo ( Coord3D * pLoc)
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 146 of file View.h.

◆ cameraModFinalPitch()

virtual void View::cameraModFinalPitch ( Real finalPitch,
Real easeIn,
Real easeOut )
inlinevirtual

Final time multiplier for current camera movement.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 141 of file View.h.

◆ cameraModFinalTimeMultiplier()

virtual void View::cameraModFinalTimeMultiplier ( Int finalMultiplier)
inlinevirtual

Number of frames to average movement for current camera movement.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 140 of file View.h.

◆ cameraModFinalZoom()

virtual void View::cameraModFinalZoom ( Real finalZoom,
Real easeIn,
Real easeOut )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 138 of file View.h.

◆ cameraModFreezeAngle()

virtual void View::cameraModFreezeAngle ( void )
inlinevirtual

Freezes time during the next camera movement.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 143 of file View.h.

◆ cameraModFreezeTime()

virtual void View::cameraModFreezeTime ( void )
inlinevirtual

Final pitch for current camera movement.

Freezes time during the next camera movement.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 142 of file View.h.

◆ cameraModLookToward()

virtual void View::cameraModLookToward ( Coord3D * pLoc)
inlinevirtual

Sets a look at point during camera movement.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 144 of file View.h.

◆ cameraModRollingAverage()

virtual void View::cameraModRollingAverage ( Int framesToAverage)
inlinevirtual

Final zoom for current camera movement.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 139 of file View.h.

◆ crc()

virtual void View::crc ( Xfer * xfer)
inlineprotectedvirtual

run the "light" crc check on this data structure

Implements Snapshot.

Definition at line 240 of file View.h.

◆ drawView()

virtual void View::drawView ( void )
pure virtual

Render the world visible in this view.

Implemented in PlaceholderView, and W3DView.

◆ forceCameraConstraintRecalc()

virtual void View::forceCameraConstraintRecalc ( void )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 232 of file View.h.

◆ forceRedraw()

virtual void View::forceRedraw ( )
pure virtual

Implemented in PlaceholderView, and W3DView.

◆ get3DCameraPosition()

virtual const Coord3D & View::get3DCameraPosition ( ) const
pure virtual

Returns the actual camera position.

Implemented in PlaceholderView, and W3DView.

◆ getAngle()

virtual Real View::getAngle ( void )
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 173 of file View.h.

◆ getCameraLock()

virtual ObjectID View::getCameraLock ( ) const
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 216 of file View.h.

◆ getCameraLockDrawable()

virtual Drawable * View::getCameraLockDrawable ( ) const
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 222 of file View.h.

◆ getCurrentHeightAboveGround()

virtual Real View::getCurrentHeightAboveGround ( )
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 194 of file View.h.

◆ getFieldOfView()

virtual Real View::getFieldOfView ( void )
inlinevirtual

Get the horizontal field of view angle.

Reimplemented in PlaceholderView.

Definition at line 198 of file View.h.

◆ getFXPitch()

virtual Real View::getFXPitch ( void ) const
inlinevirtual

returns the FX pitch angle

Reimplemented in PlaceholderView, and W3DView.

Definition at line 231 of file View.h.

◆ getHeight()

virtual Int View::getHeight ( void )
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 125 of file View.h.

◆ getHeightAboveGround()

virtual Real View::getHeightAboveGround ( )
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 183 of file View.h.

◆ getID()

virtual UnsignedInt View::getID ( void )
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 103 of file View.h.

◆ getLocation()

void View::getLocation ( ViewLocation * location)
virtual

write the view's current location in to the view location object

write the view's current location in to the view location object

Reimplemented in PlaceholderView.

Definition at line 196 of file View.cpp.

◆ getMaxZoom()

virtual Real View::getMaxZoom ( void )
inlinevirtual

return max zoom value

Reimplemented in PlaceholderView.

Definition at line 188 of file View.h.

◆ getNextView()

virtual View * View::getNextView ( void )
inlineprotectedvirtual

Return next view in the set.

Reimplemented in PlaceholderView.

Definition at line 248 of file View.h.

◆ getOrigin()

virtual void View::getOrigin ( Int * x,
Int * y )
inlinevirtual

Return location of top-left view corner on display.

Reimplemented in PlaceholderView.

Definition at line 127 of file View.h.

◆ getPitch()

virtual Real View::getPitch ( void )
inlinevirtual

Return current camera pitch.

Reimplemented in PlaceholderView.

Definition at line 175 of file View.h.

◆ getPosition() [1/2]

virtual void View::getPosition ( Coord3D * pos)
inlinevirtual

Returns position camera is looking at (z will be zero)

Reimplemented in PlaceholderView.

Definition at line 177 of file View.h.

◆ getPosition() [2/2]

const Coord3D * View::getPosition ( void ) const
inlineprotected

Definition at line 245 of file View.h.

◆ getScreenCornerWorldPointsAtZ()

void View::getScreenCornerWorldPointsAtZ ( Coord3D * topLeft,
Coord3D * topRight,
Coord3D * bottomLeft,
Coord3D * bottomRight,
Real z )
virtual

project the 4 corners of this view into the world and return each point as a parameter, the world points are at the requested Z

Reimplemented in PlaceholderView.

Definition at line 225 of file View.cpp.

◆ getTerrainHeightUnderCamera()

virtual Real View::getTerrainHeightUnderCamera ( )
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 192 of file View.h.

◆ getTimeMultiplier()

virtual Int View::getTimeMultiplier ( void )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 166 of file View.h.

◆ getViewFilterMode()

virtual enum FilterModes View::getViewFilterMode ( void )
inlinevirtual

Turns on viewport special effect (black & white mode)

Reimplemented in PlaceholderView, and W3DView.

Definition at line 152 of file View.h.

◆ getViewFilterType()

virtual enum FilterTypes View::getViewFilterType ( void )
inlinevirtual

Turns on viewport special effect (black & white mode)

Reimplemented in PlaceholderView, and W3DView.

Definition at line 153 of file View.h.

◆ getWidth()

virtual Int View::getWidth ( void )
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 123 of file View.h.

◆ getZoom()

virtual Real View::getZoom ( )
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 181 of file View.h.

◆ init()

void View::init ( void )
virtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 89 of file View.cpp.

◆ initHeightForMap()

virtual void View::initHeightForMap ( void )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 132 of file View.h.

◆ isCameraMovementFinished()

virtual Bool View::isCameraMovementFinished ( void )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 137 of file View.h.

◆ isMouseLocked()

virtual Bool View::isMouseLocked ( void )
inlinevirtual

is the mouse input locked to the tactical view?

Reimplemented in PlaceholderView.

Definition at line 226 of file View.h.

◆ isTimeFrozen()

virtual Bool View::isTimeFrozen ( void )
inlinevirtual

Rotate camera to face a location.

Freezes time during the next camera movement.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 165 of file View.h.

◆ isZoomLimited()

virtual Bool View::isZoomLimited ( void )
inlinevirtual

get status of zoom limit

Reimplemented in PlaceholderView.

Definition at line 106 of file View.h.

◆ iterateDrawablesInRegion()

virtual Int View::iterateDrawablesInRegion ( IRegion2D * screenRegion,
Bool(* callback )(Drawable *draw, void *userData),
void * userData )
pure virtual

all drawables in the 2D screen region will call the 'callback'

Implemented in PlaceholderView, and W3DView.

◆ loadPostProcess()

virtual void View::loadPostProcess ( void )
inlineprotectedvirtual

post process phase for loading save games. All save systems have their xfer run using XferLoad mode, and then all systems each have their post process run

Implements Snapshot.

Definition at line 242 of file View.h.

◆ lookAt()

void View::lookAt ( const Coord3D * o)
virtual

Center the view on the given coordinate.

Center the view on the given coordinate.

Todo
this needs to be changed to be 3D, this is still old 2D stuff

Reimplemented in PlaceholderView, and W3DView.

Definition at line 141 of file View.cpp.

◆ moveCameraAlongWaypointPath()

virtual void View::moveCameraAlongWaypointPath ( Waypoint * way,
Int frames,
Int shutter,
Bool orient,
Real easeIn,
Real easeOut )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 136 of file View.h.

◆ moveCameraTo()

virtual void View::moveCameraTo ( const Coord3D * o,
Int frames,
Int shutter,
Bool orient,
Real easeIn,
Real easeOut )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 135 of file View.h.

◆ pickDrawable()

virtual Drawable * View::pickDrawable ( const ICoord2D * screen,
Bool forceAttack,
PickType pickType )
pure virtual

pick drawable given the screen pixel coords. If force attack, picks bridges as well.

Implemented in PlaceholderView, and W3DView.

◆ pitchCamera()

virtual void View::pitchCamera ( Real finalPitch,
Int milliseconds,
Real easeIn,
Real easeOut )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 170 of file View.h.

◆ prependViewToList()

View * View::prependViewToList ( View * list)
protectedvirtual

Prepend this view to the given list, return the new list.

Prepend this view to the given list, return the new list.

Reimplemented in PlaceholderView.

Definition at line 122 of file View.cpp.

◆ reset()

void View::reset ( void )
virtual

Reimplemented in W3DView.

Definition at line 113 of file View.cpp.

◆ resetCamera()

virtual void View::resetCamera ( const Coord3D * location,
Int frames,
Real easeIn,
Real easeOut )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 161 of file View.h.

◆ rotateCamera()

virtual void View::rotateCamera ( Real rotations,
Int frames,
Real easeIn,
Real easeOut )
inlinevirtual

Move camera to location, and reset to default angle & zoom.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 162 of file View.h.

◆ rotateCameraTowardObject()

virtual void View::rotateCameraTowardObject ( ObjectID id,
Int milliseconds,
Int holdMilliseconds,
Real easeIn,
Real easeOut )
inlinevirtual

Rotate camera about current viewpoint.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 163 of file View.h.

◆ rotateCameraTowardPosition()

virtual void View::rotateCameraTowardPosition ( const Coord3D * pLoc,
Int milliseconds,
Real easeIn,
Real easeOut,
Bool reverseRotation )
inlinevirtual

Rotate camera to face an object, and hold on it.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 164 of file View.h.

◆ screenToTerrain()

virtual void View::screenToTerrain ( const ICoord2D * screen,
Coord3D * world )
pure virtual

transform screen coord to a point on the 3D terrain

Implemented in PlaceholderView, and W3DView.

◆ screenToWorld()

virtual void View::screenToWorld ( const ICoord2D * s,
Coord3D * w )
pure virtual

Transform screen coordinate "s" into world coordinate "w".

Implemented in PlaceholderView, and W3DView.

◆ screenToWorldAtZ()

virtual void View::screenToWorldAtZ ( const ICoord2D * s,
Coord3D * w,
Real z )
pure virtual

transform screen point to world point at the specified world Z value

Implemented in PlaceholderView, and W3DView.

◆ scrollBy()

void View::scrollBy ( Coord2D * delta)
virtual

Init the camera height for the map at the current position.

Shift the view by the given delta

Shift the view by the given delta.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 154 of file View.cpp.

◆ set3DWireFrameMode()

virtual void View::set3DWireFrameMode ( Bool enable)
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 159 of file View.h.

◆ setAngle()

void View::setAngle ( Real angle)
virtual

Rotate the view around the up axis to the given angle.

Rotate the view around the up axis by the given angle.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 164 of file View.cpp.

◆ setAngleAndPitchToDefault()

void View::setAngleAndPitchToDefault ( void )
virtual

Set the view angle back to default.

Set the view angle back to default

Reimplemented in PlaceholderView, and W3DView.

Definition at line 187 of file View.cpp.

◆ setCameraLock()

virtual void View::setCameraLock ( ObjectID id)
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 217 of file View.h.

◆ setCameraLockDrawable()

virtual void View::setCameraLockDrawable ( Drawable * drawable)
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 223 of file View.h.

◆ setCurrentHeightAboveGround()

virtual void View::setCurrentHeightAboveGround ( Real z)
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 195 of file View.h.

◆ setDefaultView()

virtual void View::setDefaultView ( Real pitch,
Real angle,
Real maxHeight )
inlinevirtual

Set the time multiplier.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 168 of file View.h.

◆ setFadeParameters()

virtual void View::setFadeParameters ( Int fadeFrames,
Int direction )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 158 of file View.h.

◆ setFieldOfView()

virtual void View::setFieldOfView ( Real angle)
inlinevirtual

Set the horizontal field of view angle.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 197 of file View.h.

◆ setGuardBandBias()

virtual void View::setGuardBandBias ( const Coord2D * gb)
pure virtual

Implemented in PlaceholderView, and W3DView.

◆ setHeight()

virtual void View::setHeight ( Int height)
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 124 of file View.h.

◆ setHeightAboveGround()

virtual void View::setHeightAboveGround ( Real z)
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 184 of file View.h.

◆ setLocation()

void View::setLocation ( const ViewLocation * location)
virtual

set the view's current location from to the view location object

set the view's current location from to the view location object

Reimplemented in PlaceholderView.

Definition at line 208 of file View.cpp.

◆ setMouseLock()

virtual void View::setMouseLock ( Bool mouseLocked)
inlinevirtual

lock/unlock the mouse input to the tactical view

Reimplemented in PlaceholderView.

Definition at line 225 of file View.h.

◆ setOkToAdjustHeight()

virtual void View::setOkToAdjustHeight ( Bool val)
inlinevirtual

Set this to adjust camera height.

Reimplemented in PlaceholderView.

Definition at line 189 of file View.h.

◆ setOrigin()

virtual void View::setOrigin ( Int x,
Int y )
inlinevirtual

Sets location of top-left view corner on display.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 126 of file View.h.

◆ setPitch()

void View::setPitch ( Real angle)
virtual

Rotate the view around the horizontal axis to the given angle.

Rotate the view around the horizontal (X) axis to the given angle.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 172 of file View.cpp.

◆ setPosition()

void View::setPosition ( const Coord3D * pos)
inlineprotected

Definition at line 244 of file View.h.

◆ setSnapMode()

virtual void View::setSnapMode ( CameraLockType lockType,
Real lockDist )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 220 of file View.h.

◆ setTerrainHeightUnderCamera()

virtual void View::setTerrainHeightUnderCamera ( Real z)
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 193 of file View.h.

◆ setTimeMultiplier()

virtual void View::setTimeMultiplier ( Int multiple)
inlinevirtual

Get the time multiplier.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 167 of file View.h.

◆ setViewFilter()

virtual Bool View::setViewFilter ( enum FilterTypes filter)
inlinevirtual

Passes a position to the special effect filter.

Turns on viewport special effect (black & white mode)

Reimplemented in PlaceholderView, and W3DView.

Definition at line 156 of file View.h.

◆ setViewFilterMode()

virtual Bool View::setViewFilterMode ( enum FilterModes filterMode)
inlinevirtual

Turns on viewport special effect (black & white mode)

Reimplemented in PlaceholderView, and W3DView.

Definition at line 154 of file View.h.

◆ setViewFilterPos()

virtual void View::setViewFilterPos ( const Coord3D * pos)
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 155 of file View.h.

◆ setWidth()

virtual void View::setWidth ( Int width)
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 122 of file View.h.

◆ setZoom()

virtual void View::setZoom ( Real z)
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 182 of file View.h.

◆ setZoomLimited()

virtual void View::setZoomLimited ( Bool limit)
inlinevirtual

limit the zoom height

Reimplemented in PlaceholderView.

Definition at line 105 of file View.h.

◆ setZoomToDefault()

virtual void View::setZoomToDefault ( void )
inlinevirtual

Set zoom to default value.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 187 of file View.h.

◆ shake()

virtual void View::shake ( const Coord3D * epicenter,
CameraShakeType shakeType )
inlinevirtual

Add an impulse force to shake the camera.

Reimplemented in PlaceholderView, and W3DView.

Definition at line 229 of file View.h.

◆ snapToCameraLock()

virtual void View::snapToCameraLock ( void )
inlinevirtual

Reimplemented in PlaceholderView.

Definition at line 218 of file View.h.

◆ updateView()

virtual void View::updateView ( void )
pure virtual

called once per frame to determine the final camera and object transforms

Implemented in PlaceholderView, and W3DView.

◆ worldToScreen()

Bool View::worldToScreen ( const Coord3D * w,
ICoord2D * s )
inline

Transform world coordinate "w" into screen coordinate "s".

Definition at line 200 of file View.h.

◆ worldToScreenTriReturn()

virtual WorldToScreenReturn View::worldToScreenTriReturn ( const Coord3D * w,
ICoord2D * s )
pure virtual

Like worldToScreen(), but with a more informative return value.

Implemented in PlaceholderView, and W3DView.

◆ xfer()

void View::xfer ( Xfer * xfer)
protectedvirtual

Xfer method for a view

Implements Snapshot.

Definition at line 260 of file View.cpp.

◆ zoomCamera()

virtual void View::zoomCamera ( Real finalZoom,
Int milliseconds,
Real easeIn,
Real easeOut )
inlinevirtual

Reimplemented in PlaceholderView, and W3DView.

Definition at line 169 of file View.h.

◆ zoomIn()

void View::zoomIn ( void )
virtual

Zoom in, closer to the ground, limit to min.

Reimplemented in PlaceholderView.

Definition at line 128 of file View.cpp.

◆ zoomOut()

void View::zoomOut ( void )
virtual

Zoom out, farther away from the ground, limit to max.

Reimplemented in PlaceholderView.

Definition at line 133 of file View.cpp.

Friends And Related Symbol Documentation

◆ Display

friend class Display
friend

Definition at line 237 of file View.h.

Member Data Documentation

◆ m_angle

Real View::m_angle
protected

Angle at which view has been rotated about the Z axis.

Definition at line 262 of file View.h.

◆ m_cameraLock

ObjectID View::m_cameraLock
protected

if nonzero, id of object that the camera should follow

Definition at line 277 of file View.h.

◆ m_cameraLockDrawable

Drawable* View::m_cameraLockDrawable
protected

if nonzero, drawble of object that camera should follow.

Definition at line 278 of file View.h.

◆ m_currentHeightAboveGround

Real View::m_currentHeightAboveGround
protected

Cached value for debugging.

Definition at line 274 of file View.h.

◆ m_defaultAngle

Real View::m_defaultAngle
protected

Definition at line 272 of file View.h.

◆ m_defaultPitchAngle

Real View::m_defaultPitchAngle
protected

Definition at line 273 of file View.h.

◆ m_FOV

Real View::m_FOV
protected

the current field of view angle

Definition at line 282 of file View.h.

◆ m_guardBandBias

Coord2D View::m_guardBandBias
protected

Exttra beefy margins so huge thins can stay "on-screen".

Definition at line 288 of file View.h.

◆ m_height

Int View::m_height
protected

Dimensions of the view.

Definition at line 259 of file View.h.

◆ m_heightAboveGround

Real View::m_heightAboveGround
protected

User's desired height above ground.

Definition at line 270 of file View.h.

◆ m_id

UnsignedInt View::m_id
protected

Rhe ID of this view.

Definition at line 255 of file View.h.

◆ m_idNext

UnsignedInt View::m_idNext = 1
staticprotected

Used for allocating view ID's for all views.

Definition at line 256 of file View.h.

◆ m_lockDist

Real View::m_lockDist
protected

how far can we be when tethered?

Definition at line 280 of file View.h.

◆ m_lockType

CameraLockType View::m_lockType
protected

are we following or just tethering?

Definition at line 279 of file View.h.

◆ m_maxHeightAboveGround

Real View::m_maxHeightAboveGround
protected

Definition at line 267 of file View.h.

◆ m_maxZoom

Real View::m_maxZoom
protected

Largest zoom value (minimum actual zoom)

Definition at line 265 of file View.h.

◆ m_minHeightAboveGround

Real View::m_minHeightAboveGround
protected

Definition at line 268 of file View.h.

◆ m_minZoom

Real View::m_minZoom
protected

Smallest zoom value (maximum actual zoom)

Definition at line 266 of file View.h.

◆ m_mouseLocked

Bool View::m_mouseLocked
protected

is the mouse input locked to the tactical view?

Definition at line 283 of file View.h.

◆ m_next

View* View::m_next
protected

List links used by the Display class.

Definition at line 253 of file View.h.

◆ m_okToAdjustHeight

Bool View::m_okToAdjustHeight
protected

Should we attempt to adjust camera height?

Definition at line 285 of file View.h.

◆ m_originX

Int View::m_originX
protected

Definition at line 260 of file View.h.

◆ m_originY

Int View::m_originY
protected

Location of top/left view corner.

Definition at line 260 of file View.h.

◆ m_pitchAngle

Real View::m_pitchAngle
protected

Rotation of view direction around horizontal (X) axis.

Definition at line 263 of file View.h.

◆ m_pos

Coord3D View::m_pos
protected

Position of this view, in world coordinates.

Definition at line 258 of file View.h.

◆ m_snapImmediate

Bool View::m_snapImmediate
protected

Should we immediately snap to the object we're following?

Definition at line 286 of file View.h.

◆ m_terrainHeightUnderCamera

Real View::m_terrainHeightUnderCamera
protected

Cached value for debugging.

Definition at line 275 of file View.h.

◆ m_width

Int View::m_width
protected

Definition at line 259 of file View.h.

◆ m_zoom

Real View::m_zoom
protected

Current zoom value.

Definition at line 269 of file View.h.

◆ m_zoomLimited

Bool View::m_zoomLimited
protected

Camera restricted in zoom height.

Definition at line 271 of file View.h.


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