Исходник [External] позиция кости по её имени

Начинающий
Статус
Оффлайн
Регистрация
13 Май 2023
Сообщения
215
Реакции[?]
28
Поинты[?]
28K
C++:
class ISkeletonPose
{
public:
    QuatT GetJointNameByID(const std::string& bone)
{
    //Получаем класс CModelSkeleton
    auto pModelSkeleton = Read<uintptr_t>(reinterpret_cast<uintptr_t>(this) + 0x198);

    //Получаем класс CModelJoint
    auto pModelJoint = Read<uintptr_t>(pModelSkeleton + 0x18);

    //Получаем колличество костей у персонажа из CModelSkeleton
    const int jointCount = Read<int>(pModelSkeleton + 0x28);

    //Перебираем все кости у персонажа
    for (int jointID = 0; jointID < jointCount; ++jointID)
    {
        //Получаем имя кости по её id
        const std::string jointName = ReadStringMemoryPtr(uint64_t(0x180i64 * jointID + pModelJoint + 304));

        //Проверяем имя нашей кости с найденной и возвращаем ее кватарниан
        if (jointName.find(bone) != std::string::npos)
        {
            return Read<QuatT>(Read<int64>(0x1B8) + 0x1C * jointID);
        }
    }
    return QuatT(Vec3(0, 0, 0), Quat());
}

};
Для получения с кватарниа в вектор

