Abstract base class for all camera types. More...
#include <BaseCamera.h>
Public Member Functions | |
BaseCamera (const std::string &name, float aspect, float nearPlane, float farPlane) | |
Constructor with basic camera parameters. | |
virtual | ~BaseCamera () |
Virtual destructor. | |
virtual Mat4 | GetProjectionMatrix () const =0 |
virtual CameraType | GetType () const =0 |
virtual std::string | GetTypeName () const =0 |
virtual Ray | ScreenToWorldRay (float screenX, float screenY) const =0 |
virtual Mat4 | GetViewMatrix () const |
virtual Mat4 | GetViewProjectionMatrix () const |
virtual void | SetPosition (const Vec3 &position) |
virtual void | SetTarget (const Vec3 &target) |
virtual void | SetUp (const Vec3 &up) |
virtual void | LookAt (const Vec3 &position, const Vec3 &target, const Vec3 &up) |
virtual void | SetAspectRatio (float aspect) |
virtual void | SetClippingPlanes (float nearPlane, float farPlane) |
virtual void | SetName (const std::string &name) |
const Vec3 & | GetPosition () const |
const Vec3 & | GetTarget () const |
const Vec3 & | GetUp () const |
Vec3 | GetForward () const |
Vec3 | GetRight () const |
float | GetAspectRatio () const |
float | GetNearPlane () const |
float | GetFarPlane () const |
const std::string & | GetName () const |
virtual void | Update () |
virtual void | ProcessInput () |
virtual void | SetInputEnabled (bool enabled) |
virtual void | SetMouseMovementActive (bool active) |
virtual bool | IsInputEnabled () const |
virtual void | SetViewportBounds (float x, float y, float width, float height) |
virtual bool | IsMouseInViewport () const |
virtual void | SetTransform (const Mat4 &transform) |
virtual Mat4 | GetTransform () const |
virtual void | FocusOnObjectSmooth (const Vec3 &objectPosition, float duration=1.0f) |
virtual CameraAnimator & | GetAnimator () |
virtual bool | IsAnimating () const |
Static Public Member Functions | |
static std::unique_ptr< BaseCamera > | Create (CameraType type, const std::string &name="", float aspect=16.0f/9.0f, float nearPlane=0.1f, float farPlane=1000.0f) |
Protected Member Functions | |
virtual void | ProcessMouseInput () |
virtual void | ProcessKeyboardInput () |
virtual void | ProcessScrollInput () |
virtual void | UpdatePositionFromAngles () |
virtual void | UpdateAnglesFromPosition () |
virtual void | Zoom (float delta) |
virtual void | FocusOnObject (const Vec3 &objectPosition) |
void | UpdateViewMatrix () const |
Protected Attributes | |
std::string | m_Name |
Vec3 | m_Position {0.0f, 0.0f, 3.0f} |
Vec3 | m_Target {0.0f, 0.0f, 0.0f} |
Vec3 | m_Up {0.0f, 1.0f, 0.0f} |
float | m_Aspect |
float | m_Near |
float | m_Far |
bool | m_InputEnabled = true |
bool | m_isMouseMovementActive = true |
float | m_MouseSensitivity = 0.1f |
float | m_ZoomSpeed = 1.0f |
bool | m_CursorHidden = false |
float | m_Yaw = -90.0f |
float | m_Pitch = 0.0f |
float | m_Distance = 3.0f |
float | m_ViewportX = 0.0f |
float | m_ViewportY = 0.0f |
float | m_ViewportWidth = 0.0f |
float | m_ViewportHeight = 0.0f |
std::unique_ptr< CameraAnimator > | m_Animator |
Mat4 | m_ViewMatrix |
bool | m_ViewMatrixDirty = true |
Abstract base class for all camera types.
This class provides the common interface and functionality for all camera types. It handles basic camera operations like positioning, input handling, and provides pure virtual methods for projection-specific calculations.
The design allows cameras to be used both as viewport cameras and potentially as scene objects in the future.
BaseCamera::BaseCamera | ( | const std::string & | name, |
float | aspect, | ||
float | nearPlane, | ||
float | farPlane | ||
) |
Constructor with basic camera parameters.
name | Camera name/identifier |
aspect | Aspect ratio (width/height) |
nearPlane | Near clipping plane distance |
farPlane | Far clipping plane distance |
|
virtualdefault |
Virtual destructor.
|
static |
|
protectedvirtual |
|
virtual |
|
virtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
pure virtual |
Implemented in OrthographicCamera, and PerspectiveCamera.
|
inline |
|
inline |
|
virtual |
|
pure virtual |
Implemented in OrthographicCamera, and PerspectiveCamera.
|
pure virtual |
Implemented in OrthographicCamera, and PerspectiveCamera.
|
inline |
|
virtual |
|
virtual |
|
virtual |
|
inlinevirtual |
|
virtual |
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
pure virtual |
Implemented in OrthographicCamera, and PerspectiveCamera.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
|
protected |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |