Исходник Скелет на Химеру

Energy Reload
Забаненный
Статус
Оффлайн
Регистрация
20 Авг 2017
Сообщения
1,206
Реакции[?]
330
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
void CyborgChimera(IEntity* pEnt,DWORD Color)
{
       DrawBoneByName(pEnt,"weapon_bone","Bip01 R Finger0", Color);//35-34
       DrawBoneByName(pEnt,"Bip01 R Finger0","Bip01 R Hand", Color);//34-33
       DrawBoneByName(pEnt,"Bip01 R Hand","Bip01 R Hand_jnt01", Color);//33-36
       DrawBoneByName(pEnt,"Bip01 R Hand_jnt01","Bip01 R UpperArm_jnt004", Color);//36-29
       DrawBoneByName(pEnt,"Bip01 R UpperArm_jnt004","Bip01 R UpperArm_jnt005", Color);//29-30
       DrawBoneByName(pEnt,"Bip01 R Hand","Bip01 R Forearm", Color);//33-28
       DrawBoneByName(pEnt,"Bip01 R Forearm","Bip01 R UpperArm", Color);//28-27
       DrawBoneByName(pEnt,"Bip01 R UpperArm","Bip01 R UpperArm_Box", Color);//27-31
       DrawBoneByName(pEnt,"Bip01 R UpperArm_Box","Bip01 R UpperArm_jnt005", Color);//31-30
  
       DrawBoneByName(pEnt,"Bip01 R Calf","Bip01 R Thigh", Color);//52 - 8
       DrawBoneByName(pEnt,"Bip01 R Calf_jnt01","Bip01 R Calf", Color);//    55 - 52
       DrawBoneByName(pEnt,"Bip01 R HorseLink","Bip01 R Calf_jnt01", Color);//    54 - 55
       DrawBoneByName(pEnt,"Bip01 R HorseLink","Bip01 R Foot", Color);//    54 - 56
       DrawBoneByName(pEnt,"Bip01 R Foot","Bip01 R Heel", Color);//    56 - 63
       ////////////////////////////////////////////////////////////////////////////////////////
       DrawBoneByName(pEnt,"alt_weapon_bone01","Bip01 L Finger0", Color);//    24 - 23
       DrawBoneByName(pEnt,"Bip01 L Finger0","Bip01 L Hand", Color);//    23 - 22
       DrawBoneByName(pEnt,"Bip01 L Hand","Bip01 L Forearm", Color);//    22 - 18
       DrawBoneByName(pEnt,"Bip01 L Hand","Bip01 L Hand_jnt01", Color);//    22 - 25
       DrawBoneByName(pEnt,"Bip01 L Hand_jnt01","Bip01 L UpperArm_jnt01", Color);//    25 - 19
       DrawBoneByName(pEnt,"Bip01 L Forearm","Bip01 L UpperArm", Color);//    18 - 17
       DrawBoneByName(pEnt,"Bip01 L UpperArm_jnt01","Bip01 L UpperArm_jnt02", Color);//    19 - 20
       DrawBoneByName(pEnt,"Bip01 L UpperArm","Bip01 L UpperArm_jnt02", Color);//    17 - 20
  
       DrawBoneByName(pEnt,"Bip01 L Calf","Bip01 L Thigh", Color);//40 - 7
       DrawBoneByName(pEnt,"Bip01 L Calf_jnt01","Bip01 L Calf", Color);//    41 - 40
       DrawBoneByName(pEnt,"Bip01 L HorseLink","Bip01 L Calf_jnt01", Color);//    42 - 43
       DrawBoneByName(pEnt,"Bip01 L HorseLink","Bip01 L Foot", Color);//    42 - 44
       DrawBoneByName(pEnt,"Bip01 L Foot","Bip01 L Heel", Color);//    44 - 51
       //////////////////////////////////////////////////////////////////////////////
       DrawBoneByName(pEnt,"Bip01 L Thigh","Bip01 Pelvis", Color);//7 - 1
       DrawBoneByName(pEnt,"Bip01 R Thigh","Bip01 Pelvis", Color);//    8 - 1
       DrawBoneByName(pEnt,"Bip01 Pelvis","Bip01 Spine", Color);//    1 - 3
       DrawBoneByName(pEnt,"Bip01 Spine","Bip01 Spine1", Color);//    3 - 6
       DrawBoneByName(pEnt,"Bip01 Spine1","Bip01 Spine2", Color);//    6 - 9
       DrawBoneByName(pEnt,"Bip01 Spine2","Bip01 Neck", Color);//    9 - 13
       DrawBoneByName(pEnt,"Bip01 Neck","Bip01 Head", Color);//    13 - 16
       DrawBoneByName(pEnt,"Bip01 Head","Bip01 R UpperArm_jnt005", Color);//    16 - 30
       DrawBoneByName(pEnt,"Bip01 Head","Bip01 L UpperArm_jnt02", Color);//    16 - 20
       //DrawBoneByName(pEnt, L"Bip01 Head", L"Bip01 Spine1 Cabble", Color);//    16 - 12
       DrawBoneByName(pEnt,"Bip01 Head","eye_right_bone", Color);//    16 - 77
       DrawBoneByName(pEnt,"Bip01 Head","eye_left_bone", Color);//    16 - 76
}
C++:
void DrawBoneByName(IEntity* pEnt, string Start, string End, DWORD Color)
{
    Vec3 vvStart, vvEnd;
    __int16 id_start, id_end;
    if (!pEnt)return;

    ICharacterInstance* GetCharacter = pEnt->GetCharacter();
    if (!GetCharacter)return;

    ISkeletonPose* m_pSkeleton = GetCharacter->GetISkeletonPose();
    if (!m_pSkeleton)return;

    id_start = GetBoneId(pEnt, Start.c_str());
    id_end = GetBoneId(pEnt, End.c_str());
    if (id_start != -1)
    {
        if (id_end != -1)
        {
            Matrix34 vStart = pEnt->GetProjectedWorldBBox() * Matrix34(m_pSkeleton->GetAbsJointByID(id_start));
            Matrix34 vEnd = pEnt->GetProjectedWorldBBox() * Matrix34(m_pSkeleton->GetAbsJointByID(id_end));
            if (vStart.GetTranslation() == Vec3{ 0,0,0 })return;
            if (vEnd.GetTranslation() == Vec3{ 0,0,0 })return;

            if (WorldToScreen(vStart.GetTranslation(), vvStart))
            {
                if (WorldToScreen(vEnd.GetTranslation(), vvEnd))
                {
                     DrawLine(vvStart, vvEnd, Color);
                }            }
        }
    }
}
Если есть вопросы. С удовольствием на них отвечу.
 
