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

#include <W3DView.h>

Inherits View, and SubsystemInterface.

Public Member Functions

 W3DView ()
 
 ~W3DView ()
 
virtual void init (void)
 init/re-init the W3DView
 
virtual void reset (void)
 
virtual void drawView (void)
 draw this view
 
virtual void updateView (void)
 called once per frame to determine the final camera and object transforms
 
virtual void draw ()
 draw this view
 
virtual void update ()
 called once per frame to determine the final camera and object transforms
 
virtual DrawablepickDrawable (const ICoord2D *screen, Bool forceAttack, PickType pickType)
 pick drawable given the screen pixel coords. If force attack, picks bridges.
 
virtual Int iterateDrawablesInRegion (IRegion2D *screenRegion, Bool(*callback)(Drawable *draw, void *userData), void *userData)
 all drawables in the 2D screen region will call the 'callback'
 
virtual void setWidth (Int width)
 
virtual void setHeight (Int height)
 
virtual void setOrigin (Int x, Int y)
 Sets location of top-left view corner on display.
 
virtual void scrollBy (Coord2D *delta)
 Shift the view by the given delta.
 
virtual void forceRedraw ()
 
virtual void setAngle (Real angle)
 Rotate the view around the up axis by the given angle.
 
virtual void setPitch (Real angle)
 Rotate the view around the horizontal axis to the given angle.
 
virtual void setAngleAndPitchToDefault (void)
 Set the view angle back to default.
 
virtual void lookAt (const Coord3D *o)
 Center the view on the given coordinate.
 
virtual void initHeightForMap (void)
 Init the camera height for the map at the current position.
 
virtual void moveCameraTo (const Coord3D *o, Int miliseconds, Int shutter, Bool orient, Real easeIn, Real easeOut)
 
virtual void moveCameraAlongWaypointPath (Waypoint *pWay, Int frames, Int shutter, Bool orient, Real easeIn, Real easeOut)
 
virtual Bool isCameraMovementFinished (void)
 
virtual Bool isCameraMovementAtWaypointAlongPath (void)
 
virtual void resetCamera (const Coord3D *location, Int frames, Real easeIn, Real easeOut)
 Move camera to location, and reset to default angle & zoom.
 
virtual void rotateCamera (Real rotations, Int frames, Real easeIn, Real easeOut)
 Rotate camera about current viewpoint.
 
virtual void rotateCameraTowardObject (ObjectID id, Int milliseconds, Int holdMilliseconds, Real easeIn, Real easeOut)
 Rotate camera to face an object, and hold on it.
 
virtual void rotateCameraTowardPosition (const Coord3D *pLoc, Int milliseconds, Real easeIn, Real easeOut, Bool reverseRotation)
 Rotate camera to face a location.
 
virtual void cameraModFreezeTime (void)
 Freezes time during the next camera movement.
 
virtual void cameraModFreezeAngle (void)
 Freezes time during the next camera movement.
 
virtual Bool isTimeFrozen (void)
 Freezes time during the next camera movement.
 
virtual void cameraModFinalZoom (Real finalZoom, Real easeIn, Real easeOut)
 Final zoom for current camera movement.
 
virtual void cameraModRollingAverage (Int framesToAverage)
 Number of frames to average movement for current camera movement.
 
virtual void cameraModFinalTimeMultiplier (Int finalMultiplier)
 Final time multiplier for current camera movement.
 
virtual void cameraModFinalPitch (Real finalPitch, Real easeIn, Real easeOut)
 Final pitch for current 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)
 Sets a final move to.
 
virtual void cameraEnableSlaveMode (const AsciiString &thingtemplateName, const AsciiString &boneName)
 Sets a final move to.
 
virtual void cameraDisableSlaveMode (void)
 
virtual void cameraEnableRealZoomMode (void)
 
virtual void cameraDisableRealZoomMode (void)
 
