20#include "aeongames/ProtoBufHelpers.hpp"
22#pragma warning( push )
23#pragma warning( disable : PROTOBUF_WARNINGS )
25#include "skeleton.pb.h"
29#include "aeongames/Skeleton.hpp"
30#include "aeongames/Animation.hpp"
36 mParent ( aParent ), mTransform ( aTransform ), mInvertedTransform ( aInvertedTransform ), mName ( aName )
47 return mInvertedTransform;
66 mJoints.reserve ( aSkeletonMsg.joint_size() );
67 for (
auto& joint : aSkeletonMsg.joint() )
69 mJoints.emplace_back (
70 ( joint.parentindex() < 0 ) ?
nullptr : &mJoints[joint.parentindex()],
88 joint.translation().x(),
89 joint.translation().y(),
90 joint.translation().z()
97 joint.invertedscale().x(),
98 joint.invertedscale().y(),
99 joint.invertedscale().z()
103 joint.invertedrotation().w(),
104 joint.invertedrotation().x(),
105 joint.invertedrotation().y(),
106 joint.invertedrotation().z()
110 joint.invertedtranslation().x(),
111 joint.invertedtranslation().y(),
112 joint.invertedtranslation().z()
Header for 4x4 matrix class.
Provides the DLL_PROTOBUF export/import macro for protobuf wrapper classes.
A single joint within a skeleton hierarchy.
Joint(Joint *aParent, const Transform &aTransform, const Transform &aInvertedTransform, const std::string &aName)
Construct a joint.
DLL const Transform & GetInvertedTransform() const
Get the inverse bind-pose transform.
DLL const Joint * GetParent() const
Get the parent joint.
DLL const Transform & GetTransform() const
Get the local bind-pose transform.
DLL void LoadFromMemory(const void *aBuffer, size_t aBufferSize) final
Load the skeleton from a memory buffer.
DLL ~Skeleton()
Destructor.
DLL Skeleton()
Construct an empty skeleton.
DLL const std::vector< Joint > & GetJoints() const
Get the joint list.
DLL void LoadFromPBMsg(const SkeletonMsg &aSkeletonMsg)
Load the skeleton from a protobuf message.
DLL void Unload() final
Unload and release skeleton data.
<- This is here just for the literals
void LoadFromProtoBufObject(T &aTarget, const void *aBuffer, size_t aBufferSize)
Loads a Protocol Buffer message from a buffer and populates a target object.