Avara3D 0.2.0
C++ API reference
Camera.h
1//
2// Camera.h
3// avara3d
4//
5// Created by Morgan Davis on 10/21/16.
6// Copyright © 2026 Morgan K Davis. All rights reserved.
7//
8
9#ifndef AVARA3D_VISUAL_CAMERA_CAMERA_H
10#define AVARA3D_VISUAL_CAMERA_CAMERA_H
11
12#include <memory>
13#include <optional>
14#include <string>
15
16#include "a3d/Math.h"
17
18namespace a3d {
19
26 class Camera {
27
28 public:
29 // [Public Lifecycle Functions]
30
33
35 explicit Camera(const std::string& name);
36
37 virtual ~Camera() = 0;
38
39 // [Public Member Functions]
40
42 const std::optional<std::string>& name() const;
43
45 void name(const std::string& name);
46
47 // [Internal Member Functions]
48
49 virtual math::mat4 projection(const math::uvec2& viewportSize) const = 0;
50
51 protected:
52 // [Protected Lifecycle Functions]
53
54 Camera(const Camera&) = default;
55 Camera& operator=(const Camera&) = default;
56
57 Camera(Camera&&) noexcept = default;
58 Camera& operator=(Camera&&) noexcept = default;
59
60 // [Protected Member Variables]
61
62 std::optional<std::string> _name;
63 };
64
65}
66
67#endif // AVARA3D_VISUAL_CAMERA_CAMERA_H
Base class for camera projection models used by VisualWorld.
Definition: Camera.h:26
const std::optional< std::string > & name() const
Returns the optional camera name.
Camera()
Creates an unnamed Camera.
Camera(const std::string &name)
Creates a Camera with name.
void name(const std::string &name)
Sets the camera name.