Developer knowledge network ยท moderated exchange

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Knowledge indexLive
4Categories
919Threads
2.8KPosts
Tutorial

Deriving 3D Pedestrian Bounding Boxes using ENTITY::GET_ENTITY_BONE_COORDS [v2.4 Technical Discussion]

matrix_math_guy
Math Specialist
MEMBER
Rep: 105
Join Date: Aug 2018
Posts: 52
Thanks: 41
1 months ago ยท Jul 16, 2026 6:31 AM
#1

Rendering oriented 3D bounding boxes on GTA V ped models:

CPP
void DrawPedBox3D(Ped ped, ImU32 color, const Matrix4x4& vMatrix) {
    Vector3 head = GetPedBoneCoords(ped, 31086); // SKEL_Head
    Vector3 lFoot = GetPedBoneCoords(ped, 63931); // SKEL_L_Foot
    Vector3 rFoot = GetPedBoneCoords(ped, 52301); // SKEL_R_Foot
    Vector3 feet = (lFoot + rFoot) * 0.5f;
    
    float height = head.z - feet.z + 0.35f;
    float width = 0.65f;
    
    DrawOriented3DBox(feet, width, height, GetEntityHeading(ped), color, vMatrix);
}
imgui_artisan
UI Designer
MEMBER
Rep: 202
Join Date: Apr 2019
Posts: 54
Thanks: 28
1 months ago ยท Jul 16, 2026 12:30 PM
#2

Averaging Left and Right foot bone coordinates ensures the box sits perfectly on the floor regardless of running animations.

raycast_ryan
Ballistics Dev
MEMBER
Rep: 72
Join Date: Sep 2019
Posts: 32
Thanks: 16
1 months ago ยท Jul 17, 2026 12:56 AM
#3

Clean bone mapping.