Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
Skeleton.hpp
1/*
2Copyright (C) 2017-2019,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_SKELETON_H
17#define AEONGAMES_SKELETON_H
18#include <cstdint>
19#include <vector>
20#include <string>
22#include "aeongames/Resource.hpp"
23
24namespace AeonGames
25{
26 class SkeletonMsg;
27 class Animation;
29 class Skeleton : public Resource
30 {
31 public:
33 class Joint
34 {
35 public:
41 Joint ( Joint* aParent, const Transform& aTransform, const Transform& aInvertedTransform, const std::string& aName );
44 DLL const Transform& GetTransform() const;
47 DLL const Transform& GetInvertedTransform() const;
50 DLL const Joint* GetParent() const;
51 private:
52 Joint* mParent = nullptr;
53 Transform mTransform;
54 Transform mInvertedTransform;
55 std::string mName;
56 };
57
58 DLL Skeleton();
60 DLL ~Skeleton();
64 DLL void LoadFromMemory ( const void* aBuffer, size_t aBufferSize ) final;
67 DLL void LoadFromPBMsg ( const SkeletonMsg& aSkeletonMsg );
69 DLL void Unload () final;
72 DLL const std::vector<Joint>& GetJoints() const;
73 private:
74 std::vector<Joint> mJoints{};
75 };
76}
77#endif
Header for Transform component class.
Stores skeletal animation data including keyframes and bone transforms.
Definition Animation.hpp:29
Base class for loadable engine resources.
Definition Resource.hpp:33
A single joint within a skeleton hierarchy.
Definition Skeleton.hpp:34
Joint(Joint *aParent, const Transform &aTransform, const Transform &aInvertedTransform, const std::string &aName)
Construct a joint.
Definition Skeleton.cpp:35
DLL const Transform & GetInvertedTransform() const
Get the inverse bind-pose transform.
Definition Skeleton.cpp:45
DLL const Joint * GetParent() const
Get the parent joint.
Definition Skeleton.cpp:50
DLL const Transform & GetTransform() const
Get the local bind-pose transform.
Definition Skeleton.cpp:40
DLL void LoadFromMemory(const void *aBuffer, size_t aBufferSize) final
Load the skeleton from a memory buffer.
Definition Skeleton.cpp:59
DLL ~Skeleton()
Destructor.
DLL Skeleton()
Construct an empty skeleton.
DLL const std::vector< Joint > & GetJoints() const
Get the joint list.
Definition Skeleton.cpp:124
DLL void LoadFromPBMsg(const SkeletonMsg &aSkeletonMsg)
Load the skeleton from a protobuf message.
Definition Skeleton.cpp:64
DLL void Unload() final
Unload and release skeleton data.
Definition Skeleton.cpp:119
Component class for any object that requires space transformations.
Definition Transform.hpp:34
<- This is here just for the literals
Definition AABB.hpp:31
STL namespace.