C++:
Vec3 GetJointNameByID(IEntity* pEnt, const std::string& bone)
{
const QuatT absJointStart = skeletonPose->GetJointNameByID(bone);
const Matrix34& worldTM = pEnt->GetWorldTM();
return worldTM.TransformPoint(absJointStart.t);
}
Использование
C++:
Vec3 LocBonePos = GetJointNameByID(pIEntity, Имя кости);
И собственно имена костей.
C++:
namespace BoneName
{
    static     std::string bone_barrel = { xor_s("bone_barrel") };
    static     std::string CHR_Bip01_Spine1 = { xor_s("CHR_Bip01 Spine1") };
    static     std::string CHR_Bip01_Head = { xor_s("CHR_Bip01 Head") };
    static     std::string bone_head_left_rockets = { xor_s("bone_head_left_rockets") };
    static     std::string bone_head = { xor_s("bone_head") };
    static     std::string eye_right_bone = { xor_s("eye_right_bone") };
    static     std::string eye_left_bone = { xor_s("eye_left_bone") };
    static     std::string Bip01_Head = { xor_s("Bip01 Head") };
    static     std::string L_Hand = { xor_s("Bip01 L Hand") };
    static     std::string Forearm = { xor_s("Bip01 L Forearm") };
    static     std::string R_Hand = { xor_s("Bip01 R Hand") };
    static     std::string R_Forearm = { xor_s("Bip01 R Forearm") };
    static     std::string L_UpperArm = { xor_s("Bip01 L UpperArm") };
    static     std::string L_Forearm = { xor_s("Bip01 L Forearm") };
    static     std::string R_UpperArm = { xor_s("Bip01 R UpperArm") };
    static     std::string L_Clavicle = { xor_s("Bip01 L Clavicle") };
    static     std::string R_Clavicle = { xor_s("Bip01 R Clavicle") };
    static     std::string Spine3 = { xor_s("Bip01 Spine3") };
    static     std::string Spine2 = { xor_s("Bip01 Spine2") };
    static     std::string Spine1 = { xor_s("Bip01 Spine1") };
    static     std::string Spine = { xor_s("Bip01 Spine") };
    static     std::string R_Thigh = { xor_s("Bip01 R Thigh") };
    static     std::string L_Thigh = { xor_s("Bip01 L Thigh") };
    static     std::string R_Calf = { xor_s("Bip01 R Calf") };
    static     std::string L_Calf = { xor_s("Bip01 L Calf") };
    static     std::string R_Foot = { xor_s("Bip01 R Foot") };
    static     std::string R_Toe0 = { xor_s("Bip01 R Toe0") };
    static     std::string L_Foot = { xor_s("Bip01 L Foot") };
    static     std::string L_Toe0 = { xor_s("Bip01 L Toe0") };
    static     std::string L_Finger02 = { xor_s("Bip01 L Finger02") };
    static     std::string bone_disk = { xor_s("bone_disk") };
    static     std::string weaponPos_law = { xor_s("weaponPos_law") };
    static     std::string bone_hitpoint = { xor_s("bone_hitpoint") };
    static     std::string weapon_bone = { xor_s("weapon_bone") };
    static     std::string Bip01_HNeck = { xor_s("Bip01 HNeck") };
    static     std::string Bip01_R_ForeTwist2 = { xor_s("Bip01 R ForeTwist2") };
    static     std::string Bip01_R_Hand = { xor_s("Bip01 R Hand") };
    static     std::string Bip01_R_Finger0 = { xor_s("Bip01 R Finger0") };
    static     std::string Bip01_R_Finger1 = { xor_s("Bip01 R Finger1") };
    static     std::string Bip01_R_Finger2 = { xor_s("Bip01 R Finger2") };
    static     std::string Bip01_R_Finger3 = { xor_s("Bip01 R Finger3") };
    static     std::string Bip01_R_Finger4 = { xor_s("Bip01 R Finger4") };
    static     std::string Bip01_R_Finger01 = { xor_s("Bip01 R Finger01") };
    static     std::string Bip01_R_Finger11 = { xor_s("Bip01 R Finger11") };
    static     std::string Bip01_R_Finger21 = { xor_s("Bip01 R Finger21") };
    static     std::string Bip01_R_Finger31 = { xor_s("Bip01 R Finger31") };
    static     std::string Bip01_R_Finger41 = { xor_s("Bip01 R Finger41") };
    static     std::string Bip01_R_Finger02 = { xor_s("Bip01 R Finger02") };
    static     std::string Bip01_R_Finger12 = { xor_s("Bip01 R Finger12") };
    static     std::string Bip01_R_Finger22 = { xor_s("Bip01 R Finger22") };
    static     std::string Bip01_R_Finger32 = { xor_s("Bip01 R Finger32") };
    static     std::string Bip01_R_Finger42 = { xor_s("Bip01 R Finger42") };
    static     std::string Bip01_L_ForeTwist2 = { xor_s("Bip01 L ForeTwist2") };
    static     std::string Bip01_L_Hand = { xor_s("Bip01 L Hand") };
    static     std::string Bip01_L_Finger0 = { xor_s("Bip01 L Finger0") };
    static     std::string Bip01_L_Finger1 = { xor_s("Bip01 L Finger1") };
    static     std::string Bip01_L_Finger2 = { xor_s("Bip01 L Finger2") };
    static     std::string Bip01_L_Finger3 = { xor_s("Bip01 L Finger3") };
    static     std::string Bip01_L_Finger4 = { xor_s("Bip01 L Finger4") };
    static     std::string Bip01_L_Finger01 = { xor_s("Bip01 L Finger01") };
    static     std::string Bip01_L_Finger11 = { xor_s("Bip01 L Finger11") };
    static     std::string Bip01_L_Finger21 = { xor_s("Bip01 L Finger21") };
    static     std::string Bip01_L_Finger31 = { xor_s("Bip01 L Finger31") };
    static     std::string Bip01_L_Finger41 = { xor_s("Bip01 L Finger41") };
    static     std::string Bip01_L_Finger02 = { xor_s("Bip01 L Finger02") };
    static     std::string Bip01_L_Finger12 = { xor_s("Bip01 L Finger12") };
    static     std::string Bip01_L_Finger22 = { xor_s("Bip01 L Finger22") };
    static     std::string Bip01_L_Finger32 = { xor_s("Bip01 L Finger32") };
    static     std::string Bip01_L_Finger42 = { xor_s("Bip01 L Finger42") };
};
 
