![]() |
DDNet documentation
|
#include <camera.h>
Public Types | |
| enum | { CAMTYPE_UNDEFINED = -1 , CAMTYPE_SPEC , CAMTYPE_PLAYER } |
Public Member Functions | |
| CCamera () | |
| int | Sizeof () const override |
| void | OnRender () override |
| void | OnConsoleInit () override |
| 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 IsUser) |
| bool | ZoomAllowed () const |
| int | Deadzone () const |
| int | FollowFactor () const |
| int | CamType () const |
| void | UpdateCamera () |
| void | ResetAutoSpecCamera () |
| bool | SpectatingPlayer () const |
| bool | CanUseAutoSpecCamera () const |
| void | ToggleAutoSpecCamera () |
| void | UpdateAutoSpecCameraTooltip () |
| const char * | AutoSpecCameraTooltip () |
| Public Member Functions inherited from CComponent | |
| virtual void | OnStateChange (int NewState, int OldState) |
| virtual void | OnInit () |
| virtual void | OnShutdown () |
| virtual void | OnWindowResize () |
| virtual void | OnUpdate () |
| 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) |
| virtual bool | OnTouchState (std::vector< IInput::CTouchFingerState > &vTouchFingerStates) |
| Public Member Functions inherited from CComponentInterfaces | |
| virtual void | OnInterfacesInit (CGameClient *pClient) |
| virtual | ~CComponentInterfaces ()=default |
Static Public Member Functions | |
| static float | ZoomStepsToValue (float Steps) |
Public Attributes | |
| vec2 | m_Center |
| bool | m_ZoomSet |
| bool | m_Zooming |
| float | m_Zoom |
| float | m_ZoomSmoothingTarget |
| bool | m_AutoSpecCameraZooming |
| bool | m_AutoSpecCamera |
| float | m_UserZoomTarget |
| vec2 | m_DyncamTargetCameraOffset |
| vec2 | m_aDyncamCurrentCameraOffset [NUM_DUMMIES] |
Static Public Attributes | |
| static constexpr float | ZOOM_STEP = 0.866025f |
Private Member Functions | |
| float | CameraSmoothingProgress (float CurrentTime) const |
| void | ScaleZoom (float Factor) |
| void | ChangeZoom (float Target, int Smoothness, bool IsUser) |
| 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 |
| vec2 | m_LastTargetPos |
| float | m_DyncamSmoothingSpeedBias |
| bool | m_CanUseCameraInfo |
| bool | m_UsingAutoSpecCamera |
| char | m_aAutoSpecCameraTooltip [512] |
| 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 CComponentInterfaces | |
| class CGameClient * | GameClient () const |
| class IClient * | Client () const |
| class IKernel * | Kernel () const |
| class IEngine * | Engine () const |
| class IGraphics * | Graphics () const |
| class ITextRender * | TextRender () const |
| class IInput * | Input () const |
| class IStorage * | Storage () const |
| class CUi * | Ui () const |
| class ISound * | Sound () const |
| class CRenderTools * | RenderTools () const |
| class CRenderMap * | RenderMap () const |
| class IConfigManager * | ConfigManager () const |
| class CConfig * | Config () const |
| class IConsole * | Console () const |
| class IDemoPlayer * | DemoPlayer () const |
| class IDemoRecorder * | DemoRecorder (int Recorder) const |
| class IFavorites * | Favorites () const |
| class IServerBrowser * | ServerBrowser () const |
| class CLayers * | Layers () const |
| class CCollision * | Collision () const |
| int64_t | time () const |
| float | LocalTime () const |
| class IHttp * | Http () const |
| CCamera::CCamera | ( | ) |
|
inline |
|
private |
|
inline |
| bool CCamera::CanUseAutoSpecCamera | ( | ) | const |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
| int CCamera::Deadzone | ( | ) | const |
| int CCamera::FollowFactor | ( | ) | const |
| void CCamera::GotoSwitch | ( | int | Number, |
| int | Offset = -1 ) |
| void CCamera::GotoTele | ( | int | Number, |
| int | Offset = -1 ) |
|
private |
|
private |
|
overridevirtual |
Called to let the components register their console commands.
Reimplemented from CComponent.
|
overridevirtual |
Called when the component should get rendered.
The render order depends on the component insertion order.
Reimplemented from CComponent.
|
overridevirtual |
Called to reset the component. This method is usually called on your component constructor to avoid code duplication.
Reimplemented from CComponent.
| void CCamera::ResetAutoSpecCamera | ( | ) |
|
private |
| void CCamera::SetView | ( | ivec2 | Pos, |
| bool | Relative = false ) |
| void CCamera::SetZoom | ( | float | Target, |
| int | Smoothness, | ||
| bool | IsUser ) |
|
inlineoverridevirtual |
Gets the size of the non-abstract component.
Implements CComponent.
|
inline |
| void CCamera::ToggleAutoSpecCamera | ( | ) |
| void CCamera::UpdateAutoSpecCameraTooltip | ( | ) |
| void CCamera::UpdateCamera | ( | ) |
| bool CCamera::ZoomAllowed | ( | ) | const |
|
private |
|
inlinestatic |
Convert zoom steps to zoom value
| Steps | - Zoom steps, 0.0f converts to default zoom (returns 1.0f) |
|
friend |
|
private |
| vec2 CCamera::m_aDyncamCurrentCameraOffset[NUM_DUMMIES] |
|
private |
| bool CCamera::m_AutoSpecCamera |
| bool CCamera::m_AutoSpecCameraZooming |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| vec2 CCamera::m_Center |
|
private |
|
private |
| vec2 CCamera::m_DyncamTargetCameraOffset |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| float CCamera::m_UserZoomTarget |
|
private |
|
private |
| float CCamera::m_Zoom |
| bool CCamera::m_Zooming |
| bool CCamera::m_ZoomSet |
|
private |
|
private |
|
private |
| float CCamera::m_ZoomSmoothingTarget |
|
staticconstexpr |