vengine  0.0.1
3D graphics engine
Loading...
Searching...
No Matches
Object.hpp
Go to the documentation of this file.
1///
2/// @file Object.hpp
3/// @brief This file contains the Object class
4/// @namespace ven
5///
6
7#pragma once
8
9#include <unordered_map>
10
12#include "VEngine/Gfx/Model.hpp"
14
15namespace ven {
16
17 static constexpr uint16_t MAX_OBJECTS = 1000;
18
19 ///
20 /// @class Object
21 /// @brief Class for object
22 /// @namespace ven
23 ///
24 class Object {
25
26 public:
27
28 using Map = std::unordered_map<unsigned int, Object>;
29
30 explicit Object(const unsigned int objId) : m_objId{objId} {}
31
32 ~Object() = default;
33
34 Object(const Object &) = delete;
35 Object &operator=(const Object &) = delete;
36 Object(Object &&) = default;
37 Object &operator=(Object &&) = default;
38
39 [[nodiscard]] unsigned int getId() const { return m_objId; }
40 [[nodiscard]] std::string getName() const { return m_name; }
41 [[nodiscard]] std::shared_ptr<Model> getModel() const { return m_model; }
42 [[nodiscard]] std::shared_ptr<Texture> getDiffuseMap() const { return m_diffuseMap; }
43 [[nodiscard]] VkDescriptorBufferInfo getBufferInfo(const int frameIndex) const { return m_bufferInfo.at(frameIndex); }
44 void setModel(const std::shared_ptr<Model> &model) { m_model = model; }
45 void setDiffuseMap(const std::shared_ptr<Texture> &diffuseMap) { m_diffuseMap = diffuseMap; }
46 void setName(const std::string &name) { m_name = name; }
47 void setBufferInfo(const int frameIndex, const VkDescriptorBufferInfo& info) { m_bufferInfo[frameIndex] = info; }
48
50
51 private:
52
53 unsigned int m_objId;
54 std::string m_name;
55 std::shared_ptr<Model> m_model = nullptr;
56 std::shared_ptr<Texture> m_diffuseMap = nullptr;
57 std::unordered_map<int, VkDescriptorBufferInfo> m_bufferInfo;
58
59 }; // class Object
60
61} // namespace ven
This file contains the Model class.
This file contains the Texture class.
This file contains the Transform3D class.
Class for object.
Definition Object.hpp:24
std::shared_ptr< Texture > m_diffuseMap
Definition Object.hpp:56
std::shared_ptr< Model > getModel() const
Definition Object.hpp:41
Object & operator=(Object &&)=default
Object(const Object &)=delete
Object(const unsigned int objId)
Definition Object.hpp:30
void setDiffuseMap(const std::shared_ptr< Texture > &diffuseMap)
Definition Object.hpp:45
std::shared_ptr< Texture > getDiffuseMap() const
Definition Object.hpp:42
unsigned int getId() const
Definition Object.hpp:39
VkDescriptorBufferInfo getBufferInfo(const int frameIndex) const
Definition Object.hpp:43
unsigned int m_objId
Definition Object.hpp:53
std::unordered_map< int, VkDescriptorBufferInfo > m_bufferInfo
Definition Object.hpp:57
std::string m_name
Definition Object.hpp:54
std::unordered_map< unsigned int, Object > Map
Definition Object.hpp:28
void setModel(const std::shared_ptr< Model > &model)
Definition Object.hpp:44
void setName(const std::string &name)
Definition Object.hpp:46
std::string getName() const
Definition Object.hpp:40
void setBufferInfo(const int frameIndex, const VkDescriptorBufferInfo &info)
Definition Object.hpp:47
~Object()=default
std::shared_ptr< Model > m_model
Definition Object.hpp:55
Object & operator=(const Object &)=delete
Transform3D transform
Definition Object.hpp:49
Object(Object &&)=default
Class for 3D transformation.
static constexpr uint16_t MAX_OBJECTS
Definition Object.hpp:17