Забаненный
Статус
Оффлайн
Регистрация
29 Апр 2023
Сообщения
998
Реакции[?]
16
Поинты[?]
22K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
class ISkeletonPose
{
public:
    QuatT GetJointNameByID(const std::string& bone)
{
    //Получаем класс CModelSkeleton
    auto pModelSkeleton = Read<uintptr_t>(reinterpret_cast<uintptr_t>(this) + 0x198);

    //Получаем класс CModelJoint
    auto pModelJoint = Read<uintptr_t>(pModelSkeleton + 0x18);

    //Получаем колличество костей у персонажа из CModelSkeleton
    const int jointCount = Read<int>(pModelSkeleton + 0x28);

    //Перебираем все кости у персонажа
    for (int jointID = 0; jointID < jointCount; ++jointID)
    {
        //Получаем имя кости по её id
        const std::string jointName = ReadStringMemoryPtr(uint64_t(0x180i64 * jointID + pModelJoint + 304));

        //Проверяем имя нашей кости с найденной и возвращаем ее кватарниан
        if (jointName.find(bone) != std::string::npos)
        {
            return Read<QuatT>(Read<int64>(0x1B8) + 0x1C * jointID);
        }
    }
    return QuatT(Vec3(0, 0, 0), Quat());
}

};
Для получения с кватарниа в вектор

