There are 2 useful functions:
- 0x5E4280, for getting the position of a bone:
| CODE |
| 0x5E4280 - RwV3d *__thiscall CPed__getBonePosition(RwV3d *vPosition int iBoneID, bool bIncludeAnim) |
Thanks to DK22Pac for the last argument.
- 0x5E01C0, for retrieving the position of a bone according to XYZ offsets:
| CODE |
| 0x5E01C0 - RwV3d *__thiscall CPed__getBonePositionWithOffset(RwV3d *vOffset, int iBoneID, bool bIncludeAnim) |
Here is how the CLEO code looks like:
| CODE |
0A96: 0@ = actor $PLAYER_ACTOR struct 0AC7: 4@ = var 1@ offset 0AA6: call_method 0x5E4280 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 24 vPosition 4@ // CPed__getBonePosition |
| CODE |
1@ = 0.0 // X offset 2@ = 0.0 // Y offset 3@ = 0.0 // Z offset 0A96: 0@ = actor $PLAYER_ACTOR struct 0AC7: 4@ = var 1@ offset 0AA6: call_method 0x5E01C0 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 24 vOffset 4@ // CPed__getBonePositionWithOffset |
Now, the locals between 1@ and 3@ will contain the XYZ coordinates.
Here you can find the list of all bone IDs.
This post has been edited by Wesser on Saturday, Jul 21 2012, 11:19