class CPedBody {
public:
RwMatrix * Root;
RwMatrix * Pelvis; // 1
RwMatrix * Spine; // 17
RwMatrix * Spine1;
RwMatrix * Neck;
RwMatrix * Head; // 2
RwMatrix * RClavicle; // 16
RwMatrix * RUpperArm; // 4
RwMatrix * RForeArm; // 14
RwMatrix * RHand; // 6
RwMatrix * RFinger;
RwMatrix * LClavicle; // 15
RwMatrix * LUpperArm; // 3
RwMatrix * LForeArm; // 13
RwMatrix * LHand; // 5
RwMatrix * LFinger;
RwMatrix * LThigh; // 7
RwMatrix * LCalf; // 12
RwMatrix * LFoot; // 9
RwMatrix * RThigh; // 8
RwMatrix * RCalf; // 11
RwMatrix * RFoot; // 10
static DWORD * GetAnimHierarchyFromSkinClump(RwObject *);
static RwMatrix * RpHAnimHierarchyGetMatrixArray(DWORD *);
static DWORD RpHAnimIDGetIndex(DWORD *, DWORD);
bool GetComponents(RwObject *);
void HideComponent(RwMatrix *);
};
enum PED_FRAME {
PED_FRAME_ROOT = 0,
PED_FRAME_PELVIS = 1,
PED_FRAME_SPINE = 2,
PED_FRAME_SPINE1 = 3,
PED_FRAME_NECK = 4,
PED_FRAME_HEAD = 5,
PED_FRAME_RCLAVICLE = 21,
PED_FRAME_RUPPER_ARM = 22,
PED_FRAME_RFORE_ARM = 23,
PED_FRAME_RHAND = 24,
PED_FRAME_RFINGER = 25,
PED_FRAME_LCLAVICLE = 31,
PED_FRAME_LUPPER_ARM = 32,
PED_FRAME_LFORE_ARM = 33,
PED_FRAME_LHAND = 34,
PED_FRAME_LFINGER = 35,
PED_FRAME_LTHIGH = 41,
PED_FRAME_LCALF = 42,
PED_FRAME_LFOOT = 43,
PED_FRAME_RTHIGH = 51,
PED_FRAME_RCALF = 52,
PED_FRAME_RFOOT = 53
};
void CPed::PreRender() {
((void(__thiscall *)(CPed *))0x4FE4C0)(this);
}
DWORD * CPedBody::GetAnimHierarchyFromSkinClump(RwObject * object) {
return ((DWORD *(__cdecl *)(RwObject *))0x57F250)(object);
}
RwMatrix * CPedBody::RpHAnimHierarchyGetMatrixArray(DWORD * _) {
return ((RwMatrix *(__cdecl *)(DWORD *))0x646370)(_);
}
DWORD CPedBody::RpHAnimIDGetIndex(DWORD * _1, DWORD _2) {
return ((DWORD(__cdecl *)(DWORD *, DWORD))0x646390)(_1, _2);
}
bool CPedBody::GetComponents(RwObject * object) {
DWORD * BodyHierarchy = GetAnimHierarchyFromSkinClump(object);
RwMatrix * BodyMatrix = RpHAnimHierarchyGetMatrixArray(BodyHierarchy);
this->Root = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_ROOT)];
this->Pelvis = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_PELVIS)];
this->Spine = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_SPINE)];
this->Spine1 = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_SPINE1)];
this->Neck = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_NECK)];
this->Head = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_HEAD)];
this->RClavicle = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_RCLAVICLE)];
this->RUpperArm = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_RUPPER_ARM)];
this->RForeArm = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_RFORE_ARM)];
this->RHand = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_RHAND)];
this->RFinger = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_RFINGER)];
this->LClavicle = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_LCLAVICLE)];
this->LUpperArm = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_LUPPER_ARM)];
this->LForeArm = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_LFORE_ARM)];
this->LHand = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_LHAND)];
this->LFinger = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_LFINGER)];
this->LThigh = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_LTHIGH)];
this->LCalf = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_LCALF)];
this->LFoot = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_LFOOT)];
this->RThigh = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_RTHIGH)];
this->RCalf = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_RCALF)];
this->RFoot = &BodyMatrix[RpHAnimIDGetIndex(BodyHierarchy, PED_FRAME_RFOOT)];
return ((this->Head->right.x != 1.0f) || (this->Head->right.y != 0.0f) || (this->Head->right.z != 0.0f) ||
(this->Head->up.x != 0.0f) || (this->Head->up.y != 1.0f) || (this->Head->up.z != 0.0f) ||
(this->Head->at.x != 0.0f) || (this->Head->at.y != 0.0f) || (this->Head->at.z != 1.0f));
}
void CPedBody::HideComponent(RwMatrix * component) {
component->right.x = component->right.y = component->right.z = component->up.x = component->up.y = component->up.z = component->at.x = component->at.y = component->at.z = 0.0f;
component->pos.x = this->Root->pos.x;
component->pos.y = this->Root->pos.y;
component->pos.z = this->Root->pos.z;
}