virtual void Add_Camera_Shake (const Coord3D &position, float radius, float duration, float power)
 
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 setHeightAboveGround (Real z)
 
virtual void setZoom (Real z)
 
virtual void setZoomToDefault (void)
 Set zoom to default value.
 
virtual void setFieldOfView (Real angle)
 Set the horizontal field of view angle.
 
virtual WorldToScreenReturn worldToScreenTriReturn (const Coord3D *w, ICoord2D *s)
 Transform world coordinate "w" into screen coordinate "s".
 
virtual void screenToWorld (const ICoord2D *s, Coord3D *w)
 Transform screen coordinate "s" into world coordinate "w".
 
virtual void screenToTerrain (const ICoord2D *screen, Coord3D *world)
 transform screen coord to a point on the 3D terrain
 
virtual void screenToWorldAtZ (const ICoord2D *s, Coord3D *w, Real z)
 transform screen point to world point at the specified world Z value
 
CameraClassget3DCamera () const
 
virtual const Coord3Dget3DCameraPosition () const
 Returns the actual camera position.
 
virtual void setCameraLock (ObjectID id)
 
virtual void setSnapMode (CameraLockType lockType, Real lockDist)
 
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 Bool setViewFilterMode (enum FilterModes filterMode)
 Turns on viewport special effect (black & white mode)
 
virtual Bool setViewFilter (enum FilterTypes filter)
 Turns on viewport special effect (black & white mode)
 
virtual void setViewFilterPos (const Coord3D *pos)
 Passes a position to the special effect filter.
 
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 void setFadeParameters (Int fadeFrames, Int direction)
 
virtual void set3DWireFrameMode (Bool enable)
 enables custom wireframe rendering of 3D viewport
 
Bool updateCameraMovements (void)
 
virtual void forceCameraConstraintRecalc (void)
 
virtual void setGuardBandBias (const Coord2D *gb)
 
- Public Member Functions inherited from View
 View (void)
 
virtual ~View (void)
 
virtual UnsignedInt getID (void)
 
virtual void setZoomLimited (Bool limit)
 limit the zoom height
 
virtual Bool isZoomLimited (void)
 get status of zoom limit
 
virtual void getScreenCornerWorldPointsAtZ (Coord3D *topLeft, Coord3D *topRight, Coord3D *bottomLeft, Coord3D *bottomRight, Real z)
 
virtual Int getWidth (void)
 
virtual Int getHeight (void)
 
virtual void getOrigin (Int *x, Int *y)
 Return location of top-left view corner on display.
 
virtual Real getAngle (void)
 
virtual Real getPitch (void)
 Return current camera pitch.
 
virtual void getPosition (Coord3D *pos)
 Returns position camera is looking at (z will be zero)
 
virtual Real getZoom ()
 
virtual Real getHeightAboveGround ()
 
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 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 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 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 ObjectID getCameraLock () const
 
virtual void snapToCameraLock (void)
 
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?
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 

Additional Inherited Members

- Public Types inherited from View
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 }
 
- Protected Member Functions inherited from View
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 inherited from View
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".
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 
- Static Protected Attributes inherited from View
static UnsignedInt m_idNext = 1
 Used for allocating view ID's for all views.
 

Detailed Description

W3DView implementation of the game view class. This allows us to create a "window" into the game world that can be sized and contains controls for manipulating the camera

Definition at line 132 of file W3DView.h.

Constructor & Destructor Documentation

◆ W3DView()

W3DView::W3DView ( )

Definition at line 159 of file W3DView.cpp.

◆ ~W3DView()

W3DView::~W3DView ( )

Definition at line 193 of file W3DView.cpp.

Member Function Documentation

◆ Add_Camera_Shake()

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

Reimplemented from View.

Definition at line 3352 of file W3DView.cpp.

◆ cameraDisableRealZoomMode()

void W3DView::cameraDisableRealZoomMode ( void )
virtual

Definition at line 3342 of file W3DView.cpp.

◆ cameraDisableSlaveMode()

