DrawSkeleton for Player, AI & Weapon

Posts 1–2 of 2 · Page 1 of 1
DrawSkeleton for Player, AI & Weapon
Code:
class ICLTModel
{
public:
	signed int GetNodeTransform(LTObject *hObj, UINT hNode, Transform* transform, bool bWorldSpace)
	{
		typedef signed int(__thiscall* GetNodeTransformFn)(void*, LTObject *hObj, UINT hNode, Transform* transform, bool bWorldSpace);
		return GetVFunc<GetNodeTransformFn>(this, 15)(this, hObj, hNode, transform, bWorldSpace);
	}

	signed int GetNextNode(LTObject *hObj, unsigned int hNode, unsigned int &pNext)
	{
		typedef signed int(__thiscall* GetNextNodeFn)(void*, LTObject *hObj, unsigned int hNode, unsigned int &pNext);
		return GetVFunc<GetNextNodeFn>(this, 16)(this, hObj, hNode, pNext);
	}

	signed int GetNumChildren(LTObject *hObj, unsigned int hNode, unsigned int &NumChildren)
	{
		typedef signed int(__thiscall* GetNumChildrenFn)(void*, LTObject *hObj, unsigned int hNode, unsigned int &NumChildren);
		return GetVFunc<GetNumChildrenFn>(this, 18)(this, hObj, hNode, NumChildren);
	}

	signed int GetChild(LTObject *hObj, unsigned int parent, unsigned int index, unsigned int &child)
	{
		typedef signed int(__thiscall* GetChildFn)(void*, LTObject *hObj, unsigned int parent, unsigned int index, unsigned int &child);
		return GetVFunc<GetChildFn>(this, 19)(this, hObj, parent, index, child);
	}

