DDraceNetwork Docs
CCamera Class Reference

#include <camera.h>

Inheritance diagram for CCamera:
[legend]
Collaboration diagram for CCamera:
[legend]

Public Member Functions

 CCamera ()
 
virtual int Sizeof () const override
 
virtual void OnRender () override
 
virtual void OnConsoleInit () override
 
virtual void OnReset () override
 
void SetView (ivec2 Pos, bool Relative=false)
 
void GotoSwitch (int Number, int Offset=-1)
 
void GotoTele (int Number, int Offset=-1)
 
void SetZoom (float Target, int Smoothness)
 
bool ZoomAllowed () const
 
- Public Member Functions inherited from CComponent
virtual ~CComponent ()
 
virtual int Sizeof () const =0
 
class CGameClientGameClient () const
 
class IClientClient () const
 
virtual void OnStateChange (int NewState, int OldState)
 
virtual void OnConsoleInit ()
 
virtual void OnInit ()
 
virtual void OnShutdown ()
 
virtual void OnReset ()
 
virtual void OnWindowResize ()
 
virtual void OnRefreshSkins ()
 
virtual void OnRender ()
 
virtual void OnNewSnapshot ()
 
virtual void OnRelease ()
 
virtual void OnMapLoad ()
 
virtual void OnMessage (int Msg, void *pRawMsg)
 
virtual bool OnCursorMove (float x, float y, IInput::ECursorType CursorType)
 
virtual bool OnInput (const IInput::CEvent &Event)
 

Public Attributes

vec2 m_Center
 
bool m_ZoomSet
 
bool m_Zooming
 
float m_Zoom
 
float m_ZoomSmoothingTarget
 

Static Public Attributes

static constexpr float ZOOM_STEP = 0.866025f
 

Private Types

enum  { CAMTYPE_UNDEFINED = -1 , CAMTYPE_SPEC , CAMTYPE_PLAYER }
 

Private Member Functions

float CameraSmoothingProgress (float CurrentTime) const
 
void ScaleZoom (float Factor)
 
void ChangeZoom (float Target, int Smoothness)
 
float ZoomProgress (float CurrentTime) const
 
float MinZoomLevel ()
 
float MaxZoomLevel ()
 

Static Private Member Functions

static void ConZoomPlus (IConsole::IResult *pResult, void *pUserData)
 
static void ConZoomMinus (IConsole::IResult *pResult, void *pUserData)
 
static void ConZoom (IConsole::IResult *pResult, void *pUserData)
 
static void ConSetView (IConsole::IResult *pResult, void *pUserData)
 
static void ConSetViewRelative (IConsole::IResult *pResult, void *pUserData)
 
static void ConGotoSwitch (IConsole::IResult *pResult, void *pUserData)
 
static void ConGotoTele (IConsole::IResult *pResult, void *pUserData)
 

Private Attributes

int m_CamType
 
vec2 m_aLastPos [NUM_DUMMIES]
 
vec2 m_PrevCenter
 
int m_PrevSpecId
 
bool m_WasSpectating
 
bool m_CameraSmoothing
 
vec2 m_CameraSmoothingCenter
 
vec2 m_CameraSmoothingTarget
 
CCubicBezier m_CameraSmoothingBezierX
 
CCubicBezier m_CameraSmoothingBezierY
 
float m_CameraSmoothingStart
 
float m_CameraSmoothingEnd
 
vec2 m_CenterBeforeSmoothing
 
CCubicBezier m_ZoomSmoothing
 
float m_ZoomSmoothingStart
 
float m_ZoomSmoothingEnd
 
bool m_ForceFreeview
 
vec2 m_ForceFreeviewPos
 
int m_GotoSwitchOffset
 
int m_GotoTeleOffset
 
ivec2 m_GotoSwitchLastPos
 
ivec2 m_GotoTeleLastPos
 
int m_GotoTeleLastNumber = -1
 

Friends

class CMenuBackground
 

Additional Inherited Members

- Protected Member Functions inherited from CComponent
class IKernelKernel () const
 
class IEngineEngine () const
 
class IGraphicsGraphics () const
 
class ITextRenderTextRender () const
 
class IInputInput () const
 
class IStorageStorage () const
 
class CUiUi () const
 
class ISoundSound () const
 
class CRenderToolsRenderTools () const
 
class IConfigManagerConfigManager () const
 
class CConfigConfig () const
 
class IConsoleConsole () const
 
class IDemoPlayerDemoPlayer () const
 
class IDemoRecorderDemoRecorder (int Recorder) const
 
class IFavoritesFavorites () const
 
class IServerBrowserServerBrowser () const
 
class CLayersLayers () const
 
class CCollisionCollision () const
 
int64_t time () const
 
float LocalTime () const
 
class IHttpHttp () const
 
- Protected Attributes inherited from CComponent
CGameClientm_pClient
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
CAMTYPE_UNDEFINED 
CAMTYPE_SPEC 
CAMTYPE_PLAYER 

Constructor & Destructor Documentation

◆ CCamera()

CCamera::CCamera ( )

Member Function Documentation

◆ CameraSmoothingProgress()

float CCamera::CameraSmoothingProgress ( float  CurrentTime) const
private

◆ ChangeZoom()

void CCamera::ChangeZoom ( float  Target,
int  Smoothness 
)
private

◆ ConGotoSwitch()