Просто недопастер :(
Пользователь
Статус
Оффлайн
Регистрация
23 Сен 2020
Сообщения
178
Реакции[?]
36
Поинты[?]
0
C++:
void CyborgChimera(IEntity* pEnt,DWORD Color)
{
       DrawBoneByName(pEnt,"weapon_bone","Bip01 R Finger0", Color);//35-34
       DrawBoneByName(pEnt,"Bip01 R Finger0","Bip01 R Hand", Color);//34-33
       DrawBoneByName(pEnt,"Bip01 R Hand","Bip01 R Hand_jnt01", Color);//33-36
       DrawBoneByName(pEnt,"Bip01 R Hand_jnt01","Bip01 R UpperArm_jnt004", Color);//36-29
       DrawBoneByName(pEnt,"Bip01 R UpperArm_jnt004","Bip01 R UpperArm_jnt005", Color);//29-30
       DrawBoneByName(pEnt,"Bip01 R Hand","Bip01 R Forearm", Color);//33-28
       DrawBoneByName(pEnt,"Bip01 R Forearm","Bip01 R UpperArm", Color);//28-27
       DrawBoneByName(pEnt,"Bip01 R UpperArm","Bip01 R UpperArm_Box", Color);//27-31
       DrawBoneByName(pEnt,"Bip01 R UpperArm_Box","Bip01 R UpperArm_jnt005", Color);//31-30
 
       DrawBoneByName(pEnt,"Bip01 R Calf","Bip01 R Thigh", Color);//52 - 8
       DrawBoneByName(pEnt,"Bip01 R Calf_jnt01","Bip01 R Calf", Color);//    55 - 52
       DrawBoneByName(pEnt,"Bip01 R HorseLink","Bip01 R Calf_jnt01", Color);//    54 - 55
       DrawBoneByName(pEnt,"Bip01 R HorseLink","Bip01 R Foot", Color);//    54 - 56
       DrawBoneByName(pEnt,"Bip01 R Foot","Bip01 R Heel", Color);//    56 - 63
       ////////////////////////////////////////////////////////////////////////////////////////
       DrawBoneByName(pEnt,"alt_weapon_bone01","Bip01 L Finger0", Color);//    24 - 23
       DrawBoneByName(pEnt,"Bip01 L Finger0","Bip01 L Hand", Color);//    23 - 22
       DrawBoneByName(pEnt,"Bip01 L Hand","Bip01 L Forearm", Color);//    22 - 18
       DrawBoneByName(pEnt,"Bip01 L Hand","Bip01 L Hand_jnt01", Color);//    22 - 25
       DrawBoneByName(pEnt,"Bip01 L Hand_jnt01","Bip01 L UpperArm_jnt01", Color);//    25 - 19
       DrawBoneByName(pEnt,"Bip01 L Forearm","Bip01 L UpperArm", Color);//    18 - 17
       DrawBoneByName(pEnt,"Bip01 L UpperArm_jnt01","Bip01 L UpperArm_jnt02", Color);//    19 - 20
       DrawBoneByName(pEnt,"Bip01 L UpperArm","Bip01 L UpperArm_jnt02", Color);//    17 - 20
 
       DrawBoneByName(pEnt,"Bip01 L Calf","Bip01 L Thigh", Color);//40 - 7
       DrawBoneByName(pEnt,"Bip01 L Calf_jnt01","Bip01 L Calf", Color);//    41 - 40
       DrawBoneByName(pEnt,"Bip01 L HorseLink","Bip01 L Calf_jnt01", Color);//    42 - 43
       DrawBoneByName(pEnt,"Bip01 L HorseLink","Bip01 L Foot", Color);//    42 - 44
       DrawBoneByName(pEnt,"Bip01 L Foot","Bip01 L Heel", Color);//    44 - 51
       //////////////////////////////////////////////////////////////////////////////
       DrawBoneByName(pEnt,"Bip01 L Thigh","Bip01 Pelvis", Color);//7 - 1
       DrawBoneByName(pEnt,"Bip01 R Thigh","Bip01 Pelvis", Color);//    8 - 1
       DrawBoneByName(pEnt,"Bip01 Pelvis","Bip01 Spine", Color);//    1 - 3
       DrawBoneByName(pEnt,"Bip01 Spine","Bip01 Spine1", Color);//    3 - 6
       DrawBoneByName(pEnt,"Bip01 Spine1","Bip01 Spine2", Color);//    6 - 9
       DrawBoneByName(pEnt,"Bip01 Spine2","Bip01 Neck", Color);//    9 - 13
       DrawBoneByName(pEnt,"Bip01 Neck","Bip01 Head", Color);//    13 - 16
       DrawBoneByName(pEnt,"Bip01 Head","Bip01 R UpperArm_jnt005", Color);//    16 - 30
       DrawBoneByName(pEnt,"Bip01 Head","Bip01 L UpperArm_jnt02", Color);//    16 - 20
       //DrawBoneByName(pEnt, L"Bip01 Head", L"Bip01 Spine1 Cabble", Color);//    16 - 12
       DrawBoneByName(pEnt,"Bip01 Head","eye_right_bone", Color);//    16 - 77
       DrawBoneByName(pEnt,"Bip01 Head","eye_left_bone", Color);//    16 - 76
}
C++:
void DrawBoneByName(IEntity* pEnt, string Start, string End, DWORD Color)
{
    Vec3 vvStart, vvEnd;
    __int16 id_start, id_end;
    if (!pEnt)return;

    ICharacterInstance* GetCharacter = pEnt->GetCharacter();
    if (!GetCharacter)return;

    ISkeletonPose* m_pSkeleton = GetCharacter->GetISkeletonPose();
    if (!m_pSkeleton)return;

    id_start = GetBoneId(pEnt, Start.c_str());
    id_end = GetBoneId(pEnt, End.c_str());
    if (id_start != -1)
    {
        if (id_end != -1)
        {
            Matrix34 vStart = pEnt->GetProjectedWorldBBox() * Matrix34(m_pSkeleton->GetAbsJointByID(id_start));
            Matrix34 vEnd = pEnt->GetProjectedWorldBBox() * Matrix34(m_pSkeleton->GetAbsJointByID(id_end));
            if (vStart.GetTranslation() == Vec3{ 0,0,0 })return;
            if (vEnd.GetTranslation() == Vec3{ 0,0,0 })return;

            if (WorldToScreen(vStart.GetTranslation(), vvStart))
            {
                if (WorldToScreen(vEnd.GetTranslation(), vvEnd))
                {
                     DrawLine(vvStart, vvEnd, Color);
                }            }
        }
    }
}
Если есть вопросы. С удовольствием на них отвечу.
можешь скинуть функц DrawLine
 
Energy Reload
Забаненный
Статус
Оффлайн
Регистрация
20 Авг 2017
Сообщения
1,206
Реакции[?]
330
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Продам прострел стен Warface 10к руб!
Забаненный
Статус
Оффлайн
Регистрация
7 Авг 2018
Сообщения
308
Реакции[?]
106
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
dev
Забаненный
Статус
Оффлайн
Регистрация
5 Апр 2022
Сообщения
302
Реакции[?]
215
Поинты[?]
3K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Energy Reload
Забаненный
Статус
Оффлайн
Регистрация
20 Авг 2017
Сообщения
1,206
Реакции[?]
330
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
primordial
Пользователь
Статус
Оффлайн
Регистрация
4 Сен 2020
Сообщения
361
Реакции[?]
128
Поинты[?]
42K
можешь скинуть функц DrawLine
Рендер линии:
C++:
void render::line(int x, int y, int x2, int y2, Color color)
{
    if (!m_surface())
        return;

    color.SetAlpha(static_cast<int>(color.a() * alpha_factor));

    m_surface()->DrawSetColor(color);
    m_surface()->DrawLine(x, y, x2, y2);
}
А сам DrawLine в есть в surface.
 
              ru p2cs > all                      
Разработчик
Статус
Оффлайн
Регистрация
19 Авг 2016
Сообщения
1,579
Реакции[?]
1,963
Поинты[?]
133K
Рендер линии:
C++:
void render::line(int x, int y, int x2, int y2, Color color)
{
    if (!m_surface())
        return;

    color.SetAlpha(static_cast<int>(color.a() * alpha_factor));

    m_surface()->DrawSetColor(color);
    m_surface()->DrawLine(x, y, x2, y2);
}
А сам DrawLine в есть в surface.
Дааа, хорошо что в ВАРФЕЙС добавили рендер из СУРС ДВИЖКА. Легендарный ISurface!
 
Продам прострел стен Warface 10к руб!
Забаненный
Статус
Оффлайн
Регистрация
7 Авг 2018
Сообщения
308
Реакции[?]
106
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
void HUDDrawJoint(IEntity* pEntity, int nSlot, ICharacterModel* pSkel, CModelJoint* pPerentJoint, CModelJoint* pJoint, int Color)
{
    if (!this->m_Renderer || !pJoint || !pPerentJoint) return;

    Vec3 vJoint3D, vPerent3D;
    if (!pEntity->GetBonePos(pJoint->m_idx, vJoint3D, nSlot) || !pEntity->GetBonePos(pPerentJoint->m_idx, vPerent3D, nSlot)) return;

    for (int i = 0; i < pJoint->m_numChildren; ++i)
    {
        HUDDrawJoint(pEntity, nSlot, pSkel, pJoint, pSkel->GetModelJoint(pJoint->m_idx + pJoint->m_nOffsetChildren + i), Color);
    }

    Vec3 vJoint2D, vPerent2D;
    if (this->m_Renderer->WorldToScreen(vJoint3D, vJoint2D) && this->m_Renderer->WorldToScreen(vPerent3D, vPerent2D))
    {
        UIMenager::UILine(vPerent2D.x, vPerent2D.y, vJoint2D.x, vJoint2D.y, Color);
    }
}
Обычные скелеты, без нескольких копий DrawSceleton с косятями по очереди.
Таким же методом можно нарисовать свои силуэты.
 
Сверху Снизу