C++:
Vec3 GetJointNameByID(IEntity* pEnt, const std::string& bone)
{
const QuatT absJointStart = skeletonPose->GetJointNameByID(bone);
const Matrix34& worldTM = pEnt->GetWorldTM();
return worldTM.TransformPoint(absJointStart.t);
}
Использование
C++:
Vec3 LocBonePos = GetJointNameByID(pIEntity, Имя кости);
И собственно имена костей.
C++:
namespace BoneName
{
    static     std::string bone_barrel = { xor_s("bone_barrel") };
    static     std::string CHR_Bip01_Spine1 = { xor_s("CHR_Bip01 Spine1") };
    static     std::string CHR_Bip01_Head = { xor_s("CHR_Bip01 Head") };
    static     std::string bone_head_left_rockets = { xor_s("bone_head_left_rockets") };
    static     std::string bone_head = { xor_s("bone_head") };
    static     std::string eye_right_bone = { xor_s("eye_right_bone") };
    static     std::string eye_left_bone = { xor_s("eye_left_bone") };
    static     std::string Bip01_Head = { xor_s("Bip01 Head") };
    static     std::string L_Hand = { xor_s("Bip01 L Hand") };
    static     std::string Forearm = { xor_s("Bip01 L Forearm") };
    static     std::string R_Hand = { xor_s("Bip01 R Hand") };
    static     std::string R_Forearm = { xor_s("Bip01 R Forearm") };
    static     std::string L_UpperArm = { xor_s("Bip01 L UpperArm") };
    static     std::string L_Forearm = { xor_s("Bip01 L Forearm") };
    static     std::string R_UpperArm = { xor_s("Bip01 R UpperArm") };
    static     std::string L_Clavicle = { xor_s("Bip01 L Clavicle") };
    static     std::string R_Clavicle = { xor_s("Bip01 R Clavicle") };
    static     std::string Spine3 = { xor_s("Bip01 Spine3") };
    static     std::string Spine2 = { xor_s("Bip01 Spine2") };
    static     std::string Spine1 = { xor_s("Bip01 Spine1") };
    static     std::string Spine = { xor_s("Bip01 Spine") };
    static     std::string R_Thigh = { xor_s("Bip01 R Thigh") };
    static     std::string L_Thigh = { xor_s("Bip01 L Thigh") };
    static     std::string R_Calf = { xor_s("Bip01 R Calf") };
    static     std::string L_Calf = { xor_s("Bip01 L Calf") };
    static     std::string R_Foot = { xor_s("Bip01 R Foot") };
    static     std::string R_Toe0 = { xor_s("Bip01 R Toe0") };
    static     std::string L_Foot = { xor_s("Bip01 L Foot") };
    static     std::string L_Toe0 = { xor_s("Bip01 L Toe0") };
    static     std::string L_Finger02 = { xor_s("Bip01 L Finger02") };
    static     std::string bone_disk = { xor_s("bone_disk") };
    static     std::string weaponPos_law = { xor_s("weaponPos_law") };
    static     std::string bone_hitpoint = { xor_s("bone_hitpoint") };
    static     std::string weapon_bone = { xor_s("weapon_bone") };
    static     std::string Bip01_HNeck = { xor_s("Bip01 HNeck") };
    static     std::string Bip01_R_ForeTwist2 = { xor_s("Bip01 R ForeTwist2") };
    static     std::string Bip01_R_Hand = { xor_s("Bip01 R Hand") };
    static     std::string Bip01_R_Finger0 = { xor_s("Bip01 R Finger0") };
    static     std::string Bip01_R_Finger1 = { xor_s("Bip01 R Finger1") };
    static     std::string Bip01_R_Finger2 = { xor_s("Bip01 R Finger2") };
    static     std::string Bip01_R_Finger3 = { xor_s("Bip01 R Finger3") };
    static     std::string Bip01_R_Finger4 = { xor_s("Bip01 R Finger4") };
    static     std::string Bip01_R_Finger01 = { xor_s("Bip01 R Finger01") };
    static     std::string Bip01_R_Finger11 = { xor_s("Bip01 R Finger11") };
    static     std::string Bip01_R_Finger21 = { xor_s("Bip01 R Finger21") };
    static     std::string Bip01_R_Finger31 = { xor_s("Bip01 R Finger31") };
    static     std::string Bip01_R_Finger41 = { xor_s("Bip01 R Finger41") };
    static     std::string Bip01_R_Finger02 = { xor_s("Bip01 R Finger02") };
    static     std::string Bip01_R_Finger12 = { xor_s("Bip01 R Finger12") };
    static     std::string Bip01_R_Finger22 = { xor_s("Bip01 R Finger22") };
    static     std::string Bip01_R_Finger32 = { xor_s("Bip01 R Finger32") };
    static     std::string Bip01_R_Finger42 = { xor_s("Bip01 R Finger42") };
    static     std::string Bip01_L_ForeTwist2 = { xor_s("Bip01 L ForeTwist2") };
    static     std::string Bip01_L_Hand = { xor_s("Bip01 L Hand") };
    static     std::string Bip01_L_Finger0 = { xor_s("Bip01 L Finger0") };
    static     std::string Bip01_L_Finger1 = { xor_s("Bip01 L Finger1") };
    static     std::string Bip01_L_Finger2 = { xor_s("Bip01 L Finger2") };
    static     std::string Bip01_L_Finger3 = { xor_s("Bip01 L Finger3") };
    static     std::string Bip01_L_Finger4 = { xor_s("Bip01 L Finger4") };
    static     std::string Bip01_L_Finger01 = { xor_s("Bip01 L Finger01") };
    static     std::string Bip01_L_Finger11 = { xor_s("Bip01 L Finger11") };
    static     std::string Bip01_L_Finger21 = { xor_s("Bip01 L Finger21") };
    static     std::string Bip01_L_Finger31 = { xor_s("Bip01 L Finger31") };
    static     std::string Bip01_L_Finger41 = { xor_s("Bip01 L Finger41") };
    static     std::string Bip01_L_Finger02 = { xor_s("Bip01 L Finger02") };
    static     std::string Bip01_L_Finger12 = { xor_s("Bip01 L Finger12") };
    static     std::string Bip01_L_Finger22 = { xor_s("Bip01 L Finger22") };
    static     std::string Bip01_L_Finger32 = { xor_s("Bip01 L Finger32") };
    static     std::string Bip01_L_Finger42 = { xor_s("Bip01 L Finger42") };
};
круто реализовано , лайк :seemsgood: :seemsgood:
 
Забаненный
Статус
Оффлайн
Регистрация
7 Дек 2024
Сообщения
65
Реакции[?]
5
Поинты[?]
5K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Зря ты конечно слил такую актуальную функцию... Но есть вариант проще, и все не могу понять почему бы не сделать уникальный read? Чтоб не придумывать какие то ReadStringMemoryPtr.
 
Забаненный
Статус
Оффлайн
Регистрация
17 Май 2018
Сообщения
7
Реакции[?]
0
Поинты[?]
1K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Отвратительный способ, даже стандартный метод для этого не перебирает эти строки в поиске.
Использовать skeletonpose это прошлый век, есть способы куда лучше, но вы их не узнаете.
 
Сверху Снизу