void W3DView::cameraDisableSlaveMode ( void )
virtual

Reimplemented from View.

Definition at line 3329 of file W3DView.cpp.

◆ cameraEnableRealZoomMode()

void W3DView::cameraEnableRealZoomMode ( void )
virtual

Definition at line 3334 of file W3DView.cpp.

◆ cameraEnableSlaveMode()

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

Sets a final move to.

Reimplemented from View.

Definition at line 3322 of file W3DView.cpp.

◆ cameraModFinalLookToward()

void W3DView::cameraModFinalLookToward ( Coord3D * pLoc)
virtual

Sets a look at point during camera movement.

Sets the look toward point for the end of a camera movement.

Reimplemented from View.

Definition at line 2684 of file W3DView.cpp.

◆ cameraModFinalMoveTo()

void W3DView::cameraModFinalMoveTo ( Coord3D * pLoc)
virtual

Sets a final move to.

Sets the look toward point for the end of a camera movement.

Reimplemented from View.

Definition at line 2661 of file W3DView.cpp.

◆ cameraModFinalPitch()

void W3DView::cameraModFinalPitch ( Real finalPitch,
Real easeIn,
Real easeOut )
virtual

Final pitch for current camera movement.

Sets the final pitch for a camera movement.

Reimplemented from View.

Definition at line 2775 of file W3DView.cpp.

◆ cameraModFinalTimeMultiplier()

void W3DView::cameraModFinalTimeMultiplier ( Int finalMultiplier)
virtual

Final time multiplier for current camera movement.

Sets the final time multiplier for a camera movement.

Reimplemented from View.

Definition at line 2740 of file W3DView.cpp.

◆ cameraModFinalZoom()

void W3DView::cameraModFinalZoom ( Real finalZoom,
Real easeIn,
Real easeOut )
virtual

Final zoom for current camera movement.

Sets the final zoom for a camera movement.

Reimplemented from View.

Definition at line 2561 of file W3DView.cpp.

◆ cameraModFreezeAngle()

void W3DView::cameraModFreezeAngle ( void )
virtual

Freezes time during the next camera movement.

Sets the final zoom for a camera movement.

Reimplemented from View.

Definition at line 2588 of file W3DView.cpp.

◆ cameraModFreezeTime()

virtual void W3DView::cameraModFreezeTime ( void )
inlinevirtual

Freezes time during the next camera movement.

Reimplemented from View.

Definition at line 176 of file W3DView.h.

◆ cameraModLookToward()

void W3DView::cameraModLookToward ( Coord3D * pLoc)
virtual

Sets a look at point during camera movement.

Sets the look toward point for a camera movement.

Reimplemented from View.

Definition at line 2609 of file W3DView.cpp.

◆ cameraModRollingAverage()

void W3DView::cameraModRollingAverage ( Int framesToAverage)
virtual

Number of frames to average movement for current camera movement.

Sets the number of frames to average motion for a camera movement

Reimplemented from View.

Definition at line 2766 of file W3DView.cpp.

◆ draw()

void W3DView::draw ( void )
virtual

draw this view

Todo
: Don't clear z-buffer unless shader uses z-bias or anything else that would cause <= z to fail on normal render.
Todo
we might want to consider wiping this iterate out if there is nothing to post draw

Reimplemented from SubsystemInterface.

Definition at line 1533 of file W3DView.cpp.

◆ drawView()

void W3DView::drawView ( void )
virtual

draw this view

Draw member for the W3D window, this will literally draw the window for this view

Implements View.

Definition at line 1527 of file W3DView.cpp.

◆ forceCameraConstraintRecalc()

virtual void W3DView::forceCameraConstraintRecalc ( void )
inlinevirtual

Reimplemented from View.

Definition at line 231 of file W3DView.h.

◆ forceRedraw()

void W3DView::forceRedraw ( )
virtual

Implements View.

Definition at line 1851 of file W3DView.cpp.

