All Bone ID's

Posts 1–4 of 4 · Page 1 of 1
All Bone ID's
Made this in C++. Renders the id of each bone in the correct location. The text is very small so you may have to zoom in.
I found this very useful, after discovering that not all player models share the same bones in the same places.

Here's the code. I'm sure someone's going to point out a better way to do this, but whatever. It gets the job done.
Code:
for (int i = 0;i < 90;i++)
		{
			DrawBoneText(i, pEntity->BoneBase);
		}
Code:
void DrawBoneText(int bone1, DWORD BoneBase)
{
	float Bone1[3];
	float W2S_Bone1[3];
	CBoneMatrix.GetBonePos(BoneBase, bone1, Bone1);


	stringstream ss;

	if (WorldToScreen(Bone1, W2S_Bone1))
	{



		ss << bone1;
		char * boneInfo = new char[ss.str().size() + 1];
		strcpy(boneInfo, ss.str().c_str());
		DrawString(boneInfo, W2S_Bone1[0], W2S_Bone1[1], 255, 255, 255, pFontSmall);
		delete[] boneInfo;
	}

}
Code:
class CBoneMatrix
{
public:
	void GetBonePos(DWORD boneBase, int boneID, float * bonePos)
	{
		bonePos[0] = Mem.Read<float>(boneBase + 0x30 * boneID + 0x0C);//x
		bonePos[1] = Mem.Read<float>(boneBase + 0x30 * boneID + 0x1C);//y
		bonePos[2] = Mem.Read<float>(boneBase + 0x30 * boneID + 0x2C);//z
	}
}CBoneMatrix;

Here are some screenshots of bone locations. T's and CT's are different on DUST2.














Hopefully someone finds this useful in writing their own bone esp.

Extra Credits: Stole the cbonematrix from a source @gtaplayer2 released.
Code:
Vector3 GetBonePosition(Entity* ent, int iBone) 
{
        DWORD BoneMatrix = Read(ent->Base + dwBoneMatrixOffset);
	Bone temp = m.Read<Bone>(BoneMatrix + 0x30 * iBone + 0x0C);
	ent->bone.x = temp.x;
	ent->bone.y = temp.y;
	ent->bone.z = temp.z;
	return ent->bone;
}
//bone struct is from someone else can't remember who.
Code:
struct Bone
{
	float x;
	char pad1[0xC];
	float y;
	char pad2[0xC];
	float z;
	};
vector class just use valve's or whatever, just to save some rpm
Quote Originally Posted by Draig9 View Post
Code:
Vector3 GetBonePosition(Entity* ent, int iBone) 
{
        DWORD BoneMatrix = Read(ent->Base + dwBoneMatrixOffset);
	Bone temp = m.Read<Bone>(BoneMatrix + 0x30 * iBone + 0x0C);
	ent->bone.x = temp.x;
	ent->bone.y = temp.y;
	ent->bone.z = temp.z;
	return ent->bone;
}
//bone struct is from someone else can't remember who.
Code:
struct Bone
{
	float x;
	char pad1[0xC];
	float y;
	char pad2[0xC];
	float z;
	};
vector class just use valve's or whatever, just to save some rpm
Is this much different from what i have posted here?
Quote Originally Posted by HexMurder View Post


Is this much different from what i have posted here?
3 rpms -> 1rpm. if your doing that for every player say 10 x 3 = 30rpms 10x1 = 10rpms...
You get my point you shouldn't not use less rpms whenever you can... Otherwise good job just thought i'd post it incase people didn't know about it. but hey who am I to judge people's high cpu usage
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us