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
11
#include "
VEngine/Gfx/Texture.hpp
"
12
#include "
VEngine/Gfx/Model.hpp
"
13
#include "
VEngine/Scene/Transform3D.hpp
"
14
15
namespace
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
49
Transform3D
transform
{};
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
Model.hpp
This file contains the Model class.
Texture.hpp
This file contains the Texture class.
Transform3D.hpp
This file contains the Transform3D class.
ven::Object
Class for object.
Definition
Object.hpp:24
ven::Object::m_diffuseMap
std::shared_ptr< Texture > m_diffuseMap
Definition
Object.hpp:56
ven::Object::getModel
std::shared_ptr< Model > getModel() const
Definition
Object.hpp:41
ven::Object::operator=
Object & operator=(Object &&)=default
ven::Object::Object
Object(const Object &)=delete
ven::Object::Object
Object(const unsigned int objId)
Definition
Object.hpp:30
ven::Object::setDiffuseMap
void setDiffuseMap(const std::shared_ptr< Texture > &diffuseMap)
Definition
Object.hpp:45
ven::Object::getDiffuseMap
std::shared_ptr< Texture > getDiffuseMap() const
Definition
Object.hpp:42
ven::Object::getId
unsigned int getId() const
Definition
Object.hpp:39
ven::Object::getBufferInfo
VkDescriptorBufferInfo getBufferInfo(const int frameIndex) const
Definition
Object.hpp:43
ven::Object::m_objId
unsigned int m_objId
Definition
Object.hpp:53
ven::Object::m_bufferInfo
std::unordered_map< int, VkDescriptorBufferInfo > m_bufferInfo
Definition
Object.hpp:57
ven::Object::m_name
std::string m_name
Definition
Object.hpp:54
ven::Object::Map
std::unordered_map< unsigned int, Object > Map
Definition
Object.hpp:28
ven::Object::setModel
void setModel(const std::shared_ptr< Model > &model)
Definition
Object.hpp:44
ven::Object::setName
void setName(const std::string &name)
Definition
Object.hpp:46
ven::Object::getName
std::string getName() const
Definition
Object.hpp:40
ven::Object::setBufferInfo
void setBufferInfo(const int frameIndex, const VkDescriptorBufferInfo &info)
Definition
Object.hpp:47
ven::Object::~Object
~Object()=default
ven::Object::m_model
std::shared_ptr< Model > m_model
Definition
Object.hpp:55
ven::Object::operator=
Object & operator=(const Object &)=delete
ven::Object::transform
Transform3D transform
Definition
Object.hpp:49
ven::Object::Object
Object(Object &&)=default
ven::Transform3D
Class for 3D transformation.
Definition
Transform3D.hpp:18
ven
ven::MAX_OBJECTS
static constexpr uint16_t MAX_OBJECTS
Definition
Object.hpp:17
include
VEngine
Scene
Entities
Object.hpp
Generated by
1.11.0