UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
BoneIndices.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6
8
9
11{
13
14 inline int32 GetInt() const { return BoneIndex; }
15
16 inline bool IsRootBone() const { return BoneIndex == 0; }
17
18 inline bool IsValid() const { return BoneIndex != INDEX_NONE; }
19
20 inline explicit operator int32() const { return BoneIndex; }
21
22 inline explicit operator bool() const { return IsValid(); }
23
24 friend inline uint32 GetTypeHash(const FBoneIndexBase& Index) { return GetTypeHash(Index.BoneIndex); }
25
26protected:
28};
29
31{
32 return InComp;
33}
34
36{
37 return InComp.GetInt();
38}
39
40#define UE_BONE_INDEX_COMPARE_OPERATORS(LhsType, RhsType) \
41 inline friend bool operator==(LhsType Lhs, RhsType Rhs) { return GetIntFromComp(Lhs) == GetIntFromComp(Rhs); } \
42 inline friend bool operator>(LhsType Lhs, RhsType Rhs) { return GetIntFromComp(Lhs) > GetIntFromComp(Rhs); } \
43 inline friend bool operator>=(LhsType Lhs, RhsType Rhs) { return GetIntFromComp(Lhs) >= GetIntFromComp(Rhs); } \
44 inline friend bool operator<(LhsType Lhs, RhsType Rhs) { return GetIntFromComp(Lhs) < GetIntFromComp(Rhs); } \
45 inline friend bool operator<=(LhsType Lhs, RhsType Rhs) { return GetIntFromComp(Lhs) <= GetIntFromComp(Rhs); } \
46
47#if !PLATFORM_COMPILER_HAS_GENERATED_COMPARISON_OPERATORS
48 #define UE_BONE_INDEX_COMPARE_OPERATORS_INVERTED UE_BONE_INDEX_COMPARE_OPERATORS(const int32, const Type&)
49#else
50 #define UE_BONE_INDEX_COMPARE_OPERATORS_INVERTED
51#endif
52
53#define UE_BONE_INDEX_OPERATORS(Type) \
54 UE_BONE_INDEX_COMPARE_OPERATORS(const Type&, const Type&) \
55 UE_BONE_INDEX_COMPARE_OPERATORS(const Type&, const int32) \
56 UE_BONE_INDEX_COMPARE_OPERATORS_INVERTED \
57 Type& operator++() { ++BoneIndex; return *this; } \
58 Type& operator--() { --BoneIndex; return *this; } \
59 Type& operator=(const Type& Rhs) { BoneIndex = Rhs.BoneIndex; return *this; }
60
61// This represents a compact pose bone index. A compact pose is held by a bone container and can have a different ordering than either the skeleton or skeletal mesh.
68
69// This represents a skeletal mesh bone index which may differ from the skeleton bone index it corresponds to.
76
77// This represents a skeleton bone index which may differ from the skeletal mesh bone index it corresponds to.
84
85template <typename ValueType>
86struct TCompactPoseBoneIndexMapKeyFuncs : public TDefaultMapKeyFuncs<const FCompactPoseBoneIndex, ValueType, false>
87{
88 static inline FCompactPoseBoneIndex GetSetKey(TPair<FCompactPoseBoneIndex, ValueType> const& Element) { return Element.Key; }
89 static inline uint32 GetKeyHash(FCompactPoseBoneIndex const& Key) { return GetTypeHash(Key.GetInt()); }
90 static inline bool Matches(FCompactPoseBoneIndex const& A, FCompactPoseBoneIndex const& B) { return (A.GetInt() == B.GetInt()); }
91};
int32 GetIntFromComp(const int32 InComp)
Definition BoneIndices.h:30
#define UE_BONE_INDEX_OPERATORS(Type)
Definition BoneIndices.h:53
uint16 FBoneIndexType
Definition BoneIndices.h:7
@ INDEX_NONE
Definition CoreMiscDefines.h:150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
U16 Index
Definition radfft.cpp:71
Definition BoneIndices.h:11
friend uint32 GetTypeHash(const FBoneIndexBase &Index)
Definition BoneIndices.h:24
FBoneIndexBase()
Definition BoneIndices.h:12
int32 BoneIndex
Definition BoneIndices.h:27
int32 GetInt() const
Definition BoneIndices.h:14
bool IsValid() const
Definition BoneIndices.h:18
bool IsRootBone() const
Definition BoneIndices.h:16
Definition BoneIndices.h:63
FCompactPoseBoneIndex(int32 InBoneIndex)
Definition BoneIndices.h:65
Definition BoneIndices.h:71
FMeshPoseBoneIndex(int32 InBoneIndex)
Definition BoneIndices.h:73
Definition BoneIndices.h:79
FSkeletonPoseBoneIndex(int32 InBoneIndex)
Definition BoneIndices.h:81
Definition BoneIndices.h:87
static uint32 GetKeyHash(FCompactPoseBoneIndex const &Key)
Definition BoneIndices.h:89
static bool Matches(FCompactPoseBoneIndex const &A, FCompactPoseBoneIndex const &B)
Definition BoneIndices.h:90
static FCompactPoseBoneIndex GetSetKey(TPair< FCompactPoseBoneIndex, ValueType > const &Element)
Definition BoneIndices.h:88
Definition Map.h:77
Definition Tuple.h:652