Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
Model.hpp
1/*
2Copyright (C) 2018,2021,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGAMES_MODEL_H
17#define AEONGAMES_MODEL_H
18#include <vector>
19#include <tuple>
20#include <memory>
22#include "aeongames/ResourceId.hpp"
23#include "aeongames/Resource.hpp"
24
25namespace AeonGames
26{
27 class Mesh;
28 class Pipeline;
29 class Material;
30 class Skeleton;
31 class Animation;
32 class ModelMsg;
34 class Model : public Resource
35 {
36 public:
38 using Assembly = typename std::tuple <
41 ResourceId >;
42 DLL Model();
43 DLL ~Model();
46 DLL void LoadFromPBMsg ( const ModelMsg& aModelMsg );
50 DLL void LoadFromMemory ( const void* aBuffer, size_t aBufferSize ) final;
52 DLL void Unload () final;
55 DLL const std::vector<Assembly>& GetAssemblies() const;
58 DLL const Skeleton* GetSkeleton() const;
61 DLL const std::vector<ResourceId>& GetAnimations() const;
64 DLL void LoadRendererResources ( Renderer& aRenderer ) const;
67 DLL void UnloadRendererResources ( Renderer& aRenderer ) const;
68 private:
69 ResourceId mSkeleton;
70 std::vector<Assembly> mAssemblies{};
71 std::vector<ResourceId> mAnimations;
72 };
73}
74#endif
Platform-specific macros, includes, and DLL export/import definitions.
Stores skeletal animation data including keyframes and bone transforms.
Definition Animation.hpp:29
Represents a surface material with uniform properties and texture samplers.
Definition Material.hpp:38
Represents a polygon mesh with vertex attributes and index data.
Definition Mesh.hpp:31
DLL const Skeleton * GetSkeleton() const
Get the skeleton associated with this model.
Definition Model.cpp:126
DLL void Unload() final
Unload model data and free resources.
Definition Model.cpp:114
DLL void LoadFromPBMsg(const ModelMsg &aModelMsg)
Load model data from a protobuf message.
Definition Model.cpp:54
DLL void LoadFromMemory(const void *aBuffer, size_t aBufferSize) final
Load model data from a memory buffer.
Definition Model.cpp:49
typename std::tuple< ResourceId, ResourceId, ResourceId > Assembly
A tuple of ResourceIds representing a pipeline, material, and mesh combination.
Definition Model.hpp:38
DLL void LoadRendererResources(Renderer &aRenderer) const
Load renderer-specific resources for this model.
Definition Model.cpp:136
DLL const std::vector< Assembly > & GetAssemblies() const
Get the list of assemblies that compose this model.
Definition Model.cpp:121
DLL void UnloadRendererResources(Renderer &aRenderer) const
Unload renderer-specific resources for this model.
Definition Model.cpp:146
DLL const std::vector< ResourceId > & GetAnimations() const
Get the list of animation resource identifiers.
Definition Model.cpp:131
Rendering pipeline resource.
Definition Pipeline.hpp:122
Abstract base class for rendering backends.
Definition Renderer.hpp:44
Base class for loadable engine resources.
Definition Resource.hpp:33
Identifies a resource by its type and path CRC32 hashes.
Skeletal animation resource containing a hierarchy of joints.
Definition Skeleton.hpp:30
<- This is here just for the literals
Definition AABB.hpp:31
STL namespace.