ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
CameraBase.h
Go to the documentation of this file.
1/**
2 * @file CameraBase.h
3 * @brief Declares the CameraBase class for defining camera functionality.
4 *
5 * This file defines the CameraBase class, which serves as a base class for managing
6 * camera transformations, layouts, and pixel groups in 2D or 3D space.
7 *
8 * @date 22/12/2024
9 * @author Coela Can't
10 */
11
12#pragma once
13
14#include "CameraLayout.h" // Include for camera layout management.
15#include "Pixels/IPixelGroup.h" // Include for pixel group interface.
16#include "../Utils/Math/Transform.h" // Include for transformation utilities.
17
18/**
19 * @class CameraBase
20 * @brief Base class for managing camera properties and transformations.
21 *
22 * The CameraBase class provides an abstract interface for camera operations,
23 * including retrieving camera bounds and transformations, and managing associated
24 * pixel groups.
25 */
27protected:
28 Transform* transform; ///< Pointer to the camera's transformation data.
29 CameraLayout* cameraLayout; ///< Pointer to the camera's layout information.
30 Quaternion lookOffset; ///< Look offset for the camera's orientation.
31 bool is2D = false; ///< Flag indicating whether the camera operates in 2D mode.
32
33public:
34 /**
35 * @brief Default constructor.
36 */
37 CameraBase();
38
39 /**
40 * @brief Retrieves the minimum coordinate of the camera in 2D space.
41 *
42 * @return The minimum coordinate as a Vector2D.
43 */
45
46 /**
47 * @brief Retrieves the maximum coordinate of the camera in 2D space.
48 *
49 * @return The maximum coordinate as a Vector2D.
50 */
52
53 /**
54 * @brief Retrieves the center coordinate of the camera in 2D space.
55 *
56 * @return The center coordinate as a Vector2D.
57 */
59
60 /**
61 * @brief Retrieves the minimum transform of the camera in 3D space.
62 *
63 * @return The minimum transform as a Vector3D.
64 */
66
67 /**
68 * @brief Retrieves the maximum transform of the camera in 3D space.
69 *
70 * @return The maximum transform as a Vector3D.
71 */
73
74 /**
75 * @brief Retrieves the center transform of the camera in 3D space.
76 *
77 * @return The center transform as a Vector3D.
78 */
80
81 /**
82 * @brief Retrieves the associated pixel group.
83 *
84 * @return Pointer to the IPixelGroup interface.
85 */
86 virtual IPixelGroup* GetPixelGroup() = 0;
87
88 /**
89 * @brief Retrieves the camera's layout.
90 *
91 * @return Pointer to the CameraLayout.
92 */
94
95 /**
96 * @brief Retrieves the camera's transformation data.
97 *
98 * @return Pointer to the Transform object.
99 */
101
102 /**
103 * @brief Checks if the camera operates in 2D mode.
104 *
105 * @return True if the camera is in 2D mode, otherwise false.
106 */
107 bool Is2D();
108
109 /**
110 * @brief Sets the camera's 2D mode.
111 *
112 * @param is2D True to enable 2D mode, otherwise false.
113 */
114 void Set2D(bool is2D);
115
116 /**
117 * @brief Sets the camera's look offset.
118 *
119 * @param lookOffset The new look offset as a Quaternion.
120 */
122
123 /**
124 * @brief Retrieves the camera's look offset.
125 *
126 * @return The look offset as a Quaternion.
127 */
129};
Declares the CameraLayout class for managing camera orientation and axis alignment.
Declares the IPixelGroup interface for managing collections of pixels.
Base class for managing camera properties and transformations.
Definition CameraBase.h:26
void SetLookOffset(Quaternion lookOffset)
Sets the camera's look offset.
CameraLayout * cameraLayout
Pointer to the camera's layout information.
Definition CameraBase.h:29
virtual IPixelGroup * GetPixelGroup()=0
Retrieves the associated pixel group.
virtual Vector3D GetCameraTransformMax()=0
Retrieves the maximum transform of the camera in 3D space.
Quaternion lookOffset
Look offset for the camera's orientation.
Definition CameraBase.h:30
virtual Vector3D GetCameraTransformCenter()=0
Retrieves the center transform of the camera in 3D space.
virtual Vector3D GetCameraTransformMin()=0
Retrieves the minimum transform of the camera in 3D space.
Quaternion GetLookOffset()
Retrieves the camera's look offset.
virtual Vector2D GetCameraMinCoordinate()=0
Retrieves the minimum coordinate of the camera in 2D space.
CameraBase()
Default constructor.
Definition CameraBase.cpp:3
virtual Vector2D GetCameraMaxCoordinate()=0
Retrieves the maximum coordinate of the camera in 2D space.
bool Is2D()
Checks if the camera operates in 2D mode.
CameraLayout * GetCameraLayout()
Retrieves the camera's layout.
Definition CameraBase.cpp:5
void Set2D(bool is2D)
Sets the camera's 2D mode.
bool is2D
Flag indicating whether the camera operates in 2D mode.
Definition CameraBase.h:31
Transform * transform
Pointer to the camera's transformation data.
Definition CameraBase.h:28
Transform * GetTransform()
Retrieves the camera's transformation data.
Definition CameraBase.cpp:9
virtual Vector2D GetCameraCenterCoordinate()=0
Retrieves the center coordinate of the camera in 2D space.
Manages camera orientation and axis alignment.
Interface for managing and interacting with a collection of pixels.
Definition IPixelGroup.h:25
A mathematical construct representing a rotation in 3D space.
Definition Quaternion.h:30
Represents a 3D transformation including position, rotation, and scale.
Definition Transform.h:22
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Definition Vector2D.h:27
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
Definition Vector3D.h:26