ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
Camera.h
Go to the documentation of this file.
1/**
2 * @file Camera.h
3 * @brief Declares the Camera template class for managing camera behavior and pixel groups.
4 *
5 * This file defines the Camera class, which extends CameraBase to provide functionality
6 * for camera operations and managing associated PixelGroup instances.
7 *
8 * @date 22/12/2024
9 * @author Coela Can't
10 */
11
12#pragma once
13
14#include "CameraBase.h" // Include for base camera functionality.
15#include "Pixels/PixelGroup.h" // Include for pixel group management.
16
17/**
18 * @class Camera
19 * @brief Manages camera behavior and pixel groups.
20 *
21 * The Camera class extends CameraBase and incorporates pixel group handling, allowing
22 * for advanced camera operations, including retrieving pixel data and coordinate transformations.
23 *
24 * @tparam pixelCount The total number of pixels managed by the camera.
25 */
26template<size_t pixelCount>
27class Camera : public CameraBase {
28private:
29 PixelGroup<pixelCount>* pixelGroup; ///< Pointer to the associated PixelGroup instance.
30 Vector2D maxC; ///< Cached maximum coordinate of the camera.
31 Vector2D minC; ///< Cached minimum coordinate of the camera.
32 bool calculatedMax = false; ///< Indicates if the maximum coordinate has been calculated.
33 bool calculatedMin = false; ///< Indicates if the minimum coordinate has been calculated.
34
35public:
36 /**
37 * @brief Constructs a Camera with a transform and pixel group.
38 *
39 * @param transform Pointer to the Transform associated with the camera.
40 * @param pixelGroup Pointer to the PixelGroup associated with the camera.
41 */
43
44 /**
45 * @brief Constructs a Camera with a transform, camera layout, and pixel group.
46 *
47 * @param transform Pointer to the Transform associated with the camera.
48 * @param cameraLayout Pointer to the CameraLayout for the camera.
49 * @param pixelGroup Pointer to the PixelGroup associated with the camera.
50 */
52
53 /**
54 * @brief Retrieves the associated PixelGroup.
55 *
56 * @return Pointer to the PixelGroup.
57 */
59
60 /**
61 * @brief Retrieves the minimum coordinate of the camera.
62 *
63 * @return The minimum coordinate as a Vector2D.
64 */
66
67 /**
68 * @brief Retrieves the maximum coordinate of the camera.
69 *
70 * @return The maximum coordinate as a Vector2D.
71 */
73
74 /**
75 * @brief Retrieves the center coordinate of the camera.
76 *
77 * @return The center coordinate as a Vector2D.
78 */
80
81 /**
82 * @brief Retrieves the minimum transform of the camera.
83 *
84 * @return The minimum transform as a Vector3D.
85 */
87
88 /**
89 * @brief Retrieves the maximum transform of the camera.
90 *
91 * @return The maximum transform as a Vector3D.
92 */
94
95 /**
96 * @brief Retrieves the center transform of the camera.
97 *
98 * @return The center transform as a Vector3D.
99 */
101};
102
103#include "Camera.tpp" // Include the template implementation.
Declares the CameraBase class for defining camera functionality.
Declares the PixelGroup template class for managing a collection of pixels.
Base class for managing camera properties and transformations.
Definition CameraBase.h:26
CameraLayout * cameraLayout
Pointer to the camera's layout information.
Definition CameraBase.h:29
Transform * transform
Pointer to the camera's transformation data.
Definition CameraBase.h:28
Manages camera orientation and axis alignment.
Manages camera behavior and pixel groups.
Definition Camera.h:27
PixelGroup< pixelCount > * GetPixelGroup() override
Retrieves the associated PixelGroup.
Vector2D GetCameraMaxCoordinate() override
Retrieves the maximum coordinate of the camera.
Vector3D GetCameraTransformCenter() override
Retrieves the center transform of the camera.
Vector2D maxC
Cached maximum coordinate of the camera.
Definition Camera.h:30
PixelGroup< pixelCount > * pixelGroup
Pointer to the associated PixelGroup instance.
Definition Camera.h:29
Camera(Transform *transform, PixelGroup< pixelCount > *pixelGroup)
Constructs a Camera with a transform and pixel group.
Vector2D GetCameraMinCoordinate() override
Retrieves the minimum coordinate of the camera.
Vector2D GetCameraCenterCoordinate() override
Retrieves the center coordinate of the camera.
Camera(Transform *transform, CameraLayout *cameraLayout, PixelGroup< pixelCount > *pixelGroup)
Constructs a Camera with a transform, camera layout, and pixel group.
bool calculatedMax
Indicates if the maximum coordinate has been calculated.
Definition Camera.h:32
Vector2D minC
Cached minimum coordinate of the camera.
Definition Camera.h:31
Vector3D GetCameraTransformMin() override
Retrieves the minimum transform of the camera.
Vector3D GetCameraTransformMax() override
Retrieves the maximum transform of the camera.
bool calculatedMin
Indicates if the minimum coordinate has been calculated.
Definition Camera.h:33
Manages a collection of pixels with positions, colors, and spatial relationships.
Definition PixelGroup.h:27
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