-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoxModule.hpp
More file actions
94 lines (55 loc) · 2.31 KB
/
Copy pathBoxModule.hpp
File metadata and controls
94 lines (55 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
** EPITECH PROJECT, 2020
** BoxModule.hpp
** File description:
** header for BoxModule.c
*/
#pragma once
#include "Node.hpp"
#include "GraphicalAPI/GraphicalInterfaces/IModelModule.hpp"
#include "GraphicalAPI/GraphicalInterfaces/IBoxModule.hpp"
namespace Polymorph
{
class SphereModule;
class MeshModule;
class TextureModule;
class BoxModule
{
////////////////////// CONSTRUCTORS/DESTRUCTORS /////////////////////////
public:
explicit BoxModule(std::shared_ptr<myxmlpp::Node> &data,
Config::XmlComponent &manager);
explicit BoxModule(const MeshModule &meshModule);
//////////////////////--------------------------/////////////////////////
///////////////////////////// PROPERTIES ////////////////////////////////
public:
private:
using BoxModuleLoader = Polymorph::IBoxModule *(*)(float posX,
float posY,
float posZ);
static inline BoxModuleLoader _c_box = nullptr;
using BoxModuleFromMeshLoader = Polymorph::IBoxModule *(*)(
const Polymorph::IModelModule &model);
static inline BoxModuleFromMeshLoader _c_box_from_model = nullptr;
std::unique_ptr<Polymorph::IBoxModule> _box;
Vector3 _size;
Vector3 _origin;
std::shared_ptr<TextureModule> _texture;
//////////////////////--------------------------/////////////////////////
/////////////////////////////// METHODS /////////////////////////////////
public:
void setSize(Polymorph::Vector3 size);
Polymorph::Vector3 getSize() const;
Polymorph::IBoxModule &getBox() const;
void setOrigin(Polymorph::Vector3 origin);
bool collideWithBox(const Polymorph::BoxModule &box) const;
bool collideWithSphere(const SphereModule &sphere) const;
void setTexture(const std::shared_ptr<TextureModule> &texture);
std::shared_ptr<TextureModule> getTexture() const;
void draw();
void drawWires();
private:
void _loadModule();
//////////////////////--------------------------/////////////////////////
};
}