void CCamera::ConGotoSwitch ( IConsole::IResult pResult,
void *  pUserData 
)
staticprivate

◆ ConGotoTele()

void CCamera::ConGotoTele ( IConsole::IResult pResult,
void *  pUserData 
)
staticprivate

◆ ConSetView()

void CCamera::ConSetView ( IConsole::IResult pResult,
void *  pUserData 
)
staticprivate

◆ ConSetViewRelative()

void CCamera::ConSetViewRelative ( IConsole::IResult pResult,
void *  pUserData 
)
staticprivate

◆ ConZoom()

void CCamera::ConZoom ( IConsole::IResult pResult,
void *  pUserData 
)
staticprivate

◆ ConZoomMinus()

void CCamera::ConZoomMinus ( IConsole::IResult pResult,
void *  pUserData 
)
staticprivate

◆ ConZoomPlus()

void CCamera::ConZoomPlus ( IConsole::IResult pResult,
void *  pUserData 
)
staticprivate

◆ GotoSwitch()

void CCamera::GotoSwitch ( int  Number,
int  Offset = -1 
)

◆ GotoTele()

void CCamera::GotoTele ( int  Number,
int  Offset = -1 
)

◆ MaxZoomLevel()

float CCamera::MaxZoomLevel ( )
private

◆ MinZoomLevel()

float CCamera::MinZoomLevel ( )
private

◆ OnConsoleInit()

void CCamera::OnConsoleInit ( )
overridevirtual

Called to let the components register their console commands.

Reimplemented from CComponent.

◆ OnRender()

void CCamera::OnRender ( )
overridevirtual

Called when the component should get rendered.

The render order depends on the component insertion order.

Reimplemented from CComponent.

◆ OnReset()

void CCamera::OnReset ( )
overridevirtual

Called to reset the component. This method is usually called on your component constructor to avoid code duplication.

See also
CHud::CHud()
CHud::OnReset()

Reimplemented from CComponent.

◆ ScaleZoom()

void CCamera::ScaleZoom ( float  Factor)
private

◆ SetView()

void CCamera::SetView ( ivec2  Pos,
bool  Relative = false 
)

◆ SetZoom()

void CCamera::SetZoom ( float  Target,
int  Smoothness 
)

◆ Sizeof()

virtual int CCamera::Sizeof ( ) const
inlineoverridevirtual

Gets the size of the non-abstract component.

Implements CComponent.

◆ ZoomAllowed()

bool CCamera::ZoomAllowed ( ) const

◆ ZoomProgress()

float CCamera::ZoomProgress ( float  CurrentTime) const
private

Friends And Related Function Documentation

◆ CMenuBackground

friend class CMenuBackground
friend

Member Data Documentation

◆ m_aLastPos

vec2 CCamera::m_aLastPos[NUM_DUMMIES]
private

◆ m_CameraSmoothing

bool CCamera::m_CameraSmoothing
private

◆ m_CameraSmoothingBezierX

CCubicBezier CCamera::m_CameraSmoothingBezierX
private

◆ m_CameraSmoothingBezierY

CCubicBezier CCamera::m_CameraSmoothingBezierY
private

◆ m_CameraSmoothingCenter

vec2 CCamera::m_CameraSmoothingCenter
private

◆ m_CameraSmoothingEnd

float CCamera::m_CameraSmoothingEnd
private

◆ m_CameraSmoothingStart

float CCamera::m_CameraSmoothingStart
private

◆ m_CameraSmoothingTarget

vec2 CCamera::m_CameraSmoothingTarget
private

◆ m_CamType

int CCamera::m_CamType
private

◆ m_Center

vec2 CCamera::m_Center

◆ m_CenterBeforeSmoothing

vec2 CCamera::m_CenterBeforeSmoothing
private

◆ m_ForceFreeview

bool CCamera::m_ForceFreeview
private

◆ m_ForceFreeviewPos

vec2 CCamera::m_ForceFreeviewPos
private

◆ m_GotoSwitchLastPos

ivec2 CCamera::m_GotoSwitchLastPos
private

◆ m_GotoSwitchOffset

int CCamera::m_GotoSwitchOffset
private

◆ m_GotoTeleLastNumber

int CCamera::m_GotoTeleLastNumber = -1
private

◆ m_GotoTeleLastPos

ivec2 CCamera::m_GotoTeleLastPos
private

◆ m_GotoTeleOffset

int CCamera::m_GotoTeleOffset
private

◆ m_PrevCenter

vec2 CCamera::m_PrevCenter
private

◆ m_PrevSpecId

int CCamera::m_PrevSpecId
private

◆ m_WasSpectating

bool CCamera::m_WasSpectating
private

◆ m_Zoom

float CCamera::m_Zoom

◆ m_Zooming

bool CCamera::m_Zooming

◆ m_ZoomSet

bool CCamera::m_ZoomSet

◆ m_ZoomSmoothing

CCubicBezier CCamera::m_ZoomSmoothing
private

◆ m_ZoomSmoothingEnd

float CCamera::m_ZoomSmoothingEnd
private

◆ m_ZoomSmoothingStart

float CCamera::m_ZoomSmoothingStart
private

◆ m_ZoomSmoothingTarget

float CCamera::m_ZoomSmoothingTarget

◆ ZOOM_STEP

constexpr float CCamera::ZOOM_STEP = 0.866025f
staticconstexpr

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