◆ get3DCamera()

CameraClass * W3DView::get3DCamera ( ) const
inline

Definition at line 210 of file W3DView.h.

◆ get3DCameraPosition()

const Coord3D & W3DView::get3DCameraPosition ( ) const
virtual

Returns the actual camera position.

Implements View.

Definition at line 670 of file W3DView.cpp.

◆ getFXPitch()

virtual Real W3DView::getFXPitch ( void ) const
inlinevirtual

returns the FX pitch angle

Reimplemented from View.

Definition at line 220 of file W3DView.h.

◆ getTimeMultiplier()

virtual Int W3DView::getTimeMultiplier ( void )
inlinevirtual

Reimplemented from View.

Definition at line 193 of file W3DView.h.

◆ getViewFilterMode()

virtual enum FilterModes W3DView::getViewFilterMode ( void )
inlinevirtual

Turns on viewport special effect (black & white mode)

Reimplemented from View.

Definition at line 225 of file W3DView.h.

◆ getViewFilterType()

virtual enum FilterTypes W3DView::getViewFilterType ( void )
inlinevirtual

Turns on viewport special effect (black & white mode)

Reimplemented from View.

Definition at line 226 of file W3DView.h.

◆ init()

void W3DView::init ( void )
virtual

init/re-init the W3DView

Reimplemented from View.

Definition at line 633 of file W3DView.cpp.

◆ initHeightForMap()

void W3DView::initHeightForMap ( void )
virtual

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

Reimplemented from View.

Definition at line 2378 of file W3DView.cpp.

◆ isCameraMovementAtWaypointAlongPath()

Bool W3DView::isCameraMovementAtWaypointAlongPath ( void )
virtual

Definition at line 2830 of file W3DView.cpp.

◆ isCameraMovementFinished()

Bool W3DView::isCameraMovementFinished ( void )
virtual

Reimplemented from View.

Definition at line 2813 of file W3DView.cpp.

◆ isTimeFrozen()

virtual Bool W3DView::isTimeFrozen ( void )
inlinevirtual

Freezes time during the next camera movement.

Reimplemented from View.

Definition at line 178 of file W3DView.h.

◆ iterateDrawablesInRegion()

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

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

all the drawables in the view, that fall within the 2D screen region will call the callback function. The number of drawables that passed the test are returned. Screen coordinates assumed in absolute values relative to full display resolution.

Todo
we need to have partitions of which drawables are in the view so we don't have to march through the whole list
Todo
use fast int->real type casts here later
Todo
use a real 3D position in the drawable

Implements View.

Definition at line 2091 of file W3DView.cpp.

◆ lookAt()

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

Center the view on the given coordinate.

Reimplemented from View.

Definition at line 2328 of file W3DView.cpp.

◆ moveCameraAlongWaypointPath()

void W3DView::moveCameraAlongWaypointPath ( Waypoint * pWay,
Int milliseconds,
Int shutter,
Bool orient,
Real easeIn,
Real easeOut )
virtual

Move camera along a waypoint path in an interesting fashion. Sets up parameters that get evaluated in draw().

Reimplemented from View.

Definition at line 2844 of file W3DView.cpp.

◆ moveCameraTo()

void W3DView::moveCameraTo ( const Coord3D * o,
Int milliseconds,
Int shutter,
Bool orient,
Real easeIn,
Real easeOut )
virtual

Move camera to in an interesting fashion. Sets up parameters that get evaluated in draw().

Reimplemented from View.

Definition at line 2398 of file W3DView.cpp.

◆ pickDrawable()

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

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

cast a ray from the screen coords into the scene and return a drawable there if present. Screen coordinates assumed in absolute values relative to full display resolution.

Todo
terrain and picking!

Implements View.

Definition at line 2207 of file W3DView.cpp.

◆ pitchCamera()

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

Reimplemented from View.

Definition at line 2544 of file W3DView.cpp.

◆ reset()

void W3DView::reset ( void )
virtual