	signed int GetParent(LTObject *hObj, unsigned int node, unsigned int &parent)
	{
		typedef signed int(__thiscall* GetParentFn)(void*, LTObject *hObj, unsigned int node, unsigned int &parent);
		return GetVFunc<GetParentFn>(this, 20)(this, hObj, node, parent);
	}
};
Draw Skeleton Function
Code:
void CVisual::DrawSkeleton(LTObject* obj, D3DCOLOR ESP_Color)
{
    if (obj)
    {
        HMODELNODE hCurNode = INVALID_MODEL_NODE;
        while (GetLTModel()->GetNextNode(obj, hCurNode, hCurNode) == LT_OK)
        {
            unsigned int parent = 0;
            GetLTModel()->GetParent(obj, hCurNode, parent);

            unsigned int ChildNodeCount = 0;
            GetLTModel()->GetNumChildren(obj, hCurNode, ChildNodeCount);

            for (uint32 i = 0; i < ChildNodeCount; ++i)
            {
                HMODELNODE hChildNode = INVALID_MODEL_NODE;
                GetLTModel()->GetChild(obj, hCurNode, i, hChildNode);

                unsigned int parents = 0;
                GetLTModel()->GetParent(obj, hChildNode, parents);

                D3DXVECTOR3 StartPos, EndPos;

                Transform Trans1;
                GetLTModel()->GetNodeTransform(obj, hChildNode, &Trans1, true);
                StartPos = Trans1.m_vPos;
                StartPos.y += 5;

                Transform Trans2;
                GetLTModel()->GetNodeTransform(obj, parents, &Trans2, true);
                EndPos = Trans2.m_vPos;
                EndPos.y += 5;

                if (D::WorldToScreen(&StartPos) && D::WorldToScreen(&EndPos))
                    D::AddLine(StartPos.x, StartPos.y, EndPos.x, EndPos.y, ESP_Color);
            }
        }
    }
}
Logs
Code:
    Player Logs
    == == == == == == == == == == == ==
    Name: Scene Root
    Node : 0  Parent : -1
    ChildNodeCountID : 0  ChildNode : 1  Parent : 0
    == == == == == == == == == == == ==
    Name : M - bone
    Node : 1  Parent : 0
    ChildNodeCountID : 0  ChildNode : 2  Parent : 1
    == == == == == == == == == == == ==
    Name : M - bone Pelvis
    Node : 2  Parent : 1
    ChildNodeCountID : 0  ChildNode : 3  Parent : 2
    ChildNodeCountID : 1  ChildNode : 21  Parent : 2
    ChildNodeCountID : 2  ChildNode : 25  Parent : 2
    == == == == == == == == == == == ==
    Name : M - bone Spine
    Node : 3  Parent : 2
    ChildNodeCountID : 0  ChildNode : 4  Parent : 3
    == == == == == == == == == == == ==
    Name : M - bone Spine1
    Node : 4  Parent : 3
    ChildNodeCountID : 0  ChildNode : 5  Parent : 4
    == == == == == == == == == == == ==
    Name : M - bone Neck
    Node : 5  Parent : 4
    ChildNodeCountID : 0  ChildNode : 6  Parent : 5
    ChildNodeCountID : 1  ChildNode : 7  Parent : 5
    ChildNodeCountID : 2  ChildNode : 14  Parent : 5
    == == == == == == == == == == == ==
    Name : M - bone Head
    Node : 6  Parent : 5
    == == == == == == == == == == == ==
    Name : M - bone L Clavicle
    Node : 7  Parent : 5
    ChildNodeCountID : 0  ChildNode : 8  Parent : 7
    == == == == == == == == == == == ==
    Name : M - bone L UpperArm
    Node : 8  Parent : 7
    ChildNodeCountID : 0  ChildNode : 9  Parent : 8
    == == == == == == == == == == == ==
    Name : M - bone L Forearm
    Node : 9  Parent : 8
    ChildNodeCountID : 0  ChildNode : 10  Parent : 9
    == == == == == == == == == == == ==
    Name : M - bone L Hand
    Node : 10  Parent : 9
    ChildNodeCountID : 0  ChildNode : 11  Parent : 10
    ChildNodeCountID : 1  ChildNode : 12  Parent : 10
    ChildNodeCountID : 2  ChildNode : 13  Parent : 10
    == == == == == == == == == == == ==
    Name : M - bone L Finger0
    Node : 11  Parent : 10
    == == == == == == == == == == == ==
    Name : M - bone L Finger1
    Node : 12  Parent : 10
    == == == == == == == == == == == ==
    Name : M - bone L Finger2
    Node : 13  Parent : 10
    == == == == == == == == == == == ==
    Name : M - bone R Clavicle
    Node : 14  Parent : 5
    ChildNodeCountID : 0  ChildNode : 15  Parent : 14
    == == == == == == == == == == == ==
    Name : M - bone R UpperArm
    Node : 15  Parent : 14
    ChildNodeCountID : 0  ChildNode : 16  Parent : 15
    == == == == == == == == == == == ==
    Name : M - bone R Forearm
    Node : 16  Parent : 15
    ChildNodeCountID : 0  ChildNode : 17  Parent : 16
    == == == == == == == == == == == ==
    Name : M - bone R Hand
    Node : 17  Parent : 16
    ChildNodeCountID : 0  ChildNode : 18  Parent : 17
    ChildNodeCountID : 1  ChildNode : 19  Parent : 17
    ChildNodeCountID : 2  ChildNode : 20  Parent : 17
    == == == == == == == == == == == ==
    Name : M - bone R Finger0
    Node : 18  Parent : 17
    == == == == == == == == == == == ==
    Name : M - bone R Finger1
    Node : 19  Parent : 17
    == == == == == == == == == == == ==
    Name : M - bone R Finger2
    Node : 20  Parent : 17
    == == == == == == == == == == == ==
    Name : M - bone L Thigh
    Node : 21  Parent : 2
    ChildNodeCountID : 0  ChildNode : 22  Parent : 21
    == == == == == == == == == == == ==
    Name : M - bone L Calf
    Node : 22  Parent : 21
    ChildNodeCountID : 0  ChildNode : 23  Parent : 22
    == == == == == == == == == == == ==
    Name : M - bone L Foot
    Node : 23  Parent : 22
    ChildNodeCountID : 0  ChildNode : 24  Parent : 23
    == == == == == == == == == == == ==
    Name : M - bone L Toe0
    Node : 24  Parent : 23
    == == == == == == == == == == == ==
    Name : M - bone R Thigh
    Node : 25  Parent : 2
    ChildNodeCountID : 0  ChildNode : 26  Parent : 25
    == == == == == == == == == == == ==
    Name : M - bone R Calf
    Node : 26  Parent : 25
    ChildNodeCountID : 0  ChildNode : 27  Parent : 26
    == == == == == == == == == == == ==
    Name : M - bone R Foot
    Node : 27  Parent : 26
    ChildNodeCountID : 0  ChildNode : 28  Parent : 27
    == == == == == == == == == == == ==
    Name : M - bone R Toe0
    Node : 28  Parent : 27
Screenshot









Credit(s)
» Geopulse
» Nancy (낸시)
» hkchenme
» ReClass
» ImGui
» Luizimloko
» NetworkFPS
» Dyon
» Hoàng Skyht
» Ngô Phong
» vaisefud3
what is GetVFunc and GetLTModel()? and can you share LTObject class
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?