Files
Project-M/Packages/com.rukhanka.animation/Rukhanka.Runtime/Common/Shaders/GPUStructures/RigBone.hlsl
T
2026-05-31 14:27:52 -07:00

38 lines
1.0 KiB
HLSL

#ifndef RIG_BONE_HLSL_
#define RIG_BONE_HLSL_
/////////////////////////////////////////////////////////////////////////////////
struct RigBone
{
uint hash;
int parentBoneIndex;
BoneTransform refPose;
int humanBodyPart;
static const uint size = (1 + 1 + 1) * 4 + BoneTransform::size;
static RigBone ReadFromRawBuffer(ByteAddressBuffer b, int index)
{
int byteAddress = index * size;
RigBone rv = (RigBone)0;
rv.hash = b.Load(byteAddress);
rv.parentBoneIndex = b.Load(byteAddress + 4);
rv.refPose.pos = asfloat(b.Load3(byteAddress + 8));
rv.refPose.rot.value = asfloat(b.Load4(byteAddress + 20));
rv.refPose.scale = asfloat(b.Load3(byteAddress + 36));
rv.humanBodyPart = b.Load(byteAddress + 48);
CHECK_RAW_BUFFER_OUT_OF_BOUNDS(RUKHANKADEBUGMARKERS_GPUANIMATOR_RIG_BONE_READ, byteAddress, size, b);
return rv;
}
};
/////////////////////////////////////////////////////////////////////////////////
#endif