persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
ModelComponent.hpp
Go to the documentation of this file.
1
7
8
#pragma once
9
#include "
managers/RenderManager.hpp
"
10
#include "
types/aeTypes.hpp
"
11
12
#include <aegis/component.hpp>
13
#include <memory>
14
#include <string>
15
16
class
ModelComponent
:
public
ae::Component
17
{
18
public
:
19
static
constexpr
ae::ComponentTypeID
TYPE_ID
=
static_cast<
ae::ComponentTypeID
>
(
ComponentType::Model
);
20
21
void
init
()
override
22
{
23
}
24
28
void
destroy
()
override
;
29
33
void
update
(ae::q20_12_t
/*dt*/
)
override
;
34
35
ae::ComponentTypeID
getType
()
const override
36
{
37
return
TYPE_ID
;
38
}
39
45
bool
loadMesh
(std::string* meshFilePath);
46
50
void
drawMesh
();
51
52
protected
:
53
void
submitToManager
()
override
54
{
55
}
56
57
private
:
58
std::unique_ptr<MDL3Model>
model
;
59
60
RenderManager
&
render
= RenderManager::getInstance();
61
68
bool
loadTextureHeader
(FILE* f,
MDL3Texture
& tex);
77
bool
loadTexture
(FILE* f,
MDL3Texture
& tex);
78
};
RenderManager.hpp
Manager for hardware specific rendering functionse.
aeTypes.hpp
ComponentType::Model
@ Model
Definition
aeTypes.hpp:41
ModelComponent
Definition
ModelComponent.hpp:17
ModelComponent::drawMesh
void drawMesh()
Draws the loaded mesh to the screen.
Definition
ModelComponent.cpp:237
ModelComponent::model
std::unique_ptr< MDL3Model > model
Definition
ModelComponent.hpp:58
ModelComponent::submitToManager
void submitToManager() override
Definition
ModelComponent.hpp:53
ModelComponent::TYPE_ID
static constexpr ae::ComponentTypeID TYPE_ID
Definition
ModelComponent.hpp:19
ModelComponent::update
void update(ae::q20_12_t) override
Draws the mesh to the screen every frame.
Definition
ModelComponent.cpp:4
ModelComponent::destroy
void destroy() override
Sets active to false on component destruction.
Definition
ModelComponent.cpp:9
ModelComponent::loadMesh
bool loadMesh(std::string *meshFilePath)
Loads a mesh from a file into memory.
Definition
ModelComponent.cpp:115
ModelComponent::getType
ae::ComponentTypeID getType() const override
Definition
ModelComponent.hpp:35
ModelComponent::render
RenderManager & render
Definition
ModelComponent.hpp:60
ModelComponent::loadTextureHeader
bool loadTextureHeader(FILE *f, MDL3Texture &tex)
Loads a texture header from the file buffer into memory.
Definition
ModelComponent.cpp:39
ModelComponent::init
void init() override
Definition
ModelComponent.hpp:21
ModelComponent::loadTexture
bool loadTexture(FILE *f, MDL3Texture &tex)
Loads an embedded texture from the file buffer and uploads it to the GPU.
Definition
ModelComponent.cpp:65
RenderManager
Definition
RenderManager.hpp:15
MDL3Texture
Represents a texture used in a 3D model.
Definition
ModelTypes.hpp:10
source
components
ModelComponent.hpp
Generated by
1.15.0