vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
bone_socket.h
1#pragma once
2
3#include <cstdint>
4#include <string>
5
6#include "core/reflect.h"
7#include "ecs/component/core/transform.h"
8#include "resource/asset/skeleton_asset.h"
9
10namespace Vkm::Engine {
11
23struct BoneSocket {
24 std::string bone;
26
27 // Transient: what `bone` resolved to and against, so the linear name lookup runs only when the
28 // pairing changes.
29 SkeletonHandle resolvedRig;
30 std::string resolvedName;
31 int32_t boneIndex = -1;
32};
33
34} // namespace Vkm::Engine
35
36VKM_REFLECT_BEGIN(::Vkm::Engine::BoneSocket)
37 VKM_F(bone)
38 VKM_F(offset)
39VKM_REFLECT_END()
Carried by a weapon, a hat or a muzzle flash to ride a bone of the rig it hangs off.
Definition bone_socket.h:23
std::string resolvedName
Value of bone at that resolve.
Definition bone_socket.h:30
Transform offset
Placement relative to that bone, in bone space.
Definition bone_socket.h:25
std::string bone
Bone name in the rig above; empty places nothing.
Definition bone_socket.h:24
SkeletonHandle resolvedRig
Rig boneIndex was resolved against.
Definition bone_socket.h:29
int32_t boneIndex
Bone bone names, or -1 when the rig has none.
Definition bone_socket.h:31
Local position, rotation and scale of an entity.
Definition transform.h:17