Reimplemented from View.

Definition at line 680 of file W3DView.cpp.

◆ resetCamera()

void W3DView::resetCamera ( const Coord3D * location,
Int milliseconds,
Real easeIn,
Real easeOut )
virtual

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

Move camera to a waypoint, resetting the default angle, pitch & zoom along the way..

Reimplemented from View.

Definition at line 2789 of file W3DView.cpp.

◆ rotateCamera()

void W3DView::rotateCamera ( Real rotations,
Int milliseconds,
Real easeIn,
Real easeOut )
virtual

Rotate camera about current viewpoint.

Rotate the camera

Reimplemented from View.

Definition at line 2431 of file W3DView.cpp.

◆ rotateCameraTowardObject()

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

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

Rotate the camera to follow a unit

Reimplemented from View.

Definition at line 2456 of file W3DView.cpp.

◆ rotateCameraTowardPosition()

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

Rotate camera to face a location.

Rotate camera to face a location

Reimplemented from View.

Definition at line 2484 of file W3DView.cpp.

◆ screenToTerrain()

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

transform screen coord to a point on the 3D terrain

convert a pixel (x,y) to a location in the world on the terrain. Screen coordinates assumed in absolute values relative to full display resolution.

Implements View.

Definition at line 2265 of file W3DView.cpp.

◆ screenToWorld()

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

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

Using the W3D camera translate the screen coord to world coord

Implements View.

Definition at line 2071 of file W3DView.cpp.

◆ screenToWorldAtZ()

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

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

Transformt he screen pixel coord passed in, to a world coordinate at the specified z value

Implements View.

Definition at line 3311 of file W3DView.cpp.

◆ scrollBy()

void W3DView::scrollBy ( Coord2D * delta)
virtual

Shift the view by the given delta.

Scroll the view by the given delta in SCREEN COORDINATES, this interface assumes we will be scrolling along the X,Y plane

Reimplemented from View.

Definition at line 1803 of file W3DView.cpp.

◆ set3DWireFrameMode()

void W3DView::set3DWireFrameMode ( Bool enable)
virtual

enables custom wireframe rendering of 3D viewport

Reimplemented from View.

Definition at line 1450 of file W3DView.cpp.

◆ setAngle()

void W3DView::setAngle ( Real angle)
virtual

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

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

Reimplemented from View.

Definition at line 1861 of file W3DView.cpp.

◆ setAngleAndPitchToDefault()

void W3DView::setAngleAndPitchToDefault ( void )
virtual

Set the view angle back to default.

Set the view angle & pitch back to default

Reimplemented from View.

Definition at line 1901 of file W3DView.cpp.

◆ setCameraLock()

void W3DView::setCameraLock ( ObjectID id)
virtual

Reimplemented from View.

Definition at line 1781 of file W3DView.cpp.

◆ setDefaultView()

void W3DView::setDefaultView ( Real pitch,
Real angle,
Real maxHeight )
virtual

Set the time multiplier.

Reimplemented from View.

Definition at line 1914 of file W3DView.cpp.

◆ setFadeParameters()

void W3DView::setFadeParameters ( Int fadeFrames,
Int direction )
virtual

Reimplemented from View.

Definition at line 1444 of file W3DView.cpp.

◆ setFieldOfView()

void W3DView::setFieldOfView ( Real angle)
virtual

Set the horizontal field of view angle.

Set the horizontal field of view angle

Reimplemented from View.

Definition at line 2005 of file W3DView.cpp.

◆ setGuardBandBias()

virtual void W3DView::setGuardBandBias ( const Coord2D * gb)
inlinevirtual

Implements View.

Definition at line 233 of file W3DView.h.

◆ setHeight()

void W3DView::setHeight ( Int height)
virtual

Sets the height of the viewport, while maintaining original camera perspective.

Reimplemented from View.

Definition at line 204 of file W3DView.cpp.

◆ setHeightAboveGround()

void W3DView::setHeightAboveGround ( Real z)
virtual

Reimplemented from View.

Definition at line 1926 of file W3DView.cpp.

◆ setOrigin()

void W3DView::setOrigin ( Int x,
Int y )
virtual

Sets location of top-left view corner on display.

Sets location of top-left view corner on display

Reimplemented from View.

Definition at line 238 of file W3DView.cpp.

◆ setPitch()

void W3DView::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 from View.

Definition at line 1883 of file W3DView.cpp.

◆ setSnapMode()

void W3DView::setSnapMode ( CameraLockType lockType,
Real lockDist )
virtual

Reimplemented from View.

Definition at line 1793 of file W3DView.cpp.

◆ setTimeMultiplier()

virtual void W3DView::setTimeMultiplier ( Int multiple)
inlinevirtual

Get the time multiplier.

Reimplemented from View.

Definition at line 194 of file W3DView.h.

◆ setViewFilter()

Bool W3DView::setViewFilter ( enum FilterTypes filter)
virtual

Turns on viewport special effect (black & white mode)

Sets the view filter.

Reimplemented from View.

Definition at line 1483 of file W3DView.cpp.

◆ setViewFilterMode()

Bool W3DView::setViewFilterMode ( enum FilterModes filterMode)
virtual

Turns on viewport special effect (black & white mode)

Sets the view filter mode.

Reimplemented from View.

Definition at line 1465 of file W3DView.cpp.

◆ setViewFilterPos()

void W3DView::setViewFilterPos ( const Coord3D * pos)
virtual

Passes a position to the special effect filter.

Sets the view filter mode.

Reimplemented from View.

Definition at line 1458 of file W3DView.cpp.

◆ setWidth()

void W3DView::setWidth ( Int width)
virtual

Sets the width of the viewport, while maintaining original camera perspective.

Reimplemented from View.

Definition at line 219 of file W3DView.cpp.

◆ setZoom()

void W3DView::setZoom ( Real z)
virtual

Reimplemented from View.

Definition at line 1954 of file W3DView.cpp.

◆ setZoomToDefault()

void W3DView::setZoomToDefault ( void )
virtual

Set zoom to default value.

Reimplemented from View.

Definition at line 1976 of file W3DView.cpp.

◆ shake()

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

Add an impulse force to shake the camera.

Add an impulse force to shake the camera. The camera shake is a simple simulation of an oscillating spring/damper. The idea is that some sort of shock has "pushed" the camera once, as an impluse, after which the camera vibrates back to its rest position.

Todo
This should be part of "View", not "W3DView".
Todo
make this 3D once we have the real "lookat" spot

Reimplemented from View.

Definition at line 3248 of file W3DView.cpp.

◆ update()

void W3DView::update ( void )
virtual

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

Todo
Make this framerate-independent
Todo
this needs to use a real region partition or something

Implements SubsystemInterface.

Definition at line 1084 of file W3DView.cpp.

◆ updateCameraMovements()

Bool W3DView::updateCameraMovements ( void )

Definition at line 1039 of file W3DView.cpp.

◆ updateView()

void W3DView::updateView ( void )
virtual

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

This function performs all actions which affect the camera transform or 3D objects rendered in this frame.

MW: I moved this code out out W3DView::draw() so that we can get final camera and object positions before any rendering begins. This was necessary so that reflection textures (which update before the main rendering loop) could get a correct version of the scene. Without this change, the reflections were always 1 frame behind the non-reflected view.

Implements View.

Definition at line 1078 of file W3DView.cpp.

◆ worldToScreenTriReturn()

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

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

Using the W3D camera translate the world coordinate to a screen coord. Screen coordinates returned in absolute values relative to full display resolution.
Returns if the point is on screen, off screen, or not transformable

Implements View.

Definition at line 2021 of file W3DView.cpp.

◆ zoomCamera()

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

Reimplemented from View.

Definition at line 2528 of file W3DView.cpp.


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